]> git.bitcoin.ninja Git - ldk-c-bindings/blob - lightning-c-bindings/include/lightning.h
d794b857240689ffd5e9f21fa9338502d59690d7
[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     * Blinded paths were provided but were not expected.
184     */
185    LDKBolt12SemanticError_UnexpectedPaths,
186    /**
187     * The blinded payinfo given does not match the number of blinded path hops.
188     */
189    LDKBolt12SemanticError_InvalidPayInfo,
190    /**
191     * An invoice creation time was expected but was missing.
192     */
193    LDKBolt12SemanticError_MissingCreationTime,
194    /**
195     * An invoice payment hash was expected but was missing.
196     */
197    LDKBolt12SemanticError_MissingPaymentHash,
198    /**
199     * A signature was expected but was missing.
200     */
201    LDKBolt12SemanticError_MissingSignature,
202    /**
203     * Must be last for serialization purposes
204     */
205    LDKBolt12SemanticError_Sentinel,
206 } LDKBolt12SemanticError;
207
208 /**
209  * An enum which can either contain a  or not
210  */
211 typedef enum LDKCOption_NoneZ {
212    /**
213     * When we're in this state, this COption_NoneZ contains a
214     */
215    LDKCOption_NoneZ_Some,
216    /**
217     * When we're in this state, this COption_NoneZ contains nothing
218     */
219    LDKCOption_NoneZ_None,
220    /**
221     * Must be last for serialization purposes
222     */
223    LDKCOption_NoneZ_Sentinel,
224 } LDKCOption_NoneZ;
225
226 /**
227  * An enum representing the status of a channel monitor update persistence.
228  *
229  * These are generally used as the return value for an implementation of [`Persist`] which is used
230  * as the storage layer for a [`ChainMonitor`]. See the docs on [`Persist`] for a high-level
231  * explanation of how to handle different cases.
232  *
233  * While `UnrecoverableError` is provided as a failure variant, it is not truly \"handled\" on the
234  * calling side, and generally results in an immediate panic. For those who prefer to avoid
235  * panics, `InProgress` can be used and you can retry the update operation in the background or
236  * shut down cleanly.
237  *
238  * Note that channels should generally *not* be force-closed after a persistence failure.
239  * Force-closing with the latest [`ChannelMonitorUpdate`] applied may result in a transaction
240  * being broadcast which can only be spent by the latest [`ChannelMonitor`]! Thus, if the
241  * latest [`ChannelMonitor`] is not durably persisted anywhere and exists only in memory, naively
242  * calling [`ChannelManager::force_close_broadcasting_latest_txn`] *may result in loss of funds*!
243  *
244  * [`Persist`]: chainmonitor::Persist
245  * [`ChainMonitor`]: chainmonitor::ChainMonitor
246  * [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn
247  */
248 typedef enum LDKChannelMonitorUpdateStatus {
249    /**
250     * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
251     * have been updated.
252     *
253     * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
254     * be available on restart even if the application crashes.
255     */
256    LDKChannelMonitorUpdateStatus_Completed,
257    /**
258     * Indicates that the update will happen asynchronously in the background or that a transient
259     * failure occurred which is being retried in the background and will eventually complete.
260     *
261     * This will \"freeze\" a channel, preventing us from revoking old states or submitting a new
262     * commitment transaction to the counterparty. Once the update(s) which are `InProgress` have
263     * been completed, a [`MonitorEvent::Completed`] can be used to restore the channel to an
264     * operational state.
265     *
266     * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
267     * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
268     * attempting to claim it on this channel) and those updates must still be persisted.
269     *
270     * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
271     * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
272     * monitor update for the same channel.
273     *
274     * For deployments where a copy of [`ChannelMonitor`]s and other local state are backed up in
275     * a remote location (with local copies persisted immediately), it is anticipated that all
276     * updates will return [`InProgress`] until the remote copies could be updated.
277     *
278     * Note that while fully asynchronous persistence of [`ChannelMonitor`] data is generally
279     * reliable, this feature is considered beta, and a handful of edge-cases remain. Until the
280     * remaining cases are fixed, in rare cases, *using this feature may lead to funds loss*.
281     *
282     * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
283     */
284    LDKChannelMonitorUpdateStatus_InProgress,
285    /**
286     * Indicates that an update has failed and will not complete at any point in the future.
287     *
288     * Currently returning this variant will cause LDK to immediately panic to encourage immediate
289     * shutdown. In the future this may be updated to disconnect peers and refuse to continue
290     * normal operation without a panic.
291     *
292     * Applications which wish to perform an orderly shutdown after failure should consider
293     * returning [`InProgress`] instead and simply shut down without ever marking the update
294     * complete.
295     *
296     * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
297     */
298    LDKChannelMonitorUpdateStatus_UnrecoverableError,
299    /**
300     * Must be last for serialization purposes
301     */
302    LDKChannelMonitorUpdateStatus_Sentinel,
303 } LDKChannelMonitorUpdateStatus;
304
305 /**
306  * Further information on the details of the channel shutdown.
307  * Upon channels being forced closed (i.e. commitment transaction confirmation detected
308  * by `ChainMonitor`), ChannelShutdownState will be set to `ShutdownComplete` or
309  * the channel will be removed shortly.
310  * Also note, that in normal operation, peers could disconnect at any of these states
311  * and require peer re-connection before making progress onto other states
312  */
313 typedef enum LDKChannelShutdownState {
314    /**
315     * Channel has not sent or received a shutdown message.
316     */
317    LDKChannelShutdownState_NotShuttingDown,
318    /**
319     * Local node has sent a shutdown message for this channel.
320     */
321    LDKChannelShutdownState_ShutdownInitiated,
322    /**
323     * Shutdown message exchanges have concluded and the channels are in the midst of
324     * resolving all existing open HTLCs before closing can continue.
325     */
326    LDKChannelShutdownState_ResolvingHTLCs,
327    /**
328     * All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee rates.
329     */
330    LDKChannelShutdownState_NegotiatingClosingFee,
331    /**
332     * We've successfully negotiated a closing_signed dance. At this point `ChannelManager` is about
333     * to drop the channel.
334     */
335    LDKChannelShutdownState_ShutdownComplete,
336    /**
337     * Must be last for serialization purposes
338     */
339    LDKChannelShutdownState_Sentinel,
340 } LDKChannelShutdownState;
341
342 /**
343  * An enum that represents the priority at which we want a transaction to confirm used for feerate
344  * estimation.
345  */
346 typedef enum LDKConfirmationTarget {
347    /**
348     * We have some funds available on chain which we need to spend prior to some expiry time at
349     * which point our counterparty may be able to steal them. Generally we have in the high tens
350     * to low hundreds of blocks to get our transaction on-chain, but we shouldn't risk too low a
351     * fee - this should be a relatively high priority feerate.
352     */
353    LDKConfirmationTarget_OnChainSweep,
354    /**
355     * This is the lowest feerate we will allow our channel counterparty to have in an anchor
356     * channel in order to close the channel if a channel party goes away.
357     *
358     * This needs to be sufficient to get into the mempool when the channel needs to
359     * be force-closed. Setting too high may result in force-closures if our counterparty attempts
360     * to use a lower feerate. Because this is for anchor channels, we can always bump the feerate
361     * later; the feerate here only needs to be sufficient to enter the mempool.
362     *
363     * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
364     * is not an estimate which is very easy to calculate because we do not know the future. Using
365     * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
366     * ensure you can always close the channel. A future change to Bitcoin's P2P network
367     * (package relay) may obviate the need for this entirely.
368     */
369    LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee,
370    /**
371     * The lowest feerate we will allow our channel counterparty to have in a non-anchor channel.
372     *
373     * This is the feerate on the transaction which we (or our counterparty) will broadcast in
374     * order to close the channel if a channel party goes away. Setting this value too high will
375     * cause immediate force-closures in order to avoid having an unbroadcastable state.
376     *
377     * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
378     * arbitrary time in the future. Obviously this is not an estimate which is very easy to
379     * calculate. This can leave channels subject to being unable to close if feerates rise, and in
380     * general you should prefer anchor channels to ensure you can increase the feerate when the
381     * transactions need broadcasting.
382     *
383     * Do note some fee estimators round up to the next full sat/vbyte (ie 250 sats per kw),
384     * causing occasional issues with feerate disagreements between an initiator that wants a
385     * feerate of 1.1 sat/vbyte and a receiver that wants 1.1 rounded up to 2. If your fee
386     * estimator rounds subtracting 250 to your desired feerate here can help avoid this issue.
387     *
388     * [`ChannelConfig::max_dust_htlc_exposure`]: crate::util::config::ChannelConfig::max_dust_htlc_exposure
389     */
390    LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee,
391    /**
392     * This is the feerate on the transaction which we (or our counterparty) will broadcast in
393     * order to close the channel if a channel party goes away.
394     *
395     * This needs to be sufficient to get into the mempool when the channel needs to
396     * be force-closed. Setting too low may result in force-closures. Because this is for anchor
397     * channels, it can be a low value as we can always bump the feerate later.
398     *
399     * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
400     * is not an estimate which is very easy to calculate because we do not know the future. Using
401     * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
402     * ensure you can always close the channel. A future change to Bitcoin's P2P network
403     * (package relay) may obviate the need for this entirely.
404     */
405    LDKConfirmationTarget_AnchorChannelFee,
406    /**
407     * Lightning is built around the ability to broadcast a transaction in the future to close our
408     * channel and claim all pending funds. In order to do so, non-anchor channels are built with
409     * transactions which we need to be able to broadcast at some point in the future.
410     *
411     * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
412     * arbitrary time in the future. Obviously this is not an estimate which is very easy to
413     * calculate, so most lightning nodes use some relatively high-priority feerate using the
414     * current mempool. This leaves channels subject to being unable to close if feerates rise, and
415     * in general you should prefer anchor channels to ensure you can increase the feerate when the
416     * transactions need broadcasting.
417     *
418     * Since this should represent the feerate of a channel close that does not need fee
419     * bumping, this is also used as an upper bound for our attempted feerate when doing cooperative
420     * closure of any channel.
421     */
422    LDKConfirmationTarget_NonAnchorChannelFee,
423    /**
424     * When cooperatively closing a channel, this is the minimum feerate we will accept.
425     * Recommended at least within a day or so worth of blocks.
426     *
427     * This will also be used when initiating a cooperative close of a channel. When closing a
428     * channel you can override this fee by using
429     * [`ChannelManager::close_channel_with_feerate_and_script`].
430     *
431     * [`ChannelManager::close_channel_with_feerate_and_script`]: crate::ln::channelmanager::ChannelManager::close_channel_with_feerate_and_script
432     */
433    LDKConfirmationTarget_ChannelCloseMinimum,
434    /**
435     * The feerate [`OutputSweeper`] will use on transactions spending
436     * [`SpendableOutputDescriptor`]s after a channel closure.
437     *
438     * Generally spending these outputs is safe as long as they eventually confirm, so a value
439     * (slightly above) the mempool minimum should suffice. However, as this value will influence
440     * how long funds will be unavailable after channel closure, [`FeeEstimator`] implementors
441     * might want to choose a higher feerate to regain control over funds faster.
442     *
443     * [`OutputSweeper`]: crate::util::sweep::OutputSweeper
444     * [`SpendableOutputDescriptor`]: crate::sign::SpendableOutputDescriptor
445     */
446    LDKConfirmationTarget_OutputSpendingFee,
447    /**
448     * Must be last for serialization purposes
449     */
450    LDKConfirmationTarget_Sentinel,
451 } LDKConfirmationTarget;
452
453 /**
454  * Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
455  */
456 typedef enum LDKCreationError {
457    /**
458     * The supplied description string was longer than 639 __bytes__ (see [`Description::new`])
459     */
460    LDKCreationError_DescriptionTooLong,
461    /**
462     * The specified route has too many hops and can't be encoded
463     */
464    LDKCreationError_RouteTooLong,
465    /**
466     * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
467     */
468    LDKCreationError_TimestampOutOfBounds,
469    /**
470     * The supplied millisatoshi amount was greater than the total bitcoin supply.
471     */
472    LDKCreationError_InvalidAmount,
473    /**
474     * Route hints were required for this invoice and were missing. Applies to
475     * [phantom invoices].
476     *
477     * [phantom invoices]: crate::utils::create_phantom_invoice
478     */
479    LDKCreationError_MissingRouteHints,
480    /**
481     * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
482     *
483     * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
484     */
485    LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
486    /**
487     * Must be last for serialization purposes
488     */
489    LDKCreationError_Sentinel,
490 } LDKCreationError;
491
492 /**
493  * Enum representing the crypto currencies (or networks) supported by this library
494  */
495 typedef enum LDKCurrency {
496    /**
497     * Bitcoin mainnet
498     */
499    LDKCurrency_Bitcoin,
500    /**
501     * Bitcoin testnet
502     */
503    LDKCurrency_BitcoinTestnet,
504    /**
505     * Bitcoin regtest
506     */
507    LDKCurrency_Regtest,
508    /**
509     * Bitcoin simnet
510     */
511    LDKCurrency_Simnet,
512    /**
513     * Bitcoin signet
514     */
515    LDKCurrency_Signet,
516    /**
517     * Must be last for serialization purposes
518     */
519    LDKCurrency_Sentinel,
520 } LDKCurrency;
521
522 /**
523  * The side of a channel that is the [`IntroductionNode`] in a [`BlindedPath`]. [BOLT 7] defines
524  * which nodes is which in the [`ChannelAnnouncement`] message.
525  *
526  * [BOLT 7]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
527  * [`ChannelAnnouncement`]: crate::ln::msgs::ChannelAnnouncement
528  */
529 typedef enum LDKDirection {
530    /**
531     * The lesser node id when compared lexicographically in ascending order.
532     */
533    LDKDirection_NodeOne,
534    /**
535     * The greater node id when compared lexicographically in ascending order.
536     */
537    LDKDirection_NodeTwo,
538    /**
539     * Must be last for serialization purposes
540     */
541    LDKDirection_Sentinel,
542 } LDKDirection;
543
544 /**
545  * Describes the type of HTLC claim as determined by analyzing the witness.
546  */
547 typedef enum LDKHTLCClaim {
548    /**
549     * Claims an offered output on a commitment transaction through the timeout path.
550     */
551    LDKHTLCClaim_OfferedTimeout,
552    /**
553     * Claims an offered output on a commitment transaction through the success path.
554     */
555    LDKHTLCClaim_OfferedPreimage,
556    /**
557     * Claims an accepted output on a commitment transaction through the timeout path.
558     */
559    LDKHTLCClaim_AcceptedTimeout,
560    /**
561     * Claims an accepted output on a commitment transaction through the success path.
562     */
563    LDKHTLCClaim_AcceptedPreimage,
564    /**
565     * Claims an offered/accepted output on a commitment transaction through the revocation path.
566     */
567    LDKHTLCClaim_Revocation,
568    /**
569     * Must be last for serialization purposes
570     */
571    LDKHTLCClaim_Sentinel,
572 } LDKHTLCClaim;
573
574 /**
575  * Represents an IO Error. Note that some information is lost in the conversion from Rust.
576  */
577 typedef enum LDKIOError {
578    LDKIOError_NotFound,
579    LDKIOError_PermissionDenied,
580    LDKIOError_ConnectionRefused,
581    LDKIOError_ConnectionReset,
582    LDKIOError_ConnectionAborted,
583    LDKIOError_NotConnected,
584    LDKIOError_AddrInUse,
585    LDKIOError_AddrNotAvailable,
586    LDKIOError_BrokenPipe,
587    LDKIOError_AlreadyExists,
588    LDKIOError_WouldBlock,
589    LDKIOError_InvalidInput,
590    LDKIOError_InvalidData,
591    LDKIOError_TimedOut,
592    LDKIOError_WriteZero,
593    LDKIOError_Interrupted,
594    LDKIOError_Other,
595    LDKIOError_UnexpectedEof,
596    /**
597     * Must be last for serialization purposes
598     */
599    LDKIOError_Sentinel,
600 } LDKIOError;
601
602 /**
603  * An enum representing the available verbosity levels of the logger.
604  */
605 typedef enum LDKLevel {
606    /**
607     * Designates extremely verbose information, including gossip-induced messages
608     */
609    LDKLevel_Gossip,
610    /**
611     * Designates very low priority, often extremely verbose, information
612     */
613    LDKLevel_Trace,
614    /**
615     * Designates lower priority information
616     */
617    LDKLevel_Debug,
618    /**
619     * Designates useful information
620     */
621    LDKLevel_Info,
622    /**
623     * Designates hazardous situations
624     */
625    LDKLevel_Warn,
626    /**
627     * Designates very serious errors
628     */
629    LDKLevel_Error,
630    /**
631     * Must be last for serialization purposes
632     */
633    LDKLevel_Sentinel,
634 } LDKLevel;
635
636 /**
637  * An enum representing the possible Bitcoin or test networks which we can run on
638  */
639 typedef enum LDKNetwork {
640    /**
641     * The main Bitcoin blockchain.
642     */
643    LDKNetwork_Bitcoin,
644    /**
645     * The testnet3 blockchain.
646     */
647    LDKNetwork_Testnet,
648    /**
649     * A local test blockchain.
650     */
651    LDKNetwork_Regtest,
652    /**
653     * A blockchain on which blocks are signed instead of mined.
654     */
655    LDKNetwork_Signet,
656    /**
657     * Must be last for serialization purposes
658     */
659    LDKNetwork_Sentinel,
660 } LDKNetwork;
661
662 /**
663  * The reason the payment failed. Used in [`Event::PaymentFailed`].
664  */
665 typedef enum LDKPaymentFailureReason {
666    /**
667     * The intended recipient rejected our payment.
668     */
669    LDKPaymentFailureReason_RecipientRejected,
670    /**
671     * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`].
672     *
673     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
674     */
675    LDKPaymentFailureReason_UserAbandoned,
676    /**
677     * We exhausted all of our retry attempts while trying to send the payment, or we
678     * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry
679     * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will
680     * have come before this.
681     *
682     * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout
683     */
684    LDKPaymentFailureReason_RetriesExhausted,
685    /**
686     * The payment expired while retrying, based on the provided
687     * [`PaymentParameters::expiry_time`].
688     *
689     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
690     */
691    LDKPaymentFailureReason_PaymentExpired,
692    /**
693     * We failed to find a route while retrying the payment.
694     *
695     * Note that this generally indicates that we've exhausted the available set of possible
696     * routes - we tried the payment over a few routes but were not able to find any further
697     * candidate routes beyond those.
698     */
699    LDKPaymentFailureReason_RouteNotFound,
700    /**
701     * This error should generally never happen. This likely means that there is a problem with
702     * your router.
703     */
704    LDKPaymentFailureReason_UnexpectedError,
705    /**
706     * Must be last for serialization purposes
707     */
708    LDKPaymentFailureReason_Sentinel,
709 } LDKPaymentFailureReason;
710
711 /**
712  * Specifies the recipient of an invoice.
713  *
714  * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
715  * the invoice.
716  */
717 typedef enum LDKRecipient {
718    /**
719     * The invoice should be signed with the local node secret key.
720     */
721    LDKRecipient_Node,
722    /**
723     * The invoice should be signed with the phantom node secret key. This secret key must be the
724     * same for all nodes participating in the [phantom node payment].
725     *
726     * [phantom node payment]: PhantomKeysManager
727     */
728    LDKRecipient_PhantomNode,
729    /**
730     * Must be last for serialization purposes
731     */
732    LDKRecipient_Sentinel,
733 } LDKRecipient;
734
735 /**
736  * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
737  * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
738  *
739  * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
740  * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
741  * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
742  */
743 typedef enum LDKRetryableSendFailure {
744    /**
745     * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
746     * that this error is *not* caused by [`Retry::Timeout`].
747     *
748     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
749     */
750    LDKRetryableSendFailure_PaymentExpired,
751    /**
752     * We were unable to find a route to the destination.
753     */
754    LDKRetryableSendFailure_RouteNotFound,
755    /**
756     * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
757     * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
758     *
759     * [`PaymentId`]: crate::ln::channelmanager::PaymentId
760     * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
761     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
762     */
763    LDKRetryableSendFailure_DuplicatePayment,
764    /**
765     * Must be last for serialization purposes
766     */
767    LDKRetryableSendFailure_Sentinel,
768 } LDKRetryableSendFailure;
769
770 /**
771  * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
772  */
773 typedef enum LDKSecp256k1Error {
774    /**
775     * Signature failed verification
776     */
777    LDKSecp256k1Error_IncorrectSignature,
778    /**
779     * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
780     */
781    LDKSecp256k1Error_InvalidMessage,
782    /**
783     * Bad public key
784     */
785    LDKSecp256k1Error_InvalidPublicKey,
786    /**
787     * Bad signature
788     */
789    LDKSecp256k1Error_InvalidSignature,
790    /**
791     * Bad secret key
792     */
793    LDKSecp256k1Error_InvalidSecretKey,
794    /**
795     * Bad shared secret.
796     */
797    LDKSecp256k1Error_InvalidSharedSecret,
798    /**
799     * Bad recovery id
800     */
801    LDKSecp256k1Error_InvalidRecoveryId,
802    /**
803     * Invalid tweak for add_assign or mul_assign
804     */
805    LDKSecp256k1Error_InvalidTweak,
806    /**
807     * Didn't pass enough memory to context creation with preallocated memory
808     */
809    LDKSecp256k1Error_NotEnoughMemory,
810    /**
811     * Bad set of public keys.
812     */
813    LDKSecp256k1Error_InvalidPublicKeySum,
814    /**
815     * The only valid parity values are 0 or 1.
816     */
817    LDKSecp256k1Error_InvalidParityValue,
818    /**
819     * Must be last for serialization purposes
820     */
821    LDKSecp256k1Error_Sentinel,
822 } LDKSecp256k1Error;
823
824 /**
825  * A `short_channel_id` construction error
826  */
827 typedef enum LDKShortChannelIdError {
828    /**
829     * Block height too high
830     */
831    LDKShortChannelIdError_BlockOverflow,
832    /**
833     * Tx index too high
834     */
835    LDKShortChannelIdError_TxIndexOverflow,
836    /**
837     * Vout index too high
838     */
839    LDKShortChannelIdError_VoutIndexOverflow,
840    /**
841     * Must be last for serialization purposes
842     */
843    LDKShortChannelIdError_Sentinel,
844 } LDKShortChannelIdError;
845
846 /**
847  * SI prefixes for the human readable part
848  */
849 typedef enum LDKSiPrefix {
850    /**
851     * 10^-3
852     */
853    LDKSiPrefix_Milli,
854    /**
855     * 10^-6
856     */
857    LDKSiPrefix_Micro,
858    /**
859     * 10^-9
860     */
861    LDKSiPrefix_Nano,
862    /**
863     * 10^-12
864     */
865    LDKSiPrefix_Pico,
866    /**
867     * Must be last for serialization purposes
868     */
869    LDKSiPrefix_Sentinel,
870 } LDKSiPrefix;
871
872 /**
873  * [`SocketAddress`] error variants
874  */
875 typedef enum LDKSocketAddressParseError {
876    /**
877     * Socket address (IPv4/IPv6) parsing error
878     */
879    LDKSocketAddressParseError_SocketAddrParse,
880    /**
881     * Invalid input format
882     */
883    LDKSocketAddressParseError_InvalidInput,
884    /**
885     * Invalid port
886     */
887    LDKSocketAddressParseError_InvalidPort,
888    /**
889     * Invalid onion v3 address
890     */
891    LDKSocketAddressParseError_InvalidOnionV3,
892    /**
893     * Must be last for serialization purposes
894     */
895    LDKSocketAddressParseError_Sentinel,
896 } LDKSocketAddressParseError;
897
898 /**
899  * An error when accessing the chain via [`UtxoLookup`].
900  */
901 typedef enum LDKUtxoLookupError {
902    /**
903     * The requested chain is unknown.
904     */
905    LDKUtxoLookupError_UnknownChain,
906    /**
907     * The requested transaction doesn't exist or hasn't confirmed.
908     */
909    LDKUtxoLookupError_UnknownTx,
910    /**
911     * Must be last for serialization purposes
912     */
913    LDKUtxoLookupError_Sentinel,
914 } LDKUtxoLookupError;
915
916 /**
917  * A Rust str object, ie a reference to a UTF8-valid string.
918  * This is *not* null-terminated so cannot be used directly as a C string!
919  */
920 typedef struct LDKStr {
921    /**
922     * A pointer to the string's bytes, in UTF8 encoding
923     */
924    const uint8_t *chars;
925    /**
926     * The number of bytes (not characters!) pointed to by `chars`
927     */
928    uintptr_t len;
929    /**
930     * Whether the data pointed to by `chars` should be freed or not.
931     */
932    bool chars_is_owned;
933 } LDKStr;
934
935 /**
936  * A 16-byte byte array.
937  */
938 typedef struct LDKSixteenBytes {
939    /**
940     * The sixteen bytes
941     */
942    uint8_t data[16];
943 } LDKSixteenBytes;
944
945 /**
946  * Unsigned, 128-bit integer.
947  *
948  * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
949  * See https://github.com/rust-lang/rust/issues/54341 for more details.
950  */
951 typedef struct LDKU128 {
952    /**
953     * The 128-bit integer, as 16 little-endian bytes
954     */
955    uint8_t le_bytes[16];
956 } LDKU128;
957
958 /**
959  * Integer in the range `0..=16`
960  */
961 typedef struct LDKWitnessVersion {
962    uint8_t _0;
963 } LDKWitnessVersion;
964
965 /**
966  * A dynamically-allocated array of u8s of arbitrary size.
967  * This corresponds to std::vector in C++
968  */
969 typedef struct LDKCVec_u8Z {
970    /**
971     * The elements in the array.
972     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
973     */
974    uint8_t *data;
975    /**
976     * The number of elements pointed to by `data`.
977     */
978    uintptr_t datalen;
979 } LDKCVec_u8Z;
980
981 /**
982  * A segregated witness version byte and script bytes
983  */
984 typedef struct LDKWitnessProgram {
985    struct LDKWitnessVersion version;
986    struct LDKCVec_u8Z program;
987 } LDKWitnessProgram;
988
989 /**
990  * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
991  * own the memory pointed to by data.
992  */
993 typedef struct LDKu8slice {
994    /**
995     * A pointer to the byte buffer
996     */
997    const uint8_t *data;
998    /**
999     * The number of bytes pointed to by `data`.
1000     */
1001    uintptr_t datalen;
1002 } LDKu8slice;
1003
1004 /**
1005  * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
1006  */
1007 typedef struct LDKBigEndianScalar {
1008    /**
1009     * The bytes of the scalar value.
1010     */
1011    uint8_t big_endian_bytes[32];
1012 } LDKBigEndianScalar;
1013
1014 /**
1015  * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1016  * look up the corresponding function in rust-lightning's docs.
1017  */
1018 typedef struct LDKThirtyTwoBytes {
1019    /**
1020     * The thirty-two bytes
1021     */
1022    uint8_t data[32];
1023 } LDKThirtyTwoBytes;
1024
1025 /**
1026  * Represents an error returned from the bech32 library during validation of some bech32 data
1027  */
1028 typedef enum LDKBech32Error_Tag {
1029    /**
1030     * String does not contain the separator character
1031     */
1032    LDKBech32Error_MissingSeparator,
1033    /**
1034     * The checksum does not match the rest of the data
1035     */
1036    LDKBech32Error_InvalidChecksum,
1037    /**
1038     * The data or human-readable part is too long or too short
1039     */
1040    LDKBech32Error_InvalidLength,
1041    /**
1042     * Some part of the string contains an invalid character
1043     */
1044    LDKBech32Error_InvalidChar,
1045    /**
1046     * Some part of the data has an invalid value
1047     */
1048    LDKBech32Error_InvalidData,
1049    /**
1050     * The bit conversion failed due to a padding issue
1051     */
1052    LDKBech32Error_InvalidPadding,
1053    /**
1054     * The whole string must be of one case
1055     */
1056    LDKBech32Error_MixedCase,
1057    /**
1058     * Must be last for serialization purposes
1059     */
1060    LDKBech32Error_Sentinel,
1061 } LDKBech32Error_Tag;
1062
1063 typedef struct LDKBech32Error {
1064    LDKBech32Error_Tag tag;
1065    union {
1066       struct {
1067          uint32_t invalid_char;
1068       };
1069       struct {
1070          uint8_t invalid_data;
1071       };
1072    };
1073 } LDKBech32Error;
1074
1075 /**
1076  * A serialized transaction, in (pointer, length) form.
1077  *
1078  * This type optionally owns its own memory, and thus the semantics around access change based on
1079  * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
1080  * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
1081  * access to the buffer after the scope in which the object was provided to you is invalid. eg,
1082  * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
1083  * you would be invalid.
1084  *
1085  * Note that, while it may change in the future, because transactions on the Rust side are stored
1086  * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
1087  * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
1088  * `data_is_owned` either set or unset at your discretion.
1089  */
1090 typedef struct LDKTransaction {
1091    /**
1092     * The serialized transaction data.
1093     *
1094     * This is non-const for your convenience, an object passed to Rust is never written to.
1095     */
1096    uint8_t *data;
1097    /**
1098     * The length of the serialized transaction
1099     */
1100    uintptr_t datalen;
1101    /**
1102     * Whether the data pointed to by `data` should be freed or not.
1103     */
1104    bool data_is_owned;
1105 } LDKTransaction;
1106
1107 /**
1108  * A serialized witness.
1109  */
1110 typedef struct LDKWitness {
1111    /**
1112     * The serialized transaction data.
1113     *
1114     * This is non-const for your convenience, an object passed to Rust is never written to.
1115     */
1116    uint8_t *data;
1117    /**
1118     * The length of the serialized transaction
1119     */
1120    uintptr_t datalen;
1121    /**
1122     * Whether the data pointed to by `data` should be freed or not.
1123     */
1124    bool data_is_owned;
1125 } LDKWitness;
1126
1127 /**
1128  * An input to a transaction.
1129  *
1130  * This contains the witness, the scriptSig and the previous outpoint and represents a single
1131  * input to a transaction
1132  */
1133 typedef struct LDKTxIn {
1134    /**
1135     * The witness which includes any signatures required to spend a segwit output.
1136     */
1137    struct LDKWitness witness;
1138    /**
1139     * The script_sig which includes signatures requires to spend a pre-segwit output (or a
1140     * P2SH-wrapped segwit output).
1141     */
1142    struct LDKCVec_u8Z script_sig;
1143    /**
1144     * The sequence number of the transaction input
1145     */
1146    uint32_t sequence;
1147    /**
1148     * The txid of the transaction being spent.
1149     */
1150    struct LDKThirtyTwoBytes previous_txid;
1151    /**
1152     * The output index of the transaction being spent.
1153     */
1154    uint32_t previous_vout;
1155 } LDKTxIn;
1156
1157 /**
1158  * A transaction output including a scriptPubKey and value.
1159  * This type *does* own its own memory, so must be free'd appropriately.
1160  */
1161 typedef struct LDKTxOut {
1162    /**
1163     * The script_pubkey in this output
1164     */
1165    struct LDKCVec_u8Z script_pubkey;
1166    /**
1167     * The value, in satoshis, of this output
1168     */
1169    uint64_t value;
1170 } LDKTxOut;
1171
1172
1173
1174 /**
1175  * Builds a [`Refund`] for the \"offer for money\" flow.
1176  *
1177  * See [module-level documentation] for usage.
1178  *
1179  * [module-level documentation]: self
1180  */
1181 typedef struct MUST_USE_STRUCT LDKRefundMaybeWithDerivedMetadataBuilder {
1182    /**
1183     * A pointer to the opaque Rust object.
1184     * Nearly everywhere, inner must be non-null, however in places where
1185     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1186     */
1187    LDKnativeRefundMaybeWithDerivedMetadataBuilder *inner;
1188    /**
1189     * Indicates that this is the only struct which contains the same pointer.
1190     * Rust functions which take ownership of an object provided via an argument require
1191     * this to be true and invalidate the object pointed to by inner.
1192     */
1193    bool is_owned;
1194 } LDKRefundMaybeWithDerivedMetadataBuilder;
1195
1196 /**
1197  * The contents of CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ
1198  */
1199 typedef union LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZPtr {
1200    /**
1201     * A pointer to the contents in the success state.
1202     * Reading from this pointer when `result_ok` is not set is undefined.
1203     */
1204    struct LDKRefundMaybeWithDerivedMetadataBuilder *result;
1205    /**
1206     * A pointer to the contents in the error state.
1207     * Reading from this pointer when `result_ok` is set is undefined.
1208     */
1209    enum LDKBolt12SemanticError *err;
1210 } LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZPtr;
1211
1212 /**
1213  * A CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
1214  * containing a crate::lightning::offers::refund::RefundMaybeWithDerivedMetadataBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
1215  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1216  */
1217 typedef struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ {
1218    /**
1219     * The contents of this CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ, accessible via either
1220     * `err` or `result` depending on the state of `result_ok`.
1221     */
1222    union LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZPtr contents;
1223    /**
1224     * Whether this CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ represents a success state.
1225     */
1226    bool result_ok;
1227 } LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ;
1228
1229
1230
1231 /**
1232  * A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`].
1233  *
1234  * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to
1235  * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a
1236  * bitcoin ATM.
1237  *
1238  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1239  * [`Offer`]: crate::offers::offer::Offer
1240  */
1241 typedef struct MUST_USE_STRUCT LDKRefund {
1242    /**
1243     * A pointer to the opaque Rust object.
1244     * Nearly everywhere, inner must be non-null, however in places where
1245     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1246     */
1247    LDKnativeRefund *inner;
1248    /**
1249     * Indicates that this is the only struct which contains the same pointer.
1250     * Rust functions which take ownership of an object provided via an argument require
1251     * this to be true and invalidate the object pointed to by inner.
1252     */
1253    bool is_owned;
1254 } LDKRefund;
1255
1256 /**
1257  * The contents of CResult_RefundBolt12SemanticErrorZ
1258  */
1259 typedef union LDKCResult_RefundBolt12SemanticErrorZPtr {
1260    /**
1261     * A pointer to the contents in the success state.
1262     * Reading from this pointer when `result_ok` is not set is undefined.
1263     */
1264    struct LDKRefund *result;
1265    /**
1266     * A pointer to the contents in the error state.
1267     * Reading from this pointer when `result_ok` is set is undefined.
1268     */
1269    enum LDKBolt12SemanticError *err;
1270 } LDKCResult_RefundBolt12SemanticErrorZPtr;
1271
1272 /**
1273  * A CResult_RefundBolt12SemanticErrorZ represents the result of a fallible operation,
1274  * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
1275  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1276  */
1277 typedef struct LDKCResult_RefundBolt12SemanticErrorZ {
1278    /**
1279     * The contents of this CResult_RefundBolt12SemanticErrorZ, accessible via either
1280     * `err` or `result` depending on the state of `result_ok`.
1281     */
1282    union LDKCResult_RefundBolt12SemanticErrorZPtr contents;
1283    /**
1284     * Whether this CResult_RefundBolt12SemanticErrorZ represents a success state.
1285     */
1286    bool result_ok;
1287 } LDKCResult_RefundBolt12SemanticErrorZ;
1288
1289 /**
1290  * An enum which can either contain a u64 or not
1291  */
1292 typedef enum LDKCOption_u64Z_Tag {
1293    /**
1294     * When we're in this state, this COption_u64Z contains a u64
1295     */
1296    LDKCOption_u64Z_Some,
1297    /**
1298     * When we're in this state, this COption_u64Z contains nothing
1299     */
1300    LDKCOption_u64Z_None,
1301    /**
1302     * Must be last for serialization purposes
1303     */
1304    LDKCOption_u64Z_Sentinel,
1305 } LDKCOption_u64Z_Tag;
1306
1307 typedef struct LDKCOption_u64Z {
1308    LDKCOption_u64Z_Tag tag;
1309    union {
1310       struct {
1311          uint64_t some;
1312       };
1313    };
1314 } LDKCOption_u64Z;
1315
1316
1317
1318 /**
1319  * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
1320  * identity of the recipient.
1321  */
1322 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1323    /**
1324     * A pointer to the opaque Rust object.
1325     * Nearly everywhere, inner must be non-null, however in places where
1326     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1327     */
1328    LDKnativeBlindedPath *inner;
1329    /**
1330     * Indicates that this is the only struct which contains the same pointer.
1331     * Rust functions which take ownership of an object provided via an argument require
1332     * this to be true and invalidate the object pointed to by inner.
1333     */
1334    bool is_owned;
1335 } LDKBlindedPath;
1336
1337 /**
1338  * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
1339  * This corresponds to std::vector in C++
1340  */
1341 typedef struct LDKCVec_BlindedPathZ {
1342    /**
1343     * The elements in the array.
1344     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1345     */
1346    struct LDKBlindedPath *data;
1347    /**
1348     * The number of elements pointed to by `data`.
1349     */
1350    uintptr_t datalen;
1351 } LDKCVec_BlindedPathZ;
1352
1353
1354
1355 /**
1356  * Error when parsing a bech32 encoded message using [`str::parse`].
1357  */
1358 typedef struct MUST_USE_STRUCT LDKBolt12ParseError {
1359    /**
1360     * A pointer to the opaque Rust object.
1361     * Nearly everywhere, inner must be non-null, however in places where
1362     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1363     */
1364    LDKnativeBolt12ParseError *inner;
1365    /**
1366     * Indicates that this is the only struct which contains the same pointer.
1367     * Rust functions which take ownership of an object provided via an argument require
1368     * this to be true and invalidate the object pointed to by inner.
1369     */
1370    bool is_owned;
1371 } LDKBolt12ParseError;
1372
1373 /**
1374  * The contents of CResult_RefundBolt12ParseErrorZ
1375  */
1376 typedef union LDKCResult_RefundBolt12ParseErrorZPtr {
1377    /**
1378     * A pointer to the contents in the success state.
1379     * Reading from this pointer when `result_ok` is not set is undefined.
1380     */
1381    struct LDKRefund *result;
1382    /**
1383     * A pointer to the contents in the error state.
1384     * Reading from this pointer when `result_ok` is set is undefined.
1385     */
1386    struct LDKBolt12ParseError *err;
1387 } LDKCResult_RefundBolt12ParseErrorZPtr;
1388
1389 /**
1390  * A CResult_RefundBolt12ParseErrorZ represents the result of a fallible operation,
1391  * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
1392  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1393  */
1394 typedef struct LDKCResult_RefundBolt12ParseErrorZ {
1395    /**
1396     * The contents of this CResult_RefundBolt12ParseErrorZ, accessible via either
1397     * `err` or `result` depending on the state of `result_ok`.
1398     */
1399    union LDKCResult_RefundBolt12ParseErrorZPtr contents;
1400    /**
1401     * Whether this CResult_RefundBolt12ParseErrorZ represents a success state.
1402     */
1403    bool result_ok;
1404 } LDKCResult_RefundBolt12ParseErrorZ;
1405
1406 /**
1407  * Strategies available to retry payment path failures.
1408  */
1409 typedef enum LDKRetry_Tag {
1410    /**
1411     * Max number of attempts to retry payment.
1412     *
1413     * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
1414     * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
1415     * were retried along a route from a single call to [`Router::find_route_with_id`].
1416     */
1417    LDKRetry_Attempts,
1418    /**
1419     * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
1420     * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
1421     *
1422     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
1423     */
1424    LDKRetry_Timeout,
1425    /**
1426     * Must be last for serialization purposes
1427     */
1428    LDKRetry_Sentinel,
1429 } LDKRetry_Tag;
1430
1431 typedef struct MUST_USE_STRUCT LDKRetry {
1432    LDKRetry_Tag tag;
1433    union {
1434       struct {
1435          uint32_t attempts;
1436       };
1437       struct {
1438          uint64_t timeout;
1439       };
1440    };
1441 } LDKRetry;
1442
1443 /**
1444  * An error in decoding a message or struct.
1445  */
1446 typedef enum LDKDecodeError_Tag {
1447    /**
1448     * A version byte specified something we don't know how to handle.
1449     *
1450     * Includes unknown realm byte in an onion hop data packet.
1451     */
1452    LDKDecodeError_UnknownVersion,
1453    /**
1454     * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1455     */
1456    LDKDecodeError_UnknownRequiredFeature,
1457    /**
1458     * Value was invalid.
1459     *
1460     * For example, a byte which was supposed to be a bool was something other than a 0
1461     * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1462     * syntactically incorrect, etc.
1463     */
1464    LDKDecodeError_InvalidValue,
1465    /**
1466     * The buffer to be read was too short.
1467     */
1468    LDKDecodeError_ShortRead,
1469    /**
1470     * A length descriptor in the packet didn't describe the later data correctly.
1471     */
1472    LDKDecodeError_BadLengthDescriptor,
1473    /**
1474     * Error from [`std::io`].
1475     */
1476    LDKDecodeError_Io,
1477    /**
1478     * The message included zlib-compressed values, which we don't support.
1479     */
1480    LDKDecodeError_UnsupportedCompression,
1481    /**
1482     * Value is validly encoded but is dangerous to use.
1483     *
1484     * This is used for things like [`ChannelManager`] deserialization where we want to ensure
1485     * that we don't use a [`ChannelManager`] which is in out of sync with the [`ChannelMonitor`].
1486     * This indicates that there is a critical implementation flaw in the storage implementation
1487     * and it's unsafe to continue.
1488     *
1489     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
1490     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
1491     */
1492    LDKDecodeError_DangerousValue,
1493    /**
1494     * Must be last for serialization purposes
1495     */
1496    LDKDecodeError_Sentinel,
1497 } LDKDecodeError_Tag;
1498
1499 typedef struct MUST_USE_STRUCT LDKDecodeError {
1500    LDKDecodeError_Tag tag;
1501    union {
1502       struct {
1503          enum LDKIOError io;
1504       };
1505    };
1506 } LDKDecodeError;
1507
1508 /**
1509  * The contents of CResult_RetryDecodeErrorZ
1510  */
1511 typedef union LDKCResult_RetryDecodeErrorZPtr {
1512    /**
1513     * A pointer to the contents in the success state.
1514     * Reading from this pointer when `result_ok` is not set is undefined.
1515     */
1516    struct LDKRetry *result;
1517    /**
1518     * A pointer to the contents in the error state.
1519     * Reading from this pointer when `result_ok` is set is undefined.
1520     */
1521    struct LDKDecodeError *err;
1522 } LDKCResult_RetryDecodeErrorZPtr;
1523
1524 /**
1525  * A CResult_RetryDecodeErrorZ represents the result of a fallible operation,
1526  * containing a crate::lightning::ln::outbound_payment::Retry on success and a crate::lightning::ln::msgs::DecodeError on failure.
1527  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1528  */
1529 typedef struct LDKCResult_RetryDecodeErrorZ {
1530    /**
1531     * The contents of this CResult_RetryDecodeErrorZ, accessible via either
1532     * `err` or `result` depending on the state of `result_ok`.
1533     */
1534    union LDKCResult_RetryDecodeErrorZPtr contents;
1535    /**
1536     * Whether this CResult_RetryDecodeErrorZ represents a success state.
1537     */
1538    bool result_ok;
1539 } LDKCResult_RetryDecodeErrorZ;
1540
1541
1542
1543 /**
1544  * A script pubkey for shutting down a channel as defined by [BOLT #2].
1545  *
1546  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1547  */
1548 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1549    /**
1550     * A pointer to the opaque Rust object.
1551     * Nearly everywhere, inner must be non-null, however in places where
1552     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1553     */
1554    LDKnativeShutdownScript *inner;
1555    /**
1556     * Indicates that this is the only struct which contains the same pointer.
1557     * Rust functions which take ownership of an object provided via an argument require
1558     * this to be true and invalidate the object pointed to by inner.
1559     */
1560    bool is_owned;
1561 } LDKShutdownScript;
1562
1563 /**
1564  * Indicates an error on the client's part (usually some variant of attempting to use too-low or
1565  * too-high values)
1566  */
1567 typedef enum LDKAPIError_Tag {
1568    /**
1569     * Indicates the API was wholly misused (see err for more). Cases where these can be returned
1570     * are documented, but generally indicates some precondition of a function was violated.
1571     */
1572    LDKAPIError_APIMisuseError,
1573    /**
1574     * Due to a high feerate, we were unable to complete the request.
1575     * For example, this may be returned if the feerate implies we cannot open a channel at the
1576     * requested value, but opening a larger channel would succeed.
1577     */
1578    LDKAPIError_FeeRateTooHigh,
1579    /**
1580     * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
1581     * too-many-hops, etc).
1582     */
1583    LDKAPIError_InvalidRoute,
1584    /**
1585     * We were unable to complete the request as the Channel required to do so is unable to
1586     * complete the request (or was not found). This can take many forms, including disconnected
1587     * peer, channel at capacity, channel shutting down, etc.
1588     */
1589    LDKAPIError_ChannelUnavailable,
1590    /**
1591     * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
1592     * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
1593     * monitor update is awaiting async resolution. Once it resolves the attempted action should
1594     * complete automatically.
1595     *
1596     * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
1597     * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
1598     * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
1599     */
1600    LDKAPIError_MonitorUpdateInProgress,
1601    /**
1602     * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
1603     * with the channel counterparty as negotiated in [`InitFeatures`].
1604     *
1605     * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
1606     * a channel or cooperatively close one with this peer (and will have to force-close instead).
1607     *
1608     * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
1609     * [`InitFeatures`]: crate::ln::features::InitFeatures
1610     */
1611    LDKAPIError_IncompatibleShutdownScript,
1612    /**
1613     * Must be last for serialization purposes
1614     */
1615    LDKAPIError_Sentinel,
1616 } LDKAPIError_Tag;
1617
1618 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
1619    /**
1620     * A human-readable error message
1621     */
1622    struct LDKStr err;
1623 } LDKAPIError_LDKAPIMisuseError_Body;
1624
1625 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
1626    /**
1627     * A human-readable error message
1628     */
1629    struct LDKStr err;
1630    /**
1631     * The feerate which was too high.
1632     */
1633    uint32_t feerate;
1634 } LDKAPIError_LDKFeeRateTooHigh_Body;
1635
1636 typedef struct LDKAPIError_LDKInvalidRoute_Body {
1637    /**
1638     * A human-readable error message
1639     */
1640    struct LDKStr err;
1641 } LDKAPIError_LDKInvalidRoute_Body;
1642
1643 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
1644    /**
1645     * A human-readable error message
1646     */
1647    struct LDKStr err;
1648 } LDKAPIError_LDKChannelUnavailable_Body;
1649
1650 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
1651    /**
1652     * The incompatible shutdown script.
1653     */
1654    struct LDKShutdownScript script;
1655 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
1656
1657 typedef struct MUST_USE_STRUCT LDKAPIError {
1658    LDKAPIError_Tag tag;
1659    union {
1660       LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
1661       LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
1662       LDKAPIError_LDKInvalidRoute_Body invalid_route;
1663       LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
1664       LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
1665    };
1666 } LDKAPIError;
1667
1668 /**
1669  * The contents of CResult_NoneAPIErrorZ
1670  */
1671 typedef union LDKCResult_NoneAPIErrorZPtr {
1672    /**
1673     * Note that this value is always NULL, as there are no contents in the OK variant
1674     */
1675    void *result;
1676    /**
1677     * A pointer to the contents in the error state.
1678     * Reading from this pointer when `result_ok` is set is undefined.
1679     */
1680    struct LDKAPIError *err;
1681 } LDKCResult_NoneAPIErrorZPtr;
1682
1683 /**
1684  * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
1685  * containing a () on success and a crate::lightning::util::errors::APIError on failure.
1686  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1687  */
1688 typedef struct LDKCResult_NoneAPIErrorZ {
1689    /**
1690     * The contents of this CResult_NoneAPIErrorZ, accessible via either
1691     * `err` or `result` depending on the state of `result_ok`.
1692     */
1693    union LDKCResult_NoneAPIErrorZPtr contents;
1694    /**
1695     * Whether this CResult_NoneAPIErrorZ represents a success state.
1696     */
1697    bool result_ok;
1698 } LDKCResult_NoneAPIErrorZ;
1699
1700 /**
1701  * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
1702  * This corresponds to std::vector in C++
1703  */
1704 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
1705    /**
1706     * The elements in the array.
1707     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1708     */
1709    struct LDKCResult_NoneAPIErrorZ *data;
1710    /**
1711     * The number of elements pointed to by `data`.
1712     */
1713    uintptr_t datalen;
1714 } LDKCVec_CResult_NoneAPIErrorZZ;
1715
1716 /**
1717  * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
1718  * This corresponds to std::vector in C++
1719  */
1720 typedef struct LDKCVec_APIErrorZ {
1721    /**
1722     * The elements in the array.
1723     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1724     */
1725    struct LDKAPIError *data;
1726    /**
1727     * The number of elements pointed to by `data`.
1728     */
1729    uintptr_t datalen;
1730 } LDKCVec_APIErrorZ;
1731
1732 /**
1733  * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
1734  */
1735 typedef enum LDKCOption_ThirtyTwoBytesZ_Tag {
1736    /**
1737     * When we're in this state, this COption_ThirtyTwoBytesZ contains a crate::c_types::ThirtyTwoBytes
1738     */
1739    LDKCOption_ThirtyTwoBytesZ_Some,
1740    /**
1741     * When we're in this state, this COption_ThirtyTwoBytesZ contains nothing
1742     */
1743    LDKCOption_ThirtyTwoBytesZ_None,
1744    /**
1745     * Must be last for serialization purposes
1746     */
1747    LDKCOption_ThirtyTwoBytesZ_Sentinel,
1748 } LDKCOption_ThirtyTwoBytesZ_Tag;
1749
1750 typedef struct LDKCOption_ThirtyTwoBytesZ {
1751    LDKCOption_ThirtyTwoBytesZ_Tag tag;
1752    union {
1753       struct {
1754          struct LDKThirtyTwoBytes some;
1755       };
1756    };
1757 } LDKCOption_ThirtyTwoBytesZ;
1758
1759 /**
1760  * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
1761  */
1762 typedef enum LDKCOption_CVec_u8ZZ_Tag {
1763    /**
1764     * When we're in this state, this COption_CVec_u8ZZ contains a crate::c_types::derived::CVec_u8Z
1765     */
1766    LDKCOption_CVec_u8ZZ_Some,
1767    /**
1768     * When we're in this state, this COption_CVec_u8ZZ contains nothing
1769     */
1770    LDKCOption_CVec_u8ZZ_None,
1771    /**
1772     * Must be last for serialization purposes
1773     */
1774    LDKCOption_CVec_u8ZZ_Sentinel,
1775 } LDKCOption_CVec_u8ZZ_Tag;
1776
1777 typedef struct LDKCOption_CVec_u8ZZ {
1778    LDKCOption_CVec_u8ZZ_Tag tag;
1779    union {
1780       struct {
1781          struct LDKCVec_u8Z some;
1782       };
1783    };
1784 } LDKCOption_CVec_u8ZZ;
1785
1786
1787
1788 /**
1789  * Information which is provided, encrypted, to the payment recipient when sending HTLCs.
1790  *
1791  * This should generally be constructed with data communicated to us from the recipient (via a
1792  * BOLT11 or BOLT12 invoice).
1793  */
1794 typedef struct MUST_USE_STRUCT LDKRecipientOnionFields {
1795    /**
1796     * A pointer to the opaque Rust object.
1797     * Nearly everywhere, inner must be non-null, however in places where
1798     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1799     */
1800    LDKnativeRecipientOnionFields *inner;
1801    /**
1802     * Indicates that this is the only struct which contains the same pointer.
1803     * Rust functions which take ownership of an object provided via an argument require
1804     * this to be true and invalidate the object pointed to by inner.
1805     */
1806    bool is_owned;
1807 } LDKRecipientOnionFields;
1808
1809 /**
1810  * The contents of CResult_RecipientOnionFieldsDecodeErrorZ
1811  */
1812 typedef union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr {
1813    /**
1814     * A pointer to the contents in the success state.
1815     * Reading from this pointer when `result_ok` is not set is undefined.
1816     */
1817    struct LDKRecipientOnionFields *result;
1818    /**
1819     * A pointer to the contents in the error state.
1820     * Reading from this pointer when `result_ok` is set is undefined.
1821     */
1822    struct LDKDecodeError *err;
1823 } LDKCResult_RecipientOnionFieldsDecodeErrorZPtr;
1824
1825 /**
1826  * A CResult_RecipientOnionFieldsDecodeErrorZ represents the result of a fallible operation,
1827  * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
1828  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1829  */
1830 typedef struct LDKCResult_RecipientOnionFieldsDecodeErrorZ {
1831    /**
1832     * The contents of this CResult_RecipientOnionFieldsDecodeErrorZ, accessible via either
1833     * `err` or `result` depending on the state of `result_ok`.
1834     */
1835    union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr contents;
1836    /**
1837     * Whether this CResult_RecipientOnionFieldsDecodeErrorZ represents a success state.
1838     */
1839    bool result_ok;
1840 } LDKCResult_RecipientOnionFieldsDecodeErrorZ;
1841
1842 /**
1843  * A tuple of 2 elements. See the individual fields for the types contained.
1844  */
1845 typedef struct LDKC2Tuple_u64CVec_u8ZZ {
1846    /**
1847     * The element at position 0
1848     */
1849    uint64_t a;
1850    /**
1851     * The element at position 1
1852     */
1853    struct LDKCVec_u8Z b;
1854 } LDKC2Tuple_u64CVec_u8ZZ;
1855
1856 /**
1857  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u64CVec_u8ZZs of arbitrary size.
1858  * This corresponds to std::vector in C++
1859  */
1860 typedef struct LDKCVec_C2Tuple_u64CVec_u8ZZZ {
1861    /**
1862     * The elements in the array.
1863     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1864     */
1865    struct LDKC2Tuple_u64CVec_u8ZZ *data;
1866    /**
1867     * The number of elements pointed to by `data`.
1868     */
1869    uintptr_t datalen;
1870 } LDKCVec_C2Tuple_u64CVec_u8ZZZ;
1871
1872 /**
1873  * The contents of CResult_RecipientOnionFieldsNoneZ
1874  */
1875 typedef union LDKCResult_RecipientOnionFieldsNoneZPtr {
1876    /**
1877     * A pointer to the contents in the success state.
1878     * Reading from this pointer when `result_ok` is not set is undefined.
1879     */
1880    struct LDKRecipientOnionFields *result;
1881    /**
1882     * Note that this value is always NULL, as there are no contents in the Err variant
1883     */
1884    void *err;
1885 } LDKCResult_RecipientOnionFieldsNoneZPtr;
1886
1887 /**
1888  * A CResult_RecipientOnionFieldsNoneZ represents the result of a fallible operation,
1889  * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a () on failure.
1890  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1891  */
1892 typedef struct LDKCResult_RecipientOnionFieldsNoneZ {
1893    /**
1894     * The contents of this CResult_RecipientOnionFieldsNoneZ, accessible via either
1895     * `err` or `result` depending on the state of `result_ok`.
1896     */
1897    union LDKCResult_RecipientOnionFieldsNoneZPtr contents;
1898    /**
1899     * Whether this CResult_RecipientOnionFieldsNoneZ represents a success state.
1900     */
1901    bool result_ok;
1902 } LDKCResult_RecipientOnionFieldsNoneZ;
1903
1904
1905
1906 /**
1907  * A semantically valid [`Bolt12Invoice`] that hasn't been signed.
1908  *
1909  * # Serialization
1910  *
1911  * This is serialized as a TLV stream, which includes TLV records from the originating message. As
1912  * such, it may include unknown, odd TLV records.
1913  */
1914 typedef struct MUST_USE_STRUCT LDKUnsignedBolt12Invoice {
1915    /**
1916     * A pointer to the opaque Rust object.
1917     * Nearly everywhere, inner must be non-null, however in places where
1918     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1919     */
1920    LDKnativeUnsignedBolt12Invoice *inner;
1921    /**
1922     * Indicates that this is the only struct which contains the same pointer.
1923     * Rust functions which take ownership of an object provided via an argument require
1924     * this to be true and invalidate the object pointed to by inner.
1925     */
1926    bool is_owned;
1927 } LDKUnsignedBolt12Invoice;
1928
1929 /**
1930  * The contents of CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ
1931  */
1932 typedef union LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZPtr {
1933    /**
1934     * A pointer to the contents in the success state.
1935     * Reading from this pointer when `result_ok` is not set is undefined.
1936     */
1937    struct LDKUnsignedBolt12Invoice *result;
1938    /**
1939     * A pointer to the contents in the error state.
1940     * Reading from this pointer when `result_ok` is set is undefined.
1941     */
1942    enum LDKBolt12SemanticError *err;
1943 } LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZPtr;
1944
1945 /**
1946  * A CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ represents the result of a fallible operation,
1947  * containing a crate::lightning::offers::invoice::UnsignedBolt12Invoice on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
1948  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1949  */
1950 typedef struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ {
1951    /**
1952     * The contents of this CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ, accessible via either
1953     * `err` or `result` depending on the state of `result_ok`.
1954     */
1955    union LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZPtr contents;
1956    /**
1957     * Whether this CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ represents a success state.
1958     */
1959    bool result_ok;
1960 } LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ;
1961
1962
1963
1964 /**
1965  * A `Bolt12Invoice` is a payment request, typically corresponding to an [`Offer`] or a [`Refund`].
1966  *
1967  * An invoice may be sent in response to an [`InvoiceRequest`] in the case of an offer or sent
1968  * directly after scanning a refund. It includes all the information needed to pay a recipient.
1969  *
1970  * [`Offer`]: crate::offers::offer::Offer
1971  * [`Refund`]: crate::offers::refund::Refund
1972  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
1973  */
1974 typedef struct MUST_USE_STRUCT LDKBolt12Invoice {
1975    /**
1976     * A pointer to the opaque Rust object.
1977     * Nearly everywhere, inner must be non-null, however in places where
1978     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1979     */
1980    LDKnativeBolt12Invoice *inner;
1981    /**
1982     * Indicates that this is the only struct which contains the same pointer.
1983     * Rust functions which take ownership of an object provided via an argument require
1984     * this to be true and invalidate the object pointed to by inner.
1985     */
1986    bool is_owned;
1987 } LDKBolt12Invoice;
1988
1989 /**
1990  * The contents of CResult_Bolt12InvoiceBolt12SemanticErrorZ
1991  */
1992 typedef union LDKCResult_Bolt12InvoiceBolt12SemanticErrorZPtr {
1993    /**
1994     * A pointer to the contents in the success state.
1995     * Reading from this pointer when `result_ok` is not set is undefined.
1996     */
1997    struct LDKBolt12Invoice *result;
1998    /**
1999     * A pointer to the contents in the error state.
2000     * Reading from this pointer when `result_ok` is set is undefined.
2001     */
2002    enum LDKBolt12SemanticError *err;
2003 } LDKCResult_Bolt12InvoiceBolt12SemanticErrorZPtr;
2004
2005 /**
2006  * A CResult_Bolt12InvoiceBolt12SemanticErrorZ represents the result of a fallible operation,
2007  * containing a crate::lightning::offers::invoice::Bolt12Invoice on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
2008  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2009  */
2010 typedef struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ {
2011    /**
2012     * The contents of this CResult_Bolt12InvoiceBolt12SemanticErrorZ, accessible via either
2013     * `err` or `result` depending on the state of `result_ok`.
2014     */
2015    union LDKCResult_Bolt12InvoiceBolt12SemanticErrorZPtr contents;
2016    /**
2017     * Whether this CResult_Bolt12InvoiceBolt12SemanticErrorZ represents a success state.
2018     */
2019    bool result_ok;
2020 } LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ;
2021
2022 /**
2023  * Represents a secp256k1 Schnorr signature serialized as two 32-byte numbers
2024  */
2025 typedef struct LDKSchnorrSignature {
2026    /**
2027     * The bytes of the signature as two 32-byte numbers
2028     */
2029    uint8_t compact_form[64];
2030 } LDKSchnorrSignature;
2031
2032 /**
2033  * The contents of CResult_SchnorrSignatureNoneZ
2034  */
2035 typedef union LDKCResult_SchnorrSignatureNoneZPtr {
2036    /**
2037     * A pointer to the contents in the success state.
2038     * Reading from this pointer when `result_ok` is not set is undefined.
2039     */
2040    struct LDKSchnorrSignature *result;
2041    /**
2042     * Note that this value is always NULL, as there are no contents in the Err variant
2043     */
2044    void *err;
2045 } LDKCResult_SchnorrSignatureNoneZPtr;
2046
2047 /**
2048  * A CResult_SchnorrSignatureNoneZ represents the result of a fallible operation,
2049  * containing a crate::c_types::SchnorrSignature on success and a () on failure.
2050  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2051  */
2052 typedef struct LDKCResult_SchnorrSignatureNoneZ {
2053    /**
2054     * The contents of this CResult_SchnorrSignatureNoneZ, accessible via either
2055     * `err` or `result` depending on the state of `result_ok`.
2056     */
2057    union LDKCResult_SchnorrSignatureNoneZPtr contents;
2058    /**
2059     * Whether this CResult_SchnorrSignatureNoneZ represents a success state.
2060     */
2061    bool result_ok;
2062 } LDKCResult_SchnorrSignatureNoneZ;
2063
2064 /**
2065  * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
2066  * This corresponds to std::vector in C++
2067  */
2068 typedef struct LDKCVec_ThirtyTwoBytesZ {
2069    /**
2070     * The elements in the array.
2071     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2072     */
2073    struct LDKThirtyTwoBytes *data;
2074    /**
2075     * The number of elements pointed to by `data`.
2076     */
2077    uintptr_t datalen;
2078 } LDKCVec_ThirtyTwoBytesZ;
2079
2080 /**
2081  * An enum which can either contain a crate::c_types::derived::CVec_ThirtyTwoBytesZ or not
2082  */
2083 typedef enum LDKCOption_CVec_ThirtyTwoBytesZZ_Tag {
2084    /**
2085     * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains a crate::c_types::derived::CVec_ThirtyTwoBytesZ
2086     */
2087    LDKCOption_CVec_ThirtyTwoBytesZZ_Some,
2088    /**
2089     * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains nothing
2090     */
2091    LDKCOption_CVec_ThirtyTwoBytesZZ_None,
2092    /**
2093     * Must be last for serialization purposes
2094     */
2095    LDKCOption_CVec_ThirtyTwoBytesZZ_Sentinel,
2096 } LDKCOption_CVec_ThirtyTwoBytesZZ_Tag;
2097
2098 typedef struct LDKCOption_CVec_ThirtyTwoBytesZZ {
2099    LDKCOption_CVec_ThirtyTwoBytesZZ_Tag tag;
2100    union {
2101       struct {
2102          struct LDKCVec_ThirtyTwoBytesZ some;
2103       };
2104    };
2105 } LDKCOption_CVec_ThirtyTwoBytesZZ;
2106
2107 /**
2108  * A 3-byte byte array.
2109  */
2110 typedef struct LDKThreeBytes {
2111    /**
2112     * The three bytes
2113     */
2114    uint8_t data[3];
2115 } LDKThreeBytes;
2116
2117 /**
2118  * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
2119  * another currency.
2120  */
2121 typedef enum LDKAmount_Tag {
2122    /**
2123     * An amount of bitcoin.
2124     */
2125    LDKAmount_Bitcoin,
2126    /**
2127     * An amount of currency specified using ISO 4712.
2128     */
2129    LDKAmount_Currency,
2130    /**
2131     * Must be last for serialization purposes
2132     */
2133    LDKAmount_Sentinel,
2134 } LDKAmount_Tag;
2135
2136 typedef struct LDKAmount_LDKBitcoin_Body {
2137    /**
2138     * The amount in millisatoshi.
2139     */
2140    uint64_t amount_msats;
2141 } LDKAmount_LDKBitcoin_Body;
2142
2143 typedef struct LDKAmount_LDKCurrency_Body {
2144    /**
2145     * The currency that the amount is denominated in.
2146     */
2147    struct LDKThreeBytes iso4217_code;
2148    /**
2149     * The amount in the currency unit adjusted by the ISO 4712 exponent (e.g., USD cents).
2150     */
2151    uint64_t amount;
2152 } LDKAmount_LDKCurrency_Body;
2153
2154 typedef struct MUST_USE_STRUCT LDKAmount {
2155    LDKAmount_Tag tag;
2156    union {
2157       LDKAmount_LDKBitcoin_Body bitcoin;
2158       LDKAmount_LDKCurrency_Body currency;
2159    };
2160 } LDKAmount;
2161
2162 /**
2163  * An enum which can either contain a crate::lightning::offers::offer::Amount or not
2164  */
2165 typedef enum LDKCOption_AmountZ_Tag {
2166    /**
2167     * When we're in this state, this COption_AmountZ contains a crate::lightning::offers::offer::Amount
2168     */
2169    LDKCOption_AmountZ_Some,
2170    /**
2171     * When we're in this state, this COption_AmountZ contains nothing
2172     */
2173    LDKCOption_AmountZ_None,
2174    /**
2175     * Must be last for serialization purposes
2176     */
2177    LDKCOption_AmountZ_Sentinel,
2178 } LDKCOption_AmountZ_Tag;
2179
2180 typedef struct LDKCOption_AmountZ {
2181    LDKCOption_AmountZ_Tag tag;
2182    union {
2183       struct {
2184          struct LDKAmount some;
2185       };
2186    };
2187 } LDKCOption_AmountZ;
2188
2189 /**
2190  * Quantity of items supported by an [`Offer`].
2191  */
2192 typedef enum LDKQuantity_Tag {
2193    /**
2194     * Up to a specific number of items (inclusive). Use when more than one item can be requested
2195     * but is limited (e.g., because of per customer or inventory limits).
2196     *
2197     * May be used with `NonZeroU64::new(1)` but prefer to use [`Quantity::One`] if only one item
2198     * is supported.
2199     */
2200    LDKQuantity_Bounded,
2201    /**
2202     * One or more items. Use when more than one item can be requested without any limit.
2203     */
2204    LDKQuantity_Unbounded,
2205    /**
2206     * Only one item. Use when only a single item can be requested.
2207     */
2208    LDKQuantity_One,
2209    /**
2210     * Must be last for serialization purposes
2211     */
2212    LDKQuantity_Sentinel,
2213 } LDKQuantity_Tag;
2214
2215 typedef struct MUST_USE_STRUCT LDKQuantity {
2216    LDKQuantity_Tag tag;
2217    union {
2218       struct {
2219          uint64_t bounded;
2220       };
2221    };
2222 } LDKQuantity;
2223
2224 /**
2225  * An enum which can either contain a crate::lightning::offers::offer::Quantity or not
2226  */
2227 typedef enum LDKCOption_QuantityZ_Tag {
2228    /**
2229     * When we're in this state, this COption_QuantityZ contains a crate::lightning::offers::offer::Quantity
2230     */
2231    LDKCOption_QuantityZ_Some,
2232    /**
2233     * When we're in this state, this COption_QuantityZ contains nothing
2234     */
2235    LDKCOption_QuantityZ_None,
2236    /**
2237     * Must be last for serialization purposes
2238     */
2239    LDKCOption_QuantityZ_Sentinel,
2240 } LDKCOption_QuantityZ_Tag;
2241
2242 typedef struct LDKCOption_QuantityZ {
2243    LDKCOption_QuantityZ_Tag tag;
2244    union {
2245       struct {
2246          struct LDKQuantity some;
2247       };
2248    };
2249 } LDKCOption_QuantityZ;
2250
2251 /**
2252  * The contents of CResult_ThirtyTwoBytesNoneZ
2253  */
2254 typedef union LDKCResult_ThirtyTwoBytesNoneZPtr {
2255    /**
2256     * A pointer to the contents in the success state.
2257     * Reading from this pointer when `result_ok` is not set is undefined.
2258     */
2259    struct LDKThirtyTwoBytes *result;
2260    /**
2261     * Note that this value is always NULL, as there are no contents in the Err variant
2262     */
2263    void *err;
2264 } LDKCResult_ThirtyTwoBytesNoneZPtr;
2265
2266 /**
2267  * A CResult_ThirtyTwoBytesNoneZ represents the result of a fallible operation,
2268  * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
2269  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2270  */
2271 typedef struct LDKCResult_ThirtyTwoBytesNoneZ {
2272    /**
2273     * The contents of this CResult_ThirtyTwoBytesNoneZ, accessible via either
2274     * `err` or `result` depending on the state of `result_ok`.
2275     */
2276    union LDKCResult_ThirtyTwoBytesNoneZPtr contents;
2277    /**
2278     * Whether this CResult_ThirtyTwoBytesNoneZ represents a success state.
2279     */
2280    bool result_ok;
2281 } LDKCResult_ThirtyTwoBytesNoneZ;
2282
2283
2284
2285 /**
2286  * Information needed to route a payment across a [`BlindedPath`].
2287  */
2288 typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
2289    /**
2290     * A pointer to the opaque Rust object.
2291     * Nearly everywhere, inner must be non-null, however in places where
2292     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2293     */
2294    LDKnativeBlindedPayInfo *inner;
2295    /**
2296     * Indicates that this is the only struct which contains the same pointer.
2297     * Rust functions which take ownership of an object provided via an argument require
2298     * this to be true and invalidate the object pointed to by inner.
2299     */
2300    bool is_owned;
2301 } LDKBlindedPayInfo;
2302
2303 /**
2304  * The contents of CResult_BlindedPayInfoDecodeErrorZ
2305  */
2306 typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
2307    /**
2308     * A pointer to the contents in the success state.
2309     * Reading from this pointer when `result_ok` is not set is undefined.
2310     */
2311    struct LDKBlindedPayInfo *result;
2312    /**
2313     * A pointer to the contents in the error state.
2314     * Reading from this pointer when `result_ok` is set is undefined.
2315     */
2316    struct LDKDecodeError *err;
2317 } LDKCResult_BlindedPayInfoDecodeErrorZPtr;
2318
2319 /**
2320  * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
2321  * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
2322  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2323  */
2324 typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
2325    /**
2326     * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
2327     * `err` or `result` depending on the state of `result_ok`.
2328     */
2329    union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
2330    /**
2331     * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
2332     */
2333    bool result_ok;
2334 } LDKCResult_BlindedPayInfoDecodeErrorZ;
2335
2336
2337
2338 /**
2339  * Information about a spendable output to a P2WSH script.
2340  *
2341  * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
2342  */
2343 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2344    /**
2345     * A pointer to the opaque Rust object.
2346     * Nearly everywhere, inner must be non-null, however in places where
2347     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2348     */
2349    LDKnativeDelayedPaymentOutputDescriptor *inner;
2350    /**
2351     * Indicates that this is the only struct which contains the same pointer.
2352     * Rust functions which take ownership of an object provided via an argument require
2353     * this to be true and invalidate the object pointed to by inner.
2354     */
2355    bool is_owned;
2356 } LDKDelayedPaymentOutputDescriptor;
2357
2358 /**
2359  * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
2360  */
2361 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
2362    /**
2363     * A pointer to the contents in the success state.
2364     * Reading from this pointer when `result_ok` is not set is undefined.
2365     */
2366    struct LDKDelayedPaymentOutputDescriptor *result;
2367    /**
2368     * A pointer to the contents in the error state.
2369     * Reading from this pointer when `result_ok` is set is undefined.
2370     */
2371    struct LDKDecodeError *err;
2372 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
2373
2374 /**
2375  * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2376  * containing a crate::lightning::sign::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2377  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2378  */
2379 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
2380    /**
2381     * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
2382     * `err` or `result` depending on the state of `result_ok`.
2383     */
2384    union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
2385    /**
2386     * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
2387     */
2388    bool result_ok;
2389 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
2390
2391
2392
2393 /**
2394  * Information about a spendable output to our \"payment key\".
2395  *
2396  * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
2397  */
2398 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2399    /**
2400     * A pointer to the opaque Rust object.
2401     * Nearly everywhere, inner must be non-null, however in places where
2402     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2403     */
2404    LDKnativeStaticPaymentOutputDescriptor *inner;
2405    /**
2406     * Indicates that this is the only struct which contains the same pointer.
2407     * Rust functions which take ownership of an object provided via an argument require
2408     * this to be true and invalidate the object pointed to by inner.
2409     */
2410    bool is_owned;
2411 } LDKStaticPaymentOutputDescriptor;
2412
2413 /**
2414  * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
2415  */
2416 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
2417    /**
2418     * A pointer to the contents in the success state.
2419     * Reading from this pointer when `result_ok` is not set is undefined.
2420     */
2421    struct LDKStaticPaymentOutputDescriptor *result;
2422    /**
2423     * A pointer to the contents in the error state.
2424     * Reading from this pointer when `result_ok` is set is undefined.
2425     */
2426    struct LDKDecodeError *err;
2427 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
2428
2429 /**
2430  * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2431  * containing a crate::lightning::sign::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2432  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2433  */
2434 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
2435    /**
2436     * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
2437     * `err` or `result` depending on the state of `result_ok`.
2438     */
2439    union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
2440    /**
2441     * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
2442     */
2443    bool result_ok;
2444 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
2445
2446
2447
2448 /**
2449  * A reference to a transaction output.
2450  *
2451  * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2452  * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2453  */
2454 typedef struct MUST_USE_STRUCT LDKOutPoint {
2455    /**
2456     * A pointer to the opaque Rust object.
2457     * Nearly everywhere, inner must be non-null, however in places where
2458     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2459     */
2460    LDKnativeOutPoint *inner;
2461    /**
2462     * Indicates that this is the only struct which contains the same pointer.
2463     * Rust functions which take ownership of an object provided via an argument require
2464     * this to be true and invalidate the object pointed to by inner.
2465     */
2466    bool is_owned;
2467 } LDKOutPoint;
2468
2469 /**
2470  * Describes the necessary information to spend a spendable output.
2471  *
2472  * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
2473  * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
2474  * to spend on-chain. The information needed to do this is provided in this enum, including the
2475  * outpoint describing which `txid` and output `index` is available, the full output which exists
2476  * at that `txid`/`index`, and any keys or other information required to sign.
2477  *
2478  * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
2479  */
2480 typedef enum LDKSpendableOutputDescriptor_Tag {
2481    /**
2482     * An output to a script which was provided via [`SignerProvider`] directly, either from
2483     * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
2484     * know how to spend it. No secret keys are provided as LDK was never given any key.
2485     * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2486     * on-chain using the payment preimage or after it has timed out.
2487     *
2488     * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
2489     * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
2490     */
2491    LDKSpendableOutputDescriptor_StaticOutput,
2492    /**
2493     * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
2494     * delay.
2495     *
2496     * The witness in the spending input should be:
2497     * ```bitcoin
2498     * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2499     * ```
2500     *
2501     * Note that the `nSequence` field in the spending input must be set to
2502     * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
2503     * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
2504     * the outpoint confirms, see [BIP
2505     * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
2506     * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
2507     * is reached.
2508     *
2509     * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2510     * it is an output from an old state which we broadcast (which should never happen).
2511     *
2512     * To derive the delayed payment key which is used to sign this input, you must pass the
2513     * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
2514     * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
2515     * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The DelayedPaymentKey can be
2516     * generated without the secret key using [`DelayedPaymentKey::from_basepoint`] and only the
2517     * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
2518     *
2519     * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
2520     * used in the witness script generation), you must pass the counterparty
2521     * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
2522     * [`ChannelSigner::provide_channel_parameters`]) and the provided
2523     * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
2524     * [`RevocationKey`].
2525     *
2526     * The witness script which is hashed and included in the output `script_pubkey` may be
2527     * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
2528     * as explained above), our delayed payment pubkey (derived as explained above), and the
2529     * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
2530     * [`chan_utils::get_revokeable_redeemscript`].
2531     */
2532    LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2533    /**
2534     * An output spendable exclusively by our payment key (i.e., the private key that corresponds
2535     * to the `payment_point` in [`ChannelSigner::pubkeys`]). The output type depends on the
2536     * channel type negotiated.
2537     *
2538     * On an anchor outputs channel, the witness in the spending input is:
2539     * ```bitcoin
2540     * <BIP 143 signature> <witness script>
2541     * ```
2542     *
2543     * Otherwise, it is:
2544     * ```bitcoin
2545     * <BIP 143 signature> <payment key>
2546     * ```
2547     *
2548     * These are generally the result of our counterparty having broadcast the current state,
2549     * allowing us to claim the non-HTLC-encumbered outputs immediately, or after one confirmation
2550     * in the case of anchor outputs channels.
2551     */
2552    LDKSpendableOutputDescriptor_StaticPaymentOutput,
2553    /**
2554     * Must be last for serialization purposes
2555     */
2556    LDKSpendableOutputDescriptor_Sentinel,
2557 } LDKSpendableOutputDescriptor_Tag;
2558
2559 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2560    /**
2561     * The outpoint which is spendable.
2562     */
2563    struct LDKOutPoint outpoint;
2564    /**
2565     * The output which is referenced by the given outpoint.
2566     */
2567    struct LDKTxOut output;
2568    /**
2569     * The `channel_keys_id` for the channel which this output came from.
2570     *
2571     * For channels which were generated on LDK 0.0.119 or later, this is the value which was
2572     * passed to the [`SignerProvider::get_destination_script`] call which provided this
2573     * output script.
2574     *
2575     * For channels which were generated prior to LDK 0.0.119, no such argument existed,
2576     * however this field may still be filled in if such data is available.
2577     *
2578     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2579     */
2580    struct LDKThirtyTwoBytes channel_keys_id;
2581 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2582
2583 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2584    LDKSpendableOutputDescriptor_Tag tag;
2585    union {
2586       LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2587       struct {
2588          struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2589       };
2590       struct {
2591          struct LDKStaticPaymentOutputDescriptor static_payment_output;
2592       };
2593    };
2594 } LDKSpendableOutputDescriptor;
2595
2596 /**
2597  * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
2598  */
2599 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
2600    /**
2601     * A pointer to the contents in the success state.
2602     * Reading from this pointer when `result_ok` is not set is undefined.
2603     */
2604    struct LDKSpendableOutputDescriptor *result;
2605    /**
2606     * A pointer to the contents in the error state.
2607     * Reading from this pointer when `result_ok` is set is undefined.
2608     */
2609    struct LDKDecodeError *err;
2610 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
2611
2612 /**
2613  * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2614  * containing a crate::lightning::sign::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2615  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2616  */
2617 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
2618    /**
2619     * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
2620     * `err` or `result` depending on the state of `result_ok`.
2621     */
2622    union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
2623    /**
2624     * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
2625     */
2626    bool result_ok;
2627 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
2628
2629 /**
2630  * A dynamically-allocated array of crate::lightning::sign::SpendableOutputDescriptors of arbitrary size.
2631  * This corresponds to std::vector in C++
2632  */
2633 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2634    /**
2635     * The elements in the array.
2636     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2637     */
2638    struct LDKSpendableOutputDescriptor *data;
2639    /**
2640     * The number of elements pointed to by `data`.
2641     */
2642    uintptr_t datalen;
2643 } LDKCVec_SpendableOutputDescriptorZ;
2644
2645 /**
2646  * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
2647  * This corresponds to std::vector in C++
2648  */
2649 typedef struct LDKCVec_TxOutZ {
2650    /**
2651     * The elements in the array.
2652     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2653     */
2654    struct LDKTxOut *data;
2655    /**
2656     * The number of elements pointed to by `data`.
2657     */
2658    uintptr_t datalen;
2659 } LDKCVec_TxOutZ;
2660
2661 /**
2662  * An enum which can either contain a u32 or not
2663  */
2664 typedef enum LDKCOption_u32Z_Tag {
2665    /**
2666     * When we're in this state, this COption_u32Z contains a u32
2667     */
2668    LDKCOption_u32Z_Some,
2669    /**
2670     * When we're in this state, this COption_u32Z contains nothing
2671     */
2672    LDKCOption_u32Z_None,
2673    /**
2674     * Must be last for serialization purposes
2675     */
2676    LDKCOption_u32Z_Sentinel,
2677 } LDKCOption_u32Z_Tag;
2678
2679 typedef struct LDKCOption_u32Z {
2680    LDKCOption_u32Z_Tag tag;
2681    union {
2682       struct {
2683          uint32_t some;
2684       };
2685    };
2686 } LDKCOption_u32Z;
2687
2688 /**
2689  * A tuple of 2 elements. See the individual fields for the types contained.
2690  */
2691 typedef struct LDKC2Tuple_CVec_u8Zu64Z {
2692    /**
2693     * The element at position 0
2694     */
2695    struct LDKCVec_u8Z a;
2696    /**
2697     * The element at position 1
2698     */
2699    uint64_t b;
2700 } LDKC2Tuple_CVec_u8Zu64Z;
2701
2702 /**
2703  * The contents of CResult_C2Tuple_CVec_u8Zu64ZNoneZ
2704  */
2705 typedef union LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr {
2706    /**
2707     * A pointer to the contents in the success state.
2708     * Reading from this pointer when `result_ok` is not set is undefined.
2709     */
2710    struct LDKC2Tuple_CVec_u8Zu64Z *result;
2711    /**
2712     * Note that this value is always NULL, as there are no contents in the Err variant
2713     */
2714    void *err;
2715 } LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr;
2716
2717 /**
2718  * A CResult_C2Tuple_CVec_u8Zu64ZNoneZ represents the result of a fallible operation,
2719  * containing a crate::c_types::derived::C2Tuple_CVec_u8Zu64Z on success and a () on failure.
2720  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2721  */
2722 typedef struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ {
2723    /**
2724     * The contents of this CResult_C2Tuple_CVec_u8Zu64ZNoneZ, accessible via either
2725     * `err` or `result` depending on the state of `result_ok`.
2726     */
2727    union LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr contents;
2728    /**
2729     * Whether this CResult_C2Tuple_CVec_u8Zu64ZNoneZ represents a success state.
2730     */
2731    bool result_ok;
2732 } LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ;
2733
2734
2735
2736 /**
2737  * The parameters required to derive a channel signer via [`SignerProvider`].
2738  */
2739 typedef struct MUST_USE_STRUCT LDKChannelDerivationParameters {
2740    /**
2741     * A pointer to the opaque Rust object.
2742     * Nearly everywhere, inner must be non-null, however in places where
2743     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2744     */
2745    LDKnativeChannelDerivationParameters *inner;
2746    /**
2747     * Indicates that this is the only struct which contains the same pointer.
2748     * Rust functions which take ownership of an object provided via an argument require
2749     * this to be true and invalidate the object pointed to by inner.
2750     */
2751    bool is_owned;
2752 } LDKChannelDerivationParameters;
2753
2754 /**
2755  * The contents of CResult_ChannelDerivationParametersDecodeErrorZ
2756  */
2757 typedef union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr {
2758    /**
2759     * A pointer to the contents in the success state.
2760     * Reading from this pointer when `result_ok` is not set is undefined.
2761     */
2762    struct LDKChannelDerivationParameters *result;
2763    /**
2764     * A pointer to the contents in the error state.
2765     * Reading from this pointer when `result_ok` is set is undefined.
2766     */
2767    struct LDKDecodeError *err;
2768 } LDKCResult_ChannelDerivationParametersDecodeErrorZPtr;
2769
2770 /**
2771  * A CResult_ChannelDerivationParametersDecodeErrorZ represents the result of a fallible operation,
2772  * containing a crate::lightning::sign::ChannelDerivationParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2773  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2774  */
2775 typedef struct LDKCResult_ChannelDerivationParametersDecodeErrorZ {
2776    /**
2777     * The contents of this CResult_ChannelDerivationParametersDecodeErrorZ, accessible via either
2778     * `err` or `result` depending on the state of `result_ok`.
2779     */
2780    union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr contents;
2781    /**
2782     * Whether this CResult_ChannelDerivationParametersDecodeErrorZ represents a success state.
2783     */
2784    bool result_ok;
2785 } LDKCResult_ChannelDerivationParametersDecodeErrorZ;
2786
2787
2788
2789 /**
2790  * A descriptor used to sign for a commitment transaction's HTLC output.
2791  */
2792 typedef struct MUST_USE_STRUCT LDKHTLCDescriptor {
2793    /**
2794     * A pointer to the opaque Rust object.
2795     * Nearly everywhere, inner must be non-null, however in places where
2796     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2797     */
2798    LDKnativeHTLCDescriptor *inner;
2799    /**
2800     * Indicates that this is the only struct which contains the same pointer.
2801     * Rust functions which take ownership of an object provided via an argument require
2802     * this to be true and invalidate the object pointed to by inner.
2803     */
2804    bool is_owned;
2805 } LDKHTLCDescriptor;
2806
2807 /**
2808  * The contents of CResult_HTLCDescriptorDecodeErrorZ
2809  */
2810 typedef union LDKCResult_HTLCDescriptorDecodeErrorZPtr {
2811    /**
2812     * A pointer to the contents in the success state.
2813     * Reading from this pointer when `result_ok` is not set is undefined.
2814     */
2815    struct LDKHTLCDescriptor *result;
2816    /**
2817     * A pointer to the contents in the error state.
2818     * Reading from this pointer when `result_ok` is set is undefined.
2819     */
2820    struct LDKDecodeError *err;
2821 } LDKCResult_HTLCDescriptorDecodeErrorZPtr;
2822
2823 /**
2824  * A CResult_HTLCDescriptorDecodeErrorZ represents the result of a fallible operation,
2825  * containing a crate::lightning::sign::HTLCDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2826  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2827  */
2828 typedef struct LDKCResult_HTLCDescriptorDecodeErrorZ {
2829    /**
2830     * The contents of this CResult_HTLCDescriptorDecodeErrorZ, accessible via either
2831     * `err` or `result` depending on the state of `result_ok`.
2832     */
2833    union LDKCResult_HTLCDescriptorDecodeErrorZPtr contents;
2834    /**
2835     * Whether this CResult_HTLCDescriptorDecodeErrorZ represents a success state.
2836     */
2837    bool result_ok;
2838 } LDKCResult_HTLCDescriptorDecodeErrorZ;
2839
2840 /**
2841  * The contents of CResult_NoneNoneZ
2842  */
2843 typedef union LDKCResult_NoneNoneZPtr {
2844    /**
2845     * Note that this value is always NULL, as there are no contents in the OK variant
2846     */
2847    void *result;
2848    /**
2849     * Note that this value is always NULL, as there are no contents in the Err variant
2850     */
2851    void *err;
2852 } LDKCResult_NoneNoneZPtr;
2853
2854 /**
2855  * A CResult_NoneNoneZ represents the result of a fallible operation,
2856  * containing a () on success and a () on failure.
2857  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2858  */
2859 typedef struct LDKCResult_NoneNoneZ {
2860    /**
2861     * The contents of this CResult_NoneNoneZ, accessible via either
2862     * `err` or `result` depending on the state of `result_ok`.
2863     */
2864    union LDKCResult_NoneNoneZPtr contents;
2865    /**
2866     * Whether this CResult_NoneNoneZ represents a success state.
2867     */
2868    bool result_ok;
2869 } LDKCResult_NoneNoneZ;
2870
2871 /**
2872  * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
2873  */
2874 typedef struct LDKPublicKey {
2875    /**
2876     * The bytes of the public key
2877     */
2878    uint8_t compressed_form[33];
2879 } LDKPublicKey;
2880
2881 /**
2882  * The contents of CResult_PublicKeyNoneZ
2883  */
2884 typedef union LDKCResult_PublicKeyNoneZPtr {
2885    /**
2886     * A pointer to the contents in the success state.
2887     * Reading from this pointer when `result_ok` is not set is undefined.
2888     */
2889    struct LDKPublicKey *result;
2890    /**
2891     * Note that this value is always NULL, as there are no contents in the Err variant
2892     */
2893    void *err;
2894 } LDKCResult_PublicKeyNoneZPtr;
2895
2896 /**
2897  * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
2898  * containing a crate::c_types::PublicKey on success and a () on failure.
2899  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2900  */
2901 typedef struct LDKCResult_PublicKeyNoneZ {
2902    /**
2903     * The contents of this CResult_PublicKeyNoneZ, accessible via either
2904     * `err` or `result` depending on the state of `result_ok`.
2905     */
2906    union LDKCResult_PublicKeyNoneZPtr contents;
2907    /**
2908     * Whether this CResult_PublicKeyNoneZ represents a success state.
2909     */
2910    bool result_ok;
2911 } LDKCResult_PublicKeyNoneZ;
2912
2913 /**
2914  * An enum which can either contain a crate::c_types::BigEndianScalar or not
2915  */
2916 typedef enum LDKCOption_BigEndianScalarZ_Tag {
2917    /**
2918     * When we're in this state, this COption_BigEndianScalarZ contains a crate::c_types::BigEndianScalar
2919     */
2920    LDKCOption_BigEndianScalarZ_Some,
2921    /**
2922     * When we're in this state, this COption_BigEndianScalarZ contains nothing
2923     */
2924    LDKCOption_BigEndianScalarZ_None,
2925    /**
2926     * Must be last for serialization purposes
2927     */
2928    LDKCOption_BigEndianScalarZ_Sentinel,
2929 } LDKCOption_BigEndianScalarZ_Tag;
2930
2931 typedef struct LDKCOption_BigEndianScalarZ {
2932    LDKCOption_BigEndianScalarZ_Tag tag;
2933    union {
2934       struct {
2935          struct LDKBigEndianScalar some;
2936       };
2937    };
2938 } LDKCOption_BigEndianScalarZ;
2939
2940 /**
2941  * Integer in the range `0..32`
2942  */
2943 typedef struct LDKU5 {
2944    uint8_t _0;
2945 } LDKU5;
2946
2947 /**
2948  * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
2949  * This corresponds to std::vector in C++
2950  */
2951 typedef struct LDKCVec_U5Z {
2952    /**
2953     * The elements in the array.
2954     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2955     */
2956    struct LDKU5 *data;
2957    /**
2958     * The number of elements pointed to by `data`.
2959     */
2960    uintptr_t datalen;
2961 } LDKCVec_U5Z;
2962
2963 /**
2964  * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
2965  * allows recovering the exact public key which created the signature given the message.
2966  */
2967 typedef struct LDKRecoverableSignature {
2968    /**
2969     * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
2970     * recovery.
2971     */
2972    uint8_t serialized_form[68];
2973 } LDKRecoverableSignature;
2974
2975 /**
2976  * The contents of CResult_RecoverableSignatureNoneZ
2977  */
2978 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
2979    /**
2980     * A pointer to the contents in the success state.
2981     * Reading from this pointer when `result_ok` is not set is undefined.
2982     */
2983    struct LDKRecoverableSignature *result;
2984    /**
2985     * Note that this value is always NULL, as there are no contents in the Err variant
2986     */
2987    void *err;
2988 } LDKCResult_RecoverableSignatureNoneZPtr;
2989
2990 /**
2991  * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
2992  * containing a crate::c_types::RecoverableSignature on success and a () on failure.
2993  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2994  */
2995 typedef struct LDKCResult_RecoverableSignatureNoneZ {
2996    /**
2997     * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
2998     * `err` or `result` depending on the state of `result_ok`.
2999     */
3000    union LDKCResult_RecoverableSignatureNoneZPtr contents;
3001    /**
3002     * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
3003     */
3004    bool result_ok;
3005 } LDKCResult_RecoverableSignatureNoneZ;
3006
3007 /**
3008  * Represents a secp256k1 ECDSA signature serialized as two 32-byte numbers
3009  */
3010 typedef struct LDKECDSASignature {
3011    /**
3012     * The bytes of the signature in "compact" form
3013     */
3014    uint8_t compact_form[64];
3015 } LDKECDSASignature;
3016
3017 /**
3018  * The contents of CResult_ECDSASignatureNoneZ
3019  */
3020 typedef union LDKCResult_ECDSASignatureNoneZPtr {
3021    /**
3022     * A pointer to the contents in the success state.
3023     * Reading from this pointer when `result_ok` is not set is undefined.
3024     */
3025    struct LDKECDSASignature *result;
3026    /**
3027     * Note that this value is always NULL, as there are no contents in the Err variant
3028     */
3029    void *err;
3030 } LDKCResult_ECDSASignatureNoneZPtr;
3031
3032 /**
3033  * A CResult_ECDSASignatureNoneZ represents the result of a fallible operation,
3034  * containing a crate::c_types::ECDSASignature on success and a () on failure.
3035  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3036  */
3037 typedef struct LDKCResult_ECDSASignatureNoneZ {
3038    /**
3039     * The contents of this CResult_ECDSASignatureNoneZ, accessible via either
3040     * `err` or `result` depending on the state of `result_ok`.
3041     */
3042    union LDKCResult_ECDSASignatureNoneZPtr contents;
3043    /**
3044     * Whether this CResult_ECDSASignatureNoneZ represents a success state.
3045     */
3046    bool result_ok;
3047 } LDKCResult_ECDSASignatureNoneZ;
3048
3049 /**
3050  * The contents of CResult_TransactionNoneZ
3051  */
3052 typedef union LDKCResult_TransactionNoneZPtr {
3053    /**
3054     * A pointer to the contents in the success state.
3055     * Reading from this pointer when `result_ok` is not set is undefined.
3056     */
3057    struct LDKTransaction *result;
3058    /**
3059     * Note that this value is always NULL, as there are no contents in the Err variant
3060     */
3061    void *err;
3062 } LDKCResult_TransactionNoneZPtr;
3063
3064 /**
3065  * A CResult_TransactionNoneZ represents the result of a fallible operation,
3066  * containing a crate::c_types::Transaction on success and a () on failure.
3067  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3068  */
3069 typedef struct LDKCResult_TransactionNoneZ {
3070    /**
3071     * The contents of this CResult_TransactionNoneZ, accessible via either
3072     * `err` or `result` depending on the state of `result_ok`.
3073     */
3074    union LDKCResult_TransactionNoneZPtr contents;
3075    /**
3076     * Whether this CResult_TransactionNoneZ represents a success state.
3077     */
3078    bool result_ok;
3079 } LDKCResult_TransactionNoneZ;
3080
3081 /**
3082  * A dynamically-allocated array of crate::c_types::ECDSASignatures of arbitrary size.
3083  * This corresponds to std::vector in C++
3084  */
3085 typedef struct LDKCVec_ECDSASignatureZ {
3086    /**
3087     * The elements in the array.
3088     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3089     */
3090    struct LDKECDSASignature *data;
3091    /**
3092     * The number of elements pointed to by `data`.
3093     */
3094    uintptr_t datalen;
3095 } LDKCVec_ECDSASignatureZ;
3096
3097 /**
3098  * A tuple of 2 elements. See the individual fields for the types contained.
3099  */
3100 typedef struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ {
3101    /**
3102     * The element at position 0
3103     */
3104    struct LDKECDSASignature a;
3105    /**
3106     * The element at position 1
3107     */
3108    struct LDKCVec_ECDSASignatureZ b;
3109 } LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ;
3110
3111 /**
3112  * The contents of CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ
3113  */
3114 typedef union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr {
3115    /**
3116     * A pointer to the contents in the success state.
3117     * Reading from this pointer when `result_ok` is not set is undefined.
3118     */
3119    struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *result;
3120    /**
3121     * Note that this value is always NULL, as there are no contents in the Err variant
3122     */
3123    void *err;
3124 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr;
3125
3126 /**
3127  * A CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents the result of a fallible operation,
3128  * containing a crate::c_types::derived::C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ on success and a () on failure.
3129  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3130  */
3131 typedef struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ {
3132    /**
3133     * The contents of this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ, accessible via either
3134     * `err` or `result` depending on the state of `result_ok`.
3135     */
3136    union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr contents;
3137    /**
3138     * Whether this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents a success state.
3139     */
3140    bool result_ok;
3141 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ;
3142
3143
3144
3145 /**
3146  * This class tracks the per-transaction information needed to build a commitment transaction and will
3147  * actually build it and sign.  It is used for holder transactions that we sign only when needed
3148  * and for transactions we sign for the counterparty.
3149  *
3150  * This class can be used inside a signer implementation to generate a signature given the relevant
3151  * secret key.
3152  */
3153 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
3154    /**
3155     * A pointer to the opaque Rust object.
3156     * Nearly everywhere, inner must be non-null, however in places where
3157     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3158     */
3159    LDKnativeCommitmentTransaction *inner;
3160    /**
3161     * Indicates that this is the only struct which contains the same pointer.
3162     * Rust functions which take ownership of an object provided via an argument require
3163     * this to be true and invalidate the object pointed to by inner.
3164     */
3165    bool is_owned;
3166 } LDKCommitmentTransaction;
3167
3168
3169
3170 /**
3171  * Information needed to build and sign a holder's commitment transaction.
3172  *
3173  * The transaction is only signed once we are ready to broadcast.
3174  */
3175 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
3176    /**
3177     * A pointer to the opaque Rust object.
3178     * Nearly everywhere, inner must be non-null, however in places where
3179     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3180     */
3181    LDKnativeHolderCommitmentTransaction *inner;
3182    /**
3183     * Indicates that this is the only struct which contains the same pointer.
3184     * Rust functions which take ownership of an object provided via an argument require
3185     * this to be true and invalidate the object pointed to by inner.
3186     */
3187    bool is_owned;
3188 } LDKHolderCommitmentTransaction;
3189
3190
3191
3192 /**
3193  * Information about an HTLC as it appears in a commitment transaction
3194  */
3195 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
3196    /**
3197     * A pointer to the opaque Rust object.
3198     * Nearly everywhere, inner must be non-null, however in places where
3199     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3200     */
3201    LDKnativeHTLCOutputInCommitment *inner;
3202    /**
3203     * Indicates that this is the only struct which contains the same pointer.
3204     * Rust functions which take ownership of an object provided via an argument require
3205     * this to be true and invalidate the object pointed to by inner.
3206     */
3207    bool is_owned;
3208 } LDKHTLCOutputInCommitment;
3209
3210
3211
3212 /**
3213  * This class tracks the per-transaction information needed to build a closing transaction and will
3214  * actually build it and sign.
3215  *
3216  * This class can be used inside a signer implementation to generate a signature given the relevant
3217  * secret key.
3218  */
3219 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
3220    /**
3221     * A pointer to the opaque Rust object.
3222     * Nearly everywhere, inner must be non-null, however in places where
3223     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3224     */
3225    LDKnativeClosingTransaction *inner;
3226    /**
3227     * Indicates that this is the only struct which contains the same pointer.
3228     * Rust functions which take ownership of an object provided via an argument require
3229     * this to be true and invalidate the object pointed to by inner.
3230     */
3231    bool is_owned;
3232 } LDKClosingTransaction;
3233
3234
3235
3236 /**
3237  * The unsigned part of a [`channel_announcement`] message.
3238  *
3239  * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
3240  */
3241 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
3242    /**
3243     * A pointer to the opaque Rust object.
3244     * Nearly everywhere, inner must be non-null, however in places where
3245     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3246     */
3247    LDKnativeUnsignedChannelAnnouncement *inner;
3248    /**
3249     * Indicates that this is the only struct which contains the same pointer.
3250     * Rust functions which take ownership of an object provided via an argument require
3251     * this to be true and invalidate the object pointed to by inner.
3252     */
3253    bool is_owned;
3254 } LDKUnsignedChannelAnnouncement;
3255
3256
3257
3258 /**
3259  * One counterparty's public keys which do not change over the life of a channel.
3260  */
3261 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
3262    /**
3263     * A pointer to the opaque Rust object.
3264     * Nearly everywhere, inner must be non-null, however in places where
3265     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3266     */
3267    LDKnativeChannelPublicKeys *inner;
3268    /**
3269     * Indicates that this is the only struct which contains the same pointer.
3270     * Rust functions which take ownership of an object provided via an argument require
3271     * this to be true and invalidate the object pointed to by inner.
3272     */
3273    bool is_owned;
3274 } LDKChannelPublicKeys;
3275
3276
3277
3278 /**
3279  * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
3280  * The fields are organized by holder/counterparty.
3281  *
3282  * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
3283  * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
3284  */
3285 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
3286    /**
3287     * A pointer to the opaque Rust object.
3288     * Nearly everywhere, inner must be non-null, however in places where
3289     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3290     */
3291    LDKnativeChannelTransactionParameters *inner;
3292    /**
3293     * Indicates that this is the only struct which contains the same pointer.
3294     * Rust functions which take ownership of an object provided via an argument require
3295     * this to be true and invalidate the object pointed to by inner.
3296     */
3297    bool is_owned;
3298 } LDKChannelTransactionParameters;
3299
3300 /**
3301  * A trait to handle Lightning channel key material without concretizing the channel type or
3302  * the signature mechanism.
3303  */
3304 typedef struct LDKChannelSigner {
3305    /**
3306     * An opaque pointer which is passed to your function implementations as an argument.
3307     * This has no meaning in the LDK, and can be NULL or any other value.
3308     */
3309    void *this_arg;
3310    /**
3311     * Gets the per-commitment point for a specific commitment number
3312     *
3313     * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
3314     */
3315    struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
3316    /**
3317     * Gets the commitment secret for a specific commitment number as part of the revocation process
3318     *
3319     * An external signer implementation should error here if the commitment was already signed
3320     * and should refuse to sign it in the future.
3321     *
3322     * May be called more than once for the same index.
3323     *
3324     * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
3325     */
3326    struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
3327    /**
3328     * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
3329     *
3330     * This is required in order for the signer to make sure that releasing a commitment
3331     * secret won't leave us without a broadcastable holder transaction.
3332     * Policy checks should be implemented in this function, including checking the amount
3333     * sent to us and checking the HTLCs.
3334     *
3335     * The preimages of outbound HTLCs that were fulfilled since the last commitment are provided.
3336     * A validating signer should ensure that an HTLC output is removed only when the matching
3337     * preimage is provided, or when the value to holder is restored.
3338     *
3339     * Note that all the relevant preimages will be provided, but there may also be additional
3340     * irrelevant or duplicate preimages.
3341     */
3342    struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages);
3343    /**
3344     * Validate the counterparty's revocation.
3345     *
3346     * This is required in order for the signer to make sure that the state has moved
3347     * forward and it is safe to sign the next counterparty commitment.
3348     */
3349    struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
3350    /**
3351     * Returns the holder's channel public keys and basepoints.
3352     */
3353    struct LDKChannelPublicKeys pubkeys;
3354    /**
3355     * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
3356     * Note that this takes a pointer to this object, not the this_ptr like other methods do
3357     * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
3358     */
3359    void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
3360    /**
3361     * Returns an arbitrary identifier describing the set of keys which are provided back to you in
3362     * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
3363     * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
3364     */
3365    struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
3366    /**
3367     * Set the counterparty static channel data, including basepoints,
3368     * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
3369     *
3370     * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
3371     * instance, LDK will call this method exactly once - either immediately after construction
3372     * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
3373     * information has been generated.
3374     *
3375     * channel_parameters.is_populated() MUST be true.
3376     */
3377    void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
3378    /**
3379     * Frees any resources associated with this object given its this_arg pointer.
3380     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3381     */
3382    void (*free)(void *this_arg);
3383 } LDKChannelSigner;
3384
3385 /**
3386  * A trait to sign Lightning channel transactions as described in
3387  * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
3388  *
3389  * Signing services could be implemented on a hardware wallet and should implement signing
3390  * policies in order to be secure. Please refer to the [VLS Policy
3391  * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
3392  * for an example of such policies.
3393  */
3394 typedef struct LDKEcdsaChannelSigner {
3395    /**
3396     * An opaque pointer which is passed to your function implementations as an argument.
3397     * This has no meaning in the LDK, and can be NULL or any other value.
3398     */
3399    void *this_arg;
3400    /**
3401     * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
3402     *
3403     * Note that if signing fails or is rejected, the channel will be force-closed.
3404     *
3405     * Policy checks should be implemented in this function, including checking the amount
3406     * sent to us and checking the HTLCs.
3407     *
3408     * The preimages of outbound and inbound HTLCs that were fulfilled since the last commitment
3409     * are provided. A validating signer should ensure that an outbound HTLC output is removed
3410     * only when the matching preimage is provided and after the corresponding inbound HTLC has
3411     * been removed for forwarded payments.
3412     *
3413     * Note that all the relevant preimages will be provided, but there may also be additional
3414     * irrelevant or duplicate preimages.
3415     */
3416    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);
3417    /**
3418     * Creates a signature for a holder's commitment transaction.
3419     *
3420     * This will be called
3421     * - with a non-revoked `commitment_tx`.
3422     * - with the latest `commitment_tx` when we initiate a force-close.
3423     *
3424     * This may be called multiple times for the same transaction.
3425     *
3426     * An external signer implementation should check that the commitment has not been revoked.
3427     *
3428     * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3429     * signature and should be retried later. Once the signer is ready to provide a signature after
3430     * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3431     * monitor.
3432     *
3433     * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3434     */
3435    struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
3436    /**
3437     * Create a signature for the given input in a transaction spending an HTLC transaction output
3438     * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
3439     *
3440     * A justice transaction may claim multiple outputs at the same time if timelocks are
3441     * similar, but only a signature for the input at index `input` should be signed for here.
3442     * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3443     * to an upcoming timelock expiration.
3444     *
3445     * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
3446     *
3447     * `per_commitment_key` is revocation secret which was provided by our counterparty when they
3448     * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3449     * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
3450     * so).
3451     *
3452     * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3453     * signature and should be retried later. Once the signer is ready to provide a signature after
3454     * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3455     * monitor.
3456     *
3457     * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3458     */
3459    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]);
3460    /**
3461     * Create a signature for the given input in a transaction spending a commitment transaction
3462     * HTLC output when our counterparty broadcasts an old state.
3463     *
3464     * A justice transaction may claim multiple outputs at the same time if timelocks are
3465     * similar, but only a signature for the input at index `input` should be signed for here.
3466     * It may be called multiple times for same output(s) if a fee-bump is needed with regards
3467     * to an upcoming timelock expiration.
3468     *
3469     * `amount` is the value of the output spent by this input, committed to in the BIP 143
3470     * signature.
3471     *
3472     * `per_commitment_key` is revocation secret which was provided by our counterparty when they
3473     * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
3474     * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3475     * so).
3476     *
3477     * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
3478     * (which is committed to in the BIP 143 signatures).
3479     *
3480     * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3481     * signature and should be retried later. Once the signer is ready to provide a signature after
3482     * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3483     * monitor.
3484     *
3485     * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3486     */
3487    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);
3488    /**
3489     * Computes the signature for a commitment transaction's HTLC output used as an input within
3490     * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
3491     * must be be computed using [`EcdsaSighashType::All`].
3492     *
3493     * Note that this may be called for HTLCs in the penultimate commitment transaction if a
3494     * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
3495     * broadcasts it before receiving the update for the latest commitment transaction.
3496     *
3497     * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3498     * signature and should be retried later. Once the signer is ready to provide a signature after
3499     * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3500     * monitor.
3501     *
3502     * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All
3503     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3504     * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3505     */
3506    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);
3507    /**
3508     * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
3509     * transaction, either offered or received.
3510     *
3511     * Such a transaction may claim multiples offered outputs at same time if we know the
3512     * preimage for each when we create it, but only the input at index `input` should be
3513     * signed for here. It may be called multiple times for same output(s) if a fee-bump is
3514     * needed with regards to an upcoming timelock expiration.
3515     *
3516     * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
3517     * outputs.
3518     *
3519     * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
3520     *
3521     * `per_commitment_point` is the dynamic point corresponding to the channel state
3522     * detected onchain. It has been generated by our counterparty and is used to derive
3523     * channel state keys, which are then included in the witness script and committed to in the
3524     * BIP 143 signature.
3525     *
3526     * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3527     * signature and should be retried later. Once the signer is ready to provide a signature after
3528     * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3529     * monitor.
3530     *
3531     * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3532     */
3533    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);
3534    /**
3535     * Create a signature for a (proposed) closing transaction.
3536     *
3537     * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
3538     * chosen to forgo their output as dust.
3539     */
3540    struct LDKCResult_ECDSASignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
3541    /**
3542     * Computes the signature for a commitment transaction's anchor output used as an
3543     * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
3544     *
3545     * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid
3546     * signature and should be retried later. Once the signer is ready to provide a signature after
3547     * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its
3548     * monitor.
3549     *
3550     * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked
3551     */
3552    struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
3553    /**
3554     * Signs a channel announcement message with our funding key proving it comes from one of the
3555     * channel participants.
3556     *
3557     * Channel announcements also require a signature from each node's network key. Our node
3558     * signature is computed through [`NodeSigner::sign_gossip_message`].
3559     *
3560     * Note that if this fails or is rejected, the channel will not be publicly announced and
3561     * our counterparty may (though likely will not) close the channel on us for violating the
3562     * protocol.
3563     *
3564     * [`NodeSigner::sign_gossip_message`]: crate::sign::NodeSigner::sign_gossip_message
3565     */
3566    struct LDKCResult_ECDSASignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3567    /**
3568     * Implementation of ChannelSigner for this object.
3569     */
3570    struct LDKChannelSigner ChannelSigner;
3571    /**
3572     * Frees any resources associated with this object given its this_arg pointer.
3573     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3574     */
3575    void (*free)(void *this_arg);
3576 } LDKEcdsaChannelSigner;
3577
3578 /**
3579  * A writeable signer.
3580  *
3581  * There will always be two instances of a signer per channel, one occupied by the
3582  * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
3583  *
3584  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3585  * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3586  */
3587 typedef struct LDKWriteableEcdsaChannelSigner {
3588    /**
3589     * An opaque pointer which is passed to your function implementations as an argument.
3590     * This has no meaning in the LDK, and can be NULL or any other value.
3591     */
3592    void *this_arg;
3593    /**
3594     * Implementation of EcdsaChannelSigner for this object.
3595     */
3596    struct LDKEcdsaChannelSigner EcdsaChannelSigner;
3597    /**
3598     * Serialize the object into a byte array
3599     */
3600    struct LDKCVec_u8Z (*write)(const void *this_arg);
3601    /**
3602     * Called, if set, after this WriteableEcdsaChannelSigner has been cloned into a duplicate object.
3603     * The new WriteableEcdsaChannelSigner is provided, and should be mutated as needed to perform a
3604     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
3605     */
3606    void (*cloned)(struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR new_WriteableEcdsaChannelSigner);
3607    /**
3608     * Frees any resources associated with this object given its this_arg pointer.
3609     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3610     */
3611    void (*free)(void *this_arg);
3612 } LDKWriteableEcdsaChannelSigner;
3613
3614 /**
3615  * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
3616  */
3617 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
3618    /**
3619     * A pointer to the contents in the success state.
3620     * Reading from this pointer when `result_ok` is not set is undefined.
3621     */
3622    struct LDKWriteableEcdsaChannelSigner *result;
3623    /**
3624     * A pointer to the contents in the error state.
3625     * Reading from this pointer when `result_ok` is set is undefined.
3626     */
3627    struct LDKDecodeError *err;
3628 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
3629
3630 /**
3631  * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
3632  * containing a crate::lightning::sign::ecdsa::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3633  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3634  */
3635 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
3636    /**
3637     * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
3638     * `err` or `result` depending on the state of `result_ok`.
3639     */
3640    union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
3641    /**
3642     * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
3643     */
3644    bool result_ok;
3645 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
3646
3647 /**
3648  * The contents of CResult_CVec_u8ZNoneZ
3649  */
3650 typedef union LDKCResult_CVec_u8ZNoneZPtr {
3651    /**
3652     * A pointer to the contents in the success state.
3653     * Reading from this pointer when `result_ok` is not set is undefined.
3654     */
3655    struct LDKCVec_u8Z *result;
3656    /**
3657     * Note that this value is always NULL, as there are no contents in the Err variant
3658     */
3659    void *err;
3660 } LDKCResult_CVec_u8ZNoneZPtr;
3661
3662 /**
3663  * A CResult_CVec_u8ZNoneZ represents the result of a fallible operation,
3664  * containing a crate::c_types::derived::CVec_u8Z on success and a () on failure.
3665  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3666  */
3667 typedef struct LDKCResult_CVec_u8ZNoneZ {
3668    /**
3669     * The contents of this CResult_CVec_u8ZNoneZ, accessible via either
3670     * `err` or `result` depending on the state of `result_ok`.
3671     */
3672    union LDKCResult_CVec_u8ZNoneZPtr contents;
3673    /**
3674     * Whether this CResult_CVec_u8ZNoneZ represents a success state.
3675     */
3676    bool result_ok;
3677 } LDKCResult_CVec_u8ZNoneZ;
3678
3679 /**
3680  * The contents of CResult_ShutdownScriptNoneZ
3681  */
3682 typedef union LDKCResult_ShutdownScriptNoneZPtr {
3683    /**
3684     * A pointer to the contents in the success state.
3685     * Reading from this pointer when `result_ok` is not set is undefined.
3686     */
3687    struct LDKShutdownScript *result;
3688    /**
3689     * Note that this value is always NULL, as there are no contents in the Err variant
3690     */
3691    void *err;
3692 } LDKCResult_ShutdownScriptNoneZPtr;
3693
3694 /**
3695  * A CResult_ShutdownScriptNoneZ represents the result of a fallible operation,
3696  * containing a crate::lightning::ln::script::ShutdownScript on success and a () on failure.
3697  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3698  */
3699 typedef struct LDKCResult_ShutdownScriptNoneZ {
3700    /**
3701     * The contents of this CResult_ShutdownScriptNoneZ, accessible via either
3702     * `err` or `result` depending on the state of `result_ok`.
3703     */
3704    union LDKCResult_ShutdownScriptNoneZPtr contents;
3705    /**
3706     * Whether this CResult_ShutdownScriptNoneZ represents a success state.
3707     */
3708    bool result_ok;
3709 } LDKCResult_ShutdownScriptNoneZ;
3710
3711 /**
3712  * An enum which can either contain a u16 or not
3713  */
3714 typedef enum LDKCOption_u16Z_Tag {
3715    /**
3716     * When we're in this state, this COption_u16Z contains a u16
3717     */
3718    LDKCOption_u16Z_Some,
3719    /**
3720     * When we're in this state, this COption_u16Z contains nothing
3721     */
3722    LDKCOption_u16Z_None,
3723    /**
3724     * Must be last for serialization purposes
3725     */
3726    LDKCOption_u16Z_Sentinel,
3727 } LDKCOption_u16Z_Tag;
3728
3729 typedef struct LDKCOption_u16Z {
3730    LDKCOption_u16Z_Tag tag;
3731    union {
3732       struct {
3733          uint16_t some;
3734       };
3735    };
3736 } LDKCOption_u16Z;
3737
3738 /**
3739  * An enum which can either contain a bool or not
3740  */
3741 typedef enum LDKCOption_boolZ_Tag {
3742    /**
3743     * When we're in this state, this COption_boolZ contains a bool
3744     */
3745    LDKCOption_boolZ_Some,
3746    /**
3747     * When we're in this state, this COption_boolZ contains nothing
3748     */
3749    LDKCOption_boolZ_None,
3750    /**
3751     * Must be last for serialization purposes
3752     */
3753    LDKCOption_boolZ_Sentinel,
3754 } LDKCOption_boolZ_Tag;
3755
3756 typedef struct LDKCOption_boolZ {
3757    LDKCOption_boolZ_Tag tag;
3758    union {
3759       struct {
3760          bool some;
3761       };
3762    };
3763 } LDKCOption_boolZ;
3764
3765 /**
3766  * The contents of CResult_WitnessNoneZ
3767  */
3768 typedef union LDKCResult_WitnessNoneZPtr {
3769    /**
3770     * A pointer to the contents in the success state.
3771     * Reading from this pointer when `result_ok` is not set is undefined.
3772     */
3773    struct LDKWitness *result;
3774    /**
3775     * Note that this value is always NULL, as there are no contents in the Err variant
3776     */
3777    void *err;
3778 } LDKCResult_WitnessNoneZPtr;
3779
3780 /**
3781  * A CResult_WitnessNoneZ represents the result of a fallible operation,
3782  * containing a crate::c_types::Witness on success and a () on failure.
3783  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3784  */
3785 typedef struct LDKCResult_WitnessNoneZ {
3786    /**
3787     * The contents of this CResult_WitnessNoneZ, accessible via either
3788     * `err` or `result` depending on the state of `result_ok`.
3789     */
3790    union LDKCResult_WitnessNoneZPtr contents;
3791    /**
3792     * Whether this CResult_WitnessNoneZ represents a success state.
3793     */
3794    bool result_ok;
3795 } LDKCResult_WitnessNoneZ;
3796
3797
3798
3799 /**
3800  * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
3801  *
3802  * This implementation performs no policy checks and is insufficient by itself as
3803  * a secure external signer.
3804  */
3805 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3806    /**
3807     * A pointer to the opaque Rust object.
3808     * Nearly everywhere, inner must be non-null, however in places where
3809     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3810     */
3811    LDKnativeInMemorySigner *inner;
3812    /**
3813     * Indicates that this is the only struct which contains the same pointer.
3814     * Rust functions which take ownership of an object provided via an argument require
3815     * this to be true and invalidate the object pointed to by inner.
3816     */
3817    bool is_owned;
3818 } LDKInMemorySigner;
3819
3820 /**
3821  * The contents of CResult_InMemorySignerDecodeErrorZ
3822  */
3823 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3824    /**
3825     * A pointer to the contents in the success state.
3826     * Reading from this pointer when `result_ok` is not set is undefined.
3827     */
3828    struct LDKInMemorySigner *result;
3829    /**
3830     * A pointer to the contents in the error state.
3831     * Reading from this pointer when `result_ok` is set is undefined.
3832     */
3833    struct LDKDecodeError *err;
3834 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3835
3836 /**
3837  * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3838  * containing a crate::lightning::sign::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3839  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3840  */
3841 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3842    /**
3843     * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3844     * `err` or `result` depending on the state of `result_ok`.
3845     */
3846    union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3847    /**
3848     * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3849     */
3850    bool result_ok;
3851 } LDKCResult_InMemorySignerDecodeErrorZ;
3852
3853
3854
3855 /**
3856  * A [`CandidateRouteHop::FirstHop`] entry.
3857  */
3858 typedef struct MUST_USE_STRUCT LDKFirstHopCandidate {
3859    /**
3860     * A pointer to the opaque Rust object.
3861     * Nearly everywhere, inner must be non-null, however in places where
3862     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3863     */
3864    LDKnativeFirstHopCandidate *inner;
3865    /**
3866     * Indicates that this is the only struct which contains the same pointer.
3867     * Rust functions which take ownership of an object provided via an argument require
3868     * this to be true and invalidate the object pointed to by inner.
3869     */
3870    bool is_owned;
3871 } LDKFirstHopCandidate;
3872
3873
3874
3875 /**
3876  * A [`CandidateRouteHop::PublicHop`] entry.
3877  */
3878 typedef struct MUST_USE_STRUCT LDKPublicHopCandidate {
3879    /**
3880     * A pointer to the opaque Rust object.
3881     * Nearly everywhere, inner must be non-null, however in places where
3882     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3883     */
3884    LDKnativePublicHopCandidate *inner;
3885    /**
3886     * Indicates that this is the only struct which contains the same pointer.
3887     * Rust functions which take ownership of an object provided via an argument require
3888     * this to be true and invalidate the object pointed to by inner.
3889     */
3890    bool is_owned;
3891 } LDKPublicHopCandidate;
3892
3893
3894
3895 /**
3896  * A [`CandidateRouteHop::PrivateHop`] entry.
3897  */
3898 typedef struct MUST_USE_STRUCT LDKPrivateHopCandidate {
3899    /**
3900     * A pointer to the opaque Rust object.
3901     * Nearly everywhere, inner must be non-null, however in places where
3902     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3903     */
3904    LDKnativePrivateHopCandidate *inner;
3905    /**
3906     * Indicates that this is the only struct which contains the same pointer.
3907     * Rust functions which take ownership of an object provided via an argument require
3908     * this to be true and invalidate the object pointed to by inner.
3909     */
3910    bool is_owned;
3911 } LDKPrivateHopCandidate;
3912
3913
3914
3915 /**
3916  * A [`CandidateRouteHop::Blinded`] entry.
3917  */
3918 typedef struct MUST_USE_STRUCT LDKBlindedPathCandidate {
3919    /**
3920     * A pointer to the opaque Rust object.
3921     * Nearly everywhere, inner must be non-null, however in places where
3922     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3923     */
3924    LDKnativeBlindedPathCandidate *inner;
3925    /**
3926     * Indicates that this is the only struct which contains the same pointer.
3927     * Rust functions which take ownership of an object provided via an argument require
3928     * this to be true and invalidate the object pointed to by inner.
3929     */
3930    bool is_owned;
3931 } LDKBlindedPathCandidate;
3932
3933
3934
3935 /**
3936  * A [`CandidateRouteHop::OneHopBlinded`] entry.
3937  */
3938 typedef struct MUST_USE_STRUCT LDKOneHopBlindedPathCandidate {
3939    /**
3940     * A pointer to the opaque Rust object.
3941     * Nearly everywhere, inner must be non-null, however in places where
3942     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3943     */
3944    LDKnativeOneHopBlindedPathCandidate *inner;
3945    /**
3946     * Indicates that this is the only struct which contains the same pointer.
3947     * Rust functions which take ownership of an object provided via an argument require
3948     * this to be true and invalidate the object pointed to by inner.
3949     */
3950    bool is_owned;
3951 } LDKOneHopBlindedPathCandidate;
3952
3953 /**
3954  * A wrapper around the various hop representations.
3955  *
3956  * Can be used to examine the properties of a hop,
3957  * potentially to decide whether to include it in a route.
3958  */
3959 typedef enum LDKCandidateRouteHop_Tag {
3960    /**
3961     * A hop from the payer, where the outbound liquidity is known.
3962     */
3963    LDKCandidateRouteHop_FirstHop,
3964    /**
3965     * A hop found in the [`ReadOnlyNetworkGraph`].
3966     */
3967    LDKCandidateRouteHop_PublicHop,
3968    /**
3969     * A private hop communicated by the payee, generally via a BOLT 11 invoice.
3970     *
3971     * Because BOLT 11 route hints can take multiple hops to get to the destination, this may not
3972     * terminate at the payee.
3973     */
3974    LDKCandidateRouteHop_PrivateHop,
3975    /**
3976     * A blinded path which starts with an introduction point and ultimately terminates with the
3977     * payee.
3978     *
3979     * Because we don't know the payee's identity, [`CandidateRouteHop::target`] will return
3980     * `None` in this state.
3981     *
3982     * Because blinded paths are \"all or nothing\", and we cannot use just one part of a blinded
3983     * path, the full path is treated as a single [`CandidateRouteHop`].
3984     */
3985    LDKCandidateRouteHop_Blinded,
3986    /**
3987     * Similar to [`Self::Blinded`], but the path here only has one hop.
3988     *
3989     * While we treat this similarly to [`CandidateRouteHop::Blinded`] in many respects (e.g.
3990     * returning `None` from [`CandidateRouteHop::target`]), in this case we do actually know the
3991     * payee's identity - it's the introduction point!
3992     *
3993     * [`BlindedPayInfo`] provided for 1-hop blinded paths is ignored because it is meant to apply
3994     * to the hops *between* the introduction node and the destination.
3995     *
3996     * This primarily exists to track that we need to included a blinded path at the end of our
3997     * [`Route`], even though it doesn't actually add an additional hop in the payment.
3998     */
3999    LDKCandidateRouteHop_OneHopBlinded,
4000    /**
4001     * Must be last for serialization purposes
4002     */
4003    LDKCandidateRouteHop_Sentinel,
4004 } LDKCandidateRouteHop_Tag;
4005
4006 typedef struct MUST_USE_STRUCT LDKCandidateRouteHop {
4007    LDKCandidateRouteHop_Tag tag;
4008    union {
4009       struct {
4010          struct LDKFirstHopCandidate first_hop;
4011       };
4012       struct {
4013          struct LDKPublicHopCandidate public_hop;
4014       };
4015       struct {
4016          struct LDKPrivateHopCandidate private_hop;
4017       };
4018       struct {
4019          struct LDKBlindedPathCandidate blinded;
4020       };
4021       struct {
4022          struct LDKOneHopBlindedPathCandidate one_hop_blinded;
4023       };
4024    };
4025 } LDKCandidateRouteHop;
4026
4027
4028
4029 /**
4030  * Proposed use of a channel passed as a parameter to [`ScoreLookUp::channel_penalty_msat`].
4031  */
4032 typedef struct MUST_USE_STRUCT LDKChannelUsage {
4033    /**
4034     * A pointer to the opaque Rust object.
4035     * Nearly everywhere, inner must be non-null, however in places where
4036     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4037     */
4038    LDKnativeChannelUsage *inner;
4039    /**
4040     * Indicates that this is the only struct which contains the same pointer.
4041     * Rust functions which take ownership of an object provided via an argument require
4042     * this to be true and invalidate the object pointed to by inner.
4043     */
4044    bool is_owned;
4045 } LDKChannelUsage;
4046
4047
4048
4049 /**
4050  * Parameters for configuring [`ProbabilisticScorer`].
4051  *
4052  * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
4053  * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
4054  *
4055  * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
4056  * parameters here.
4057  */
4058 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringFeeParameters {
4059    /**
4060     * A pointer to the opaque Rust object.
4061     * Nearly everywhere, inner must be non-null, however in places where
4062     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4063     */
4064    LDKnativeProbabilisticScoringFeeParameters *inner;
4065    /**
4066     * Indicates that this is the only struct which contains the same pointer.
4067     * Rust functions which take ownership of an object provided via an argument require
4068     * this to be true and invalidate the object pointed to by inner.
4069     */
4070    bool is_owned;
4071 } LDKProbabilisticScoringFeeParameters;
4072
4073 /**
4074  * An interface used to score payment channels for path finding.
4075  *
4076  * `ScoreLookUp` is used to determine the penalty for a given channel.
4077  *
4078  * Scoring is in terms of fees willing to be paid in order to avoid routing through a channel.
4079  */
4080 typedef struct LDKScoreLookUp {
4081    /**
4082     * An opaque pointer which is passed to your function implementations as an argument.
4083     * This has no meaning in the LDK, and can be NULL or any other value.
4084     */
4085    void *this_arg;
4086    /**
4087     * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
4088     * given channel in the direction from `source` to `target`.
4089     *
4090     * The channel's capacity (less any other MPP parts that are also being considered for use in
4091     * the same payment) is given by `capacity_msat`. It may be determined from various sources
4092     * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
4093     * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
4094     * Thus, implementations should be overflow-safe.
4095     */
4096    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);
4097    /**
4098     * Frees any resources associated with this object given its this_arg pointer.
4099     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4100     */
4101    void (*free)(void *this_arg);
4102 } LDKScoreLookUp;
4103
4104
4105
4106 /**
4107  * A path in a [`Route`] to the payment recipient. Must always be at least length one.
4108  * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19.
4109  */
4110 typedef struct MUST_USE_STRUCT LDKPath {
4111    /**
4112     * A pointer to the opaque Rust object.
4113     * Nearly everywhere, inner must be non-null, however in places where
4114     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4115     */
4116    LDKnativePath *inner;
4117    /**
4118     * Indicates that this is the only struct which contains the same pointer.
4119     * Rust functions which take ownership of an object provided via an argument require
4120     * this to be true and invalidate the object pointed to by inner.
4121     */
4122    bool is_owned;
4123 } LDKPath;
4124
4125 /**
4126  * `ScoreUpdate` is used to update the scorer's internal state after a payment attempt.
4127  */
4128 typedef struct LDKScoreUpdate {
4129    /**
4130     * An opaque pointer which is passed to your function implementations as an argument.
4131     * This has no meaning in the LDK, and can be NULL or any other value.
4132     */
4133    void *this_arg;
4134    /**
4135     * Handles updating channel penalties after failing to route through a channel.
4136     */
4137    void (*payment_path_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id, uint64_t duration_since_epoch);
4138    /**
4139     * Handles updating channel penalties after successfully routing along a path.
4140     */
4141    void (*payment_path_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t duration_since_epoch);
4142    /**
4143     * Handles updating channel penalties after a probe over the given path failed.
4144     */
4145    void (*probe_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id, uint64_t duration_since_epoch);
4146    /**
4147     * Handles updating channel penalties after a probe over the given path succeeded.
4148     */
4149    void (*probe_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t duration_since_epoch);
4150    /**
4151     * Scorers may wish to reduce their certainty of channel liquidity information over time.
4152     * Thus, this method is provided to allow scorers to observe the passage of time - the holder
4153     * of this object should call this method regularly (generally via the
4154     * `lightning-background-processor` crate).
4155     */
4156    void (*time_passed)(void *this_arg, uint64_t duration_since_epoch);
4157    /**
4158     * Frees any resources associated with this object given its this_arg pointer.
4159     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4160     */
4161    void (*free)(void *this_arg);
4162 } LDKScoreUpdate;
4163
4164 /**
4165  * A scorer that is accessed under a lock.
4166  *
4167  * Needed so that calls to [`ScoreLookUp::channel_penalty_msat`] in [`find_route`] can be made while
4168  * having shared ownership of a scorer but without requiring internal locking in [`ScoreUpdate`]
4169  * implementations. Internal locking would be detrimental to route finding performance and could
4170  * result in [`ScoreLookUp::channel_penalty_msat`] returning a different value for the same channel.
4171  *
4172  * [`find_route`]: crate::routing::router::find_route
4173  */
4174 typedef struct LDKLockableScore {
4175    /**
4176     * An opaque pointer which is passed to your function implementations as an argument.
4177     * This has no meaning in the LDK, and can be NULL or any other value.
4178     */
4179    void *this_arg;
4180    /**
4181     * Returns read locked scorer.
4182     */
4183    struct LDKScoreLookUp (*read_lock)(const void *this_arg);
4184    /**
4185     * Returns write locked scorer.
4186     */
4187    struct LDKScoreUpdate (*write_lock)(const void *this_arg);
4188    /**
4189     * Frees any resources associated with this object given its this_arg pointer.
4190     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4191     */
4192    void (*free)(void *this_arg);
4193 } LDKLockableScore;
4194
4195 /**
4196  * Refers to a scorer that is accessible under lock and also writeable to disk
4197  *
4198  * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
4199  * use the Persister to persist it.
4200  */
4201 typedef struct LDKWriteableScore {
4202    /**
4203     * An opaque pointer which is passed to your function implementations as an argument.
4204     * This has no meaning in the LDK, and can be NULL or any other value.
4205     */
4206    void *this_arg;
4207    /**
4208     * Implementation of LockableScore for this object.
4209     */
4210    struct LDKLockableScore LockableScore;
4211    /**
4212     * Serialize the object into a byte array
4213     */
4214    struct LDKCVec_u8Z (*write)(const void *this_arg);
4215    /**
4216     * Frees any resources associated with this object given its this_arg pointer.
4217     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4218     */
4219    void (*free)(void *this_arg);
4220 } LDKWriteableScore;
4221
4222 /**
4223  * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
4224  */
4225 typedef enum LDKCOption_WriteableScoreZ_Tag {
4226    /**
4227     * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
4228     */
4229    LDKCOption_WriteableScoreZ_Some,
4230    /**
4231     * When we're in this state, this COption_WriteableScoreZ contains nothing
4232     */
4233    LDKCOption_WriteableScoreZ_None,
4234    /**
4235     * Must be last for serialization purposes
4236     */
4237    LDKCOption_WriteableScoreZ_Sentinel,
4238 } LDKCOption_WriteableScoreZ_Tag;
4239
4240 typedef struct LDKCOption_WriteableScoreZ {
4241    LDKCOption_WriteableScoreZ_Tag tag;
4242    union {
4243       struct {
4244          struct LDKWriteableScore some;
4245       };
4246    };
4247 } LDKCOption_WriteableScoreZ;
4248
4249 /**
4250  * The contents of CResult_NoneIOErrorZ
4251  */
4252 typedef union LDKCResult_NoneIOErrorZPtr {
4253    /**
4254     * Note that this value is always NULL, as there are no contents in the OK variant
4255     */
4256    void *result;
4257    /**
4258     * A pointer to the contents in the error state.
4259     * Reading from this pointer when `result_ok` is set is undefined.
4260     */
4261    enum LDKIOError *err;
4262 } LDKCResult_NoneIOErrorZPtr;
4263
4264 /**
4265  * A CResult_NoneIOErrorZ represents the result of a fallible operation,
4266  * containing a () on success and a crate::c_types::IOError on failure.
4267  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4268  */
4269 typedef struct LDKCResult_NoneIOErrorZ {
4270    /**
4271     * The contents of this CResult_NoneIOErrorZ, accessible via either
4272     * `err` or `result` depending on the state of `result_ok`.
4273     */
4274    union LDKCResult_NoneIOErrorZPtr contents;
4275    /**
4276     * Whether this CResult_NoneIOErrorZ represents a success state.
4277     */
4278    bool result_ok;
4279 } LDKCResult_NoneIOErrorZ;
4280
4281
4282
4283 /**
4284  * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
4285  */
4286 typedef struct MUST_USE_STRUCT LDKChannelDetails {
4287    /**
4288     * A pointer to the opaque Rust object.
4289     * Nearly everywhere, inner must be non-null, however in places where
4290     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4291     */
4292    LDKnativeChannelDetails *inner;
4293    /**
4294     * Indicates that this is the only struct which contains the same pointer.
4295     * Rust functions which take ownership of an object provided via an argument require
4296     * this to be true and invalidate the object pointed to by inner.
4297     */
4298    bool is_owned;
4299 } LDKChannelDetails;
4300
4301 /**
4302  * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
4303  * This corresponds to std::vector in C++
4304  */
4305 typedef struct LDKCVec_ChannelDetailsZ {
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 LDKChannelDetails *data;
4311    /**
4312     * The number of elements pointed to by `data`.
4313     */
4314    uintptr_t datalen;
4315 } LDKCVec_ChannelDetailsZ;
4316
4317
4318
4319 /**
4320  * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
4321  * it can take multiple paths. Each path is composed of one or more hops through the network.
4322  */
4323 typedef struct MUST_USE_STRUCT LDKRoute {
4324    /**
4325     * A pointer to the opaque Rust object.
4326     * Nearly everywhere, inner must be non-null, however in places where
4327     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4328     */
4329    LDKnativeRoute *inner;
4330    /**
4331     * Indicates that this is the only struct which contains the same pointer.
4332     * Rust functions which take ownership of an object provided via an argument require
4333     * this to be true and invalidate the object pointed to by inner.
4334     */
4335    bool is_owned;
4336 } LDKRoute;
4337
4338
4339
4340 /**
4341  * An Err type for failure to process messages.
4342  */
4343 typedef struct MUST_USE_STRUCT LDKLightningError {
4344    /**
4345     * A pointer to the opaque Rust object.
4346     * Nearly everywhere, inner must be non-null, however in places where
4347     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4348     */
4349    LDKnativeLightningError *inner;
4350    /**
4351     * Indicates that this is the only struct which contains the same pointer.
4352     * Rust functions which take ownership of an object provided via an argument require
4353     * this to be true and invalidate the object pointed to by inner.
4354     */
4355    bool is_owned;
4356 } LDKLightningError;
4357
4358 /**
4359  * The contents of CResult_RouteLightningErrorZ
4360  */
4361 typedef union LDKCResult_RouteLightningErrorZPtr {
4362    /**
4363     * A pointer to the contents in the success state.
4364     * Reading from this pointer when `result_ok` is not set is undefined.
4365     */
4366    struct LDKRoute *result;
4367    /**
4368     * A pointer to the contents in the error state.
4369     * Reading from this pointer when `result_ok` is set is undefined.
4370     */
4371    struct LDKLightningError *err;
4372 } LDKCResult_RouteLightningErrorZPtr;
4373
4374 /**
4375  * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
4376  * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
4377  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4378  */
4379 typedef struct LDKCResult_RouteLightningErrorZ {
4380    /**
4381     * The contents of this CResult_RouteLightningErrorZ, accessible via either
4382     * `err` or `result` depending on the state of `result_ok`.
4383     */
4384    union LDKCResult_RouteLightningErrorZPtr contents;
4385    /**
4386     * Whether this CResult_RouteLightningErrorZ represents a success state.
4387     */
4388    bool result_ok;
4389 } LDKCResult_RouteLightningErrorZ;
4390
4391 /**
4392  * A tuple of 2 elements. See the individual fields for the types contained.
4393  */
4394 typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
4395    /**
4396     * The element at position 0
4397     */
4398    struct LDKBlindedPayInfo a;
4399    /**
4400     * The element at position 1
4401     */
4402    struct LDKBlindedPath b;
4403 } LDKC2Tuple_BlindedPayInfoBlindedPathZ;
4404
4405 /**
4406  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
4407  * This corresponds to std::vector in C++
4408  */
4409 typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
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    struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
4415    /**
4416     * The number of elements pointed to by `data`.
4417     */
4418    uintptr_t datalen;
4419 } LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
4420
4421 /**
4422  * The contents of CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ
4423  */
4424 typedef union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr {
4425    /**
4426     * A pointer to the contents in the success state.
4427     * Reading from this pointer when `result_ok` is not set is undefined.
4428     */
4429    struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *result;
4430    /**
4431     * Note that this value is always NULL, as there are no contents in the Err variant
4432     */
4433    void *err;
4434 } LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr;
4435
4436 /**
4437  * A CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents the result of a fallible operation,
4438  * containing a crate::c_types::derived::CVec_C2Tuple_BlindedPayInfoBlindedPathZZ on success and a () on failure.
4439  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4440  */
4441 typedef struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ {
4442    /**
4443     * The contents of this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ, accessible via either
4444     * `err` or `result` depending on the state of `result_ok`.
4445     */
4446    union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr contents;
4447    /**
4448     * Whether this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents a success state.
4449     */
4450    bool result_ok;
4451 } LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ;
4452
4453 /**
4454  * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
4455  * This corresponds to std::vector in C++
4456  */
4457 typedef struct LDKCVec_PublicKeyZ {
4458    /**
4459     * The elements in the array.
4460     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4461     */
4462    struct LDKPublicKey *data;
4463    /**
4464     * The number of elements pointed to by `data`.
4465     */
4466    uintptr_t datalen;
4467 } LDKCVec_PublicKeyZ;
4468
4469
4470
4471 /**
4472  * A path for sending an [`OnionMessage`].
4473  */
4474 typedef struct MUST_USE_STRUCT LDKOnionMessagePath {
4475    /**
4476     * A pointer to the opaque Rust object.
4477     * Nearly everywhere, inner must be non-null, however in places where
4478     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4479     */
4480    LDKnativeOnionMessagePath *inner;
4481    /**
4482     * Indicates that this is the only struct which contains the same pointer.
4483     * Rust functions which take ownership of an object provided via an argument require
4484     * this to be true and invalidate the object pointed to by inner.
4485     */
4486    bool is_owned;
4487 } LDKOnionMessagePath;
4488
4489 /**
4490  * The contents of CResult_OnionMessagePathNoneZ
4491  */
4492 typedef union LDKCResult_OnionMessagePathNoneZPtr {
4493    /**
4494     * A pointer to the contents in the success state.
4495     * Reading from this pointer when `result_ok` is not set is undefined.
4496     */
4497    struct LDKOnionMessagePath *result;
4498    /**
4499     * Note that this value is always NULL, as there are no contents in the Err variant
4500     */
4501    void *err;
4502 } LDKCResult_OnionMessagePathNoneZPtr;
4503
4504 /**
4505  * A CResult_OnionMessagePathNoneZ represents the result of a fallible operation,
4506  * containing a crate::lightning::onion_message::messenger::OnionMessagePath on success and a () on failure.
4507  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4508  */
4509 typedef struct LDKCResult_OnionMessagePathNoneZ {
4510    /**
4511     * The contents of this CResult_OnionMessagePathNoneZ, accessible via either
4512     * `err` or `result` depending on the state of `result_ok`.
4513     */
4514    union LDKCResult_OnionMessagePathNoneZPtr contents;
4515    /**
4516     * Whether this CResult_OnionMessagePathNoneZ represents a success state.
4517     */
4518    bool result_ok;
4519 } LDKCResult_OnionMessagePathNoneZ;
4520
4521 /**
4522  * The contents of CResult_CVec_BlindedPathZNoneZ
4523  */
4524 typedef union LDKCResult_CVec_BlindedPathZNoneZPtr {
4525    /**
4526     * A pointer to the contents in the success state.
4527     * Reading from this pointer when `result_ok` is not set is undefined.
4528     */
4529    struct LDKCVec_BlindedPathZ *result;
4530    /**
4531     * Note that this value is always NULL, as there are no contents in the Err variant
4532     */
4533    void *err;
4534 } LDKCResult_CVec_BlindedPathZNoneZPtr;
4535
4536 /**
4537  * A CResult_CVec_BlindedPathZNoneZ represents the result of a fallible operation,
4538  * containing a crate::c_types::derived::CVec_BlindedPathZ on success and a () on failure.
4539  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4540  */
4541 typedef struct LDKCResult_CVec_BlindedPathZNoneZ {
4542    /**
4543     * The contents of this CResult_CVec_BlindedPathZNoneZ, accessible via either
4544     * `err` or `result` depending on the state of `result_ok`.
4545     */
4546    union LDKCResult_CVec_BlindedPathZNoneZPtr contents;
4547    /**
4548     * Whether this CResult_CVec_BlindedPathZNoneZ represents a success state.
4549     */
4550    bool result_ok;
4551 } LDKCResult_CVec_BlindedPathZNoneZ;
4552
4553
4554
4555 /**
4556  * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
4557  * in-use channel liquidity.
4558  */
4559 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
4560    /**
4561     * A pointer to the opaque Rust object.
4562     * Nearly everywhere, inner must be non-null, however in places where
4563     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4564     */
4565    LDKnativeInFlightHtlcs *inner;
4566    /**
4567     * Indicates that this is the only struct which contains the same pointer.
4568     * Rust functions which take ownership of an object provided via an argument require
4569     * this to be true and invalidate the object pointed to by inner.
4570     */
4571    bool is_owned;
4572 } LDKInFlightHtlcs;
4573
4574 /**
4575  * The contents of CResult_InFlightHtlcsDecodeErrorZ
4576  */
4577 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
4578    /**
4579     * A pointer to the contents in the success state.
4580     * Reading from this pointer when `result_ok` is not set is undefined.
4581     */
4582    struct LDKInFlightHtlcs *result;
4583    /**
4584     * A pointer to the contents in the error state.
4585     * Reading from this pointer when `result_ok` is set is undefined.
4586     */
4587    struct LDKDecodeError *err;
4588 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
4589
4590 /**
4591  * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
4592  * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
4593  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4594  */
4595 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
4596    /**
4597     * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
4598     * `err` or `result` depending on the state of `result_ok`.
4599     */
4600    union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
4601    /**
4602     * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
4603     */
4604    bool result_ok;
4605 } LDKCResult_InFlightHtlcsDecodeErrorZ;
4606
4607
4608
4609 /**
4610  * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
4611  * that leads to it.
4612  */
4613 typedef struct MUST_USE_STRUCT LDKRouteHop {
4614    /**
4615     * A pointer to the opaque Rust object.
4616     * Nearly everywhere, inner must be non-null, however in places where
4617     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4618     */
4619    LDKnativeRouteHop *inner;
4620    /**
4621     * Indicates that this is the only struct which contains the same pointer.
4622     * Rust functions which take ownership of an object provided via an argument require
4623     * this to be true and invalidate the object pointed to by inner.
4624     */
4625    bool is_owned;
4626 } LDKRouteHop;
4627
4628 /**
4629  * The contents of CResult_RouteHopDecodeErrorZ
4630  */
4631 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
4632    /**
4633     * A pointer to the contents in the success state.
4634     * Reading from this pointer when `result_ok` is not set is undefined.
4635     */
4636    struct LDKRouteHop *result;
4637    /**
4638     * A pointer to the contents in the error state.
4639     * Reading from this pointer when `result_ok` is set is undefined.
4640     */
4641    struct LDKDecodeError *err;
4642 } LDKCResult_RouteHopDecodeErrorZPtr;
4643
4644 /**
4645  * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
4646  * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
4647  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4648  */
4649 typedef struct LDKCResult_RouteHopDecodeErrorZ {
4650    /**
4651     * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
4652     * `err` or `result` depending on the state of `result_ok`.
4653     */
4654    union LDKCResult_RouteHopDecodeErrorZPtr contents;
4655    /**
4656     * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
4657     */
4658    bool result_ok;
4659 } LDKCResult_RouteHopDecodeErrorZ;
4660
4661
4662
4663 /**
4664  * An encrypted payload and node id corresponding to a hop in a payment or onion message path, to
4665  * be encoded in the sender's onion packet. These hops cannot be identified by outside observers
4666  * and thus can be used to hide the identity of the recipient.
4667  */
4668 typedef struct MUST_USE_STRUCT LDKBlindedHop {
4669    /**
4670     * A pointer to the opaque Rust object.
4671     * Nearly everywhere, inner must be non-null, however in places where
4672     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4673     */
4674    LDKnativeBlindedHop *inner;
4675    /**
4676     * Indicates that this is the only struct which contains the same pointer.
4677     * Rust functions which take ownership of an object provided via an argument require
4678     * this to be true and invalidate the object pointed to by inner.
4679     */
4680    bool is_owned;
4681 } LDKBlindedHop;
4682
4683 /**
4684  * A dynamically-allocated array of crate::lightning::blinded_path::BlindedHops of arbitrary size.
4685  * This corresponds to std::vector in C++
4686  */
4687 typedef struct LDKCVec_BlindedHopZ {
4688    /**
4689     * The elements in the array.
4690     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4691     */
4692    struct LDKBlindedHop *data;
4693    /**
4694     * The number of elements pointed to by `data`.
4695     */
4696    uintptr_t datalen;
4697 } LDKCVec_BlindedHopZ;
4698
4699
4700
4701 /**
4702  * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
4703  * their [`Bolt12Invoice`].
4704  *
4705  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
4706  */
4707 typedef struct MUST_USE_STRUCT LDKBlindedTail {
4708    /**
4709     * A pointer to the opaque Rust object.
4710     * Nearly everywhere, inner must be non-null, however in places where
4711     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4712     */
4713    LDKnativeBlindedTail *inner;
4714    /**
4715     * Indicates that this is the only struct which contains the same pointer.
4716     * Rust functions which take ownership of an object provided via an argument require
4717     * this to be true and invalidate the object pointed to by inner.
4718     */
4719    bool is_owned;
4720 } LDKBlindedTail;
4721
4722 /**
4723  * The contents of CResult_BlindedTailDecodeErrorZ
4724  */
4725 typedef union LDKCResult_BlindedTailDecodeErrorZPtr {
4726    /**
4727     * A pointer to the contents in the success state.
4728     * Reading from this pointer when `result_ok` is not set is undefined.
4729     */
4730    struct LDKBlindedTail *result;
4731    /**
4732     * A pointer to the contents in the error state.
4733     * Reading from this pointer when `result_ok` is set is undefined.
4734     */
4735    struct LDKDecodeError *err;
4736 } LDKCResult_BlindedTailDecodeErrorZPtr;
4737
4738 /**
4739  * A CResult_BlindedTailDecodeErrorZ represents the result of a fallible operation,
4740  * containing a crate::lightning::routing::router::BlindedTail on success and a crate::lightning::ln::msgs::DecodeError on failure.
4741  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4742  */
4743 typedef struct LDKCResult_BlindedTailDecodeErrorZ {
4744    /**
4745     * The contents of this CResult_BlindedTailDecodeErrorZ, accessible via either
4746     * `err` or `result` depending on the state of `result_ok`.
4747     */
4748    union LDKCResult_BlindedTailDecodeErrorZPtr contents;
4749    /**
4750     * Whether this CResult_BlindedTailDecodeErrorZ represents a success state.
4751     */
4752    bool result_ok;
4753 } LDKCResult_BlindedTailDecodeErrorZ;
4754
4755 /**
4756  * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
4757  * This corresponds to std::vector in C++
4758  */
4759 typedef struct LDKCVec_RouteHopZ {
4760    /**
4761     * The elements in the array.
4762     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4763     */
4764    struct LDKRouteHop *data;
4765    /**
4766     * The number of elements pointed to by `data`.
4767     */
4768    uintptr_t datalen;
4769 } LDKCVec_RouteHopZ;
4770
4771 /**
4772  * A dynamically-allocated array of crate::lightning::routing::router::Paths of arbitrary size.
4773  * This corresponds to std::vector in C++
4774  */
4775 typedef struct LDKCVec_PathZ {
4776    /**
4777     * The elements in the array.
4778     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4779     */
4780    struct LDKPath *data;
4781    /**
4782     * The number of elements pointed to by `data`.
4783     */
4784    uintptr_t datalen;
4785 } LDKCVec_PathZ;
4786
4787 /**
4788  * The contents of CResult_RouteDecodeErrorZ
4789  */
4790 typedef union LDKCResult_RouteDecodeErrorZPtr {
4791    /**
4792     * A pointer to the contents in the success state.
4793     * Reading from this pointer when `result_ok` is not set is undefined.
4794     */
4795    struct LDKRoute *result;
4796    /**
4797     * A pointer to the contents in the error state.
4798     * Reading from this pointer when `result_ok` is set is undefined.
4799     */
4800    struct LDKDecodeError *err;
4801 } LDKCResult_RouteDecodeErrorZPtr;
4802
4803 /**
4804  * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
4805  * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
4806  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4807  */
4808 typedef struct LDKCResult_RouteDecodeErrorZ {
4809    /**
4810     * The contents of this CResult_RouteDecodeErrorZ, accessible via either
4811     * `err` or `result` depending on the state of `result_ok`.
4812     */
4813    union LDKCResult_RouteDecodeErrorZPtr contents;
4814    /**
4815     * Whether this CResult_RouteDecodeErrorZ represents a success state.
4816     */
4817    bool result_ok;
4818 } LDKCResult_RouteDecodeErrorZ;
4819
4820
4821
4822 /**
4823  * Parameters needed to find a [`Route`].
4824  *
4825  * Passed to [`find_route`] and [`build_route_from_hops`].
4826  */
4827 typedef struct MUST_USE_STRUCT LDKRouteParameters {
4828    /**
4829     * A pointer to the opaque Rust object.
4830     * Nearly everywhere, inner must be non-null, however in places where
4831     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4832     */
4833    LDKnativeRouteParameters *inner;
4834    /**
4835     * Indicates that this is the only struct which contains the same pointer.
4836     * Rust functions which take ownership of an object provided via an argument require
4837     * this to be true and invalidate the object pointed to by inner.
4838     */
4839    bool is_owned;
4840 } LDKRouteParameters;
4841
4842 /**
4843  * The contents of CResult_RouteParametersDecodeErrorZ
4844  */
4845 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
4846    /**
4847     * A pointer to the contents in the success state.
4848     * Reading from this pointer when `result_ok` is not set is undefined.
4849     */
4850    struct LDKRouteParameters *result;
4851    /**
4852     * A pointer to the contents in the error state.
4853     * Reading from this pointer when `result_ok` is set is undefined.
4854     */
4855    struct LDKDecodeError *err;
4856 } LDKCResult_RouteParametersDecodeErrorZPtr;
4857
4858 /**
4859  * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
4860  * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4861  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4862  */
4863 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
4864    /**
4865     * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
4866     * `err` or `result` depending on the state of `result_ok`.
4867     */
4868    union LDKCResult_RouteParametersDecodeErrorZPtr contents;
4869    /**
4870     * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
4871     */
4872    bool result_ok;
4873 } LDKCResult_RouteParametersDecodeErrorZ;
4874
4875 /**
4876  * A dynamically-allocated array of u64s of arbitrary size.
4877  * This corresponds to std::vector in C++
4878  */
4879 typedef struct LDKCVec_u64Z {
4880    /**
4881     * The elements in the array.
4882     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4883     */
4884    uint64_t *data;
4885    /**
4886     * The number of elements pointed to by `data`.
4887     */
4888    uintptr_t datalen;
4889 } LDKCVec_u64Z;
4890
4891
4892
4893 /**
4894  * Information used to route a payment.
4895  */
4896 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
4897    /**
4898     * A pointer to the opaque Rust object.
4899     * Nearly everywhere, inner must be non-null, however in places where
4900     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4901     */
4902    LDKnativePaymentParameters *inner;
4903    /**
4904     * Indicates that this is the only struct which contains the same pointer.
4905     * Rust functions which take ownership of an object provided via an argument require
4906     * this to be true and invalidate the object pointed to by inner.
4907     */
4908    bool is_owned;
4909 } LDKPaymentParameters;
4910
4911 /**
4912  * The contents of CResult_PaymentParametersDecodeErrorZ
4913  */
4914 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
4915    /**
4916     * A pointer to the contents in the success state.
4917     * Reading from this pointer when `result_ok` is not set is undefined.
4918     */
4919    struct LDKPaymentParameters *result;
4920    /**
4921     * A pointer to the contents in the error state.
4922     * Reading from this pointer when `result_ok` is set is undefined.
4923     */
4924    struct LDKDecodeError *err;
4925 } LDKCResult_PaymentParametersDecodeErrorZPtr;
4926
4927 /**
4928  * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
4929  * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4930  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4931  */
4932 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
4933    /**
4934     * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
4935     * `err` or `result` depending on the state of `result_ok`.
4936     */
4937    union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
4938    /**
4939     * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
4940     */
4941    bool result_ok;
4942 } LDKCResult_PaymentParametersDecodeErrorZ;
4943
4944
4945
4946 /**
4947  * A list of hops along a payment path terminating with a channel to the recipient.
4948  */
4949 typedef struct MUST_USE_STRUCT LDKRouteHint {
4950    /**
4951     * A pointer to the opaque Rust object.
4952     * Nearly everywhere, inner must be non-null, however in places where
4953     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4954     */
4955    LDKnativeRouteHint *inner;
4956    /**
4957     * Indicates that this is the only struct which contains the same pointer.
4958     * Rust functions which take ownership of an object provided via an argument require
4959     * this to be true and invalidate the object pointed to by inner.
4960     */
4961    bool is_owned;
4962 } LDKRouteHint;
4963
4964 /**
4965  * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
4966  * This corresponds to std::vector in C++
4967  */
4968 typedef struct LDKCVec_RouteHintZ {
4969    /**
4970     * The elements in the array.
4971     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4972     */
4973    struct LDKRouteHint *data;
4974    /**
4975     * The number of elements pointed to by `data`.
4976     */
4977    uintptr_t datalen;
4978 } LDKCVec_RouteHintZ;
4979
4980
4981
4982 /**
4983  * A channel descriptor for a hop along a payment path.
4984  *
4985  * While this generally comes from BOLT 11's `r` field, this struct includes more fields than are
4986  * available in BOLT 11. Thus, encoding and decoding this via `lightning-invoice` is lossy, as
4987  * fields not supported in BOLT 11 will be stripped.
4988  */
4989 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
4990    /**
4991     * A pointer to the opaque Rust object.
4992     * Nearly everywhere, inner must be non-null, however in places where
4993     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4994     */
4995    LDKnativeRouteHintHop *inner;
4996    /**
4997     * Indicates that this is the only struct which contains the same pointer.
4998     * Rust functions which take ownership of an object provided via an argument require
4999     * this to be true and invalidate the object pointed to by inner.
5000     */
5001    bool is_owned;
5002 } LDKRouteHintHop;
5003
5004 /**
5005  * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
5006  * This corresponds to std::vector in C++
5007  */
5008 typedef struct LDKCVec_RouteHintHopZ {
5009    /**
5010     * The elements in the array.
5011     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5012     */
5013    struct LDKRouteHintHop *data;
5014    /**
5015     * The number of elements pointed to by `data`.
5016     */
5017    uintptr_t datalen;
5018 } LDKCVec_RouteHintHopZ;
5019
5020 /**
5021  * The contents of CResult_RouteHintDecodeErrorZ
5022  */
5023 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
5024    /**
5025     * A pointer to the contents in the success state.
5026     * Reading from this pointer when `result_ok` is not set is undefined.
5027     */
5028    struct LDKRouteHint *result;
5029    /**
5030     * A pointer to the contents in the error state.
5031     * Reading from this pointer when `result_ok` is set is undefined.
5032     */
5033    struct LDKDecodeError *err;
5034 } LDKCResult_RouteHintDecodeErrorZPtr;
5035
5036 /**
5037  * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
5038  * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
5039  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5040  */
5041 typedef struct LDKCResult_RouteHintDecodeErrorZ {
5042    /**
5043     * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
5044     * `err` or `result` depending on the state of `result_ok`.
5045     */
5046    union LDKCResult_RouteHintDecodeErrorZPtr contents;
5047    /**
5048     * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
5049     */
5050    bool result_ok;
5051 } LDKCResult_RouteHintDecodeErrorZ;
5052
5053 /**
5054  * The contents of CResult_RouteHintHopDecodeErrorZ
5055  */
5056 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
5057    /**
5058     * A pointer to the contents in the success state.
5059     * Reading from this pointer when `result_ok` is not set is undefined.
5060     */
5061    struct LDKRouteHintHop *result;
5062    /**
5063     * A pointer to the contents in the error state.
5064     * Reading from this pointer when `result_ok` is set is undefined.
5065     */
5066    struct LDKDecodeError *err;
5067 } LDKCResult_RouteHintHopDecodeErrorZPtr;
5068
5069 /**
5070  * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
5071  * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
5072  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5073  */
5074 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
5075    /**
5076     * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
5077     * `err` or `result` depending on the state of `result_ok`.
5078     */
5079    union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
5080    /**
5081     * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
5082     */
5083    bool result_ok;
5084 } LDKCResult_RouteHintHopDecodeErrorZ;
5085
5086
5087
5088 /**
5089  * [`ScoreLookUp`] implementation that uses a fixed penalty.
5090  */
5091 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
5092    /**
5093     * A pointer to the opaque Rust object.
5094     * Nearly everywhere, inner must be non-null, however in places where
5095     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5096     */
5097    LDKnativeFixedPenaltyScorer *inner;
5098    /**
5099     * Indicates that this is the only struct which contains the same pointer.
5100     * Rust functions which take ownership of an object provided via an argument require
5101     * this to be true and invalidate the object pointed to by inner.
5102     */
5103    bool is_owned;
5104 } LDKFixedPenaltyScorer;
5105
5106 /**
5107  * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
5108  */
5109 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
5110    /**
5111     * A pointer to the contents in the success state.
5112     * Reading from this pointer when `result_ok` is not set is undefined.
5113     */
5114    struct LDKFixedPenaltyScorer *result;
5115    /**
5116     * A pointer to the contents in the error state.
5117     * Reading from this pointer when `result_ok` is set is undefined.
5118     */
5119    struct LDKDecodeError *err;
5120 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
5121
5122 /**
5123  * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
5124  * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5125  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5126  */
5127 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
5128    /**
5129     * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
5130     * `err` or `result` depending on the state of `result_ok`.
5131     */
5132    union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
5133    /**
5134     * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
5135     */
5136    bool result_ok;
5137 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
5138
5139
5140
5141 /**
5142  * Represents the compressed public key of a node
5143  */
5144 typedef struct MUST_USE_STRUCT LDKNodeId {
5145    /**
5146     * A pointer to the opaque Rust object.
5147     * Nearly everywhere, inner must be non-null, however in places where
5148     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5149     */
5150    LDKnativeNodeId *inner;
5151    /**
5152     * Indicates that this is the only struct which contains the same pointer.
5153     * Rust functions which take ownership of an object provided via an argument require
5154     * this to be true and invalidate the object pointed to by inner.
5155     */
5156    bool is_owned;
5157 } LDKNodeId;
5158
5159 /**
5160  * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
5161  * This corresponds to std::vector in C++
5162  */
5163 typedef struct LDKCVec_NodeIdZ {
5164    /**
5165     * The elements in the array.
5166     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5167     */
5168    struct LDKNodeId *data;
5169    /**
5170     * The number of elements pointed to by `data`.
5171     */
5172    uintptr_t datalen;
5173 } LDKCVec_NodeIdZ;
5174
5175 /**
5176  * A tuple of 2 elements. See the individual fields for the types contained.
5177  */
5178 typedef struct LDKC2Tuple_u64u64Z {
5179    /**
5180     * The element at position 0
5181     */
5182    uint64_t a;
5183    /**
5184     * The element at position 1
5185     */
5186    uint64_t b;
5187 } LDKC2Tuple_u64u64Z;
5188
5189 /**
5190  * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
5191  */
5192 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
5193    /**
5194     * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
5195     */
5196    LDKCOption_C2Tuple_u64u64ZZ_Some,
5197    /**
5198     * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
5199     */
5200    LDKCOption_C2Tuple_u64u64ZZ_None,
5201    /**
5202     * Must be last for serialization purposes
5203     */
5204    LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
5205 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
5206
5207 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
5208    LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
5209    union {
5210       struct {
5211          struct LDKC2Tuple_u64u64Z some;
5212       };
5213    };
5214 } LDKCOption_C2Tuple_u64u64ZZ;
5215
5216 /**
5217  * 32 u16s
5218  */
5219 typedef struct LDKThirtyTwoU16s {
5220    /**
5221     * The thirty-two 16-bit integers
5222     */
5223    uint16_t data[32];
5224 } LDKThirtyTwoU16s;
5225
5226 /**
5227  * A tuple of 2 elements. See the individual fields for the types contained.
5228  */
5229 typedef struct LDKC2Tuple_Z {
5230    /**
5231     * The element at position 0
5232     */
5233    struct LDKThirtyTwoU16s a;
5234    /**
5235     * The element at position 1
5236     */
5237    struct LDKThirtyTwoU16s b;
5238 } LDKC2Tuple_Z;
5239
5240 /**
5241  * A tuple of 2 elements. See the individual fields for the types contained.
5242  */
5243 typedef struct LDKC2Tuple__u1632_u1632Z {
5244    /**
5245     * The element at position 0
5246     */
5247    struct LDKThirtyTwoU16s a;
5248    /**
5249     * The element at position 1
5250     */
5251    struct LDKThirtyTwoU16s b;
5252 } LDKC2Tuple__u1632_u1632Z;
5253
5254 /**
5255  * An enum which can either contain a crate::c_types::derived::C2Tuple__u1632_u1632Z or not
5256  */
5257 typedef enum LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag {
5258    /**
5259     * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains a crate::c_types::derived::C2Tuple__u1632_u1632Z
5260     */
5261    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some,
5262    /**
5263     * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains nothing
5264     */
5265    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_None,
5266    /**
5267     * Must be last for serialization purposes
5268     */
5269    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Sentinel,
5270 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag;
5271
5272 typedef struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
5273    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag tag;
5274    union {
5275       struct {
5276          struct LDKC2Tuple__u1632_u1632Z some;
5277       };
5278    };
5279 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ;
5280
5281 /**
5282  * An enum which can either contain a f64 or not
5283  */
5284 typedef enum LDKCOption_f64Z_Tag {
5285    /**
5286     * When we're in this state, this COption_f64Z contains a f64
5287     */
5288    LDKCOption_f64Z_Some,
5289    /**
5290     * When we're in this state, this COption_f64Z contains nothing
5291     */
5292    LDKCOption_f64Z_None,
5293    /**
5294     * Must be last for serialization purposes
5295     */
5296    LDKCOption_f64Z_Sentinel,
5297 } LDKCOption_f64Z_Tag;
5298
5299 typedef struct LDKCOption_f64Z {
5300    LDKCOption_f64Z_Tag tag;
5301    union {
5302       struct {
5303          double some;
5304       };
5305    };
5306 } LDKCOption_f64Z;
5307
5308
5309
5310 /**
5311  * A Record, unit of logging output with Metadata to enable filtering
5312  * Module_path, file, line to inform on log's source
5313  */
5314 typedef struct MUST_USE_STRUCT LDKRecord {
5315    /**
5316     * A pointer to the opaque Rust object.
5317     * Nearly everywhere, inner must be non-null, however in places where
5318     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5319     */
5320    LDKnativeRecord *inner;
5321    /**
5322     * Indicates that this is the only struct which contains the same pointer.
5323     * Rust functions which take ownership of an object provided via an argument require
5324     * this to be true and invalidate the object pointed to by inner.
5325     */
5326    bool is_owned;
5327 } LDKRecord;
5328
5329 /**
5330  * A trait encapsulating the operations required of a logger.
5331  */
5332 typedef struct LDKLogger {
5333    /**
5334     * An opaque pointer which is passed to your function implementations as an argument.
5335     * This has no meaning in the LDK, and can be NULL or any other value.
5336     */
5337    void *this_arg;
5338    /**
5339     * Logs the [`Record`].
5340     */
5341    void (*log)(const void *this_arg, struct LDKRecord record);
5342    /**
5343     * Frees any resources associated with this object given its this_arg pointer.
5344     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5345     */
5346    void (*free)(void *this_arg);
5347 } LDKLogger;
5348
5349
5350
5351 /**
5352  * Represents the network as nodes and channels between them
5353  */
5354 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
5355    /**
5356     * A pointer to the opaque Rust object.
5357     * Nearly everywhere, inner must be non-null, however in places where
5358     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5359     */
5360    LDKnativeNetworkGraph *inner;
5361    /**
5362     * Indicates that this is the only struct which contains the same pointer.
5363     * Rust functions which take ownership of an object provided via an argument require
5364     * this to be true and invalidate the object pointed to by inner.
5365     */
5366    bool is_owned;
5367 } LDKNetworkGraph;
5368
5369
5370
5371 /**
5372  * [`ScoreLookUp`] implementation using channel success probability distributions.
5373  *
5374  * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
5375  * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
5376  * When a payment is forwarded through a channel (but fails later in the route), we learn the
5377  * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
5378  *
5379  * These bounds are then used to determine a success probability using the formula from
5380  * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
5381  * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
5382  *
5383  * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
5384  * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
5385  * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
5386  * terms of the entire path's success probability. This allows the router to directly compare
5387  * penalties for different paths. See the documentation of those parameters for the exact formulas.
5388  *
5389  * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
5390  *
5391  * Further, we track the history of our upper and lower liquidity bounds for each channel,
5392  * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
5393  * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
5394  * formula, but using the history of a channel rather than our latest estimates for the liquidity
5395  * bounds.
5396  *
5397  * [1]: https://arxiv.org/abs/2107.05322
5398  * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat
5399  * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat
5400  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
5401  * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat
5402  * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat
5403  */
5404 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
5405    /**
5406     * A pointer to the opaque Rust object.
5407     * Nearly everywhere, inner must be non-null, however in places where
5408     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5409     */
5410    LDKnativeProbabilisticScorer *inner;
5411    /**
5412     * Indicates that this is the only struct which contains the same pointer.
5413     * Rust functions which take ownership of an object provided via an argument require
5414     * this to be true and invalidate the object pointed to by inner.
5415     */
5416    bool is_owned;
5417 } LDKProbabilisticScorer;
5418
5419 /**
5420  * The contents of CResult_ProbabilisticScorerDecodeErrorZ
5421  */
5422 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
5423    /**
5424     * A pointer to the contents in the success state.
5425     * Reading from this pointer when `result_ok` is not set is undefined.
5426     */
5427    struct LDKProbabilisticScorer *result;
5428    /**
5429     * A pointer to the contents in the error state.
5430     * Reading from this pointer when `result_ok` is set is undefined.
5431     */
5432    struct LDKDecodeError *err;
5433 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
5434
5435 /**
5436  * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
5437  * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5438  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5439  */
5440 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
5441    /**
5442     * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
5443     * `err` or `result` depending on the state of `result_ok`.
5444     */
5445    union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
5446    /**
5447     * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
5448     */
5449    bool result_ok;
5450 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
5451
5452
5453
5454 /**
5455  * The best known block as identified by its hash and height.
5456  */
5457 typedef struct MUST_USE_STRUCT LDKBestBlock {
5458    /**
5459     * A pointer to the opaque Rust object.
5460     * Nearly everywhere, inner must be non-null, however in places where
5461     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5462     */
5463    LDKnativeBestBlock *inner;
5464    /**
5465     * Indicates that this is the only struct which contains the same pointer.
5466     * Rust functions which take ownership of an object provided via an argument require
5467     * this to be true and invalidate the object pointed to by inner.
5468     */
5469    bool is_owned;
5470 } LDKBestBlock;
5471
5472 /**
5473  * The contents of CResult_BestBlockDecodeErrorZ
5474  */
5475 typedef union LDKCResult_BestBlockDecodeErrorZPtr {
5476    /**
5477     * A pointer to the contents in the success state.
5478     * Reading from this pointer when `result_ok` is not set is undefined.
5479     */
5480    struct LDKBestBlock *result;
5481    /**
5482     * A pointer to the contents in the error state.
5483     * Reading from this pointer when `result_ok` is set is undefined.
5484     */
5485    struct LDKDecodeError *err;
5486 } LDKCResult_BestBlockDecodeErrorZPtr;
5487
5488 /**
5489  * A CResult_BestBlockDecodeErrorZ represents the result of a fallible operation,
5490  * containing a crate::lightning::chain::BestBlock on success and a crate::lightning::ln::msgs::DecodeError on failure.
5491  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5492  */
5493 typedef struct LDKCResult_BestBlockDecodeErrorZ {
5494    /**
5495     * The contents of this CResult_BestBlockDecodeErrorZ, accessible via either
5496     * `err` or `result` depending on the state of `result_ok`.
5497     */
5498    union LDKCResult_BestBlockDecodeErrorZPtr contents;
5499    /**
5500     * Whether this CResult_BestBlockDecodeErrorZ represents a success state.
5501     */
5502    bool result_ok;
5503 } LDKCResult_BestBlockDecodeErrorZ;
5504
5505 /**
5506  * A tuple of 2 elements. See the individual fields for the types contained.
5507  */
5508 typedef struct LDKC2Tuple_usizeTransactionZ {
5509    /**
5510     * The element at position 0
5511     */
5512    uintptr_t a;
5513    /**
5514     * The element at position 1
5515     */
5516    struct LDKTransaction b;
5517 } LDKC2Tuple_usizeTransactionZ;
5518
5519 /**
5520  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
5521  * This corresponds to std::vector in C++
5522  */
5523 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
5524    /**
5525     * The elements in the array.
5526     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5527     */
5528    struct LDKC2Tuple_usizeTransactionZ *data;
5529    /**
5530     * The number of elements pointed to by `data`.
5531     */
5532    uintptr_t datalen;
5533 } LDKCVec_C2Tuple_usizeTransactionZZ;
5534
5535 /**
5536  * A tuple of 3 elements. See the individual fields for the types contained.
5537  */
5538 typedef struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ {
5539    /**
5540     * The element at position 0
5541     */
5542    struct LDKThirtyTwoBytes a;
5543    /**
5544     * The element at position 1
5545     */
5546    uint32_t b;
5547    /**
5548     * The element at position 2
5549     */
5550    struct LDKCOption_ThirtyTwoBytesZ c;
5551 } LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ;
5552
5553 /**
5554  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZs of arbitrary size.
5555  * This corresponds to std::vector in C++
5556  */
5557 typedef struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ {
5558    /**
5559     * The elements in the array.
5560     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5561     */
5562    struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *data;
5563    /**
5564     * The number of elements pointed to by `data`.
5565     */
5566    uintptr_t datalen;
5567 } LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ;
5568
5569 /**
5570  * The contents of CResult_ChannelMonitorUpdateStatusNoneZ
5571  */
5572 typedef union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr {
5573    /**
5574     * A pointer to the contents in the success state.
5575     * Reading from this pointer when `result_ok` is not set is undefined.
5576     */
5577    enum LDKChannelMonitorUpdateStatus *result;
5578    /**
5579     * Note that this value is always NULL, as there are no contents in the Err variant
5580     */
5581    void *err;
5582 } LDKCResult_ChannelMonitorUpdateStatusNoneZPtr;
5583
5584 /**
5585  * A CResult_ChannelMonitorUpdateStatusNoneZ represents the result of a fallible operation,
5586  * containing a crate::lightning::chain::ChannelMonitorUpdateStatus on success and a () on failure.
5587  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5588  */
5589 typedef struct LDKCResult_ChannelMonitorUpdateStatusNoneZ {
5590    /**
5591     * The contents of this CResult_ChannelMonitorUpdateStatusNoneZ, accessible via either
5592     * `err` or `result` depending on the state of `result_ok`.
5593     */
5594    union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr contents;
5595    /**
5596     * Whether this CResult_ChannelMonitorUpdateStatusNoneZ represents a success state.
5597     */
5598    bool result_ok;
5599 } LDKCResult_ChannelMonitorUpdateStatusNoneZ;
5600
5601
5602
5603 /**
5604  * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
5605  * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
5606  * preimage claim backward will lead to loss of funds.
5607  */
5608 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
5609    /**
5610     * A pointer to the opaque Rust object.
5611     * Nearly everywhere, inner must be non-null, however in places where
5612     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5613     */
5614    LDKnativeHTLCUpdate *inner;
5615    /**
5616     * Indicates that this is the only struct which contains the same pointer.
5617     * Rust functions which take ownership of an object provided via an argument require
5618     * this to be true and invalidate the object pointed to by inner.
5619     */
5620    bool is_owned;
5621 } LDKHTLCUpdate;
5622
5623
5624
5625 /**
5626  * Struct to `Display` fields in a safe way using `PrintableString`
5627  */
5628 typedef struct MUST_USE_STRUCT LDKUntrustedString {
5629    /**
5630     * A pointer to the opaque Rust object.
5631     * Nearly everywhere, inner must be non-null, however in places where
5632     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5633     */
5634    LDKnativeUntrustedString *inner;
5635    /**
5636     * Indicates that this is the only struct which contains the same pointer.
5637     * Rust functions which take ownership of an object provided via an argument require
5638     * this to be true and invalidate the object pointed to by inner.
5639     */
5640    bool is_owned;
5641 } LDKUntrustedString;
5642
5643 /**
5644  * The reason the channel was closed. See individual variants for more details.
5645  */
5646 typedef enum LDKClosureReason_Tag {
5647    /**
5648     * Closure generated from receiving a peer error message.
5649     *
5650     * Our counterparty may have broadcasted their latest commitment state, and we have
5651     * as well.
5652     */
5653    LDKClosureReason_CounterpartyForceClosed,
5654    /**
5655     * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
5656     *
5657     * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
5658     */
5659    LDKClosureReason_HolderForceClosed,
5660    /**
5661     * The channel was closed after negotiating a cooperative close and we've now broadcasted
5662     * the cooperative close transaction. Note the shutdown may have been initiated by us.
5663     *
5664     * This was only set in versions of LDK prior to 0.0.122.
5665     */
5666    LDKClosureReason_LegacyCooperativeClosure,
5667    /**
5668     * The channel was closed after negotiating a cooperative close and we've now broadcasted
5669     * the cooperative close transaction. This indicates that the shutdown was initiated by our
5670     * counterparty.
5671     *
5672     * In rare cases where we initiated closure immediately prior to shutting down without
5673     * persisting, this value may be provided for channels we initiated closure for.
5674     */
5675    LDKClosureReason_CounterpartyInitiatedCooperativeClosure,
5676    /**
5677     * The channel was closed after negotiating a cooperative close and we've now broadcasted
5678     * the cooperative close transaction. This indicates that the shutdown was initiated by us.
5679     */
5680    LDKClosureReason_LocallyInitiatedCooperativeClosure,
5681    /**
5682     * A commitment transaction was confirmed on chain, closing the channel. Most likely this
5683     * commitment transaction came from our counterparty, but it may also have come from
5684     * a copy of our own `ChannelMonitor`.
5685     */
5686    LDKClosureReason_CommitmentTxConfirmed,
5687    /**
5688     * The funding transaction failed to confirm in a timely manner on an inbound channel.
5689     */
5690    LDKClosureReason_FundingTimedOut,
5691    /**
5692     * Closure generated from processing an event, likely a HTLC forward/relay/reception.
5693     */
5694    LDKClosureReason_ProcessingError,
5695    /**
5696     * The peer disconnected prior to funding completing. In this case the spec mandates that we
5697     * forget the channel entirely - we can attempt again if the peer reconnects.
5698     *
5699     * This includes cases where we restarted prior to funding completion, including prior to the
5700     * initial [`ChannelMonitor`] persistence completing.
5701     *
5702     * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
5703     * peer because of mutual incompatibility between us and our channel counterparty.
5704     *
5705     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
5706     */
5707    LDKClosureReason_DisconnectedPeer,
5708    /**
5709     * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
5710     * the [`ChannelManager`] deserialized.
5711     *
5712     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
5713     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
5714     */
5715    LDKClosureReason_OutdatedChannelManager,
5716    /**
5717     * The counterparty requested a cooperative close of a channel that had not been funded yet.
5718     * The channel has been immediately closed.
5719     */
5720    LDKClosureReason_CounterpartyCoopClosedUnfundedChannel,
5721    /**
5722     * Another channel in the same funding batch closed before the funding transaction
5723     * was ready to be broadcast.
5724     */
5725    LDKClosureReason_FundingBatchClosure,
5726    /**
5727     * One of our HTLCs timed out in a channel, causing us to force close the channel.
5728     */
5729    LDKClosureReason_HTLCsTimedOut,
5730    /**
5731     * Must be last for serialization purposes
5732     */
5733    LDKClosureReason_Sentinel,
5734 } LDKClosureReason_Tag;
5735
5736 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
5737    /**
5738     * The error which the peer sent us.
5739     *
5740     * Be careful about printing the peer_msg, a well-crafted message could exploit
5741     * a security vulnerability in the terminal emulator or the logging subsystem.
5742     * To be safe, use `Display` on `UntrustedString`
5743     *
5744     * [`UntrustedString`]: crate::util::string::UntrustedString
5745     */
5746    struct LDKUntrustedString peer_msg;
5747 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
5748
5749 typedef struct LDKClosureReason_LDKProcessingError_Body {
5750    /**
5751     * A developer-readable error message which we generated.
5752     */
5753    struct LDKStr err;
5754 } LDKClosureReason_LDKProcessingError_Body;
5755
5756 typedef struct MUST_USE_STRUCT LDKClosureReason {
5757    LDKClosureReason_Tag tag;
5758    union {
5759       LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
5760       LDKClosureReason_LDKProcessingError_Body processing_error;
5761    };
5762 } LDKClosureReason;
5763
5764
5765
5766 /**
5767  * A unique 32-byte identifier for a channel.
5768  * Depending on how the ID is generated, several varieties are distinguished
5769  * (but all are stored as 32 bytes):
5770  *   _v1_ and _temporary_.
5771  * A _v1_ channel ID is generated based on funding tx outpoint (txid & index).
5772  * A _temporary_ ID is generated randomly.
5773  * (Later revocation-point-based _v2_ is a possibility.)
5774  * The variety (context) is not stored, it is relevant only at creation.
5775  */
5776 typedef struct MUST_USE_STRUCT LDKChannelId {
5777    /**
5778     * A pointer to the opaque Rust object.
5779     * Nearly everywhere, inner must be non-null, however in places where
5780     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5781     */
5782    LDKnativeChannelId *inner;
5783    /**
5784     * Indicates that this is the only struct which contains the same pointer.
5785     * Rust functions which take ownership of an object provided via an argument require
5786     * this to be true and invalidate the object pointed to by inner.
5787     */
5788    bool is_owned;
5789 } LDKChannelId;
5790
5791 /**
5792  * An event to be processed by the ChannelManager.
5793  */
5794 typedef enum LDKMonitorEvent_Tag {
5795    /**
5796     * A monitor event containing an HTLCUpdate.
5797     */
5798    LDKMonitorEvent_HTLCEvent,
5799    /**
5800     * Indicates we broadcasted the channel's latest commitment transaction and thus closed the
5801     * channel. Holds information about the channel and why it was closed.
5802     */
5803    LDKMonitorEvent_HolderForceClosedWithInfo,
5804    /**
5805     * Indicates we broadcasted the channel's latest commitment transaction and thus closed the
5806     * channel.
5807     */
5808    LDKMonitorEvent_HolderForceClosed,
5809    /**
5810     * Indicates a [`ChannelMonitor`] update has completed. See
5811     * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
5812     *
5813     * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
5814     */
5815    LDKMonitorEvent_Completed,
5816    /**
5817     * Must be last for serialization purposes
5818     */
5819    LDKMonitorEvent_Sentinel,
5820 } LDKMonitorEvent_Tag;
5821
5822 typedef struct LDKMonitorEvent_LDKHolderForceClosedWithInfo_Body {
5823    /**
5824     * The reason the channel was closed.
5825     */
5826    struct LDKClosureReason reason;
5827    /**
5828     * The funding outpoint of the channel.
5829     */
5830    struct LDKOutPoint outpoint;
5831    /**
5832     * The channel ID of the channel.
5833     */
5834    struct LDKChannelId channel_id;
5835 } LDKMonitorEvent_LDKHolderForceClosedWithInfo_Body;
5836
5837 typedef struct LDKMonitorEvent_LDKCompleted_Body {
5838    /**
5839     * The funding outpoint of the [`ChannelMonitor`] that was updated
5840     */
5841    struct LDKOutPoint funding_txo;
5842    /**
5843     * The channel ID of the channel associated with the [`ChannelMonitor`]
5844     */
5845    struct LDKChannelId channel_id;
5846    /**
5847     * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
5848     * [`ChannelMonitor::get_latest_update_id`].
5849     *
5850     * Note that this should only be set to a given update's ID if all previous updates for the
5851     * same [`ChannelMonitor`] have been applied and persisted.
5852     */
5853    uint64_t monitor_update_id;
5854 } LDKMonitorEvent_LDKCompleted_Body;
5855
5856 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
5857    LDKMonitorEvent_Tag tag;
5858    union {
5859       struct {
5860          struct LDKHTLCUpdate htlc_event;
5861       };
5862       LDKMonitorEvent_LDKHolderForceClosedWithInfo_Body holder_force_closed_with_info;
5863       struct {
5864          struct LDKOutPoint holder_force_closed;
5865       };
5866       LDKMonitorEvent_LDKCompleted_Body completed;
5867    };
5868 } LDKMonitorEvent;
5869
5870 /**
5871  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
5872  * This corresponds to std::vector in C++
5873  */
5874 typedef struct LDKCVec_MonitorEventZ {
5875    /**
5876     * The elements in the array.
5877     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5878     */
5879    struct LDKMonitorEvent *data;
5880    /**
5881     * The number of elements pointed to by `data`.
5882     */
5883    uintptr_t datalen;
5884 } LDKCVec_MonitorEventZ;
5885
5886 /**
5887  * A tuple of 4 elements. See the individual fields for the types contained.
5888  */
5889 typedef struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ {
5890    /**
5891     * The element at position 0
5892     */
5893    struct LDKOutPoint a;
5894    /**
5895     * The element at position 1
5896     */
5897    struct LDKChannelId b;
5898    /**
5899     * The element at position 2
5900     */
5901    struct LDKCVec_MonitorEventZ c;
5902    /**
5903     * The element at position 3
5904     */
5905    struct LDKPublicKey d;
5906 } LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ;
5907
5908 /**
5909  * A dynamically-allocated array of crate::c_types::derived::C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZs of arbitrary size.
5910  * This corresponds to std::vector in C++
5911  */
5912 typedef struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ {
5913    /**
5914     * The elements in the array.
5915     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5916     */
5917    struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *data;
5918    /**
5919     * The number of elements pointed to by `data`.
5920     */
5921    uintptr_t datalen;
5922 } LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ;
5923
5924
5925
5926 /**
5927  * Features used within an `init` message.
5928  */
5929 typedef struct MUST_USE_STRUCT LDKInitFeatures {
5930    /**
5931     * A pointer to the opaque Rust object.
5932     * Nearly everywhere, inner must be non-null, however in places where
5933     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5934     */
5935    LDKnativeInitFeatures *inner;
5936    /**
5937     * Indicates that this is the only struct which contains the same pointer.
5938     * Rust functions which take ownership of an object provided via an argument require
5939     * this to be true and invalidate the object pointed to by inner.
5940     */
5941    bool is_owned;
5942 } LDKInitFeatures;
5943
5944 /**
5945  * The contents of CResult_InitFeaturesDecodeErrorZ
5946  */
5947 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
5948    /**
5949     * A pointer to the contents in the success state.
5950     * Reading from this pointer when `result_ok` is not set is undefined.
5951     */
5952    struct LDKInitFeatures *result;
5953    /**
5954     * A pointer to the contents in the error state.
5955     * Reading from this pointer when `result_ok` is set is undefined.
5956     */
5957    struct LDKDecodeError *err;
5958 } LDKCResult_InitFeaturesDecodeErrorZPtr;
5959
5960 /**
5961  * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
5962  * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5963  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5964  */
5965 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
5966    /**
5967     * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
5968     * `err` or `result` depending on the state of `result_ok`.
5969     */
5970    union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
5971    /**
5972     * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
5973     */
5974    bool result_ok;
5975 } LDKCResult_InitFeaturesDecodeErrorZ;
5976
5977
5978
5979 /**
5980  * Features used within a `channel_announcement` message.
5981  */
5982 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
5983    /**
5984     * A pointer to the opaque Rust object.
5985     * Nearly everywhere, inner must be non-null, however in places where
5986     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5987     */
5988    LDKnativeChannelFeatures *inner;
5989    /**
5990     * Indicates that this is the only struct which contains the same pointer.
5991     * Rust functions which take ownership of an object provided via an argument require
5992     * this to be true and invalidate the object pointed to by inner.
5993     */
5994    bool is_owned;
5995 } LDKChannelFeatures;
5996
5997 /**
5998  * The contents of CResult_ChannelFeaturesDecodeErrorZ
5999  */
6000 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
6001    /**
6002     * A pointer to the contents in the success state.
6003     * Reading from this pointer when `result_ok` is not set is undefined.
6004     */
6005    struct LDKChannelFeatures *result;
6006    /**
6007     * A pointer to the contents in the error state.
6008     * Reading from this pointer when `result_ok` is set is undefined.
6009     */
6010    struct LDKDecodeError *err;
6011 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
6012
6013 /**
6014  * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
6015  * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6016  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6017  */
6018 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
6019    /**
6020     * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
6021     * `err` or `result` depending on the state of `result_ok`.
6022     */
6023    union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
6024    /**
6025     * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
6026     */
6027    bool result_ok;
6028 } LDKCResult_ChannelFeaturesDecodeErrorZ;
6029
6030
6031
6032 /**
6033  * Features used within a `node_announcement` message.
6034  */
6035 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
6036    /**
6037     * A pointer to the opaque Rust object.
6038     * Nearly everywhere, inner must be non-null, however in places where
6039     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6040     */
6041    LDKnativeNodeFeatures *inner;
6042    /**
6043     * Indicates that this is the only struct which contains the same pointer.
6044     * Rust functions which take ownership of an object provided via an argument require
6045     * this to be true and invalidate the object pointed to by inner.
6046     */
6047    bool is_owned;
6048 } LDKNodeFeatures;
6049
6050 /**
6051  * The contents of CResult_NodeFeaturesDecodeErrorZ
6052  */
6053 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
6054    /**
6055     * A pointer to the contents in the success state.
6056     * Reading from this pointer when `result_ok` is not set is undefined.
6057     */
6058    struct LDKNodeFeatures *result;
6059    /**
6060     * A pointer to the contents in the error state.
6061     * Reading from this pointer when `result_ok` is set is undefined.
6062     */
6063    struct LDKDecodeError *err;
6064 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
6065
6066 /**
6067  * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
6068  * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6069  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6070  */
6071 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
6072    /**
6073     * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
6074     * `err` or `result` depending on the state of `result_ok`.
6075     */
6076    union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
6077    /**
6078     * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
6079     */
6080    bool result_ok;
6081 } LDKCResult_NodeFeaturesDecodeErrorZ;
6082
6083
6084
6085 /**
6086  * Features used within an invoice.
6087  */
6088 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceFeatures {
6089    /**
6090     * A pointer to the opaque Rust object.
6091     * Nearly everywhere, inner must be non-null, however in places where
6092     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6093     */
6094    LDKnativeBolt11InvoiceFeatures *inner;
6095    /**
6096     * Indicates that this is the only struct which contains the same pointer.
6097     * Rust functions which take ownership of an object provided via an argument require
6098     * this to be true and invalidate the object pointed to by inner.
6099     */
6100    bool is_owned;
6101 } LDKBolt11InvoiceFeatures;
6102
6103 /**
6104  * The contents of CResult_Bolt11InvoiceFeaturesDecodeErrorZ
6105  */
6106 typedef union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr {
6107    /**
6108     * A pointer to the contents in the success state.
6109     * Reading from this pointer when `result_ok` is not set is undefined.
6110     */
6111    struct LDKBolt11InvoiceFeatures *result;
6112    /**
6113     * A pointer to the contents in the error state.
6114     * Reading from this pointer when `result_ok` is set is undefined.
6115     */
6116    struct LDKDecodeError *err;
6117 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr;
6118
6119 /**
6120  * A CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
6121  * containing a crate::lightning::ln::features::Bolt11InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6122  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6123  */
6124 typedef struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ {
6125    /**
6126     * The contents of this CResult_Bolt11InvoiceFeaturesDecodeErrorZ, accessible via either
6127     * `err` or `result` depending on the state of `result_ok`.
6128     */
6129    union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr contents;
6130    /**
6131     * Whether this CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents a success state.
6132     */
6133    bool result_ok;
6134 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ;
6135
6136
6137
6138 /**
6139  * Features used within an `invoice`.
6140  */
6141 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
6142    /**
6143     * A pointer to the opaque Rust object.
6144     * Nearly everywhere, inner must be non-null, however in places where
6145     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6146     */
6147    LDKnativeBolt12InvoiceFeatures *inner;
6148    /**
6149     * Indicates that this is the only struct which contains the same pointer.
6150     * Rust functions which take ownership of an object provided via an argument require
6151     * this to be true and invalidate the object pointed to by inner.
6152     */
6153    bool is_owned;
6154 } LDKBolt12InvoiceFeatures;
6155
6156 /**
6157  * The contents of CResult_Bolt12InvoiceFeaturesDecodeErrorZ
6158  */
6159 typedef union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr {
6160    /**
6161     * A pointer to the contents in the success state.
6162     * Reading from this pointer when `result_ok` is not set is undefined.
6163     */
6164    struct LDKBolt12InvoiceFeatures *result;
6165    /**
6166     * A pointer to the contents in the error state.
6167     * Reading from this pointer when `result_ok` is set is undefined.
6168     */
6169    struct LDKDecodeError *err;
6170 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr;
6171
6172 /**
6173  * A CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
6174  * containing a crate::lightning::ln::features::Bolt12InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6175  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6176  */
6177 typedef struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ {
6178    /**
6179     * The contents of this CResult_Bolt12InvoiceFeaturesDecodeErrorZ, accessible via either
6180     * `err` or `result` depending on the state of `result_ok`.
6181     */
6182    union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr contents;
6183    /**
6184     * Whether this CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents a success state.
6185     */
6186    bool result_ok;
6187 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ;
6188
6189
6190
6191 /**
6192  * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
6193  */
6194 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
6195    /**
6196     * A pointer to the opaque Rust object.
6197     * Nearly everywhere, inner must be non-null, however in places where
6198     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6199     */
6200    LDKnativeBlindedHopFeatures *inner;
6201    /**
6202     * Indicates that this is the only struct which contains the same pointer.
6203     * Rust functions which take ownership of an object provided via an argument require
6204     * this to be true and invalidate the object pointed to by inner.
6205     */
6206    bool is_owned;
6207 } LDKBlindedHopFeatures;
6208
6209 /**
6210  * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
6211  */
6212 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
6213    /**
6214     * A pointer to the contents in the success state.
6215     * Reading from this pointer when `result_ok` is not set is undefined.
6216     */
6217    struct LDKBlindedHopFeatures *result;
6218    /**
6219     * A pointer to the contents in the error state.
6220     * Reading from this pointer when `result_ok` is set is undefined.
6221     */
6222    struct LDKDecodeError *err;
6223 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
6224
6225 /**
6226  * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
6227  * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6228  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6229  */
6230 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
6231    /**
6232     * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
6233     * `err` or `result` depending on the state of `result_ok`.
6234     */
6235    union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
6236    /**
6237     * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
6238     */
6239    bool result_ok;
6240 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
6241
6242
6243
6244 /**
6245  * Features used within the channel_type field in an OpenChannel message.
6246  *
6247  * A channel is always of some known \"type\", describing the transaction formats used and the exact
6248  * semantics of our interaction with our peer.
6249  *
6250  * Note that because a channel is a specific type which is proposed by the opener and accepted by
6251  * the counterparty, only required features are allowed here.
6252  *
6253  * This is serialized differently from other feature types - it is not prefixed by a length, and
6254  * thus must only appear inside a TLV where its length is known in advance.
6255  */
6256 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
6257    /**
6258     * A pointer to the opaque Rust object.
6259     * Nearly everywhere, inner must be non-null, however in places where
6260     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6261     */
6262    LDKnativeChannelTypeFeatures *inner;
6263    /**
6264     * Indicates that this is the only struct which contains the same pointer.
6265     * Rust functions which take ownership of an object provided via an argument require
6266     * this to be true and invalidate the object pointed to by inner.
6267     */
6268    bool is_owned;
6269 } LDKChannelTypeFeatures;
6270
6271 /**
6272  * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
6273  */
6274 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
6275    /**
6276     * A pointer to the contents in the success state.
6277     * Reading from this pointer when `result_ok` is not set is undefined.
6278     */
6279    struct LDKChannelTypeFeatures *result;
6280    /**
6281     * A pointer to the contents in the error state.
6282     * Reading from this pointer when `result_ok` is set is undefined.
6283     */
6284    struct LDKDecodeError *err;
6285 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
6286
6287 /**
6288  * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
6289  * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6290  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6291  */
6292 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
6293    /**
6294     * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
6295     * `err` or `result` depending on the state of `result_ok`.
6296     */
6297    union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
6298    /**
6299     * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
6300     */
6301    bool result_ok;
6302 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
6303
6304
6305
6306 /**
6307  * An identifier for an [`Offer`] built using [`DerivedMetadata`].
6308  */
6309 typedef struct MUST_USE_STRUCT LDKOfferId {
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    LDKnativeOfferId *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 } LDKOfferId;
6323
6324 /**
6325  * The contents of CResult_OfferIdDecodeErrorZ
6326  */
6327 typedef union LDKCResult_OfferIdDecodeErrorZPtr {
6328    /**
6329     * A pointer to the contents in the success state.
6330     * Reading from this pointer when `result_ok` is not set is undefined.
6331     */
6332    struct LDKOfferId *result;
6333    /**
6334     * A pointer to the contents in the error state.
6335     * Reading from this pointer when `result_ok` is set is undefined.
6336     */
6337    struct LDKDecodeError *err;
6338 } LDKCResult_OfferIdDecodeErrorZPtr;
6339
6340 /**
6341  * A CResult_OfferIdDecodeErrorZ represents the result of a fallible operation,
6342  * containing a crate::lightning::offers::offer::OfferId on success and a crate::lightning::ln::msgs::DecodeError on failure.
6343  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6344  */
6345 typedef struct LDKCResult_OfferIdDecodeErrorZ {
6346    /**
6347     * The contents of this CResult_OfferIdDecodeErrorZ, accessible via either
6348     * `err` or `result` depending on the state of `result_ok`.
6349     */
6350    union LDKCResult_OfferIdDecodeErrorZPtr contents;
6351    /**
6352     * Whether this CResult_OfferIdDecodeErrorZ represents a success state.
6353     */
6354    bool result_ok;
6355 } LDKCResult_OfferIdDecodeErrorZ;
6356
6357
6358
6359 /**
6360  * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow.
6361  *
6362  * See [module-level documentation] for usage.
6363  *
6364  * [module-level documentation]: self
6365  */
6366 typedef struct MUST_USE_STRUCT LDKInvoiceRequestWithDerivedPayerIdBuilder {
6367    /**
6368     * A pointer to the opaque Rust object.
6369     * Nearly everywhere, inner must be non-null, however in places where
6370     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6371     */
6372    LDKnativeInvoiceRequestWithDerivedPayerIdBuilder *inner;
6373    /**
6374     * Indicates that this is the only struct which contains the same pointer.
6375     * Rust functions which take ownership of an object provided via an argument require
6376     * this to be true and invalidate the object pointed to by inner.
6377     */
6378    bool is_owned;
6379 } LDKInvoiceRequestWithDerivedPayerIdBuilder;
6380
6381 /**
6382  * The contents of CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ
6383  */
6384 typedef union LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr {
6385    /**
6386     * A pointer to the contents in the success state.
6387     * Reading from this pointer when `result_ok` is not set is undefined.
6388     */
6389    struct LDKInvoiceRequestWithDerivedPayerIdBuilder *result;
6390    /**
6391     * A pointer to the contents in the error state.
6392     * Reading from this pointer when `result_ok` is set is undefined.
6393     */
6394    enum LDKBolt12SemanticError *err;
6395 } LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr;
6396
6397 /**
6398  * A CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
6399  * containing a crate::lightning::offers::invoice_request::InvoiceRequestWithDerivedPayerIdBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6400  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6401  */
6402 typedef struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ {
6403    /**
6404     * The contents of this CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ, accessible via either
6405     * `err` or `result` depending on the state of `result_ok`.
6406     */
6407    union LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZPtr contents;
6408    /**
6409     * Whether this CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ represents a success state.
6410     */
6411    bool result_ok;
6412 } LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ;
6413
6414
6415
6416 /**
6417  * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow.
6418  *
6419  * See [module-level documentation] for usage.
6420  *
6421  * [module-level documentation]: self
6422  */
6423 typedef struct MUST_USE_STRUCT LDKInvoiceRequestWithExplicitPayerIdBuilder {
6424    /**
6425     * A pointer to the opaque Rust object.
6426     * Nearly everywhere, inner must be non-null, however in places where
6427     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6428     */
6429    LDKnativeInvoiceRequestWithExplicitPayerIdBuilder *inner;
6430    /**
6431     * Indicates that this is the only struct which contains the same pointer.
6432     * Rust functions which take ownership of an object provided via an argument require
6433     * this to be true and invalidate the object pointed to by inner.
6434     */
6435    bool is_owned;
6436 } LDKInvoiceRequestWithExplicitPayerIdBuilder;
6437
6438 /**
6439  * The contents of CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ
6440  */
6441 typedef union LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr {
6442    /**
6443     * A pointer to the contents in the success state.
6444     * Reading from this pointer when `result_ok` is not set is undefined.
6445     */
6446    struct LDKInvoiceRequestWithExplicitPayerIdBuilder *result;
6447    /**
6448     * A pointer to the contents in the error state.
6449     * Reading from this pointer when `result_ok` is set is undefined.
6450     */
6451    enum LDKBolt12SemanticError *err;
6452 } LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr;
6453
6454 /**
6455  * A CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
6456  * containing a crate::lightning::offers::invoice_request::InvoiceRequestWithExplicitPayerIdBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
6457  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6458  */
6459 typedef struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ {
6460    /**
6461     * The contents of this CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ, accessible via either
6462     * `err` or `result` depending on the state of `result_ok`.
6463     */
6464    union LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZPtr contents;
6465    /**
6466     * Whether this CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ represents a success state.
6467     */
6468    bool result_ok;
6469 } LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ;
6470
6471
6472
6473 /**
6474  * An `Offer` is a potentially long-lived proposal for payment of a good or service.
6475  *
6476  * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
6477  * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient
6478  * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
6479  *
6480  * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
6481  * latter.
6482  *
6483  * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
6484  *
6485  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
6486  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
6487  */
6488 typedef struct MUST_USE_STRUCT LDKOffer {
6489    /**
6490     * A pointer to the opaque Rust object.
6491     * Nearly everywhere, inner must be non-null, however in places where
6492     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6493     */
6494    LDKnativeOffer *inner;
6495    /**
6496     * Indicates that this is the only struct which contains the same pointer.
6497     * Rust functions which take ownership of an object provided via an argument require
6498     * this to be true and invalidate the object pointed to by inner.
6499     */
6500    bool is_owned;
6501 } LDKOffer;
6502
6503 /**
6504  * The contents of CResult_OfferBolt12ParseErrorZ
6505  */
6506 typedef union LDKCResult_OfferBolt12ParseErrorZPtr {
6507    /**
6508     * A pointer to the contents in the success state.
6509     * Reading from this pointer when `result_ok` is not set is undefined.
6510     */
6511    struct LDKOffer *result;
6512    /**
6513     * A pointer to the contents in the error state.
6514     * Reading from this pointer when `result_ok` is set is undefined.
6515     */
6516    struct LDKBolt12ParseError *err;
6517 } LDKCResult_OfferBolt12ParseErrorZPtr;
6518
6519 /**
6520  * A CResult_OfferBolt12ParseErrorZ represents the result of a fallible operation,
6521  * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
6522  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6523  */
6524 typedef struct LDKCResult_OfferBolt12ParseErrorZ {
6525    /**
6526     * The contents of this CResult_OfferBolt12ParseErrorZ, accessible via either
6527     * `err` or `result` depending on the state of `result_ok`.
6528     */
6529    union LDKCResult_OfferBolt12ParseErrorZPtr contents;
6530    /**
6531     * Whether this CResult_OfferBolt12ParseErrorZ represents a success state.
6532     */
6533    bool result_ok;
6534 } LDKCResult_OfferBolt12ParseErrorZ;
6535
6536 /**
6537  * The contents of CResult_NodeIdDecodeErrorZ
6538  */
6539 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
6540    /**
6541     * A pointer to the contents in the success state.
6542     * Reading from this pointer when `result_ok` is not set is undefined.
6543     */
6544    struct LDKNodeId *result;
6545    /**
6546     * A pointer to the contents in the error state.
6547     * Reading from this pointer when `result_ok` is set is undefined.
6548     */
6549    struct LDKDecodeError *err;
6550 } LDKCResult_NodeIdDecodeErrorZPtr;
6551
6552 /**
6553  * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
6554  * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
6555  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6556  */
6557 typedef struct LDKCResult_NodeIdDecodeErrorZ {
6558    /**
6559     * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
6560     * `err` or `result` depending on the state of `result_ok`.
6561     */
6562    union LDKCResult_NodeIdDecodeErrorZPtr contents;
6563    /**
6564     * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
6565     */
6566    bool result_ok;
6567 } LDKCResult_NodeIdDecodeErrorZ;
6568
6569 /**
6570  * The contents of CResult_PublicKeySecp256k1ErrorZ
6571  */
6572 typedef union LDKCResult_PublicKeySecp256k1ErrorZPtr {
6573    /**
6574     * A pointer to the contents in the success state.
6575     * Reading from this pointer when `result_ok` is not set is undefined.
6576     */
6577    struct LDKPublicKey *result;
6578    /**
6579     * A pointer to the contents in the error state.
6580     * Reading from this pointer when `result_ok` is set is undefined.
6581     */
6582    enum LDKSecp256k1Error *err;
6583 } LDKCResult_PublicKeySecp256k1ErrorZPtr;
6584
6585 /**
6586  * A CResult_PublicKeySecp256k1ErrorZ represents the result of a fallible operation,
6587  * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
6588  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6589  */
6590 typedef struct LDKCResult_PublicKeySecp256k1ErrorZ {
6591    /**
6592     * The contents of this CResult_PublicKeySecp256k1ErrorZ, accessible via either
6593     * `err` or `result` depending on the state of `result_ok`.
6594     */
6595    union LDKCResult_PublicKeySecp256k1ErrorZPtr contents;
6596    /**
6597     * Whether this CResult_PublicKeySecp256k1ErrorZ represents a success state.
6598     */
6599    bool result_ok;
6600 } LDKCResult_PublicKeySecp256k1ErrorZ;
6601
6602
6603
6604 /**
6605  * A [`channel_update`] message to be sent to or received from a peer.
6606  *
6607  * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
6608  */
6609 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
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    LDKnativeChannelUpdate *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 } LDKChannelUpdate;
6623
6624 /**
6625  * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
6626  * return packet by a node along the route. See [BOLT #4] for details.
6627  *
6628  * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
6629  */
6630 typedef enum LDKNetworkUpdate_Tag {
6631    /**
6632     * An error indicating a `channel_update` messages should be applied via
6633     * [`NetworkGraph::update_channel`].
6634     */
6635    LDKNetworkUpdate_ChannelUpdateMessage,
6636    /**
6637     * An error indicating that a channel failed to route a payment, which should be applied via
6638     * [`NetworkGraph::channel_failed_permanent`] if permanent.
6639     */
6640    LDKNetworkUpdate_ChannelFailure,
6641    /**
6642     * An error indicating that a node failed to route a payment, which should be applied via
6643     * [`NetworkGraph::node_failed_permanent`] if permanent.
6644     */
6645    LDKNetworkUpdate_NodeFailure,
6646    /**
6647     * Must be last for serialization purposes
6648     */
6649    LDKNetworkUpdate_Sentinel,
6650 } LDKNetworkUpdate_Tag;
6651
6652 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
6653    /**
6654     * The update to apply via [`NetworkGraph::update_channel`].
6655     */
6656    struct LDKChannelUpdate msg;
6657 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
6658
6659 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
6660    /**
6661     * The short channel id of the closed channel.
6662     */
6663    uint64_t short_channel_id;
6664    /**
6665     * Whether the channel should be permanently removed or temporarily disabled until a new
6666     * `channel_update` message is received.
6667     */
6668    bool is_permanent;
6669 } LDKNetworkUpdate_LDKChannelFailure_Body;
6670
6671 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
6672    /**
6673     * The node id of the failed node.
6674     */
6675    struct LDKPublicKey node_id;
6676    /**
6677     * Whether the node should be permanently removed from consideration or can be restored
6678     * when a new `channel_update` message is received.
6679     */
6680    bool is_permanent;
6681 } LDKNetworkUpdate_LDKNodeFailure_Body;
6682
6683 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
6684    LDKNetworkUpdate_Tag tag;
6685    union {
6686       LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
6687       LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
6688       LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
6689    };
6690 } LDKNetworkUpdate;
6691
6692 /**
6693  * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
6694  */
6695 typedef enum LDKCOption_NetworkUpdateZ_Tag {
6696    /**
6697     * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
6698     */
6699    LDKCOption_NetworkUpdateZ_Some,
6700    /**
6701     * When we're in this state, this COption_NetworkUpdateZ contains nothing
6702     */
6703    LDKCOption_NetworkUpdateZ_None,
6704    /**
6705     * Must be last for serialization purposes
6706     */
6707    LDKCOption_NetworkUpdateZ_Sentinel,
6708 } LDKCOption_NetworkUpdateZ_Tag;
6709
6710 typedef struct LDKCOption_NetworkUpdateZ {
6711    LDKCOption_NetworkUpdateZ_Tag tag;
6712    union {
6713       struct {
6714          struct LDKNetworkUpdate some;
6715       };
6716    };
6717 } LDKCOption_NetworkUpdateZ;
6718
6719 /**
6720  * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
6721  */
6722 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
6723    /**
6724     * A pointer to the contents in the success state.
6725     * Reading from this pointer when `result_ok` is not set is undefined.
6726     */
6727    struct LDKCOption_NetworkUpdateZ *result;
6728    /**
6729     * A pointer to the contents in the error state.
6730     * Reading from this pointer when `result_ok` is set is undefined.
6731     */
6732    struct LDKDecodeError *err;
6733 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
6734
6735 /**
6736  * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
6737  * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6738  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6739  */
6740 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
6741    /**
6742     * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
6743     * `err` or `result` depending on the state of `result_ok`.
6744     */
6745    union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
6746    /**
6747     * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
6748     */
6749    bool result_ok;
6750 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
6751
6752 /**
6753  * The contents of CResult_TxOutUtxoLookupErrorZ
6754  */
6755 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
6756    /**
6757     * A pointer to the contents in the success state.
6758     * Reading from this pointer when `result_ok` is not set is undefined.
6759     */
6760    struct LDKTxOut *result;
6761    /**
6762     * A pointer to the contents in the error state.
6763     * Reading from this pointer when `result_ok` is set is undefined.
6764     */
6765    enum LDKUtxoLookupError *err;
6766 } LDKCResult_TxOutUtxoLookupErrorZPtr;
6767
6768 /**
6769  * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
6770  * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
6771  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6772  */
6773 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
6774    /**
6775     * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
6776     * `err` or `result` depending on the state of `result_ok`.
6777     */
6778    union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
6779    /**
6780     * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
6781     */
6782    bool result_ok;
6783 } LDKCResult_TxOutUtxoLookupErrorZ;
6784
6785
6786
6787 /**
6788  * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
6789  *
6790  * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
6791  */
6792 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
6793    /**
6794     * A pointer to the opaque Rust object.
6795     * Nearly everywhere, inner must be non-null, however in places where
6796     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6797     */
6798    LDKnativeUtxoFuture *inner;
6799    /**
6800     * Indicates that this is the only struct which contains the same pointer.
6801     * Rust functions which take ownership of an object provided via an argument require
6802     * this to be true and invalidate the object pointed to by inner.
6803     */
6804    bool is_owned;
6805 } LDKUtxoFuture;
6806
6807 /**
6808  * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
6809  * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
6810  * variant.
6811  */
6812 typedef enum LDKUtxoResult_Tag {
6813    /**
6814     * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
6815     * requested or a [`UtxoLookupError`].
6816     */
6817    LDKUtxoResult_Sync,
6818    /**
6819     * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
6820     * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
6821     *
6822     * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
6823     * but only fairly loosely. Because a pending checks block all message processing, leaving
6824     * checks pending for an extended time may cause DoS of other functions. It is recommended you
6825     * keep a tight timeout on lookups, on the order of a few seconds.
6826     */
6827    LDKUtxoResult_Async,
6828    /**
6829     * Must be last for serialization purposes
6830     */
6831    LDKUtxoResult_Sentinel,
6832 } LDKUtxoResult_Tag;
6833
6834 typedef struct MUST_USE_STRUCT LDKUtxoResult {
6835    LDKUtxoResult_Tag tag;
6836    union {
6837       struct {
6838          struct LDKCResult_TxOutUtxoLookupErrorZ sync;
6839       };
6840       struct {
6841          struct LDKUtxoFuture async;
6842       };
6843    };
6844 } LDKUtxoResult;
6845
6846 /**
6847  * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
6848  */
6849 typedef struct LDKUtxoLookup {
6850    /**
6851     * An opaque pointer which is passed to your function implementations as an argument.
6852     * This has no meaning in the LDK, and can be NULL or any other value.
6853     */
6854    void *this_arg;
6855    /**
6856     * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
6857     * Returns an error if `chain_hash` is for a different chain or if such a transaction output is
6858     * unknown.
6859     *
6860     * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
6861     */
6862    struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*chain_hash)[32], uint64_t short_channel_id);
6863    /**
6864     * Frees any resources associated with this object given its this_arg pointer.
6865     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6866     */
6867    void (*free)(void *this_arg);
6868 } LDKUtxoLookup;
6869
6870 /**
6871  * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
6872  */
6873 typedef enum LDKCOption_UtxoLookupZ_Tag {
6874    /**
6875     * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
6876     */
6877    LDKCOption_UtxoLookupZ_Some,
6878    /**
6879     * When we're in this state, this COption_UtxoLookupZ contains nothing
6880     */
6881    LDKCOption_UtxoLookupZ_None,
6882    /**
6883     * Must be last for serialization purposes
6884     */
6885    LDKCOption_UtxoLookupZ_Sentinel,
6886 } LDKCOption_UtxoLookupZ_Tag;
6887
6888 typedef struct LDKCOption_UtxoLookupZ {
6889    LDKCOption_UtxoLookupZ_Tag tag;
6890    union {
6891       struct {
6892          struct LDKUtxoLookup some;
6893       };
6894    };
6895 } LDKCOption_UtxoLookupZ;
6896
6897 /**
6898  * The contents of CResult_NoneLightningErrorZ
6899  */
6900 typedef union LDKCResult_NoneLightningErrorZPtr {
6901    /**
6902     * Note that this value is always NULL, as there are no contents in the OK variant
6903     */
6904    void *result;
6905    /**
6906     * A pointer to the contents in the error state.
6907     * Reading from this pointer when `result_ok` is set is undefined.
6908     */
6909    struct LDKLightningError *err;
6910 } LDKCResult_NoneLightningErrorZPtr;
6911
6912 /**
6913  * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
6914  * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
6915  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6916  */
6917 typedef struct LDKCResult_NoneLightningErrorZ {
6918    /**
6919     * The contents of this CResult_NoneLightningErrorZ, accessible via either
6920     * `err` or `result` depending on the state of `result_ok`.
6921     */
6922    union LDKCResult_NoneLightningErrorZPtr contents;
6923    /**
6924     * Whether this CResult_NoneLightningErrorZ represents a success state.
6925     */
6926    bool result_ok;
6927 } LDKCResult_NoneLightningErrorZ;
6928
6929 /**
6930  * The contents of CResult_boolLightningErrorZ
6931  */
6932 typedef union LDKCResult_boolLightningErrorZPtr {
6933    /**
6934     * A pointer to the contents in the success state.
6935     * Reading from this pointer when `result_ok` is not set is undefined.
6936     */
6937    bool *result;
6938    /**
6939     * A pointer to the contents in the error state.
6940     * Reading from this pointer when `result_ok` is set is undefined.
6941     */
6942    struct LDKLightningError *err;
6943 } LDKCResult_boolLightningErrorZPtr;
6944
6945 /**
6946  * A CResult_boolLightningErrorZ represents the result of a fallible operation,
6947  * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
6948  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6949  */
6950 typedef struct LDKCResult_boolLightningErrorZ {
6951    /**
6952     * The contents of this CResult_boolLightningErrorZ, accessible via either
6953     * `err` or `result` depending on the state of `result_ok`.
6954     */
6955    union LDKCResult_boolLightningErrorZPtr contents;
6956    /**
6957     * Whether this CResult_boolLightningErrorZ represents a success state.
6958     */
6959    bool result_ok;
6960 } LDKCResult_boolLightningErrorZ;
6961
6962
6963
6964 /**
6965  * A [`channel_announcement`] message to be sent to or received from a peer.
6966  *
6967  * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
6968  */
6969 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
6970    /**
6971     * A pointer to the opaque Rust object.
6972     * Nearly everywhere, inner must be non-null, however in places where
6973     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6974     */
6975    LDKnativeChannelAnnouncement *inner;
6976    /**
6977     * Indicates that this is the only struct which contains the same pointer.
6978     * Rust functions which take ownership of an object provided via an argument require
6979     * this to be true and invalidate the object pointed to by inner.
6980     */
6981    bool is_owned;
6982 } LDKChannelAnnouncement;
6983
6984 /**
6985  * A tuple of 3 elements. See the individual fields for the types contained.
6986  */
6987 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
6988    /**
6989     * The element at position 0
6990     */
6991    struct LDKChannelAnnouncement a;
6992    /**
6993     * The element at position 1
6994     */
6995    struct LDKChannelUpdate b;
6996    /**
6997     * The element at position 2
6998     */
6999    struct LDKChannelUpdate c;
7000 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
7001
7002 /**
7003  * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
7004  */
7005 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
7006    /**
7007     * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
7008     */
7009    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
7010    /**
7011     * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
7012     */
7013    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
7014    /**
7015     * Must be last for serialization purposes
7016     */
7017    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
7018 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
7019
7020 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
7021    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
7022    union {
7023       struct {
7024          struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
7025       };
7026    };
7027 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
7028
7029
7030
7031 /**
7032  * An [`accept_channel`] message to be sent to or received from a peer.
7033  *
7034  * Used in V1 channel establishment
7035  *
7036  * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
7037  */
7038 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
7039    /**
7040     * A pointer to the opaque Rust object.
7041     * Nearly everywhere, inner must be non-null, however in places where
7042     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7043     */
7044    LDKnativeAcceptChannel *inner;
7045    /**
7046     * Indicates that this is the only struct which contains the same pointer.
7047     * Rust functions which take ownership of an object provided via an argument require
7048     * this to be true and invalidate the object pointed to by inner.
7049     */
7050    bool is_owned;
7051 } LDKAcceptChannel;
7052
7053
7054
7055 /**
7056  * An accept_channel2 message to be sent by or received from the channel accepter.
7057  *
7058  * Used in V2 channel establishment
7059  *
7060  */
7061 typedef struct MUST_USE_STRUCT LDKAcceptChannelV2 {
7062    /**
7063     * A pointer to the opaque Rust object.
7064     * Nearly everywhere, inner must be non-null, however in places where
7065     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7066     */
7067    LDKnativeAcceptChannelV2 *inner;
7068    /**
7069     * Indicates that this is the only struct which contains the same pointer.
7070     * Rust functions which take ownership of an object provided via an argument require
7071     * this to be true and invalidate the object pointed to by inner.
7072     */
7073    bool is_owned;
7074 } LDKAcceptChannelV2;
7075
7076
7077
7078 /**
7079  * An [`open_channel`] message to be sent to or received from a peer.
7080  *
7081  * Used in V1 channel establishment
7082  *
7083  * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
7084  */
7085 typedef struct MUST_USE_STRUCT LDKOpenChannel {
7086    /**
7087     * A pointer to the opaque Rust object.
7088     * Nearly everywhere, inner must be non-null, however in places where
7089     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7090     */
7091    LDKnativeOpenChannel *inner;
7092    /**
7093     * Indicates that this is the only struct which contains the same pointer.
7094     * Rust functions which take ownership of an object provided via an argument require
7095     * this to be true and invalidate the object pointed to by inner.
7096     */
7097    bool is_owned;
7098 } LDKOpenChannel;
7099
7100
7101
7102 /**
7103  * An open_channel2 message to be sent by or received from the channel initiator.
7104  *
7105  * Used in V2 channel establishment
7106  *
7107  */
7108 typedef struct MUST_USE_STRUCT LDKOpenChannelV2 {
7109    /**
7110     * A pointer to the opaque Rust object.
7111     * Nearly everywhere, inner must be non-null, however in places where
7112     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7113     */
7114    LDKnativeOpenChannelV2 *inner;
7115    /**
7116     * Indicates that this is the only struct which contains the same pointer.
7117     * Rust functions which take ownership of an object provided via an argument require
7118     * this to be true and invalidate the object pointed to by inner.
7119     */
7120    bool is_owned;
7121 } LDKOpenChannelV2;
7122
7123
7124
7125 /**
7126  * A [`funding_created`] message to be sent to or received from a peer.
7127  *
7128  * Used in V1 channel establishment
7129  *
7130  * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
7131  */
7132 typedef struct MUST_USE_STRUCT LDKFundingCreated {
7133    /**
7134     * A pointer to the opaque Rust object.
7135     * Nearly everywhere, inner must be non-null, however in places where
7136     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7137     */
7138    LDKnativeFundingCreated *inner;
7139    /**
7140     * Indicates that this is the only struct which contains the same pointer.
7141     * Rust functions which take ownership of an object provided via an argument require
7142     * this to be true and invalidate the object pointed to by inner.
7143     */
7144    bool is_owned;
7145 } LDKFundingCreated;
7146
7147
7148
7149 /**
7150  * A [`funding_signed`] message to be sent to or received from a peer.
7151  *
7152  * Used in V1 channel establishment
7153  *
7154  * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
7155  */
7156 typedef struct MUST_USE_STRUCT LDKFundingSigned {
7157    /**
7158     * A pointer to the opaque Rust object.
7159     * Nearly everywhere, inner must be non-null, however in places where
7160     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7161     */
7162    LDKnativeFundingSigned *inner;
7163    /**
7164     * Indicates that this is the only struct which contains the same pointer.
7165     * Rust functions which take ownership of an object provided via an argument require
7166     * this to be true and invalidate the object pointed to by inner.
7167     */
7168    bool is_owned;
7169 } LDKFundingSigned;
7170
7171
7172
7173 /**
7174  * An stfu (quiescence) message to be sent by or received from the stfu initiator.
7175  */
7176 typedef struct MUST_USE_STRUCT LDKStfu {
7177    /**
7178     * A pointer to the opaque Rust object.
7179     * Nearly everywhere, inner must be non-null, however in places where
7180     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7181     */
7182    LDKnativeStfu *inner;
7183    /**
7184     * Indicates that this is the only struct which contains the same pointer.
7185     * Rust functions which take ownership of an object provided via an argument require
7186     * this to be true and invalidate the object pointed to by inner.
7187     */
7188    bool is_owned;
7189 } LDKStfu;
7190
7191
7192
7193 /**
7194  * A splice message to be sent by or received from the stfu initiator (splice initiator).
7195  */
7196 typedef struct MUST_USE_STRUCT LDKSplice {
7197    /**
7198     * A pointer to the opaque Rust object.
7199     * Nearly everywhere, inner must be non-null, however in places where
7200     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7201     */
7202    LDKnativeSplice *inner;
7203    /**
7204     * Indicates that this is the only struct which contains the same pointer.
7205     * Rust functions which take ownership of an object provided via an argument require
7206     * this to be true and invalidate the object pointed to by inner.
7207     */
7208    bool is_owned;
7209 } LDKSplice;
7210
7211
7212
7213 /**
7214  * A splice_ack message to be received by or sent to the splice initiator.
7215  *
7216  */
7217 typedef struct MUST_USE_STRUCT LDKSpliceAck {
7218    /**
7219     * A pointer to the opaque Rust object.
7220     * Nearly everywhere, inner must be non-null, however in places where
7221     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7222     */
7223    LDKnativeSpliceAck *inner;
7224    /**
7225     * Indicates that this is the only struct which contains the same pointer.
7226     * Rust functions which take ownership of an object provided via an argument require
7227     * this to be true and invalidate the object pointed to by inner.
7228     */
7229    bool is_owned;
7230 } LDKSpliceAck;
7231
7232
7233
7234 /**
7235  * A splice_locked message to be sent to or received from a peer.
7236  *
7237  */
7238 typedef struct MUST_USE_STRUCT LDKSpliceLocked {
7239    /**
7240     * A pointer to the opaque Rust object.
7241     * Nearly everywhere, inner must be non-null, however in places where
7242     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7243     */
7244    LDKnativeSpliceLocked *inner;
7245    /**
7246     * Indicates that this is the only struct which contains the same pointer.
7247     * Rust functions which take ownership of an object provided via an argument require
7248     * this to be true and invalidate the object pointed to by inner.
7249     */
7250    bool is_owned;
7251 } LDKSpliceLocked;
7252
7253
7254
7255 /**
7256  * A tx_add_input message for adding an input during interactive transaction construction
7257  *
7258  */
7259 typedef struct MUST_USE_STRUCT LDKTxAddInput {
7260    /**
7261     * A pointer to the opaque Rust object.
7262     * Nearly everywhere, inner must be non-null, however in places where
7263     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7264     */
7265    LDKnativeTxAddInput *inner;
7266    /**
7267     * Indicates that this is the only struct which contains the same pointer.
7268     * Rust functions which take ownership of an object provided via an argument require
7269     * this to be true and invalidate the object pointed to by inner.
7270     */
7271    bool is_owned;
7272 } LDKTxAddInput;
7273
7274
7275
7276 /**
7277  * A tx_add_output message for adding an output during interactive transaction construction.
7278  *
7279  */
7280 typedef struct MUST_USE_STRUCT LDKTxAddOutput {
7281    /**
7282     * A pointer to the opaque Rust object.
7283     * Nearly everywhere, inner must be non-null, however in places where
7284     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7285     */
7286    LDKnativeTxAddOutput *inner;
7287    /**
7288     * Indicates that this is the only struct which contains the same pointer.
7289     * Rust functions which take ownership of an object provided via an argument require
7290     * this to be true and invalidate the object pointed to by inner.
7291     */
7292    bool is_owned;
7293 } LDKTxAddOutput;
7294
7295
7296
7297 /**
7298  * A tx_remove_input message for removing an input during interactive transaction construction.
7299  *
7300  */
7301 typedef struct MUST_USE_STRUCT LDKTxRemoveInput {
7302    /**
7303     * A pointer to the opaque Rust object.
7304     * Nearly everywhere, inner must be non-null, however in places where
7305     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7306     */
7307    LDKnativeTxRemoveInput *inner;
7308    /**
7309     * Indicates that this is the only struct which contains the same pointer.
7310     * Rust functions which take ownership of an object provided via an argument require
7311     * this to be true and invalidate the object pointed to by inner.
7312     */
7313    bool is_owned;
7314 } LDKTxRemoveInput;
7315
7316
7317
7318 /**
7319  * A tx_remove_output message for removing an output during interactive transaction construction.
7320  *
7321  */
7322 typedef struct MUST_USE_STRUCT LDKTxRemoveOutput {
7323    /**
7324     * A pointer to the opaque Rust object.
7325     * Nearly everywhere, inner must be non-null, however in places where
7326     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7327     */
7328    LDKnativeTxRemoveOutput *inner;
7329    /**
7330     * Indicates that this is the only struct which contains the same pointer.
7331     * Rust functions which take ownership of an object provided via an argument require
7332     * this to be true and invalidate the object pointed to by inner.
7333     */
7334    bool is_owned;
7335 } LDKTxRemoveOutput;
7336
7337
7338
7339 /**
7340  * A tx_complete message signalling the conclusion of a peer's transaction contributions during
7341  * interactive transaction construction.
7342  *
7343  */
7344 typedef struct MUST_USE_STRUCT LDKTxComplete {
7345    /**
7346     * A pointer to the opaque Rust object.
7347     * Nearly everywhere, inner must be non-null, however in places where
7348     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7349     */
7350    LDKnativeTxComplete *inner;
7351    /**
7352     * Indicates that this is the only struct which contains the same pointer.
7353     * Rust functions which take ownership of an object provided via an argument require
7354     * this to be true and invalidate the object pointed to by inner.
7355     */
7356    bool is_owned;
7357 } LDKTxComplete;
7358
7359
7360
7361 /**
7362  * A tx_signatures message containing the sender's signatures for a transaction constructed with
7363  * interactive transaction construction.
7364  *
7365  */
7366 typedef struct MUST_USE_STRUCT LDKTxSignatures {
7367    /**
7368     * A pointer to the opaque Rust object.
7369     * Nearly everywhere, inner must be non-null, however in places where
7370     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7371     */
7372    LDKnativeTxSignatures *inner;
7373    /**
7374     * Indicates that this is the only struct which contains the same pointer.
7375     * Rust functions which take ownership of an object provided via an argument require
7376     * this to be true and invalidate the object pointed to by inner.
7377     */
7378    bool is_owned;
7379 } LDKTxSignatures;
7380
7381
7382
7383 /**
7384  * A tx_init_rbf message which initiates a replacement of the transaction after it's been
7385  * completed.
7386  *
7387  */
7388 typedef struct MUST_USE_STRUCT LDKTxInitRbf {
7389    /**
7390     * A pointer to the opaque Rust object.
7391     * Nearly everywhere, inner must be non-null, however in places where
7392     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7393     */
7394    LDKnativeTxInitRbf *inner;
7395    /**
7396     * Indicates that this is the only struct which contains the same pointer.
7397     * Rust functions which take ownership of an object provided via an argument require
7398     * this to be true and invalidate the object pointed to by inner.
7399     */
7400    bool is_owned;
7401 } LDKTxInitRbf;
7402
7403
7404
7405 /**
7406  * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
7407  * completed.
7408  *
7409  */
7410 typedef struct MUST_USE_STRUCT LDKTxAckRbf {
7411    /**
7412     * A pointer to the opaque Rust object.
7413     * Nearly everywhere, inner must be non-null, however in places where
7414     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7415     */
7416    LDKnativeTxAckRbf *inner;
7417    /**
7418     * Indicates that this is the only struct which contains the same pointer.
7419     * Rust functions which take ownership of an object provided via an argument require
7420     * this to be true and invalidate the object pointed to by inner.
7421     */
7422    bool is_owned;
7423 } LDKTxAckRbf;
7424
7425
7426
7427 /**
7428  * A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
7429  *
7430  */
7431 typedef struct MUST_USE_STRUCT LDKTxAbort {
7432    /**
7433     * A pointer to the opaque Rust object.
7434     * Nearly everywhere, inner must be non-null, however in places where
7435     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7436     */
7437    LDKnativeTxAbort *inner;
7438    /**
7439     * Indicates that this is the only struct which contains the same pointer.
7440     * Rust functions which take ownership of an object provided via an argument require
7441     * this to be true and invalidate the object pointed to by inner.
7442     */
7443    bool is_owned;
7444 } LDKTxAbort;
7445
7446
7447
7448 /**
7449  * A [`channel_ready`] message to be sent to or received from a peer.
7450  *
7451  * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
7452  */
7453 typedef struct MUST_USE_STRUCT LDKChannelReady {
7454    /**
7455     * A pointer to the opaque Rust object.
7456     * Nearly everywhere, inner must be non-null, however in places where
7457     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7458     */
7459    LDKnativeChannelReady *inner;
7460    /**
7461     * Indicates that this is the only struct which contains the same pointer.
7462     * Rust functions which take ownership of an object provided via an argument require
7463     * this to be true and invalidate the object pointed to by inner.
7464     */
7465    bool is_owned;
7466 } LDKChannelReady;
7467
7468
7469
7470 /**
7471  * An [`announcement_signatures`] message to be sent to or received from a peer.
7472  *
7473  * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
7474  */
7475 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
7476    /**
7477     * A pointer to the opaque Rust object.
7478     * Nearly everywhere, inner must be non-null, however in places where
7479     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7480     */
7481    LDKnativeAnnouncementSignatures *inner;
7482    /**
7483     * Indicates that this is the only struct which contains the same pointer.
7484     * Rust functions which take ownership of an object provided via an argument require
7485     * this to be true and invalidate the object pointed to by inner.
7486     */
7487    bool is_owned;
7488 } LDKAnnouncementSignatures;
7489
7490
7491
7492 /**
7493  * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
7494  * transaction updates if they were pending.
7495  */
7496 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
7497    /**
7498     * A pointer to the opaque Rust object.
7499     * Nearly everywhere, inner must be non-null, however in places where
7500     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7501     */
7502    LDKnativeCommitmentUpdate *inner;
7503    /**
7504     * Indicates that this is the only struct which contains the same pointer.
7505     * Rust functions which take ownership of an object provided via an argument require
7506     * this to be true and invalidate the object pointed to by inner.
7507     */
7508    bool is_owned;
7509 } LDKCommitmentUpdate;
7510
7511
7512
7513 /**
7514  * A [`revoke_and_ack`] message to be sent to or received from a peer.
7515  *
7516  * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
7517  */
7518 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
7519    /**
7520     * A pointer to the opaque Rust object.
7521     * Nearly everywhere, inner must be non-null, however in places where
7522     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7523     */
7524    LDKnativeRevokeAndACK *inner;
7525    /**
7526     * Indicates that this is the only struct which contains the same pointer.
7527     * Rust functions which take ownership of an object provided via an argument require
7528     * this to be true and invalidate the object pointed to by inner.
7529     */
7530    bool is_owned;
7531 } LDKRevokeAndACK;
7532
7533
7534
7535 /**
7536  * A [`closing_signed`] message to be sent to or received from a peer.
7537  *
7538  * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
7539  */
7540 typedef struct MUST_USE_STRUCT LDKClosingSigned {
7541    /**
7542     * A pointer to the opaque Rust object.
7543     * Nearly everywhere, inner must be non-null, however in places where
7544     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7545     */
7546    LDKnativeClosingSigned *inner;
7547    /**
7548     * Indicates that this is the only struct which contains the same pointer.
7549     * Rust functions which take ownership of an object provided via an argument require
7550     * this to be true and invalidate the object pointed to by inner.
7551     */
7552    bool is_owned;
7553 } LDKClosingSigned;
7554
7555
7556
7557 /**
7558  * A [`shutdown`] message to be sent to or received from a peer.
7559  *
7560  * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
7561  */
7562 typedef struct MUST_USE_STRUCT LDKShutdown {
7563    /**
7564     * A pointer to the opaque Rust object.
7565     * Nearly everywhere, inner must be non-null, however in places where
7566     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7567     */
7568    LDKnativeShutdown *inner;
7569    /**
7570     * Indicates that this is the only struct which contains the same pointer.
7571     * Rust functions which take ownership of an object provided via an argument require
7572     * this to be true and invalidate the object pointed to by inner.
7573     */
7574    bool is_owned;
7575 } LDKShutdown;
7576
7577
7578
7579 /**
7580  * A [`channel_reestablish`] message to be sent to or received from a peer.
7581  *
7582  * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
7583  */
7584 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
7585    /**
7586     * A pointer to the opaque Rust object.
7587     * Nearly everywhere, inner must be non-null, however in places where
7588     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7589     */
7590    LDKnativeChannelReestablish *inner;
7591    /**
7592     * Indicates that this is the only struct which contains the same pointer.
7593     * Rust functions which take ownership of an object provided via an argument require
7594     * this to be true and invalidate the object pointed to by inner.
7595     */
7596    bool is_owned;
7597 } LDKChannelReestablish;
7598
7599
7600
7601 /**
7602  * A [`node_announcement`] message to be sent to or received from a peer.
7603  *
7604  * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
7605  */
7606 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
7607    /**
7608     * A pointer to the opaque Rust object.
7609     * Nearly everywhere, inner must be non-null, however in places where
7610     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7611     */
7612    LDKnativeNodeAnnouncement *inner;
7613    /**
7614     * Indicates that this is the only struct which contains the same pointer.
7615     * Rust functions which take ownership of an object provided via an argument require
7616     * this to be true and invalidate the object pointed to by inner.
7617     */
7618    bool is_owned;
7619 } LDKNodeAnnouncement;
7620
7621
7622
7623 /**
7624  * An [`error`] message to be sent to or received from a peer.
7625  *
7626  * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
7627  */
7628 typedef struct MUST_USE_STRUCT LDKErrorMessage {
7629    /**
7630     * A pointer to the opaque Rust object.
7631     * Nearly everywhere, inner must be non-null, however in places where
7632     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7633     */
7634    LDKnativeErrorMessage *inner;
7635    /**
7636     * Indicates that this is the only struct which contains the same pointer.
7637     * Rust functions which take ownership of an object provided via an argument require
7638     * this to be true and invalidate the object pointed to by inner.
7639     */
7640    bool is_owned;
7641 } LDKErrorMessage;
7642
7643
7644
7645 /**
7646  * A [`warning`] message to be sent to or received from a peer.
7647  *
7648  * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
7649  */
7650 typedef struct MUST_USE_STRUCT LDKWarningMessage {
7651    /**
7652     * A pointer to the opaque Rust object.
7653     * Nearly everywhere, inner must be non-null, however in places where
7654     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7655     */
7656    LDKnativeWarningMessage *inner;
7657    /**
7658     * Indicates that this is the only struct which contains the same pointer.
7659     * Rust functions which take ownership of an object provided via an argument require
7660     * this to be true and invalidate the object pointed to by inner.
7661     */
7662    bool is_owned;
7663 } LDKWarningMessage;
7664
7665 /**
7666  * Used to put an error message in a [`LightningError`].
7667  */
7668 typedef enum LDKErrorAction_Tag {
7669    /**
7670     * The peer took some action which made us think they were useless. Disconnect them.
7671     */
7672    LDKErrorAction_DisconnectPeer,
7673    /**
7674     * The peer did something incorrect. Tell them without closing any channels and disconnect them.
7675     */
7676    LDKErrorAction_DisconnectPeerWithWarning,
7677    /**
7678     * The peer did something harmless that we weren't able to process, just log and ignore
7679     */
7680    LDKErrorAction_IgnoreError,
7681    /**
7682     * The peer did something harmless that we weren't able to meaningfully process.
7683     * If the error is logged, log it at the given level.
7684     */
7685    LDKErrorAction_IgnoreAndLog,
7686    /**
7687     * The peer provided us with a gossip message which we'd already seen. In most cases this
7688     * should be ignored, but it may result in the message being forwarded if it is a duplicate of
7689     * our own channel announcements.
7690     */
7691    LDKErrorAction_IgnoreDuplicateGossip,
7692    /**
7693     * The peer did something incorrect. Tell them.
7694     */
7695    LDKErrorAction_SendErrorMessage,
7696    /**
7697     * The peer did something incorrect. Tell them without closing any channels.
7698     */
7699    LDKErrorAction_SendWarningMessage,
7700    /**
7701     * Must be last for serialization purposes
7702     */
7703    LDKErrorAction_Sentinel,
7704 } LDKErrorAction_Tag;
7705
7706 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
7707    /**
7708     * An error message which we should make an effort to send before we disconnect.
7709     *
7710     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7711     */
7712    struct LDKErrorMessage msg;
7713 } LDKErrorAction_LDKDisconnectPeer_Body;
7714
7715 typedef struct LDKErrorAction_LDKDisconnectPeerWithWarning_Body {
7716    /**
7717     * A warning message which we should make an effort to send before we disconnect.
7718     */
7719    struct LDKWarningMessage msg;
7720 } LDKErrorAction_LDKDisconnectPeerWithWarning_Body;
7721
7722 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
7723    /**
7724     * The message to send.
7725     */
7726    struct LDKErrorMessage msg;
7727 } LDKErrorAction_LDKSendErrorMessage_Body;
7728
7729 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
7730    /**
7731     * The message to send.
7732     */
7733    struct LDKWarningMessage msg;
7734    /**
7735     * The peer may have done something harmless that we weren't able to meaningfully process,
7736     * though we should still tell them about it.
7737     * If this event is logged, log it at the given level.
7738     */
7739    enum LDKLevel log_level;
7740 } LDKErrorAction_LDKSendWarningMessage_Body;
7741
7742 typedef struct MUST_USE_STRUCT LDKErrorAction {
7743    LDKErrorAction_Tag tag;
7744    union {
7745       LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
7746       LDKErrorAction_LDKDisconnectPeerWithWarning_Body disconnect_peer_with_warning;
7747       struct {
7748          enum LDKLevel ignore_and_log;
7749       };
7750       LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
7751       LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
7752    };
7753 } LDKErrorAction;
7754
7755
7756
7757 /**
7758  * A [`query_channel_range`] message is used to query a peer for channel
7759  * UTXOs in a range of blocks. The recipient of a query makes a best
7760  * effort to reply to the query using one or more [`ReplyChannelRange`]
7761  * messages.
7762  *
7763  * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
7764  */
7765 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
7766    /**
7767     * A pointer to the opaque Rust object.
7768     * Nearly everywhere, inner must be non-null, however in places where
7769     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7770     */
7771    LDKnativeQueryChannelRange *inner;
7772    /**
7773     * Indicates that this is the only struct which contains the same pointer.
7774     * Rust functions which take ownership of an object provided via an argument require
7775     * this to be true and invalidate the object pointed to by inner.
7776     */
7777    bool is_owned;
7778 } LDKQueryChannelRange;
7779
7780
7781
7782 /**
7783  * A [`query_short_channel_ids`] message is used to query a peer for
7784  * routing gossip messages related to one or more `short_channel_id`s.
7785  *
7786  * The query recipient will reply with the latest, if available,
7787  * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
7788  * it maintains for the requested `short_channel_id`s followed by a
7789  * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
7790  * this query are encoded. We only support `encoding_type=0` uncompressed
7791  * serialization and do not support `encoding_type=1` zlib serialization.
7792  *
7793  * [`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
7794  */
7795 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
7796    /**
7797     * A pointer to the opaque Rust object.
7798     * Nearly everywhere, inner must be non-null, however in places where
7799     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7800     */
7801    LDKnativeQueryShortChannelIds *inner;
7802    /**
7803     * Indicates that this is the only struct which contains the same pointer.
7804     * Rust functions which take ownership of an object provided via an argument require
7805     * this to be true and invalidate the object pointed to by inner.
7806     */
7807    bool is_owned;
7808 } LDKQueryShortChannelIds;
7809
7810
7811
7812 /**
7813  * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
7814  * message.
7815  *
7816  * Multiple `reply_channel_range` messages can be sent in reply
7817  * to a single [`QueryChannelRange`] message. The query recipient makes a
7818  * best effort to respond based on their local network view which may
7819  * not be a perfect view of the network. The `short_channel_id`s in the
7820  * reply are encoded. We only support `encoding_type=0` uncompressed
7821  * serialization and do not support `encoding_type=1` zlib serialization.
7822  *
7823  * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
7824  */
7825 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
7826    /**
7827     * A pointer to the opaque Rust object.
7828     * Nearly everywhere, inner must be non-null, however in places where
7829     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7830     */
7831    LDKnativeReplyChannelRange *inner;
7832    /**
7833     * Indicates that this is the only struct which contains the same pointer.
7834     * Rust functions which take ownership of an object provided via an argument require
7835     * this to be true and invalidate the object pointed to by inner.
7836     */
7837    bool is_owned;
7838 } LDKReplyChannelRange;
7839
7840
7841
7842 /**
7843  * A [`gossip_timestamp_filter`] message is used by a node to request
7844  * gossip relay for messages in the requested time range when the
7845  * `gossip_queries` feature has been negotiated.
7846  *
7847  * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
7848  */
7849 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
7850    /**
7851     * A pointer to the opaque Rust object.
7852     * Nearly everywhere, inner must be non-null, however in places where
7853     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7854     */
7855    LDKnativeGossipTimestampFilter *inner;
7856    /**
7857     * Indicates that this is the only struct which contains the same pointer.
7858     * Rust functions which take ownership of an object provided via an argument require
7859     * this to be true and invalidate the object pointed to by inner.
7860     */
7861    bool is_owned;
7862 } LDKGossipTimestampFilter;
7863
7864 /**
7865  * An event generated by ChannelManager which indicates a message should be sent to a peer (or
7866  * broadcast to most peers).
7867  * These events are handled by PeerManager::process_events if you are using a PeerManager.
7868  */
7869 typedef enum LDKMessageSendEvent_Tag {
7870    /**
7871     * Used to indicate that we've accepted a channel open and should send the accept_channel
7872     * message provided to the given peer.
7873     */
7874    LDKMessageSendEvent_SendAcceptChannel,
7875    /**
7876     * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
7877     * message provided to the given peer.
7878     */
7879    LDKMessageSendEvent_SendAcceptChannelV2,
7880    /**
7881     * Used to indicate that we've initiated a channel open and should send the open_channel
7882     * message provided to the given peer.
7883     */
7884    LDKMessageSendEvent_SendOpenChannel,
7885    /**
7886     * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
7887     * message provided to the given peer.
7888     */
7889    LDKMessageSendEvent_SendOpenChannelV2,
7890    /**
7891     * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
7892     */
7893    LDKMessageSendEvent_SendFundingCreated,
7894    /**
7895     * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
7896     */
7897    LDKMessageSendEvent_SendFundingSigned,
7898    /**
7899     * Used to indicate that a stfu message should be sent to the peer with the given node id.
7900     */
7901    LDKMessageSendEvent_SendStfu,
7902    /**
7903     * Used to indicate that a splice message should be sent to the peer with the given node id.
7904     */
7905    LDKMessageSendEvent_SendSplice,
7906    /**
7907     * Used to indicate that a splice_ack message should be sent to the peer with the given node id.
7908     */
7909    LDKMessageSendEvent_SendSpliceAck,
7910    /**
7911     * Used to indicate that a splice_locked message should be sent to the peer with the given node id.
7912     */
7913    LDKMessageSendEvent_SendSpliceLocked,
7914    /**
7915     * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
7916     */
7917    LDKMessageSendEvent_SendTxAddInput,
7918    /**
7919     * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
7920     */
7921    LDKMessageSendEvent_SendTxAddOutput,
7922    /**
7923     * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
7924     */
7925    LDKMessageSendEvent_SendTxRemoveInput,
7926    /**
7927     * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
7928     */
7929    LDKMessageSendEvent_SendTxRemoveOutput,
7930    /**
7931     * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
7932     */
7933    LDKMessageSendEvent_SendTxComplete,
7934    /**
7935     * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
7936     */
7937    LDKMessageSendEvent_SendTxSignatures,
7938    /**
7939     * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
7940     */
7941    LDKMessageSendEvent_SendTxInitRbf,
7942    /**
7943     * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
7944     */
7945    LDKMessageSendEvent_SendTxAckRbf,
7946    /**
7947     * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
7948     */
7949    LDKMessageSendEvent_SendTxAbort,
7950    /**
7951     * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
7952     */
7953    LDKMessageSendEvent_SendChannelReady,
7954    /**
7955     * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
7956     */
7957    LDKMessageSendEvent_SendAnnouncementSignatures,
7958    /**
7959     * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
7960     * message should be sent to the peer with the given node_id.
7961     */
7962    LDKMessageSendEvent_UpdateHTLCs,
7963    /**
7964     * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
7965     */
7966    LDKMessageSendEvent_SendRevokeAndACK,
7967    /**
7968     * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
7969     */
7970    LDKMessageSendEvent_SendClosingSigned,
7971    /**
7972     * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
7973     */
7974    LDKMessageSendEvent_SendShutdown,
7975    /**
7976     * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
7977     */
7978    LDKMessageSendEvent_SendChannelReestablish,
7979    /**
7980     * Used to send a channel_announcement and channel_update to a specific peer, likely on
7981     * initial connection to ensure our peers know about our channels.
7982     */
7983    LDKMessageSendEvent_SendChannelAnnouncement,
7984    /**
7985     * Used to indicate that a channel_announcement and channel_update should be broadcast to all
7986     * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
7987     *
7988     * Note that after doing so, you very likely (unless you did so very recently) want to
7989     * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
7990     * ensures that any nodes which see our channel_announcement also have a relevant
7991     * node_announcement, including relevant feature flags which may be important for routing
7992     * through or to us.
7993     *
7994     * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
7995     */
7996    LDKMessageSendEvent_BroadcastChannelAnnouncement,
7997    /**
7998     * Used to indicate that a channel_update should be broadcast to all peers.
7999     */
8000    LDKMessageSendEvent_BroadcastChannelUpdate,
8001    /**
8002     * Used to indicate that a node_announcement should be broadcast to all peers.
8003     */
8004    LDKMessageSendEvent_BroadcastNodeAnnouncement,
8005    /**
8006     * Used to indicate that a channel_update should be sent to a single peer.
8007     * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
8008     * private channel and we shouldn't be informing all of our peers of channel parameters.
8009     */
8010    LDKMessageSendEvent_SendChannelUpdate,
8011    /**
8012     * Broadcast an error downstream to be handled
8013     */
8014    LDKMessageSendEvent_HandleError,
8015    /**
8016     * Query a peer for channels with funding transaction UTXOs in a block range.
8017     */
8018    LDKMessageSendEvent_SendChannelRangeQuery,
8019    /**
8020     * Request routing gossip messages from a peer for a list of channels identified by
8021     * their short_channel_ids.
8022     */
8023    LDKMessageSendEvent_SendShortIdsQuery,
8024    /**
8025     * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
8026     * emitted during processing of the query.
8027     */
8028    LDKMessageSendEvent_SendReplyChannelRange,
8029    /**
8030     * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
8031     * enable receiving gossip messages from the peer.
8032     */
8033    LDKMessageSendEvent_SendGossipTimestampFilter,
8034    /**
8035     * Must be last for serialization purposes
8036     */
8037    LDKMessageSendEvent_Sentinel,
8038 } LDKMessageSendEvent_Tag;
8039
8040 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
8041    /**
8042     * The node_id of the node which should receive this message
8043     */
8044    struct LDKPublicKey node_id;
8045    /**
8046     * The message which should be sent.
8047     */
8048    struct LDKAcceptChannel msg;
8049 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
8050
8051 typedef struct LDKMessageSendEvent_LDKSendAcceptChannelV2_Body {
8052    /**
8053     * The node_id of the node which should receive this message
8054     */
8055    struct LDKPublicKey node_id;
8056    /**
8057     * The message which should be sent.
8058     */
8059    struct LDKAcceptChannelV2 msg;
8060 } LDKMessageSendEvent_LDKSendAcceptChannelV2_Body;
8061
8062 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
8063    /**
8064     * The node_id of the node which should receive this message
8065     */
8066    struct LDKPublicKey node_id;
8067    /**
8068     * The message which should be sent.
8069     */
8070    struct LDKOpenChannel msg;
8071 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
8072
8073 typedef struct LDKMessageSendEvent_LDKSendOpenChannelV2_Body {
8074    /**
8075     * The node_id of the node which should receive this message
8076     */
8077    struct LDKPublicKey node_id;
8078    /**
8079     * The message which should be sent.
8080     */
8081    struct LDKOpenChannelV2 msg;
8082 } LDKMessageSendEvent_LDKSendOpenChannelV2_Body;
8083
8084 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
8085    /**
8086     * The node_id of the node which should receive this message
8087     */
8088    struct LDKPublicKey node_id;
8089    /**
8090     * The message which should be sent.
8091     */
8092    struct LDKFundingCreated msg;
8093 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
8094
8095 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
8096    /**
8097     * The node_id of the node which should receive this message
8098     */
8099    struct LDKPublicKey node_id;
8100    /**
8101     * The message which should be sent.
8102     */
8103    struct LDKFundingSigned msg;
8104 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
8105
8106 typedef struct LDKMessageSendEvent_LDKSendStfu_Body {
8107    /**
8108     * The node_id of the node which should receive this message
8109     */
8110    struct LDKPublicKey node_id;
8111    /**
8112     * The message which should be sent.
8113     */
8114    struct LDKStfu msg;
8115 } LDKMessageSendEvent_LDKSendStfu_Body;
8116
8117 typedef struct LDKMessageSendEvent_LDKSendSplice_Body {
8118    /**
8119     * The node_id of the node which should receive this message
8120     */
8121    struct LDKPublicKey node_id;
8122    /**
8123     * The message which should be sent.
8124     */
8125    struct LDKSplice msg;
8126 } LDKMessageSendEvent_LDKSendSplice_Body;
8127
8128 typedef struct LDKMessageSendEvent_LDKSendSpliceAck_Body {
8129    /**
8130     * The node_id of the node which should receive this message
8131     */
8132    struct LDKPublicKey node_id;
8133    /**
8134     * The message which should be sent.
8135     */
8136    struct LDKSpliceAck msg;
8137 } LDKMessageSendEvent_LDKSendSpliceAck_Body;
8138
8139 typedef struct LDKMessageSendEvent_LDKSendSpliceLocked_Body {
8140    /**
8141     * The node_id of the node which should receive this message
8142     */
8143    struct LDKPublicKey node_id;
8144    /**
8145     * The message which should be sent.
8146     */
8147    struct LDKSpliceLocked msg;
8148 } LDKMessageSendEvent_LDKSendSpliceLocked_Body;
8149
8150 typedef struct LDKMessageSendEvent_LDKSendTxAddInput_Body {
8151    /**
8152     * The node_id of the node which should receive this message
8153     */
8154    struct LDKPublicKey node_id;
8155    /**
8156     * The message which should be sent.
8157     */
8158    struct LDKTxAddInput msg;
8159 } LDKMessageSendEvent_LDKSendTxAddInput_Body;
8160
8161 typedef struct LDKMessageSendEvent_LDKSendTxAddOutput_Body {
8162    /**
8163     * The node_id of the node which should receive this message
8164     */
8165    struct LDKPublicKey node_id;
8166    /**
8167     * The message which should be sent.
8168     */
8169    struct LDKTxAddOutput msg;
8170 } LDKMessageSendEvent_LDKSendTxAddOutput_Body;
8171
8172 typedef struct LDKMessageSendEvent_LDKSendTxRemoveInput_Body {
8173    /**
8174     * The node_id of the node which should receive this message
8175     */
8176    struct LDKPublicKey node_id;
8177    /**
8178     * The message which should be sent.
8179     */
8180    struct LDKTxRemoveInput msg;
8181 } LDKMessageSendEvent_LDKSendTxRemoveInput_Body;
8182
8183 typedef struct LDKMessageSendEvent_LDKSendTxRemoveOutput_Body {
8184    /**
8185     * The node_id of the node which should receive this message
8186     */
8187    struct LDKPublicKey node_id;
8188    /**
8189     * The message which should be sent.
8190     */
8191    struct LDKTxRemoveOutput msg;
8192 } LDKMessageSendEvent_LDKSendTxRemoveOutput_Body;
8193
8194 typedef struct LDKMessageSendEvent_LDKSendTxComplete_Body {
8195    /**
8196     * The node_id of the node which should receive this message
8197     */
8198    struct LDKPublicKey node_id;
8199    /**
8200     * The message which should be sent.
8201     */
8202    struct LDKTxComplete msg;
8203 } LDKMessageSendEvent_LDKSendTxComplete_Body;
8204
8205 typedef struct LDKMessageSendEvent_LDKSendTxSignatures_Body {
8206    /**
8207     * The node_id of the node which should receive this message
8208     */
8209    struct LDKPublicKey node_id;
8210    /**
8211     * The message which should be sent.
8212     */
8213    struct LDKTxSignatures msg;
8214 } LDKMessageSendEvent_LDKSendTxSignatures_Body;
8215
8216 typedef struct LDKMessageSendEvent_LDKSendTxInitRbf_Body {
8217    /**
8218     * The node_id of the node which should receive this message
8219     */
8220    struct LDKPublicKey node_id;
8221    /**
8222     * The message which should be sent.
8223     */
8224    struct LDKTxInitRbf msg;
8225 } LDKMessageSendEvent_LDKSendTxInitRbf_Body;
8226
8227 typedef struct LDKMessageSendEvent_LDKSendTxAckRbf_Body {
8228    /**
8229     * The node_id of the node which should receive this message
8230     */
8231    struct LDKPublicKey node_id;
8232    /**
8233     * The message which should be sent.
8234     */
8235    struct LDKTxAckRbf msg;
8236 } LDKMessageSendEvent_LDKSendTxAckRbf_Body;
8237
8238 typedef struct LDKMessageSendEvent_LDKSendTxAbort_Body {
8239    /**
8240     * The node_id of the node which should receive this message
8241     */
8242    struct LDKPublicKey node_id;
8243    /**
8244     * The message which should be sent.
8245     */
8246    struct LDKTxAbort msg;
8247 } LDKMessageSendEvent_LDKSendTxAbort_Body;
8248
8249 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
8250    /**
8251     * The node_id of the node which should receive these message(s)
8252     */
8253    struct LDKPublicKey node_id;
8254    /**
8255     * The channel_ready message which should be sent.
8256     */
8257    struct LDKChannelReady msg;
8258 } LDKMessageSendEvent_LDKSendChannelReady_Body;
8259
8260 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
8261    /**
8262     * The node_id of the node which should receive these message(s)
8263     */
8264    struct LDKPublicKey node_id;
8265    /**
8266     * The announcement_signatures message which should be sent.
8267     */
8268    struct LDKAnnouncementSignatures msg;
8269 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
8270
8271 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
8272    /**
8273     * The node_id of the node which should receive these message(s)
8274     */
8275    struct LDKPublicKey node_id;
8276    /**
8277     * The update messages which should be sent. ALL messages in the struct should be sent!
8278     */
8279    struct LDKCommitmentUpdate updates;
8280 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
8281
8282 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
8283    /**
8284     * The node_id of the node which should receive this message
8285     */
8286    struct LDKPublicKey node_id;
8287    /**
8288     * The message which should be sent.
8289     */
8290    struct LDKRevokeAndACK msg;
8291 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
8292
8293 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
8294    /**
8295     * The node_id of the node which should receive this message
8296     */
8297    struct LDKPublicKey node_id;
8298    /**
8299     * The message which should be sent.
8300     */
8301    struct LDKClosingSigned msg;
8302 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
8303
8304 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
8305    /**
8306     * The node_id of the node which should receive this message
8307     */
8308    struct LDKPublicKey node_id;
8309    /**
8310     * The message which should be sent.
8311     */
8312    struct LDKShutdown msg;
8313 } LDKMessageSendEvent_LDKSendShutdown_Body;
8314
8315 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
8316    /**
8317     * The node_id of the node which should receive this message
8318     */
8319    struct LDKPublicKey node_id;
8320    /**
8321     * The message which should be sent.
8322     */
8323    struct LDKChannelReestablish msg;
8324 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
8325
8326 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
8327    /**
8328     * The node_id of the node which should receive this message
8329     */
8330    struct LDKPublicKey node_id;
8331    /**
8332     * The channel_announcement which should be sent.
8333     */
8334    struct LDKChannelAnnouncement msg;
8335    /**
8336     * The followup channel_update which should be sent.
8337     */
8338    struct LDKChannelUpdate update_msg;
8339 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
8340
8341 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
8342    /**
8343     * The channel_announcement which should be sent.
8344     */
8345    struct LDKChannelAnnouncement msg;
8346    /**
8347     * The followup channel_update which should be sent.
8348     *
8349     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8350     */
8351    struct LDKChannelUpdate update_msg;
8352 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
8353
8354 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
8355    /**
8356     * The channel_update which should be sent.
8357     */
8358    struct LDKChannelUpdate msg;
8359 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
8360
8361 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
8362    /**
8363     * The node_announcement which should be sent.
8364     */
8365    struct LDKNodeAnnouncement msg;
8366 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
8367
8368 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
8369    /**
8370     * The node_id of the node which should receive this message
8371     */
8372    struct LDKPublicKey node_id;
8373    /**
8374     * The channel_update which should be sent.
8375     */
8376    struct LDKChannelUpdate msg;
8377 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
8378
8379 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
8380    /**
8381     * The node_id of the node which should receive this message
8382     */
8383    struct LDKPublicKey node_id;
8384    /**
8385     * The action which should be taken.
8386     */
8387    struct LDKErrorAction action;
8388 } LDKMessageSendEvent_LDKHandleError_Body;
8389
8390 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
8391    /**
8392     * The node_id of this message recipient
8393     */
8394    struct LDKPublicKey node_id;
8395    /**
8396     * The query_channel_range which should be sent.
8397     */
8398    struct LDKQueryChannelRange msg;
8399 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
8400
8401 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
8402    /**
8403     * The node_id of this message recipient
8404     */
8405    struct LDKPublicKey node_id;
8406    /**
8407     * The query_short_channel_ids which should be sent.
8408     */
8409    struct LDKQueryShortChannelIds msg;
8410 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
8411
8412 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
8413    /**
8414     * The node_id of this message recipient
8415     */
8416    struct LDKPublicKey node_id;
8417    /**
8418     * The reply_channel_range which should be sent.
8419     */
8420    struct LDKReplyChannelRange msg;
8421 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
8422
8423 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
8424    /**
8425     * The node_id of this message recipient
8426     */
8427    struct LDKPublicKey node_id;
8428    /**
8429     * The gossip_timestamp_filter which should be sent.
8430     */
8431    struct LDKGossipTimestampFilter msg;
8432 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
8433
8434 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
8435    LDKMessageSendEvent_Tag tag;
8436    union {
8437       LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
8438       LDKMessageSendEvent_LDKSendAcceptChannelV2_Body send_accept_channel_v2;
8439       LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
8440       LDKMessageSendEvent_LDKSendOpenChannelV2_Body send_open_channel_v2;
8441       LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
8442       LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
8443       LDKMessageSendEvent_LDKSendStfu_Body send_stfu;
8444       LDKMessageSendEvent_LDKSendSplice_Body send_splice;
8445       LDKMessageSendEvent_LDKSendSpliceAck_Body send_splice_ack;
8446       LDKMessageSendEvent_LDKSendSpliceLocked_Body send_splice_locked;
8447       LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
8448       LDKMessageSendEvent_LDKSendTxAddOutput_Body send_tx_add_output;
8449       LDKMessageSendEvent_LDKSendTxRemoveInput_Body send_tx_remove_input;
8450       LDKMessageSendEvent_LDKSendTxRemoveOutput_Body send_tx_remove_output;
8451       LDKMessageSendEvent_LDKSendTxComplete_Body send_tx_complete;
8452       LDKMessageSendEvent_LDKSendTxSignatures_Body send_tx_signatures;
8453       LDKMessageSendEvent_LDKSendTxInitRbf_Body send_tx_init_rbf;
8454       LDKMessageSendEvent_LDKSendTxAckRbf_Body send_tx_ack_rbf;
8455       LDKMessageSendEvent_LDKSendTxAbort_Body send_tx_abort;
8456       LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
8457       LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
8458       LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
8459       LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
8460       LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
8461       LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
8462       LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
8463       LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
8464       LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
8465       LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
8466       LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
8467       LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
8468       LDKMessageSendEvent_LDKHandleError_Body handle_error;
8469       LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
8470       LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
8471       LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
8472       LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
8473    };
8474 } LDKMessageSendEvent;
8475
8476 /**
8477  * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
8478  * This corresponds to std::vector in C++
8479  */
8480 typedef struct LDKCVec_MessageSendEventZ {
8481    /**
8482     * The elements in the array.
8483     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8484     */
8485    struct LDKMessageSendEvent *data;
8486    /**
8487     * The number of elements pointed to by `data`.
8488     */
8489    uintptr_t datalen;
8490 } LDKCVec_MessageSendEventZ;
8491
8492
8493
8494 /**
8495  * Details about one direction of a channel as received within a [`ChannelUpdate`].
8496  */
8497 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
8498    /**
8499     * A pointer to the opaque Rust object.
8500     * Nearly everywhere, inner must be non-null, however in places where
8501     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8502     */
8503    LDKnativeChannelUpdateInfo *inner;
8504    /**
8505     * Indicates that this is the only struct which contains the same pointer.
8506     * Rust functions which take ownership of an object provided via an argument require
8507     * this to be true and invalidate the object pointed to by inner.
8508     */
8509    bool is_owned;
8510 } LDKChannelUpdateInfo;
8511
8512 /**
8513  * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
8514  */
8515 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
8516    /**
8517     * A pointer to the contents in the success state.
8518     * Reading from this pointer when `result_ok` is not set is undefined.
8519     */
8520    struct LDKChannelUpdateInfo *result;
8521    /**
8522     * A pointer to the contents in the error state.
8523     * Reading from this pointer when `result_ok` is set is undefined.
8524     */
8525    struct LDKDecodeError *err;
8526 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
8527
8528 /**
8529  * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
8530  * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8531  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8532  */
8533 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
8534    /**
8535     * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
8536     * `err` or `result` depending on the state of `result_ok`.
8537     */
8538    union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
8539    /**
8540     * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
8541     */
8542    bool result_ok;
8543 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
8544
8545
8546
8547 /**
8548  * Details about a channel (both directions).
8549  * Received within a channel announcement.
8550  */
8551 typedef struct MUST_USE_STRUCT LDKChannelInfo {
8552    /**
8553     * A pointer to the opaque Rust object.
8554     * Nearly everywhere, inner must be non-null, however in places where
8555     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8556     */
8557    LDKnativeChannelInfo *inner;
8558    /**
8559     * Indicates that this is the only struct which contains the same pointer.
8560     * Rust functions which take ownership of an object provided via an argument require
8561     * this to be true and invalidate the object pointed to by inner.
8562     */
8563    bool is_owned;
8564 } LDKChannelInfo;
8565
8566 /**
8567  * The contents of CResult_ChannelInfoDecodeErrorZ
8568  */
8569 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
8570    /**
8571     * A pointer to the contents in the success state.
8572     * Reading from this pointer when `result_ok` is not set is undefined.
8573     */
8574    struct LDKChannelInfo *result;
8575    /**
8576     * A pointer to the contents in the error state.
8577     * Reading from this pointer when `result_ok` is set is undefined.
8578     */
8579    struct LDKDecodeError *err;
8580 } LDKCResult_ChannelInfoDecodeErrorZPtr;
8581
8582 /**
8583  * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
8584  * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8585  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8586  */
8587 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
8588    /**
8589     * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
8590     * `err` or `result` depending on the state of `result_ok`.
8591     */
8592    union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
8593    /**
8594     * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
8595     */
8596    bool result_ok;
8597 } LDKCResult_ChannelInfoDecodeErrorZ;
8598
8599
8600
8601 /**
8602  * Fees for routing via a given channel or a node
8603  */
8604 typedef struct MUST_USE_STRUCT LDKRoutingFees {
8605    /**
8606     * A pointer to the opaque Rust object.
8607     * Nearly everywhere, inner must be non-null, however in places where
8608     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8609     */
8610    LDKnativeRoutingFees *inner;
8611    /**
8612     * Indicates that this is the only struct which contains the same pointer.
8613     * Rust functions which take ownership of an object provided via an argument require
8614     * this to be true and invalidate the object pointed to by inner.
8615     */
8616    bool is_owned;
8617 } LDKRoutingFees;
8618
8619 /**
8620  * The contents of CResult_RoutingFeesDecodeErrorZ
8621  */
8622 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
8623    /**
8624     * A pointer to the contents in the success state.
8625     * Reading from this pointer when `result_ok` is not set is undefined.
8626     */
8627    struct LDKRoutingFees *result;
8628    /**
8629     * A pointer to the contents in the error state.
8630     * Reading from this pointer when `result_ok` is set is undefined.
8631     */
8632    struct LDKDecodeError *err;
8633 } LDKCResult_RoutingFeesDecodeErrorZPtr;
8634
8635 /**
8636  * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
8637  * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
8638  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8639  */
8640 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
8641    /**
8642     * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
8643     * `err` or `result` depending on the state of `result_ok`.
8644     */
8645    union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
8646    /**
8647     * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
8648     */
8649    bool result_ok;
8650 } LDKCResult_RoutingFeesDecodeErrorZ;
8651
8652 /**
8653  * A 4-byte byte array.
8654  */
8655 typedef struct LDKFourBytes {
8656    /**
8657     * The four bytes
8658     */
8659    uint8_t data[4];
8660 } LDKFourBytes;
8661
8662 /**
8663  * A 12-byte byte array.
8664  */
8665 typedef struct LDKTwelveBytes {
8666    /**
8667     * The twelve bytes
8668     */
8669    uint8_t data[12];
8670 } LDKTwelveBytes;
8671
8672
8673
8674 /**
8675  * Represents a hostname for serialization purposes.
8676  * Only the character set and length will be validated.
8677  * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
8678  * Its length is guaranteed to be representable by a single byte.
8679  * This serialization is used by [`BOLT 7`] hostnames.
8680  *
8681  * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
8682  */
8683 typedef struct MUST_USE_STRUCT LDKHostname {
8684    /**
8685     * A pointer to the opaque Rust object.
8686     * Nearly everywhere, inner must be non-null, however in places where
8687     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8688     */
8689    LDKnativeHostname *inner;
8690    /**
8691     * Indicates that this is the only struct which contains the same pointer.
8692     * Rust functions which take ownership of an object provided via an argument require
8693     * this to be true and invalidate the object pointed to by inner.
8694     */
8695    bool is_owned;
8696 } LDKHostname;
8697
8698 /**
8699  * An address which can be used to connect to a remote peer.
8700  */
8701 typedef enum LDKSocketAddress_Tag {
8702    /**
8703     * An IPv4 address and port on which the peer is listening.
8704     */
8705    LDKSocketAddress_TcpIpV4,
8706    /**
8707     * An IPv6 address and port on which the peer is listening.
8708     */
8709    LDKSocketAddress_TcpIpV6,
8710    /**
8711     * An old-style Tor onion address/port on which the peer is listening.
8712     *
8713     * This field is deprecated and the Tor network generally no longer supports V2 Onion
8714     * addresses. Thus, the details are not parsed here.
8715     */
8716    LDKSocketAddress_OnionV2,
8717    /**
8718     * A new-style Tor onion address/port on which the peer is listening.
8719     *
8720     * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
8721     * wrap as base32 and append \".onion\".
8722     */
8723    LDKSocketAddress_OnionV3,
8724    /**
8725     * A hostname/port on which the peer is listening.
8726     */
8727    LDKSocketAddress_Hostname,
8728    /**
8729     * Must be last for serialization purposes
8730     */
8731    LDKSocketAddress_Sentinel,
8732 } LDKSocketAddress_Tag;
8733
8734 typedef struct LDKSocketAddress_LDKTcpIpV4_Body {
8735    /**
8736     * The 4-byte IPv4 address
8737     */
8738    struct LDKFourBytes addr;
8739    /**
8740     * The port on which the node is listening
8741     */
8742    uint16_t port;
8743 } LDKSocketAddress_LDKTcpIpV4_Body;
8744
8745 typedef struct LDKSocketAddress_LDKTcpIpV6_Body {
8746    /**
8747     * The 16-byte IPv6 address
8748     */
8749    struct LDKSixteenBytes addr;
8750    /**
8751     * The port on which the node is listening
8752     */
8753    uint16_t port;
8754 } LDKSocketAddress_LDKTcpIpV6_Body;
8755
8756 typedef struct LDKSocketAddress_LDKOnionV3_Body {
8757    /**
8758     * The ed25519 long-term public key of the peer
8759     */
8760    struct LDKThirtyTwoBytes ed25519_pubkey;
8761    /**
8762     * The checksum of the pubkey and version, as included in the onion address
8763     */
8764    uint16_t checksum;
8765    /**
8766     * The version byte, as defined by the Tor Onion v3 spec.
8767     */
8768    uint8_t version;
8769    /**
8770     * The port on which the node is listening
8771     */
8772    uint16_t port;
8773 } LDKSocketAddress_LDKOnionV3_Body;
8774
8775 typedef struct LDKSocketAddress_LDKHostname_Body {
8776    /**
8777     * The hostname on which the node is listening.
8778     */
8779    struct LDKHostname hostname;
8780    /**
8781     * The port on which the node is listening.
8782     */
8783    uint16_t port;
8784 } LDKSocketAddress_LDKHostname_Body;
8785
8786 typedef struct MUST_USE_STRUCT LDKSocketAddress {
8787    LDKSocketAddress_Tag tag;
8788    union {
8789       LDKSocketAddress_LDKTcpIpV4_Body tcp_ip_v4;
8790       LDKSocketAddress_LDKTcpIpV6_Body tcp_ip_v6;
8791       struct {
8792          struct LDKTwelveBytes onion_v2;
8793       };
8794       LDKSocketAddress_LDKOnionV3_Body onion_v3;
8795       LDKSocketAddress_LDKHostname_Body hostname;
8796    };
8797 } LDKSocketAddress;
8798
8799 /**
8800  * A dynamically-allocated array of crate::lightning::ln::msgs::SocketAddresss of arbitrary size.
8801  * This corresponds to std::vector in C++
8802  */
8803 typedef struct LDKCVec_SocketAddressZ {
8804    /**
8805     * The elements in the array.
8806     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8807     */
8808    struct LDKSocketAddress *data;
8809    /**
8810     * The number of elements pointed to by `data`.
8811     */
8812    uintptr_t datalen;
8813 } LDKCVec_SocketAddressZ;
8814
8815
8816
8817 /**
8818  * Information received in the latest node_announcement from this node.
8819  */
8820 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
8821    /**
8822     * A pointer to the opaque Rust object.
8823     * Nearly everywhere, inner must be non-null, however in places where
8824     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8825     */
8826    LDKnativeNodeAnnouncementInfo *inner;
8827    /**
8828     * Indicates that this is the only struct which contains the same pointer.
8829     * Rust functions which take ownership of an object provided via an argument require
8830     * this to be true and invalidate the object pointed to by inner.
8831     */
8832    bool is_owned;
8833 } LDKNodeAnnouncementInfo;
8834
8835 /**
8836  * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
8837  */
8838 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
8839    /**
8840     * A pointer to the contents in the success state.
8841     * Reading from this pointer when `result_ok` is not set is undefined.
8842     */
8843    struct LDKNodeAnnouncementInfo *result;
8844    /**
8845     * A pointer to the contents in the error state.
8846     * Reading from this pointer when `result_ok` is set is undefined.
8847     */
8848    struct LDKDecodeError *err;
8849 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
8850
8851 /**
8852  * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
8853  * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8854  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8855  */
8856 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
8857    /**
8858     * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
8859     * `err` or `result` depending on the state of `result_ok`.
8860     */
8861    union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
8862    /**
8863     * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
8864     */
8865    bool result_ok;
8866 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
8867
8868
8869
8870 /**
8871  * A user-defined name for a node, which may be used when displaying the node in a graph.
8872  *
8873  * Since node aliases are provided by third parties, they are a potential avenue for injection
8874  * attacks. Care must be taken when processing.
8875  */
8876 typedef struct MUST_USE_STRUCT LDKNodeAlias {
8877    /**
8878     * A pointer to the opaque Rust object.
8879     * Nearly everywhere, inner must be non-null, however in places where
8880     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8881     */
8882    LDKnativeNodeAlias *inner;
8883    /**
8884     * Indicates that this is the only struct which contains the same pointer.
8885     * Rust functions which take ownership of an object provided via an argument require
8886     * this to be true and invalidate the object pointed to by inner.
8887     */
8888    bool is_owned;
8889 } LDKNodeAlias;
8890
8891 /**
8892  * The contents of CResult_NodeAliasDecodeErrorZ
8893  */
8894 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
8895    /**
8896     * A pointer to the contents in the success state.
8897     * Reading from this pointer when `result_ok` is not set is undefined.
8898     */
8899    struct LDKNodeAlias *result;
8900    /**
8901     * A pointer to the contents in the error state.
8902     * Reading from this pointer when `result_ok` is set is undefined.
8903     */
8904    struct LDKDecodeError *err;
8905 } LDKCResult_NodeAliasDecodeErrorZPtr;
8906
8907 /**
8908  * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
8909  * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
8910  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8911  */
8912 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
8913    /**
8914     * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
8915     * `err` or `result` depending on the state of `result_ok`.
8916     */
8917    union LDKCResult_NodeAliasDecodeErrorZPtr contents;
8918    /**
8919     * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
8920     */
8921    bool result_ok;
8922 } LDKCResult_NodeAliasDecodeErrorZ;
8923
8924
8925
8926 /**
8927  * Details about a node in the network, known from the network announcement.
8928  */
8929 typedef struct MUST_USE_STRUCT LDKNodeInfo {
8930    /**
8931     * A pointer to the opaque Rust object.
8932     * Nearly everywhere, inner must be non-null, however in places where
8933     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8934     */
8935    LDKnativeNodeInfo *inner;
8936    /**
8937     * Indicates that this is the only struct which contains the same pointer.
8938     * Rust functions which take ownership of an object provided via an argument require
8939     * this to be true and invalidate the object pointed to by inner.
8940     */
8941    bool is_owned;
8942 } LDKNodeInfo;
8943
8944 /**
8945  * The contents of CResult_NodeInfoDecodeErrorZ
8946  */
8947 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
8948    /**
8949     * A pointer to the contents in the success state.
8950     * Reading from this pointer when `result_ok` is not set is undefined.
8951     */
8952    struct LDKNodeInfo *result;
8953    /**
8954     * A pointer to the contents in the error state.
8955     * Reading from this pointer when `result_ok` is set is undefined.
8956     */
8957    struct LDKDecodeError *err;
8958 } LDKCResult_NodeInfoDecodeErrorZPtr;
8959
8960 /**
8961  * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
8962  * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8963  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8964  */
8965 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
8966    /**
8967     * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
8968     * `err` or `result` depending on the state of `result_ok`.
8969     */
8970    union LDKCResult_NodeInfoDecodeErrorZPtr contents;
8971    /**
8972     * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
8973     */
8974    bool result_ok;
8975 } LDKCResult_NodeInfoDecodeErrorZ;
8976
8977 /**
8978  * The contents of CResult_NetworkGraphDecodeErrorZ
8979  */
8980 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
8981    /**
8982     * A pointer to the contents in the success state.
8983     * Reading from this pointer when `result_ok` is not set is undefined.
8984     */
8985    struct LDKNetworkGraph *result;
8986    /**
8987     * A pointer to the contents in the error state.
8988     * Reading from this pointer when `result_ok` is set is undefined.
8989     */
8990    struct LDKDecodeError *err;
8991 } LDKCResult_NetworkGraphDecodeErrorZPtr;
8992
8993 /**
8994  * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
8995  * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
8996  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8997  */
8998 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
8999    /**
9000     * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
9001     * `err` or `result` depending on the state of `result_ok`.
9002     */
9003    union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
9004    /**
9005     * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
9006     */
9007    bool result_ok;
9008 } LDKCResult_NetworkGraphDecodeErrorZ;
9009
9010 /**
9011  * An enum which can either contain a crate::c_types::derived::CVec_SocketAddressZ or not
9012  */
9013 typedef enum LDKCOption_CVec_SocketAddressZZ_Tag {
9014    /**
9015     * When we're in this state, this COption_CVec_SocketAddressZZ contains a crate::c_types::derived::CVec_SocketAddressZ
9016     */
9017    LDKCOption_CVec_SocketAddressZZ_Some,
9018    /**
9019     * When we're in this state, this COption_CVec_SocketAddressZZ contains nothing
9020     */
9021    LDKCOption_CVec_SocketAddressZZ_None,
9022    /**
9023     * Must be last for serialization purposes
9024     */
9025    LDKCOption_CVec_SocketAddressZZ_Sentinel,
9026 } LDKCOption_CVec_SocketAddressZZ_Tag;
9027
9028 typedef struct LDKCOption_CVec_SocketAddressZZ {
9029    LDKCOption_CVec_SocketAddressZZ_Tag tag;
9030    union {
9031       struct {
9032          struct LDKCVec_SocketAddressZ some;
9033       };
9034    };
9035 } LDKCOption_CVec_SocketAddressZZ;
9036
9037 /**
9038  * The contents of CResult_u64ShortChannelIdErrorZ
9039  */
9040 typedef union LDKCResult_u64ShortChannelIdErrorZPtr {
9041    /**
9042     * A pointer to the contents in the success state.
9043     * Reading from this pointer when `result_ok` is not set is undefined.
9044     */
9045    uint64_t *result;
9046    /**
9047     * A pointer to the contents in the error state.
9048     * Reading from this pointer when `result_ok` is set is undefined.
9049     */
9050    enum LDKShortChannelIdError *err;
9051 } LDKCResult_u64ShortChannelIdErrorZPtr;
9052
9053 /**
9054  * A CResult_u64ShortChannelIdErrorZ represents the result of a fallible operation,
9055  * containing a u64 on success and a crate::lightning::util::scid_utils::ShortChannelIdError on failure.
9056  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9057  */
9058 typedef struct LDKCResult_u64ShortChannelIdErrorZ {
9059    /**
9060     * The contents of this CResult_u64ShortChannelIdErrorZ, accessible via either
9061     * `err` or `result` depending on the state of `result_ok`.
9062     */
9063    union LDKCResult_u64ShortChannelIdErrorZPtr contents;
9064    /**
9065     * Whether this CResult_u64ShortChannelIdErrorZ represents a success state.
9066     */
9067    bool result_ok;
9068 } LDKCResult_u64ShortChannelIdErrorZ;
9069
9070
9071
9072 /**
9073  * Information about an incoming HTLC, including the [`PendingHTLCRouting`] describing where it
9074  * should go next.
9075  */
9076 typedef struct MUST_USE_STRUCT LDKPendingHTLCInfo {
9077    /**
9078     * A pointer to the opaque Rust object.
9079     * Nearly everywhere, inner must be non-null, however in places where
9080     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9081     */
9082    LDKnativePendingHTLCInfo *inner;
9083    /**
9084     * Indicates that this is the only struct which contains the same pointer.
9085     * Rust functions which take ownership of an object provided via an argument require
9086     * this to be true and invalidate the object pointed to by inner.
9087     */
9088    bool is_owned;
9089 } LDKPendingHTLCInfo;
9090
9091
9092
9093 /**
9094  * Invalid inbound onion payment.
9095  */
9096 typedef struct MUST_USE_STRUCT LDKInboundHTLCErr {
9097    /**
9098     * A pointer to the opaque Rust object.
9099     * Nearly everywhere, inner must be non-null, however in places where
9100     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9101     */
9102    LDKnativeInboundHTLCErr *inner;
9103    /**
9104     * Indicates that this is the only struct which contains the same pointer.
9105     * Rust functions which take ownership of an object provided via an argument require
9106     * this to be true and invalidate the object pointed to by inner.
9107     */
9108    bool is_owned;
9109 } LDKInboundHTLCErr;
9110
9111 /**
9112  * The contents of CResult_PendingHTLCInfoInboundHTLCErrZ
9113  */
9114 typedef union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr {
9115    /**
9116     * A pointer to the contents in the success state.
9117     * Reading from this pointer when `result_ok` is not set is undefined.
9118     */
9119    struct LDKPendingHTLCInfo *result;
9120    /**
9121     * A pointer to the contents in the error state.
9122     * Reading from this pointer when `result_ok` is set is undefined.
9123     */
9124    struct LDKInboundHTLCErr *err;
9125 } LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr;
9126
9127 /**
9128  * A CResult_PendingHTLCInfoInboundHTLCErrZ represents the result of a fallible operation,
9129  * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::onion_payment::InboundHTLCErr on failure.
9130  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9131  */
9132 typedef struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ {
9133    /**
9134     * The contents of this CResult_PendingHTLCInfoInboundHTLCErrZ, accessible via either
9135     * `err` or `result` depending on the state of `result_ok`.
9136     */
9137    union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr contents;
9138    /**
9139     * Whether this CResult_PendingHTLCInfoInboundHTLCErrZ represents a success state.
9140     */
9141    bool result_ok;
9142 } LDKCResult_PendingHTLCInfoInboundHTLCErrZ;
9143
9144 /**
9145  * A dynamically-allocated array of crate::lightning::ln::chan_utils::HTLCOutputInCommitments of arbitrary size.
9146  * This corresponds to std::vector in C++
9147  */
9148 typedef struct LDKCVec_HTLCOutputInCommitmentZ {
9149    /**
9150     * The elements in the array.
9151     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9152     */
9153    struct LDKHTLCOutputInCommitment *data;
9154    /**
9155     * The number of elements pointed to by `data`.
9156     */
9157    uintptr_t datalen;
9158 } LDKCVec_HTLCOutputInCommitmentZ;
9159
9160 /**
9161  * A dynamically-allocated array of crate::lightning::sign::HTLCDescriptors of arbitrary size.
9162  * This corresponds to std::vector in C++
9163  */
9164 typedef struct LDKCVec_HTLCDescriptorZ {
9165    /**
9166     * The elements in the array.
9167     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9168     */
9169    struct LDKHTLCDescriptor *data;
9170    /**
9171     * The number of elements pointed to by `data`.
9172     */
9173    uintptr_t datalen;
9174 } LDKCVec_HTLCDescriptorZ;
9175
9176
9177
9178 /**
9179  * An unspent transaction output that is available to spend resulting from a successful
9180  * [`CoinSelection`] attempt.
9181  */
9182 typedef struct MUST_USE_STRUCT LDKUtxo {
9183    /**
9184     * A pointer to the opaque Rust object.
9185     * Nearly everywhere, inner must be non-null, however in places where
9186     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9187     */
9188    LDKnativeUtxo *inner;
9189    /**
9190     * Indicates that this is the only struct which contains the same pointer.
9191     * Rust functions which take ownership of an object provided via an argument require
9192     * this to be true and invalidate the object pointed to by inner.
9193     */
9194    bool is_owned;
9195 } LDKUtxo;
9196
9197 /**
9198  * A dynamically-allocated array of crate::lightning::events::bump_transaction::Utxos of arbitrary size.
9199  * This corresponds to std::vector in C++
9200  */
9201 typedef struct LDKCVec_UtxoZ {
9202    /**
9203     * The elements in the array.
9204     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9205     */
9206    struct LDKUtxo *data;
9207    /**
9208     * The number of elements pointed to by `data`.
9209     */
9210    uintptr_t datalen;
9211 } LDKCVec_UtxoZ;
9212
9213 /**
9214  * An enum which can either contain a crate::c_types::TxOut or not
9215  */
9216 typedef enum LDKCOption_TxOutZ_Tag {
9217    /**
9218     * When we're in this state, this COption_TxOutZ contains a crate::c_types::TxOut
9219     */
9220    LDKCOption_TxOutZ_Some,
9221    /**
9222     * When we're in this state, this COption_TxOutZ contains nothing
9223     */
9224    LDKCOption_TxOutZ_None,
9225    /**
9226     * Must be last for serialization purposes
9227     */
9228    LDKCOption_TxOutZ_Sentinel,
9229 } LDKCOption_TxOutZ_Tag;
9230
9231 typedef struct LDKCOption_TxOutZ {
9232    LDKCOption_TxOutZ_Tag tag;
9233    union {
9234       struct {
9235          struct LDKTxOut some;
9236       };
9237    };
9238 } LDKCOption_TxOutZ;
9239
9240
9241
9242 /**
9243  * An input that must be included in a transaction when performing coin selection through
9244  * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
9245  * must have an empty [`TxIn::script_sig`] when spent.
9246  */
9247 typedef struct MUST_USE_STRUCT LDKInput {
9248    /**
9249     * A pointer to the opaque Rust object.
9250     * Nearly everywhere, inner must be non-null, however in places where
9251     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9252     */
9253    LDKnativeInput *inner;
9254    /**
9255     * Indicates that this is the only struct which contains the same pointer.
9256     * Rust functions which take ownership of an object provided via an argument require
9257     * this to be true and invalidate the object pointed to by inner.
9258     */
9259    bool is_owned;
9260 } LDKInput;
9261
9262 /**
9263  * A dynamically-allocated array of crate::lightning::events::bump_transaction::Inputs of arbitrary size.
9264  * This corresponds to std::vector in C++
9265  */
9266 typedef struct LDKCVec_InputZ {
9267    /**
9268     * The elements in the array.
9269     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9270     */
9271    struct LDKInput *data;
9272    /**
9273     * The number of elements pointed to by `data`.
9274     */
9275    uintptr_t datalen;
9276 } LDKCVec_InputZ;
9277
9278
9279
9280 /**
9281  * The result of a successful coin selection attempt for a transaction requiring additional UTXOs
9282  * to cover its fees.
9283  */
9284 typedef struct MUST_USE_STRUCT LDKCoinSelection {
9285    /**
9286     * A pointer to the opaque Rust object.
9287     * Nearly everywhere, inner must be non-null, however in places where
9288     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9289     */
9290    LDKnativeCoinSelection *inner;
9291    /**
9292     * Indicates that this is the only struct which contains the same pointer.
9293     * Rust functions which take ownership of an object provided via an argument require
9294     * this to be true and invalidate the object pointed to by inner.
9295     */
9296    bool is_owned;
9297 } LDKCoinSelection;
9298
9299 /**
9300  * The contents of CResult_CoinSelectionNoneZ
9301  */
9302 typedef union LDKCResult_CoinSelectionNoneZPtr {
9303    /**
9304     * A pointer to the contents in the success state.
9305     * Reading from this pointer when `result_ok` is not set is undefined.
9306     */
9307    struct LDKCoinSelection *result;
9308    /**
9309     * Note that this value is always NULL, as there are no contents in the Err variant
9310     */
9311    void *err;
9312 } LDKCResult_CoinSelectionNoneZPtr;
9313
9314 /**
9315  * A CResult_CoinSelectionNoneZ represents the result of a fallible operation,
9316  * containing a crate::lightning::events::bump_transaction::CoinSelection on success and a () on failure.
9317  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9318  */
9319 typedef struct LDKCResult_CoinSelectionNoneZ {
9320    /**
9321     * The contents of this CResult_CoinSelectionNoneZ, accessible via either
9322     * `err` or `result` depending on the state of `result_ok`.
9323     */
9324    union LDKCResult_CoinSelectionNoneZPtr contents;
9325    /**
9326     * Whether this CResult_CoinSelectionNoneZ represents a success state.
9327     */
9328    bool result_ok;
9329 } LDKCResult_CoinSelectionNoneZ;
9330
9331 /**
9332  * The contents of CResult_CVec_UtxoZNoneZ
9333  */
9334 typedef union LDKCResult_CVec_UtxoZNoneZPtr {
9335    /**
9336     * A pointer to the contents in the success state.
9337     * Reading from this pointer when `result_ok` is not set is undefined.
9338     */
9339    struct LDKCVec_UtxoZ *result;
9340    /**
9341     * Note that this value is always NULL, as there are no contents in the Err variant
9342     */
9343    void *err;
9344 } LDKCResult_CVec_UtxoZNoneZPtr;
9345
9346 /**
9347  * A CResult_CVec_UtxoZNoneZ represents the result of a fallible operation,
9348  * containing a crate::c_types::derived::CVec_UtxoZ on success and a () on failure.
9349  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9350  */
9351 typedef struct LDKCResult_CVec_UtxoZNoneZ {
9352    /**
9353     * The contents of this CResult_CVec_UtxoZNoneZ, accessible via either
9354     * `err` or `result` depending on the state of `result_ok`.
9355     */
9356    union LDKCResult_CVec_UtxoZNoneZPtr contents;
9357    /**
9358     * Whether this CResult_CVec_UtxoZNoneZ represents a success state.
9359     */
9360    bool result_ok;
9361 } LDKCResult_CVec_UtxoZNoneZ;
9362
9363
9364
9365 /**
9366  * An unknown payment context.
9367  */
9368 typedef struct MUST_USE_STRUCT LDKUnknownPaymentContext {
9369    /**
9370     * A pointer to the opaque Rust object.
9371     * Nearly everywhere, inner must be non-null, however in places where
9372     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9373     */
9374    LDKnativeUnknownPaymentContext *inner;
9375    /**
9376     * Indicates that this is the only struct which contains the same pointer.
9377     * Rust functions which take ownership of an object provided via an argument require
9378     * this to be true and invalidate the object pointed to by inner.
9379     */
9380    bool is_owned;
9381 } LDKUnknownPaymentContext;
9382
9383
9384
9385 /**
9386  * The context of a payment made for an invoice requested from a BOLT 12 [`Offer`].
9387  *
9388  * [`Offer`]: crate::offers::offer::Offer
9389  */
9390 typedef struct MUST_USE_STRUCT LDKBolt12OfferContext {
9391    /**
9392     * A pointer to the opaque Rust object.
9393     * Nearly everywhere, inner must be non-null, however in places where
9394     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9395     */
9396    LDKnativeBolt12OfferContext *inner;
9397    /**
9398     * Indicates that this is the only struct which contains the same pointer.
9399     * Rust functions which take ownership of an object provided via an argument require
9400     * this to be true and invalidate the object pointed to by inner.
9401     */
9402    bool is_owned;
9403 } LDKBolt12OfferContext;
9404
9405
9406
9407 /**
9408  * The context of a payment made for an invoice sent for a BOLT 12 [`Refund`].
9409  *
9410  * [`Refund`]: crate::offers::refund::Refund
9411  */
9412 typedef struct MUST_USE_STRUCT LDKBolt12RefundContext {
9413    /**
9414     * A pointer to the opaque Rust object.
9415     * Nearly everywhere, inner must be non-null, however in places where
9416     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9417     */
9418    LDKnativeBolt12RefundContext *inner;
9419    /**
9420     * Indicates that this is the only struct which contains the same pointer.
9421     * Rust functions which take ownership of an object provided via an argument require
9422     * this to be true and invalidate the object pointed to by inner.
9423     */
9424    bool is_owned;
9425 } LDKBolt12RefundContext;
9426
9427 /**
9428  * The context of an inbound payment, which is included in a [`BlindedPath`] via [`ReceiveTlvs`]
9429  * and surfaced in [`PaymentPurpose`].
9430  *
9431  * [`BlindedPath`]: crate::blinded_path::BlindedPath
9432  * [`PaymentPurpose`]: crate::events::PaymentPurpose
9433  */
9434 typedef enum LDKPaymentContext_Tag {
9435    /**
9436     * The payment context was unknown.
9437     */
9438    LDKPaymentContext_Unknown,
9439    /**
9440     * The payment was made for an invoice requested from a BOLT 12 [`Offer`].
9441     *
9442     * [`Offer`]: crate::offers::offer::Offer
9443     */
9444    LDKPaymentContext_Bolt12Offer,
9445    /**
9446     * The payment was made for an invoice sent for a BOLT 12 [`Refund`].
9447     *
9448     * [`Refund`]: crate::offers::refund::Refund
9449     */
9450    LDKPaymentContext_Bolt12Refund,
9451    /**
9452     * Must be last for serialization purposes
9453     */
9454    LDKPaymentContext_Sentinel,
9455 } LDKPaymentContext_Tag;
9456
9457 typedef struct MUST_USE_STRUCT LDKPaymentContext {
9458    LDKPaymentContext_Tag tag;
9459    union {
9460       struct {
9461          struct LDKUnknownPaymentContext unknown;
9462       };
9463       struct {
9464          struct LDKBolt12OfferContext bolt12_offer;
9465       };
9466       struct {
9467          struct LDKBolt12RefundContext bolt12_refund;
9468       };
9469    };
9470 } LDKPaymentContext;
9471
9472 /**
9473  * An enum which can either contain a crate::lightning::blinded_path::payment::PaymentContext or not
9474  */
9475 typedef enum LDKCOption_PaymentContextZ_Tag {
9476    /**
9477     * When we're in this state, this COption_PaymentContextZ contains a crate::lightning::blinded_path::payment::PaymentContext
9478     */
9479    LDKCOption_PaymentContextZ_Some,
9480    /**
9481     * When we're in this state, this COption_PaymentContextZ contains nothing
9482     */
9483    LDKCOption_PaymentContextZ_None,
9484    /**
9485     * Must be last for serialization purposes
9486     */
9487    LDKCOption_PaymentContextZ_Sentinel,
9488 } LDKCOption_PaymentContextZ_Tag;
9489
9490 typedef struct LDKCOption_PaymentContextZ {
9491    LDKCOption_PaymentContextZ_Tag tag;
9492    union {
9493       struct {
9494          struct LDKPaymentContext some;
9495       };
9496    };
9497 } LDKCOption_PaymentContextZ;
9498
9499 /**
9500  * A tuple of 2 elements. See the individual fields for the types contained.
9501  */
9502 typedef struct LDKC2Tuple_u64u16Z {
9503    /**
9504     * The element at position 0
9505     */
9506    uint64_t a;
9507    /**
9508     * The element at position 1
9509     */
9510    uint16_t b;
9511 } LDKC2Tuple_u64u16Z;
9512
9513 /**
9514  * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u16Z or not
9515  */
9516 typedef enum LDKCOption_C2Tuple_u64u16ZZ_Tag {
9517    /**
9518     * When we're in this state, this COption_C2Tuple_u64u16ZZ contains a crate::c_types::derived::C2Tuple_u64u16Z
9519     */
9520    LDKCOption_C2Tuple_u64u16ZZ_Some,
9521    /**
9522     * When we're in this state, this COption_C2Tuple_u64u16ZZ contains nothing
9523     */
9524    LDKCOption_C2Tuple_u64u16ZZ_None,
9525    /**
9526     * Must be last for serialization purposes
9527     */
9528    LDKCOption_C2Tuple_u64u16ZZ_Sentinel,
9529 } LDKCOption_C2Tuple_u64u16ZZ_Tag;
9530
9531 typedef struct LDKCOption_C2Tuple_u64u16ZZ {
9532    LDKCOption_C2Tuple_u64u16ZZ_Tag tag;
9533    union {
9534       struct {
9535          struct LDKC2Tuple_u64u16Z some;
9536       };
9537    };
9538 } LDKCOption_C2Tuple_u64u16ZZ;
9539
9540 /**
9541  * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not
9542  */
9543 typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
9544    /**
9545     * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channelmanager::ChannelShutdownState
9546     */
9547    LDKCOption_ChannelShutdownStateZ_Some,
9548    /**
9549     * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
9550     */
9551    LDKCOption_ChannelShutdownStateZ_None,
9552    /**
9553     * Must be last for serialization purposes
9554     */
9555    LDKCOption_ChannelShutdownStateZ_Sentinel,
9556 } LDKCOption_ChannelShutdownStateZ_Tag;
9557
9558 typedef struct LDKCOption_ChannelShutdownStateZ {
9559    LDKCOption_ChannelShutdownStateZ_Tag tag;
9560    union {
9561       struct {
9562          enum LDKChannelShutdownState some;
9563       };
9564    };
9565 } LDKCOption_ChannelShutdownStateZ;
9566
9567 /**
9568  * The contents of CResult_ChannelIdAPIErrorZ
9569  */
9570 typedef union LDKCResult_ChannelIdAPIErrorZPtr {
9571    /**
9572     * A pointer to the contents in the success state.
9573     * Reading from this pointer when `result_ok` is not set is undefined.
9574     */
9575    struct LDKChannelId *result;
9576    /**
9577     * A pointer to the contents in the error state.
9578     * Reading from this pointer when `result_ok` is set is undefined.
9579     */
9580    struct LDKAPIError *err;
9581 } LDKCResult_ChannelIdAPIErrorZPtr;
9582
9583 /**
9584  * A CResult_ChannelIdAPIErrorZ represents the result of a fallible operation,
9585  * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::util::errors::APIError on failure.
9586  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9587  */
9588 typedef struct LDKCResult_ChannelIdAPIErrorZ {
9589    /**
9590     * The contents of this CResult_ChannelIdAPIErrorZ, accessible via either
9591     * `err` or `result` depending on the state of `result_ok`.
9592     */
9593    union LDKCResult_ChannelIdAPIErrorZPtr contents;
9594    /**
9595     * Whether this CResult_ChannelIdAPIErrorZ represents a success state.
9596     */
9597    bool result_ok;
9598 } LDKCResult_ChannelIdAPIErrorZ;
9599
9600 /**
9601  * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
9602  * These include payments that have yet to find a successful path, or have unresolved HTLCs.
9603  */
9604 typedef enum LDKRecentPaymentDetails_Tag {
9605    /**
9606     * When an invoice was requested and thus a payment has not yet been sent.
9607     */
9608    LDKRecentPaymentDetails_AwaitingInvoice,
9609    /**
9610     * When a payment is still being sent and awaiting successful delivery.
9611     */
9612    LDKRecentPaymentDetails_Pending,
9613    /**
9614     * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
9615     * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
9616     * payment is removed from tracking.
9617     */
9618    LDKRecentPaymentDetails_Fulfilled,
9619    /**
9620     * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
9621     * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
9622     * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
9623     */
9624    LDKRecentPaymentDetails_Abandoned,
9625    /**
9626     * Must be last for serialization purposes
9627     */
9628    LDKRecentPaymentDetails_Sentinel,
9629 } LDKRecentPaymentDetails_Tag;
9630
9631 typedef struct LDKRecentPaymentDetails_LDKAwaitingInvoice_Body {
9632    /**
9633     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9634     * a payment and ensure idempotency in LDK.
9635     */
9636    struct LDKThirtyTwoBytes payment_id;
9637 } LDKRecentPaymentDetails_LDKAwaitingInvoice_Body;
9638
9639 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
9640    /**
9641     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9642     * a payment and ensure idempotency in LDK.
9643     */
9644    struct LDKThirtyTwoBytes payment_id;
9645    /**
9646     * Hash of the payment that is currently being sent but has yet to be fulfilled or
9647     * abandoned.
9648     */
9649    struct LDKThirtyTwoBytes payment_hash;
9650    /**
9651     * Total amount (in msat, excluding fees) across all paths for this payment,
9652     * not just the amount currently inflight.
9653     */
9654    uint64_t total_msat;
9655 } LDKRecentPaymentDetails_LDKPending_Body;
9656
9657 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
9658    /**
9659     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9660     * a payment and ensure idempotency in LDK.
9661     */
9662    struct LDKThirtyTwoBytes payment_id;
9663    /**
9664     * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
9665     * made before LDK version 0.0.104.
9666     */
9667    struct LDKCOption_ThirtyTwoBytesZ payment_hash;
9668 } LDKRecentPaymentDetails_LDKFulfilled_Body;
9669
9670 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
9671    /**
9672     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
9673     * a payment and ensure idempotency in LDK.
9674     */
9675    struct LDKThirtyTwoBytes payment_id;
9676    /**
9677     * Hash of the payment that we have given up trying to send.
9678     */
9679    struct LDKThirtyTwoBytes payment_hash;
9680 } LDKRecentPaymentDetails_LDKAbandoned_Body;
9681
9682 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
9683    LDKRecentPaymentDetails_Tag tag;
9684    union {
9685       LDKRecentPaymentDetails_LDKAwaitingInvoice_Body awaiting_invoice;
9686       LDKRecentPaymentDetails_LDKPending_Body pending;
9687       LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
9688       LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
9689    };
9690 } LDKRecentPaymentDetails;
9691
9692 /**
9693  * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
9694  * This corresponds to std::vector in C++
9695  */
9696 typedef struct LDKCVec_RecentPaymentDetailsZ {
9697    /**
9698     * The elements in the array.
9699     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9700     */
9701    struct LDKRecentPaymentDetails *data;
9702    /**
9703     * The number of elements pointed to by `data`.
9704     */
9705    uintptr_t datalen;
9706 } LDKCVec_RecentPaymentDetailsZ;
9707
9708 /**
9709  * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
9710  * of several states. This enum is returned as the Err() type describing which state the payment
9711  * is in, see the description of individual enum states for more.
9712  *
9713  * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
9714  */
9715 typedef enum LDKPaymentSendFailure_Tag {
9716    /**
9717     * A parameter which was passed to send_payment was invalid, preventing us from attempting to
9718     * send the payment at all.
9719     *
9720     * You can freely resend the payment in full (with the parameter error fixed).
9721     *
9722     * Because the payment failed outright, no payment tracking is done and no
9723     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9724     *
9725     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9726     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9727     */
9728    LDKPaymentSendFailure_ParameterError,
9729    /**
9730     * A parameter in a single path which was passed to send_payment was invalid, preventing us
9731     * from attempting to send the payment at all.
9732     *
9733     * You can freely resend the payment in full (with the parameter error fixed).
9734     *
9735     * Because the payment failed outright, no payment tracking is done and no
9736     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9737     *
9738     * The results here are ordered the same as the paths in the route object which was passed to
9739     * send_payment.
9740     *
9741     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9742     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9743     */
9744    LDKPaymentSendFailure_PathParameterError,
9745    /**
9746     * All paths which were attempted failed to send, with no channel state change taking place.
9747     * You can freely resend the payment in full (though you probably want to do so over different
9748     * paths than the ones selected).
9749     *
9750     * Because the payment failed outright, no payment tracking is done and no
9751     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
9752     *
9753     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
9754     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9755     */
9756    LDKPaymentSendFailure_AllFailedResendSafe,
9757    /**
9758     * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
9759     * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
9760     *
9761     * [`PaymentId`]: crate::ln::channelmanager::PaymentId
9762     * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
9763     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
9764     */
9765    LDKPaymentSendFailure_DuplicatePayment,
9766    /**
9767     * Some paths that were attempted failed to send, though some paths may have succeeded. At least
9768     * some paths have irrevocably committed to the HTLC.
9769     *
9770     * The results here are ordered the same as the paths in the route object that was passed to
9771     * send_payment.
9772     *
9773     * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
9774     * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
9775     *
9776     * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
9777     */
9778    LDKPaymentSendFailure_PartialFailure,
9779    /**
9780     * Must be last for serialization purposes
9781     */
9782    LDKPaymentSendFailure_Sentinel,
9783 } LDKPaymentSendFailure_Tag;
9784
9785 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
9786    /**
9787     * The errors themselves, in the same order as the paths from the route.
9788     */
9789    struct LDKCVec_CResult_NoneAPIErrorZZ results;
9790    /**
9791     * If some paths failed without irrevocably committing to the new HTLC(s), this will
9792     * contain a [`RouteParameters`] object for the failing paths.
9793     *
9794     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
9795     */
9796    struct LDKRouteParameters failed_paths_retry;
9797    /**
9798     * The payment id for the payment, which is now at least partially pending.
9799     */
9800    struct LDKThirtyTwoBytes payment_id;
9801 } LDKPaymentSendFailure_LDKPartialFailure_Body;
9802
9803 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
9804    LDKPaymentSendFailure_Tag tag;
9805    union {
9806       struct {
9807          struct LDKAPIError parameter_error;
9808       };
9809       struct {
9810          struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
9811       };
9812       struct {
9813          struct LDKCVec_APIErrorZ all_failed_resend_safe;
9814       };
9815       LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
9816    };
9817 } LDKPaymentSendFailure;
9818
9819 /**
9820  * The contents of CResult_NonePaymentSendFailureZ
9821  */
9822 typedef union LDKCResult_NonePaymentSendFailureZPtr {
9823    /**
9824     * Note that this value is always NULL, as there are no contents in the OK variant
9825     */
9826    void *result;
9827    /**
9828     * A pointer to the contents in the error state.
9829     * Reading from this pointer when `result_ok` is set is undefined.
9830     */
9831    struct LDKPaymentSendFailure *err;
9832 } LDKCResult_NonePaymentSendFailureZPtr;
9833
9834 /**
9835  * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
9836  * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
9837  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9838  */
9839 typedef struct LDKCResult_NonePaymentSendFailureZ {
9840    /**
9841     * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
9842     * `err` or `result` depending on the state of `result_ok`.
9843     */
9844    union LDKCResult_NonePaymentSendFailureZPtr contents;
9845    /**
9846     * Whether this CResult_NonePaymentSendFailureZ represents a success state.
9847     */
9848    bool result_ok;
9849 } LDKCResult_NonePaymentSendFailureZ;
9850
9851 /**
9852  * The contents of CResult_NoneRetryableSendFailureZ
9853  */
9854 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
9855    /**
9856     * Note that this value is always NULL, as there are no contents in the OK variant
9857     */
9858    void *result;
9859    /**
9860     * A pointer to the contents in the error state.
9861     * Reading from this pointer when `result_ok` is set is undefined.
9862     */
9863    enum LDKRetryableSendFailure *err;
9864 } LDKCResult_NoneRetryableSendFailureZPtr;
9865
9866 /**
9867  * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
9868  * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
9869  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9870  */
9871 typedef struct LDKCResult_NoneRetryableSendFailureZ {
9872    /**
9873     * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
9874     * `err` or `result` depending on the state of `result_ok`.
9875     */
9876    union LDKCResult_NoneRetryableSendFailureZPtr contents;
9877    /**
9878     * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
9879     */
9880    bool result_ok;
9881 } LDKCResult_NoneRetryableSendFailureZ;
9882
9883 /**
9884  * The contents of CResult_ThirtyTwoBytesPaymentSendFailureZ
9885  */
9886 typedef union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr {
9887    /**
9888     * A pointer to the contents in the success state.
9889     * Reading from this pointer when `result_ok` is not set is undefined.
9890     */
9891    struct LDKThirtyTwoBytes *result;
9892    /**
9893     * A pointer to the contents in the error state.
9894     * Reading from this pointer when `result_ok` is set is undefined.
9895     */
9896    struct LDKPaymentSendFailure *err;
9897 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr;
9898
9899 /**
9900  * A CResult_ThirtyTwoBytesPaymentSendFailureZ represents the result of a fallible operation,
9901  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
9902  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9903  */
9904 typedef struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ {
9905    /**
9906     * The contents of this CResult_ThirtyTwoBytesPaymentSendFailureZ, accessible via either
9907     * `err` or `result` depending on the state of `result_ok`.
9908     */
9909    union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr contents;
9910    /**
9911     * Whether this CResult_ThirtyTwoBytesPaymentSendFailureZ represents a success state.
9912     */
9913    bool result_ok;
9914 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZ;
9915
9916 /**
9917  * The contents of CResult_ThirtyTwoBytesRetryableSendFailureZ
9918  */
9919 typedef union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr {
9920    /**
9921     * A pointer to the contents in the success state.
9922     * Reading from this pointer when `result_ok` is not set is undefined.
9923     */
9924    struct LDKThirtyTwoBytes *result;
9925    /**
9926     * A pointer to the contents in the error state.
9927     * Reading from this pointer when `result_ok` is set is undefined.
9928     */
9929    enum LDKRetryableSendFailure *err;
9930 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr;
9931
9932 /**
9933  * A CResult_ThirtyTwoBytesRetryableSendFailureZ represents the result of a fallible operation,
9934  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
9935  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9936  */
9937 typedef struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ {
9938    /**
9939     * The contents of this CResult_ThirtyTwoBytesRetryableSendFailureZ, accessible via either
9940     * `err` or `result` depending on the state of `result_ok`.
9941     */
9942    union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr contents;
9943    /**
9944     * Whether this CResult_ThirtyTwoBytesRetryableSendFailureZ represents a success state.
9945     */
9946    bool result_ok;
9947 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZ;
9948
9949 /**
9950  * A tuple of 2 elements. See the individual fields for the types contained.
9951  */
9952 typedef struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ {
9953    /**
9954     * The element at position 0
9955     */
9956    struct LDKThirtyTwoBytes a;
9957    /**
9958     * The element at position 1
9959     */
9960    struct LDKThirtyTwoBytes b;
9961 } LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ;
9962
9963 /**
9964  * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ
9965  */
9966 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr {
9967    /**
9968     * A pointer to the contents in the success state.
9969     * Reading from this pointer when `result_ok` is not set is undefined.
9970     */
9971    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
9972    /**
9973     * A pointer to the contents in the error state.
9974     * Reading from this pointer when `result_ok` is set is undefined.
9975     */
9976    struct LDKPaymentSendFailure *err;
9977 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr;
9978
9979 /**
9980  * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents the result of a fallible operation,
9981  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
9982  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9983  */
9984 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ {
9985    /**
9986     * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ, accessible via either
9987     * `err` or `result` depending on the state of `result_ok`.
9988     */
9989    union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr contents;
9990    /**
9991     * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents a success state.
9992     */
9993    bool result_ok;
9994 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ;
9995
9996 /**
9997  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZs of arbitrary size.
9998  * This corresponds to std::vector in C++
9999  */
10000 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ {
10001    /**
10002     * The elements in the array.
10003     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10004     */
10005    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *data;
10006    /**
10007     * The number of elements pointed to by `data`.
10008     */
10009    uintptr_t datalen;
10010 } LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ;
10011
10012 /**
10013  * Indicates that we failed to send a payment probe. Further errors may be surfaced later via
10014  * [`Event::ProbeFailed`].
10015  *
10016  * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
10017  */
10018 typedef enum LDKProbeSendFailure_Tag {
10019    /**
10020     * We were unable to find a route to the destination.
10021     */
10022    LDKProbeSendFailure_RouteNotFound,
10023    /**
10024     * We failed to send the payment probes.
10025     */
10026    LDKProbeSendFailure_SendingFailed,
10027    /**
10028     * Must be last for serialization purposes
10029     */
10030    LDKProbeSendFailure_Sentinel,
10031 } LDKProbeSendFailure_Tag;
10032
10033 typedef struct MUST_USE_STRUCT LDKProbeSendFailure {
10034    LDKProbeSendFailure_Tag tag;
10035    union {
10036       struct {
10037          struct LDKPaymentSendFailure sending_failed;
10038       };
10039    };
10040 } LDKProbeSendFailure;
10041
10042 /**
10043  * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ
10044  */
10045 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr {
10046    /**
10047     * A pointer to the contents in the success state.
10048     * Reading from this pointer when `result_ok` is not set is undefined.
10049     */
10050    struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
10051    /**
10052     * A pointer to the contents in the error state.
10053     * Reading from this pointer when `result_ok` is set is undefined.
10054     */
10055    struct LDKProbeSendFailure *err;
10056 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr;
10057
10058 /**
10059  * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents the result of a fallible operation,
10060  * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning::ln::outbound_payment::ProbeSendFailure on failure.
10061  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10062  */
10063 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
10064    /**
10065     * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ, accessible via either
10066     * `err` or `result` depending on the state of `result_ok`.
10067     */
10068    union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr contents;
10069    /**
10070     * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents a success state.
10071     */
10072    bool result_ok;
10073 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ;
10074
10075 /**
10076  * A tuple of 2 elements. See the individual fields for the types contained.
10077  */
10078 typedef struct LDKC2Tuple_ChannelIdPublicKeyZ {
10079    /**
10080     * The element at position 0
10081     */
10082    struct LDKChannelId a;
10083    /**
10084     * The element at position 1
10085     */
10086    struct LDKPublicKey b;
10087 } LDKC2Tuple_ChannelIdPublicKeyZ;
10088
10089 /**
10090  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ChannelIdPublicKeyZs of arbitrary size.
10091  * This corresponds to std::vector in C++
10092  */
10093 typedef struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ {
10094    /**
10095     * The elements in the array.
10096     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10097     */
10098    struct LDKC2Tuple_ChannelIdPublicKeyZ *data;
10099    /**
10100     * The number of elements pointed to by `data`.
10101     */
10102    uintptr_t datalen;
10103 } LDKCVec_C2Tuple_ChannelIdPublicKeyZZ;
10104
10105 /**
10106  * A dynamically-allocated array of crate::lightning::ln::types::ChannelIds of arbitrary size.
10107  * This corresponds to std::vector in C++
10108  */
10109 typedef struct LDKCVec_ChannelIdZ {
10110    /**
10111     * The elements in the array.
10112     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10113     */
10114    struct LDKChannelId *data;
10115    /**
10116     * The number of elements pointed to by `data`.
10117     */
10118    uintptr_t datalen;
10119 } LDKCVec_ChannelIdZ;
10120
10121 /**
10122  * An enum which can either contain a crate::c_types::Str or not
10123  */
10124 typedef enum LDKCOption_StrZ_Tag {
10125    /**
10126     * When we're in this state, this COption_StrZ contains a crate::c_types::Str
10127     */
10128    LDKCOption_StrZ_Some,
10129    /**
10130     * When we're in this state, this COption_StrZ contains nothing
10131     */
10132    LDKCOption_StrZ_None,
10133    /**
10134     * Must be last for serialization purposes
10135     */
10136    LDKCOption_StrZ_Sentinel,
10137 } LDKCOption_StrZ_Tag;
10138
10139 typedef struct LDKCOption_StrZ {
10140    LDKCOption_StrZ_Tag tag;
10141    union {
10142       struct {
10143          struct LDKStr some;
10144       };
10145    };
10146 } LDKCOption_StrZ;
10147
10148 /**
10149  * The contents of CResult_NoneBolt12SemanticErrorZ
10150  */
10151 typedef union LDKCResult_NoneBolt12SemanticErrorZPtr {
10152    /**
10153     * Note that this value is always NULL, as there are no contents in the OK variant
10154     */
10155    void *result;
10156    /**
10157     * A pointer to the contents in the error state.
10158     * Reading from this pointer when `result_ok` is set is undefined.
10159     */
10160    enum LDKBolt12SemanticError *err;
10161 } LDKCResult_NoneBolt12SemanticErrorZPtr;
10162
10163 /**
10164  * A CResult_NoneBolt12SemanticErrorZ represents the result of a fallible operation,
10165  * containing a () on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
10166  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10167  */
10168 typedef struct LDKCResult_NoneBolt12SemanticErrorZ {
10169    /**
10170     * The contents of this CResult_NoneBolt12SemanticErrorZ, accessible via either
10171     * `err` or `result` depending on the state of `result_ok`.
10172     */
10173    union LDKCResult_NoneBolt12SemanticErrorZPtr contents;
10174    /**
10175     * Whether this CResult_NoneBolt12SemanticErrorZ represents a success state.
10176     */
10177    bool result_ok;
10178 } LDKCResult_NoneBolt12SemanticErrorZ;
10179
10180 /**
10181  * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ
10182  */
10183 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr {
10184    /**
10185     * A pointer to the contents in the success state.
10186     * Reading from this pointer when `result_ok` is not set is undefined.
10187     */
10188    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
10189    /**
10190     * Note that this value is always NULL, as there are no contents in the Err variant
10191     */
10192    void *err;
10193 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr;
10194
10195 /**
10196  * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents the result of a fallible operation,
10197  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a () on failure.
10198  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10199  */
10200 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ {
10201    /**
10202     * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ, accessible via either
10203     * `err` or `result` depending on the state of `result_ok`.
10204     */
10205    union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr contents;
10206    /**
10207     * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents a success state.
10208     */
10209    bool result_ok;
10210 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ;
10211
10212 /**
10213  * The contents of CResult_ThirtyTwoBytesAPIErrorZ
10214  */
10215 typedef union LDKCResult_ThirtyTwoBytesAPIErrorZPtr {
10216    /**
10217     * A pointer to the contents in the success state.
10218     * Reading from this pointer when `result_ok` is not set is undefined.
10219     */
10220    struct LDKThirtyTwoBytes *result;
10221    /**
10222     * A pointer to the contents in the error state.
10223     * Reading from this pointer when `result_ok` is set is undefined.
10224     */
10225    struct LDKAPIError *err;
10226 } LDKCResult_ThirtyTwoBytesAPIErrorZPtr;
10227
10228 /**
10229  * A CResult_ThirtyTwoBytesAPIErrorZ represents the result of a fallible operation,
10230  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
10231  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10232  */
10233 typedef struct LDKCResult_ThirtyTwoBytesAPIErrorZ {
10234    /**
10235     * The contents of this CResult_ThirtyTwoBytesAPIErrorZ, accessible via either
10236     * `err` or `result` depending on the state of `result_ok`.
10237     */
10238    union LDKCResult_ThirtyTwoBytesAPIErrorZPtr contents;
10239    /**
10240     * Whether this CResult_ThirtyTwoBytesAPIErrorZ represents a success state.
10241     */
10242    bool result_ok;
10243 } LDKCResult_ThirtyTwoBytesAPIErrorZ;
10244
10245
10246
10247 /**
10248  * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
10249  *
10250  * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
10251  * specifies these such that its recipient can send an invoice for payment.
10252  *
10253  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10254  * [`Offer`]: crate::offers::offer::Offer
10255  */
10256 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
10257    /**
10258     * A pointer to the opaque Rust object.
10259     * Nearly everywhere, inner must be non-null, however in places where
10260     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10261     */
10262    LDKnativeInvoiceRequest *inner;
10263    /**
10264     * Indicates that this is the only struct which contains the same pointer.
10265     * Rust functions which take ownership of an object provided via an argument require
10266     * this to be true and invalidate the object pointed to by inner.
10267     */
10268    bool is_owned;
10269 } LDKInvoiceRequest;
10270
10271
10272
10273 /**
10274  * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
10275  *
10276  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
10277  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10278  */
10279 typedef struct MUST_USE_STRUCT LDKInvoiceError {
10280    /**
10281     * A pointer to the opaque Rust object.
10282     * Nearly everywhere, inner must be non-null, however in places where
10283     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10284     */
10285    LDKnativeInvoiceError *inner;
10286    /**
10287     * Indicates that this is the only struct which contains the same pointer.
10288     * Rust functions which take ownership of an object provided via an argument require
10289     * this to be true and invalidate the object pointed to by inner.
10290     */
10291    bool is_owned;
10292 } LDKInvoiceError;
10293
10294 /**
10295  * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`].
10296  *
10297  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
10298  */
10299 typedef enum LDKOffersMessage_Tag {
10300    /**
10301     * A request for a [`Bolt12Invoice`] for a particular [`Offer`].
10302     *
10303     * [`Offer`]: crate::offers::offer::Offer
10304     */
10305    LDKOffersMessage_InvoiceRequest,
10306    /**
10307     * A [`Bolt12Invoice`] sent in response to an [`InvoiceRequest`] or a [`Refund`].
10308     *
10309     * [`Refund`]: crate::offers::refund::Refund
10310     */
10311    LDKOffersMessage_Invoice,
10312    /**
10313     * An error from handling an [`OffersMessage`].
10314     */
10315    LDKOffersMessage_InvoiceError,
10316    /**
10317     * Must be last for serialization purposes
10318     */
10319    LDKOffersMessage_Sentinel,
10320 } LDKOffersMessage_Tag;
10321
10322 typedef struct MUST_USE_STRUCT LDKOffersMessage {
10323    LDKOffersMessage_Tag tag;
10324    union {
10325       struct {
10326          struct LDKInvoiceRequest invoice_request;
10327       };
10328       struct {
10329          struct LDKBolt12Invoice invoice;
10330       };
10331       struct {
10332          struct LDKInvoiceError invoice_error;
10333       };
10334    };
10335 } LDKOffersMessage;
10336
10337 /**
10338  * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
10339  */
10340 typedef enum LDKCOption_OffersMessageZ_Tag {
10341    /**
10342     * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
10343     */
10344    LDKCOption_OffersMessageZ_Some,
10345    /**
10346     * When we're in this state, this COption_OffersMessageZ contains nothing
10347     */
10348    LDKCOption_OffersMessageZ_None,
10349    /**
10350     * Must be last for serialization purposes
10351     */
10352    LDKCOption_OffersMessageZ_Sentinel,
10353 } LDKCOption_OffersMessageZ_Tag;
10354
10355 typedef struct LDKCOption_OffersMessageZ {
10356    LDKCOption_OffersMessageZ_Tag tag;
10357    union {
10358       struct {
10359          struct LDKOffersMessage some;
10360       };
10361    };
10362 } LDKCOption_OffersMessageZ;
10363
10364 /**
10365  * The destination of an onion message.
10366  */
10367 typedef enum LDKDestination_Tag {
10368    /**
10369     * We're sending this onion message to a node.
10370     */
10371    LDKDestination_Node,
10372    /**
10373     * We're sending this onion message to a blinded path.
10374     */
10375    LDKDestination_BlindedPath,
10376    /**
10377     * Must be last for serialization purposes
10378     */
10379    LDKDestination_Sentinel,
10380 } LDKDestination_Tag;
10381
10382 typedef struct MUST_USE_STRUCT LDKDestination {
10383    LDKDestination_Tag tag;
10384    union {
10385       struct {
10386          struct LDKPublicKey node;
10387       };
10388       struct {
10389          struct LDKBlindedPath blinded_path;
10390       };
10391    };
10392 } LDKDestination;
10393
10394 /**
10395  * A tuple of 3 elements. See the individual fields for the types contained.
10396  */
10397 typedef struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ {
10398    /**
10399     * The element at position 0
10400     */
10401    struct LDKOffersMessage a;
10402    /**
10403     * The element at position 1
10404     */
10405    struct LDKDestination b;
10406    /**
10407     * The element at position 2
10408     */
10409    struct LDKBlindedPath c;
10410 } LDKC3Tuple_OffersMessageDestinationBlindedPathZ;
10411
10412 /**
10413  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OffersMessageDestinationBlindedPathZs of arbitrary size.
10414  * This corresponds to std::vector in C++
10415  */
10416 typedef struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ {
10417    /**
10418     * The elements in the array.
10419     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10420     */
10421    struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *data;
10422    /**
10423     * The number of elements pointed to by `data`.
10424     */
10425    uintptr_t datalen;
10426 } LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ;
10427
10428
10429
10430 /**
10431  * Information needed for constructing an invoice route hint for this channel.
10432  */
10433 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
10434    /**
10435     * A pointer to the opaque Rust object.
10436     * Nearly everywhere, inner must be non-null, however in places where
10437     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10438     */
10439    LDKnativeCounterpartyForwardingInfo *inner;
10440    /**
10441     * Indicates that this is the only struct which contains the same pointer.
10442     * Rust functions which take ownership of an object provided via an argument require
10443     * this to be true and invalidate the object pointed to by inner.
10444     */
10445    bool is_owned;
10446 } LDKCounterpartyForwardingInfo;
10447
10448 /**
10449  * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
10450  */
10451 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
10452    /**
10453     * A pointer to the contents in the success state.
10454     * Reading from this pointer when `result_ok` is not set is undefined.
10455     */
10456    struct LDKCounterpartyForwardingInfo *result;
10457    /**
10458     * A pointer to the contents in the error state.
10459     * Reading from this pointer when `result_ok` is set is undefined.
10460     */
10461    struct LDKDecodeError *err;
10462 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
10463
10464 /**
10465  * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
10466  * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
10467  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10468  */
10469 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
10470    /**
10471     * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
10472     * `err` or `result` depending on the state of `result_ok`.
10473     */
10474    union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
10475    /**
10476     * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
10477     */
10478    bool result_ok;
10479 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
10480
10481
10482
10483 /**
10484  * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
10485  * to better separate parameters.
10486  */
10487 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
10488    /**
10489     * A pointer to the opaque Rust object.
10490     * Nearly everywhere, inner must be non-null, however in places where
10491     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10492     */
10493    LDKnativeChannelCounterparty *inner;
10494    /**
10495     * Indicates that this is the only struct which contains the same pointer.
10496     * Rust functions which take ownership of an object provided via an argument require
10497     * this to be true and invalidate the object pointed to by inner.
10498     */
10499    bool is_owned;
10500 } LDKChannelCounterparty;
10501
10502 /**
10503  * The contents of CResult_ChannelCounterpartyDecodeErrorZ
10504  */
10505 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
10506    /**
10507     * A pointer to the contents in the success state.
10508     * Reading from this pointer when `result_ok` is not set is undefined.
10509     */
10510    struct LDKChannelCounterparty *result;
10511    /**
10512     * A pointer to the contents in the error state.
10513     * Reading from this pointer when `result_ok` is set is undefined.
10514     */
10515    struct LDKDecodeError *err;
10516 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
10517
10518 /**
10519  * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
10520  * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
10521  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10522  */
10523 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
10524    /**
10525     * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
10526     * `err` or `result` depending on the state of `result_ok`.
10527     */
10528    union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
10529    /**
10530     * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
10531     */
10532    bool result_ok;
10533 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
10534
10535 /**
10536  * The contents of CResult_ChannelDetailsDecodeErrorZ
10537  */
10538 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
10539    /**
10540     * A pointer to the contents in the success state.
10541     * Reading from this pointer when `result_ok` is not set is undefined.
10542     */
10543    struct LDKChannelDetails *result;
10544    /**
10545     * A pointer to the contents in the error state.
10546     * Reading from this pointer when `result_ok` is set is undefined.
10547     */
10548    struct LDKDecodeError *err;
10549 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
10550
10551 /**
10552  * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
10553  * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
10554  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10555  */
10556 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
10557    /**
10558     * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
10559     * `err` or `result` depending on the state of `result_ok`.
10560     */
10561    union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
10562    /**
10563     * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
10564     */
10565    bool result_ok;
10566 } LDKCResult_ChannelDetailsDecodeErrorZ;
10567
10568
10569
10570 /**
10571  * Route hints used in constructing invoices for [phantom node payents].
10572  *
10573  * [phantom node payments]: crate::sign::PhantomKeysManager
10574  */
10575 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
10576    /**
10577     * A pointer to the opaque Rust object.
10578     * Nearly everywhere, inner must be non-null, however in places where
10579     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10580     */
10581    LDKnativePhantomRouteHints *inner;
10582    /**
10583     * Indicates that this is the only struct which contains the same pointer.
10584     * Rust functions which take ownership of an object provided via an argument require
10585     * this to be true and invalidate the object pointed to by inner.
10586     */
10587    bool is_owned;
10588 } LDKPhantomRouteHints;
10589
10590 /**
10591  * The contents of CResult_PhantomRouteHintsDecodeErrorZ
10592  */
10593 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
10594    /**
10595     * A pointer to the contents in the success state.
10596     * Reading from this pointer when `result_ok` is not set is undefined.
10597     */
10598    struct LDKPhantomRouteHints *result;
10599    /**
10600     * A pointer to the contents in the error state.
10601     * Reading from this pointer when `result_ok` is set is undefined.
10602     */
10603    struct LDKDecodeError *err;
10604 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
10605
10606 /**
10607  * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
10608  * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
10609  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10610  */
10611 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
10612    /**
10613     * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
10614     * `err` or `result` depending on the state of `result_ok`.
10615     */
10616    union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
10617    /**
10618     * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
10619     */
10620    bool result_ok;
10621 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
10622
10623
10624
10625 /**
10626  * Information used to forward or fail this HTLC that is being forwarded within a blinded path.
10627  */
10628 typedef struct MUST_USE_STRUCT LDKBlindedForward {
10629    /**
10630     * A pointer to the opaque Rust object.
10631     * Nearly everywhere, inner must be non-null, however in places where
10632     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10633     */
10634    LDKnativeBlindedForward *inner;
10635    /**
10636     * Indicates that this is the only struct which contains the same pointer.
10637     * Rust functions which take ownership of an object provided via an argument require
10638     * this to be true and invalidate the object pointed to by inner.
10639     */
10640    bool is_owned;
10641 } LDKBlindedForward;
10642
10643 /**
10644  * The contents of CResult_BlindedForwardDecodeErrorZ
10645  */
10646 typedef union LDKCResult_BlindedForwardDecodeErrorZPtr {
10647    /**
10648     * A pointer to the contents in the success state.
10649     * Reading from this pointer when `result_ok` is not set is undefined.
10650     */
10651    struct LDKBlindedForward *result;
10652    /**
10653     * A pointer to the contents in the error state.
10654     * Reading from this pointer when `result_ok` is set is undefined.
10655     */
10656    struct LDKDecodeError *err;
10657 } LDKCResult_BlindedForwardDecodeErrorZPtr;
10658
10659 /**
10660  * A CResult_BlindedForwardDecodeErrorZ represents the result of a fallible operation,
10661  * containing a crate::lightning::ln::channelmanager::BlindedForward on success and a crate::lightning::ln::msgs::DecodeError on failure.
10662  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10663  */
10664 typedef struct LDKCResult_BlindedForwardDecodeErrorZ {
10665    /**
10666     * The contents of this CResult_BlindedForwardDecodeErrorZ, accessible via either
10667     * `err` or `result` depending on the state of `result_ok`.
10668     */
10669    union LDKCResult_BlindedForwardDecodeErrorZPtr contents;
10670    /**
10671     * Whether this CResult_BlindedForwardDecodeErrorZ represents a success state.
10672     */
10673    bool result_ok;
10674 } LDKCResult_BlindedForwardDecodeErrorZ;
10675
10676
10677
10678 /**
10679  * BOLT 4 onion packet including hop data for the next peer.
10680  */
10681 typedef struct MUST_USE_STRUCT LDKOnionPacket {
10682    /**
10683     * A pointer to the opaque Rust object.
10684     * Nearly everywhere, inner must be non-null, however in places where
10685     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10686     */
10687    LDKnativeOnionPacket *inner;
10688    /**
10689     * Indicates that this is the only struct which contains the same pointer.
10690     * Rust functions which take ownership of an object provided via an argument require
10691     * this to be true and invalidate the object pointed to by inner.
10692     */
10693    bool is_owned;
10694 } LDKOnionPacket;
10695
10696
10697
10698 /**
10699  * Information communicated in the onion to the recipient for multi-part tracking and proof that
10700  * the payment is associated with an invoice.
10701  */
10702 typedef struct MUST_USE_STRUCT LDKFinalOnionHopData {
10703    /**
10704     * A pointer to the opaque Rust object.
10705     * Nearly everywhere, inner must be non-null, however in places where
10706     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10707     */
10708    LDKnativeFinalOnionHopData *inner;
10709    /**
10710     * Indicates that this is the only struct which contains the same pointer.
10711     * Rust functions which take ownership of an object provided via an argument require
10712     * this to be true and invalidate the object pointed to by inner.
10713     */
10714    bool is_owned;
10715 } LDKFinalOnionHopData;
10716
10717 /**
10718  * Information about where a received HTLC('s onion) has indicated the HTLC should go.
10719  */
10720 typedef enum LDKPendingHTLCRouting_Tag {
10721    /**
10722     * An HTLC which should be forwarded on to another node.
10723     */
10724    LDKPendingHTLCRouting_Forward,
10725    /**
10726     * The onion indicates that this is a payment for an invoice (supposedly) generated by us.
10727     *
10728     * Note that at this point, we have not checked that the invoice being paid was actually
10729     * generated by us, but rather it's claiming to pay an invoice of ours.
10730     */
10731    LDKPendingHTLCRouting_Receive,
10732    /**
10733     * The onion indicates that this is for payment to us but which contains the preimage for
10734     * claiming included, and is unrelated to any invoice we'd previously generated (aka a
10735     * \"keysend\" or \"spontaneous\" payment).
10736     */
10737    LDKPendingHTLCRouting_ReceiveKeysend,
10738    /**
10739     * Must be last for serialization purposes
10740     */
10741    LDKPendingHTLCRouting_Sentinel,
10742 } LDKPendingHTLCRouting_Tag;
10743
10744 typedef struct LDKPendingHTLCRouting_LDKForward_Body {
10745    /**
10746     * The onion which should be included in the forwarded HTLC, telling the next hop what to
10747     * do with the HTLC.
10748     */
10749    struct LDKOnionPacket onion_packet;
10750    /**
10751     * The short channel ID of the channel which we were instructed to forward this HTLC to.
10752     *
10753     * This could be a real on-chain SCID, an SCID alias, or some other SCID which has meaning
10754     * to the receiving node, such as one returned from
10755     * [`ChannelManager::get_intercept_scid`] or [`ChannelManager::get_phantom_scid`].
10756     */
10757    uint64_t short_channel_id;
10758    /**
10759     * Set if this HTLC is being forwarded within a blinded path.
10760     *
10761     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10762     */
10763    struct LDKBlindedForward blinded;
10764 } LDKPendingHTLCRouting_LDKForward_Body;
10765
10766 typedef struct LDKPendingHTLCRouting_LDKReceive_Body {
10767    /**
10768     * Information about the amount the sender intended to pay and (potential) proof that this
10769     * is a payment for an invoice we generated. This proof of payment is is also used for
10770     * linking MPP parts of a larger payment.
10771     */
10772    struct LDKFinalOnionHopData payment_data;
10773    /**
10774     * Additional data which we (allegedly) instructed the sender to include in the onion.
10775     *
10776     * For HTLCs received by LDK, this will ultimately be exposed in
10777     * [`Event::PaymentClaimable::onion_fields`] as
10778     * [`RecipientOnionFields::payment_metadata`].
10779     */
10780    struct LDKCOption_CVec_u8ZZ payment_metadata;
10781    /**
10782     * The context of the payment included by the recipient in a blinded path, or `None` if a
10783     * blinded path was not used.
10784     *
10785     * Used in part to determine the [`events::PaymentPurpose`].
10786     */
10787    struct LDKCOption_PaymentContextZ payment_context;
10788    /**
10789     * CLTV expiry of the received HTLC.
10790     *
10791     * Used to track when we should expire pending HTLCs that go unclaimed.
10792     */
10793    uint32_t incoming_cltv_expiry;
10794    /**
10795     * If the onion had forwarding instructions to one of our phantom node SCIDs, this will
10796     * provide the onion shared secret used to decrypt the next level of forwarding
10797     * instructions.
10798     *
10799     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10800     */
10801    struct LDKThirtyTwoBytes phantom_shared_secret;
10802    /**
10803     * Custom TLVs which were set by the sender.
10804     *
10805     * For HTLCs received by LDK, this will ultimately be exposed in
10806     * [`Event::PaymentClaimable::onion_fields`] as
10807     * [`RecipientOnionFields::custom_tlvs`].
10808     */
10809    struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
10810    /**
10811     * Set if this HTLC is the final hop in a multi-hop blinded path.
10812     */
10813    bool requires_blinded_error;
10814 } LDKPendingHTLCRouting_LDKReceive_Body;
10815
10816 typedef struct LDKPendingHTLCRouting_LDKReceiveKeysend_Body {
10817    /**
10818     * Information about the amount the sender intended to pay and possibly a token to
10819     * associate MPP parts of a larger payment.
10820     *
10821     * This will only be filled in if receiving MPP keysend payments is enabled, and it being
10822     * present will cause deserialization to fail on versions of LDK prior to 0.0.116.
10823     *
10824     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
10825     */
10826    struct LDKFinalOnionHopData payment_data;
10827    /**
10828     * Preimage for this onion payment. This preimage is provided by the sender and will be
10829     * used to settle the spontaneous payment.
10830     */
10831    struct LDKThirtyTwoBytes payment_preimage;
10832    /**
10833     * Additional data which we (allegedly) instructed the sender to include in the onion.
10834     *
10835     * For HTLCs received by LDK, this will ultimately bubble back up as
10836     * [`RecipientOnionFields::payment_metadata`].
10837     */
10838    struct LDKCOption_CVec_u8ZZ payment_metadata;
10839    /**
10840     * CLTV expiry of the received HTLC.
10841     *
10842     * Used to track when we should expire pending HTLCs that go unclaimed.
10843     */
10844    uint32_t incoming_cltv_expiry;
10845    /**
10846     * Custom TLVs which were set by the sender.
10847     *
10848     * For HTLCs received by LDK, these will ultimately bubble back up as
10849     * [`RecipientOnionFields::custom_tlvs`].
10850     */
10851    struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
10852    /**
10853     * Set if this HTLC is the final hop in a multi-hop blinded path.
10854     */
10855    bool requires_blinded_error;
10856 } LDKPendingHTLCRouting_LDKReceiveKeysend_Body;
10857
10858 typedef struct MUST_USE_STRUCT LDKPendingHTLCRouting {
10859    LDKPendingHTLCRouting_Tag tag;
10860    union {
10861       LDKPendingHTLCRouting_LDKForward_Body forward;
10862       LDKPendingHTLCRouting_LDKReceive_Body receive;
10863       LDKPendingHTLCRouting_LDKReceiveKeysend_Body receive_keysend;
10864    };
10865 } LDKPendingHTLCRouting;
10866
10867 /**
10868  * The contents of CResult_PendingHTLCRoutingDecodeErrorZ
10869  */
10870 typedef union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr {
10871    /**
10872     * A pointer to the contents in the success state.
10873     * Reading from this pointer when `result_ok` is not set is undefined.
10874     */
10875    struct LDKPendingHTLCRouting *result;
10876    /**
10877     * A pointer to the contents in the error state.
10878     * Reading from this pointer when `result_ok` is set is undefined.
10879     */
10880    struct LDKDecodeError *err;
10881 } LDKCResult_PendingHTLCRoutingDecodeErrorZPtr;
10882
10883 /**
10884  * A CResult_PendingHTLCRoutingDecodeErrorZ represents the result of a fallible operation,
10885  * containing a crate::lightning::ln::channelmanager::PendingHTLCRouting on success and a crate::lightning::ln::msgs::DecodeError on failure.
10886  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10887  */
10888 typedef struct LDKCResult_PendingHTLCRoutingDecodeErrorZ {
10889    /**
10890     * The contents of this CResult_PendingHTLCRoutingDecodeErrorZ, accessible via either
10891     * `err` or `result` depending on the state of `result_ok`.
10892     */
10893    union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr contents;
10894    /**
10895     * Whether this CResult_PendingHTLCRoutingDecodeErrorZ represents a success state.
10896     */
10897    bool result_ok;
10898 } LDKCResult_PendingHTLCRoutingDecodeErrorZ;
10899
10900 /**
10901  * The contents of CResult_PendingHTLCInfoDecodeErrorZ
10902  */
10903 typedef union LDKCResult_PendingHTLCInfoDecodeErrorZPtr {
10904    /**
10905     * A pointer to the contents in the success state.
10906     * Reading from this pointer when `result_ok` is not set is undefined.
10907     */
10908    struct LDKPendingHTLCInfo *result;
10909    /**
10910     * A pointer to the contents in the error state.
10911     * Reading from this pointer when `result_ok` is set is undefined.
10912     */
10913    struct LDKDecodeError *err;
10914 } LDKCResult_PendingHTLCInfoDecodeErrorZPtr;
10915
10916 /**
10917  * A CResult_PendingHTLCInfoDecodeErrorZ represents the result of a fallible operation,
10918  * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
10919  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10920  */
10921 typedef struct LDKCResult_PendingHTLCInfoDecodeErrorZ {
10922    /**
10923     * The contents of this CResult_PendingHTLCInfoDecodeErrorZ, accessible via either
10924     * `err` or `result` depending on the state of `result_ok`.
10925     */
10926    union LDKCResult_PendingHTLCInfoDecodeErrorZPtr contents;
10927    /**
10928     * Whether this CResult_PendingHTLCInfoDecodeErrorZ represents a success state.
10929     */
10930    bool result_ok;
10931 } LDKCResult_PendingHTLCInfoDecodeErrorZ;
10932
10933 /**
10934  * The contents of CResult_BlindedFailureDecodeErrorZ
10935  */
10936 typedef union LDKCResult_BlindedFailureDecodeErrorZPtr {
10937    /**
10938     * A pointer to the contents in the success state.
10939     * Reading from this pointer when `result_ok` is not set is undefined.
10940     */
10941    enum LDKBlindedFailure *result;
10942    /**
10943     * A pointer to the contents in the error state.
10944     * Reading from this pointer when `result_ok` is set is undefined.
10945     */
10946    struct LDKDecodeError *err;
10947 } LDKCResult_BlindedFailureDecodeErrorZPtr;
10948
10949 /**
10950  * A CResult_BlindedFailureDecodeErrorZ represents the result of a fallible operation,
10951  * containing a crate::lightning::ln::channelmanager::BlindedFailure on success and a crate::lightning::ln::msgs::DecodeError on failure.
10952  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10953  */
10954 typedef struct LDKCResult_BlindedFailureDecodeErrorZ {
10955    /**
10956     * The contents of this CResult_BlindedFailureDecodeErrorZ, accessible via either
10957     * `err` or `result` depending on the state of `result_ok`.
10958     */
10959    union LDKCResult_BlindedFailureDecodeErrorZPtr contents;
10960    /**
10961     * Whether this CResult_BlindedFailureDecodeErrorZ represents a success state.
10962     */
10963    bool result_ok;
10964 } LDKCResult_BlindedFailureDecodeErrorZ;
10965
10966 /**
10967  * The contents of CResult_ChannelShutdownStateDecodeErrorZ
10968  */
10969 typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
10970    /**
10971     * A pointer to the contents in the success state.
10972     * Reading from this pointer when `result_ok` is not set is undefined.
10973     */
10974    enum LDKChannelShutdownState *result;
10975    /**
10976     * A pointer to the contents in the error state.
10977     * Reading from this pointer when `result_ok` is set is undefined.
10978     */
10979    struct LDKDecodeError *err;
10980 } LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
10981
10982 /**
10983  * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
10984  * containing a crate::lightning::ln::channelmanager::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
10985  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10986  */
10987 typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
10988    /**
10989     * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
10990     * `err` or `result` depending on the state of `result_ok`.
10991     */
10992    union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
10993    /**
10994     * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
10995     */
10996    bool result_ok;
10997 } LDKCResult_ChannelShutdownStateDecodeErrorZ;
10998
10999
11000
11001 /**
11002  * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
11003  * on-chain transactions to ensure no loss of funds occurs.
11004  *
11005  * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
11006  * information and are actively monitoring the chain.
11007  *
11008  * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
11009  * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
11010  * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
11011  * returned block hash and the the current chain and then reconnecting blocks to get to the
11012  * best chain) upon deserializing the object!
11013  */
11014 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
11015    /**
11016     * A pointer to the opaque Rust object.
11017     * Nearly everywhere, inner must be non-null, however in places where
11018     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11019     */
11020    LDKnativeChannelMonitor *inner;
11021    /**
11022     * Indicates that this is the only struct which contains the same pointer.
11023     * Rust functions which take ownership of an object provided via an argument require
11024     * this to be true and invalidate the object pointed to by inner.
11025     */
11026    bool is_owned;
11027 } LDKChannelMonitor;
11028
11029 /**
11030  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
11031  * This corresponds to std::vector in C++
11032  */
11033 typedef struct LDKCVec_ChannelMonitorZ {
11034    /**
11035     * The elements in the array.
11036     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11037     */
11038    struct LDKChannelMonitor *data;
11039    /**
11040     * The number of elements pointed to by `data`.
11041     */
11042    uintptr_t datalen;
11043 } LDKCVec_ChannelMonitorZ;
11044
11045
11046
11047 /**
11048  * An update generated by the underlying channel itself which contains some new information the
11049  * [`ChannelMonitor`] should be made aware of.
11050  *
11051  * Because this represents only a small number of updates to the underlying state, it is generally
11052  * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
11053  * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
11054  * transaction), a single update may reach upwards of 1 MiB in serialized size.
11055  */
11056 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
11057    /**
11058     * A pointer to the opaque Rust object.
11059     * Nearly everywhere, inner must be non-null, however in places where
11060     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11061     */
11062    LDKnativeChannelMonitorUpdate *inner;
11063    /**
11064     * Indicates that this is the only struct which contains the same pointer.
11065     * Rust functions which take ownership of an object provided via an argument require
11066     * this to be true and invalidate the object pointed to by inner.
11067     */
11068    bool is_owned;
11069 } LDKChannelMonitorUpdate;
11070
11071 /**
11072  * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
11073  * blocks are connected and disconnected.
11074  *
11075  * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
11076  * responsible for maintaining a set of monitors such that they can be updated as channel state
11077  * changes. On each update, *all copies* of a [`ChannelMonitor`] must be updated and the update
11078  * persisted to disk to ensure that the latest [`ChannelMonitor`] state can be reloaded if the
11079  * application crashes.
11080  *
11081  * See method documentation and [`ChannelMonitorUpdateStatus`] for specific requirements.
11082  */
11083 typedef struct LDKWatch {
11084    /**
11085     * An opaque pointer which is passed to your function implementations as an argument.
11086     * This has no meaning in the LDK, and can be NULL or any other value.
11087     */
11088    void *this_arg;
11089    /**
11090     * Watches a channel identified by `funding_txo` using `monitor`.
11091     *
11092     * Implementations are responsible for watching the chain for the funding transaction along
11093     * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
11094     * calling [`block_connected`] and [`block_disconnected`] on the monitor.
11095     *
11096     * A return of `Err(())` indicates that the channel should immediately be force-closed without
11097     * broadcasting the funding transaction.
11098     *
11099     * If the given `funding_txo` has previously been registered via `watch_channel`, `Err(())`
11100     * must be returned.
11101     *
11102     * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
11103     * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
11104     * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
11105     */
11106    struct LDKCResult_ChannelMonitorUpdateStatusNoneZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
11107    /**
11108     * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
11109     *
11110     * Implementations must call [`ChannelMonitor::update_monitor`] with the given update. This
11111     * may fail (returning an `Err(())`), in which case this should return
11112     * [`ChannelMonitorUpdateStatus::InProgress`] (and the update should never complete). This
11113     * generally implies the channel has been closed (either by the funding outpoint being spent
11114     * on-chain or the [`ChannelMonitor`] having decided to do so and broadcasted a transaction),
11115     * and the [`ChannelManager`] state will be updated once it sees the funding spend on-chain.
11116     *
11117     * In general, persistence failures should be retried after returning
11118     * [`ChannelMonitorUpdateStatus::InProgress`] and eventually complete. If a failure truly
11119     * cannot be retried, the node should shut down immediately after returning
11120     * [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
11121     *
11122     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11123     */
11124    enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
11125    /**
11126     * Returns any monitor events since the last call. Subsequent calls must only return new
11127     * events.
11128     *
11129     * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
11130     * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
11131     * to disk.
11132     *
11133     * For details on asynchronous [`ChannelMonitor`] updating and returning
11134     * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
11135     */
11136    struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
11137    /**
11138     * Frees any resources associated with this object given its this_arg pointer.
11139     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11140     */
11141    void (*free)(void *this_arg);
11142 } LDKWatch;
11143
11144 /**
11145  * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
11146  * This corresponds to std::vector in C++
11147  */
11148 typedef struct LDKCVec_TransactionZ {
11149    /**
11150     * The elements in the array.
11151     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11152     */
11153    struct LDKTransaction *data;
11154    /**
11155     * The number of elements pointed to by `data`.
11156     */
11157    uintptr_t datalen;
11158 } LDKCVec_TransactionZ;
11159
11160 /**
11161  * An interface to send a transaction to the Bitcoin network.
11162  */
11163 typedef struct LDKBroadcasterInterface {
11164    /**
11165     * An opaque pointer which is passed to your function implementations as an argument.
11166     * This has no meaning in the LDK, and can be NULL or any other value.
11167     */
11168    void *this_arg;
11169    /**
11170     * Sends a list of transactions out to (hopefully) be mined.
11171     * This only needs to handle the actual broadcasting of transactions, LDK will automatically
11172     * rebroadcast transactions that haven't made it into a block.
11173     *
11174     * In some cases LDK may attempt to broadcast a transaction which double-spends another
11175     * and this isn't a bug and can be safely ignored.
11176     *
11177     * If more than one transaction is given, these transactions should be considered to be a
11178     * package and broadcast together. Some of the transactions may or may not depend on each other,
11179     * be sure to manage both cases correctly.
11180     *
11181     * Bitcoin transaction packages are defined in BIP 331 and here:
11182     * <https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md>
11183     */
11184    void (*broadcast_transactions)(const void *this_arg, struct LDKCVec_TransactionZ txs);
11185    /**
11186     * Frees any resources associated with this object given its this_arg pointer.
11187     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11188     */
11189    void (*free)(void *this_arg);
11190 } LDKBroadcasterInterface;
11191
11192 /**
11193  * A trait that describes a source of entropy.
11194  */
11195 typedef struct LDKEntropySource {
11196    /**
11197     * An opaque pointer which is passed to your function implementations as an argument.
11198     * This has no meaning in the LDK, and can be NULL or any other value.
11199     */
11200    void *this_arg;
11201    /**
11202     * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
11203     * different value each time it is called.
11204     */
11205    struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
11206    /**
11207     * Frees any resources associated with this object given its this_arg pointer.
11208     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11209     */
11210    void (*free)(void *this_arg);
11211 } LDKEntropySource;
11212
11213
11214
11215 /**
11216  * A semantically valid [`InvoiceRequest`] that hasn't been signed.
11217  *
11218  * # Serialization
11219  *
11220  * This is serialized as a TLV stream, which includes TLV records from the originating message. As
11221  * such, it may include unknown, odd TLV records.
11222  */
11223 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
11224    /**
11225     * A pointer to the opaque Rust object.
11226     * Nearly everywhere, inner must be non-null, however in places where
11227     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11228     */
11229    LDKnativeUnsignedInvoiceRequest *inner;
11230    /**
11231     * Indicates that this is the only struct which contains the same pointer.
11232     * Rust functions which take ownership of an object provided via an argument require
11233     * this to be true and invalidate the object pointed to by inner.
11234     */
11235    bool is_owned;
11236 } LDKUnsignedInvoiceRequest;
11237
11238
11239
11240 /**
11241  * The unsigned part of a [`channel_update`] message.
11242  *
11243  * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
11244  */
11245 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
11246    /**
11247     * A pointer to the opaque Rust object.
11248     * Nearly everywhere, inner must be non-null, however in places where
11249     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11250     */
11251    LDKnativeUnsignedChannelUpdate *inner;
11252    /**
11253     * Indicates that this is the only struct which contains the same pointer.
11254     * Rust functions which take ownership of an object provided via an argument require
11255     * this to be true and invalidate the object pointed to by inner.
11256     */
11257    bool is_owned;
11258 } LDKUnsignedChannelUpdate;
11259
11260
11261
11262 /**
11263  * The unsigned part of a [`node_announcement`] message.
11264  *
11265  * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
11266  */
11267 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
11268    /**
11269     * A pointer to the opaque Rust object.
11270     * Nearly everywhere, inner must be non-null, however in places where
11271     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11272     */
11273    LDKnativeUnsignedNodeAnnouncement *inner;
11274    /**
11275     * Indicates that this is the only struct which contains the same pointer.
11276     * Rust functions which take ownership of an object provided via an argument require
11277     * this to be true and invalidate the object pointed to by inner.
11278     */
11279    bool is_owned;
11280 } LDKUnsignedNodeAnnouncement;
11281
11282 /**
11283  * Represents the set of gossip messages that require a signature from a node's identity key.
11284  */
11285 typedef enum LDKUnsignedGossipMessage_Tag {
11286    /**
11287     * An unsigned channel announcement.
11288     */
11289    LDKUnsignedGossipMessage_ChannelAnnouncement,
11290    /**
11291     * An unsigned channel update.
11292     */
11293    LDKUnsignedGossipMessage_ChannelUpdate,
11294    /**
11295     * An unsigned node announcement.
11296     */
11297    LDKUnsignedGossipMessage_NodeAnnouncement,
11298    /**
11299     * Must be last for serialization purposes
11300     */
11301    LDKUnsignedGossipMessage_Sentinel,
11302 } LDKUnsignedGossipMessage_Tag;
11303
11304 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
11305    LDKUnsignedGossipMessage_Tag tag;
11306    union {
11307       struct {
11308          struct LDKUnsignedChannelAnnouncement channel_announcement;
11309       };
11310       struct {
11311          struct LDKUnsignedChannelUpdate channel_update;
11312       };
11313       struct {
11314          struct LDKUnsignedNodeAnnouncement node_announcement;
11315       };
11316    };
11317 } LDKUnsignedGossipMessage;
11318
11319 /**
11320  * A trait that can handle cryptographic operations at the scope level of a node.
11321  */
11322 typedef struct LDKNodeSigner {
11323    /**
11324     * An opaque pointer which is passed to your function implementations as an argument.
11325     * This has no meaning in the LDK, and can be NULL or any other value.
11326     */
11327    void *this_arg;
11328    /**
11329     * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
11330     *
11331     * If the implementor of this trait supports [phantom node payments], then every node that is
11332     * intended to be included in the phantom invoice route hints must return the same value from
11333     * this method.
11334     *
11335     * This method must return the same value each time it is called.
11336     *
11337     * [phantom node payments]: PhantomKeysManager
11338     */
11339    struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
11340    /**
11341     * Get node id based on the provided [`Recipient`].
11342     *
11343     * This method must return the same value each time it is called with a given [`Recipient`]
11344     * parameter.
11345     *
11346     * Errors if the [`Recipient`] variant is not supported by the implementation.
11347     */
11348    struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
11349    /**
11350     * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
11351     * one is provided. Note that this tweak can be applied to `other_key` instead of our node
11352     * secret, though this is less efficient.
11353     *
11354     * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
11355     * should be resolved to allow LDK to resume forwarding HTLCs.
11356     *
11357     * Errors if the [`Recipient`] variant is not supported by the implementation.
11358     */
11359    struct LDKCResult_ThirtyTwoBytesNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak);
11360    /**
11361     * Sign an invoice.
11362     *
11363     * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
11364     * this trait to parse the invoice and make sure they're signing what they expect, rather than
11365     * blindly signing the hash.
11366     *
11367     * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
11368     *
11369     * The secret key used to sign the invoice is dependent on the [`Recipient`].
11370     *
11371     * Errors if the [`Recipient`] variant is not supported by the implementation.
11372     */
11373    struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
11374    /**
11375     * Signs the [`TaggedHash`] of a BOLT 12 invoice request.
11376     *
11377     * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where
11378     * `invoice_request` is the callee.
11379     *
11380     * Implementors may check that the `invoice_request` is expected rather than blindly signing
11381     * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with
11382     * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with
11383     * [`UnsignedInvoiceRequest::payer_id`].
11384     *
11385     * [`TaggedHash`]: crate::offers::merkle::TaggedHash
11386     */
11387    struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request);
11388    /**
11389     * Signs the [`TaggedHash`] of a BOLT 12 invoice.
11390     *
11391     * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
11392     * callee.
11393     *
11394     * Implementors may check that the `invoice` is expected rather than blindly signing the tagged
11395     * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing
11396     * key or an ephemeral key to preserve privacy, whichever is associated with
11397     * [`UnsignedBolt12Invoice::signing_pubkey`].
11398     *
11399     * [`TaggedHash`]: crate::offers::merkle::TaggedHash
11400     */
11401    struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice);
11402    /**
11403     * Sign a gossip message.
11404     *
11405     * Note that if this fails, LDK may panic and the message will not be broadcast to the network
11406     * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
11407     * message to be broadcast, as otherwise it may prevent one from receiving funds over the
11408     * corresponding channel.
11409     */
11410    struct LDKCResult_ECDSASignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
11411    /**
11412     * Frees any resources associated with this object given its this_arg pointer.
11413     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11414     */
11415    void (*free)(void *this_arg);
11416 } LDKNodeSigner;
11417
11418 /**
11419  * A trait that can return signer instances for individual channels.
11420  */
11421 typedef struct LDKSignerProvider {
11422    /**
11423     * An opaque pointer which is passed to your function implementations as an argument.
11424     * This has no meaning in the LDK, and can be NULL or any other value.
11425     */
11426    void *this_arg;
11427    /**
11428     * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::EcdsaSigner`] through
11429     * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
11430     * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
11431     * `channel_keys_id`.
11432     *
11433     * This method must return a different value each time it is called.
11434     */
11435    struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
11436    /**
11437     * Derives the private key material backing a `Signer`.
11438     *
11439     * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
11440     * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
11441     * re-derived from its `channel_keys_id`, which can be obtained through its trait method
11442     * [`ChannelSigner::channel_keys_id`].
11443     */
11444    struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
11445    /**
11446     * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
11447     * This is only called during deserialization of other objects which contain
11448     * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
11449     * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
11450     * contain no versioning scheme. You may wish to include your own version prefix and ensure
11451     * you've read all of the provided bytes to ensure no corruption occurred.
11452     *
11453     * This method is slowly being phased out -- it will only be called when reading objects
11454     * written by LDK versions prior to 0.0.113.
11455     *
11456     * [`Signer`]: Self::EcdsaSigner
11457     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
11458     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11459     */
11460    struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
11461    /**
11462     * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
11463     *
11464     * If this function returns an error, this will result in a channel failing to open.
11465     *
11466     * This method should return a different value each time it is called, to avoid linking
11467     * on-chain funds across channels as controlled to the same user. `channel_keys_id` may be
11468     * used to derive a unique value for each channel.
11469     */
11470    struct LDKCResult_CVec_u8ZNoneZ (*get_destination_script)(const void *this_arg, struct LDKThirtyTwoBytes channel_keys_id);
11471    /**
11472     * Get a script pubkey which we will send funds to when closing a channel.
11473     *
11474     * If this function returns an error, this will result in a channel failing to open or close.
11475     * In the event of a failure when the counterparty is initiating a close, this can result in a
11476     * channel force close.
11477     *
11478     * This method should return a different value each time it is called, to avoid linking
11479     * on-chain funds across channels as controlled to the same user.
11480     */
11481    struct LDKCResult_ShutdownScriptNoneZ (*get_shutdown_scriptpubkey)(const void *this_arg);
11482    /**
11483     * Frees any resources associated with this object given its this_arg pointer.
11484     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11485     */
11486    void (*free)(void *this_arg);
11487 } LDKSignerProvider;
11488
11489 /**
11490  * A trait which should be implemented to provide feerate information on a number of time
11491  * horizons.
11492  *
11493  * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of
11494  * third-parties hosting them. Note that this enables them to affect the propagation of your
11495  * pre-signed transactions at any time and therefore endangers the safety of channels funds. It
11496  * should be considered carefully as a deployment.
11497  *
11498  * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
11499  * called from inside the library in response to chain events, P2P events, or timer events).
11500  *
11501  * LDK may generate a substantial number of fee-estimation calls in some cases. You should
11502  * pre-calculate and cache the fee estimate results to ensure you don't substantially slow HTLC
11503  * handling.
11504  */
11505 typedef struct LDKFeeEstimator {
11506    /**
11507     * An opaque pointer which is passed to your function implementations as an argument.
11508     * This has no meaning in the LDK, and can be NULL or any other value.
11509     */
11510    void *this_arg;
11511    /**
11512     * Gets estimated satoshis of fee required per 1000 Weight-Units.
11513     *
11514     * LDK will wrap this method and ensure that the value returned is no smaller than 253
11515     * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
11516     *
11517     * The following unit conversions can be used to convert to sats/KW:
11518     *  * satoshis-per-byte * 250
11519     *  * satoshis-per-kbyte / 4
11520     */
11521    uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
11522    /**
11523     * Frees any resources associated with this object given its this_arg pointer.
11524     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11525     */
11526    void (*free)(void *this_arg);
11527 } LDKFeeEstimator;
11528
11529
11530
11531 /**
11532  * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and
11533  * may not be valid if received by another lightning implementation.
11534  */
11535 typedef struct MUST_USE_STRUCT LDKReceiveTlvs {
11536    /**
11537     * A pointer to the opaque Rust object.
11538     * Nearly everywhere, inner must be non-null, however in places where
11539     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11540     */
11541    LDKnativeReceiveTlvs *inner;
11542    /**
11543     * Indicates that this is the only struct which contains the same pointer.
11544     * Rust functions which take ownership of an object provided via an argument require
11545     * this to be true and invalidate the object pointed to by inner.
11546     */
11547    bool is_owned;
11548 } LDKReceiveTlvs;
11549
11550 /**
11551  * A trait defining behavior for routing an [`OnionMessage`].
11552  */
11553 typedef struct LDKMessageRouter {
11554    /**
11555     * An opaque pointer which is passed to your function implementations as an argument.
11556     * This has no meaning in the LDK, and can be NULL or any other value.
11557     */
11558    void *this_arg;
11559    /**
11560     * Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
11561     */
11562    struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
11563    /**
11564     * Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be
11565     * direct peers with the `recipient`.
11566     */
11567    struct LDKCResult_CVec_BlindedPathZNoneZ (*create_blinded_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_PublicKeyZ peers);
11568    /**
11569     * Frees any resources associated with this object given its this_arg pointer.
11570     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11571     */
11572    void (*free)(void *this_arg);
11573 } LDKMessageRouter;
11574
11575 /**
11576  * A trait defining behavior for routing a payment.
11577  */
11578 typedef struct LDKRouter {
11579    /**
11580     * An opaque pointer which is passed to your function implementations as an argument.
11581     * This has no meaning in the LDK, and can be NULL or any other value.
11582     */
11583    void *this_arg;
11584    /**
11585     * Finds a [`Route`] for a payment between the given `payer` and a payee.
11586     *
11587     * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
11588     * and [`RouteParameters::final_value_msat`], respectively.
11589     *
11590     * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
11591     */
11592    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);
11593    /**
11594     * Finds a [`Route`] for a payment between the given `payer` and a payee.
11595     *
11596     * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
11597     * and [`RouteParameters::final_value_msat`], respectively.
11598     *
11599     * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific
11600     * payment.
11601     *
11602     * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
11603     */
11604    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);
11605    /**
11606     * Creates [`BlindedPath`]s for payment to the `recipient` node. The channels in `first_hops`
11607     * are assumed to be with the `recipient`'s peers. The payment secret and any constraints are
11608     * given in `tlvs`.
11609     */
11610    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);
11611    /**
11612     * Implementation of MessageRouter for this object.
11613     */
11614    struct LDKMessageRouter MessageRouter;
11615    /**
11616     * Frees any resources associated with this object given its this_arg pointer.
11617     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11618     */
11619    void (*free)(void *this_arg);
11620 } LDKRouter;
11621
11622
11623
11624 /**
11625  * A lightning node's channel state machine and payment management logic, which facilitates
11626  * sending, forwarding, and receiving payments through lightning channels.
11627  *
11628  * [`ChannelManager`] is parameterized by a number of components to achieve this.
11629  * - [`chain::Watch`] (typically [`ChainMonitor`]) for on-chain monitoring and enforcement of each
11630  *   channel
11631  * - [`BroadcasterInterface`] for broadcasting transactions related to opening, funding, and
11632  *   closing channels
11633  * - [`EntropySource`] for providing random data needed for cryptographic operations
11634  * - [`NodeSigner`] for cryptographic operations scoped to the node
11635  * - [`SignerProvider`] for providing signers whose operations are scoped to individual channels
11636  * - [`FeeEstimator`] to determine transaction fee rates needed to have a transaction mined in a
11637  *   timely manner
11638  * - [`Router`] for finding payment paths when initiating and retrying payments
11639  * - [`Logger`] for logging operational information of varying degrees
11640  *
11641  * Additionally, it implements the following traits:
11642  * - [`ChannelMessageHandler`] to handle off-chain channel activity from peers
11643  * - [`MessageSendEventsProvider`] to similarly send such messages to peers
11644  * - [`OffersMessageHandler`] for BOLT 12 message handling and sending
11645  * - [`EventsProvider`] to generate user-actionable [`Event`]s
11646  * - [`chain::Listen`] and [`chain::Confirm`] for notification of on-chain activity
11647  *
11648  * Thus, [`ChannelManager`] is typically used to parameterize a [`MessageHandler`] and an
11649  * [`OnionMessenger`]. The latter is required to support BOLT 12 functionality.
11650  *
11651  * # `ChannelManager` vs `ChannelMonitor`
11652  *
11653  * It's important to distinguish between the *off-chain* management and *on-chain* enforcement of
11654  * lightning channels. [`ChannelManager`] exchanges messages with peers to manage the off-chain
11655  * state of each channel. During this process, it generates a [`ChannelMonitor`] for each channel
11656  * and a [`ChannelMonitorUpdate`] for each relevant change, notifying its parameterized
11657  * [`chain::Watch`] of them.
11658  *
11659  * An implementation of [`chain::Watch`], such as [`ChainMonitor`], is responsible for aggregating
11660  * these [`ChannelMonitor`]s and applying any [`ChannelMonitorUpdate`]s to them. It then monitors
11661  * for any pertinent on-chain activity, enforcing claims as needed.
11662  *
11663  * This division of off-chain management and on-chain enforcement allows for interesting node
11664  * setups. For instance, on-chain enforcement could be moved to a separate host or have added
11665  * redundancy, possibly as a watchtower. See [`chain::Watch`] for the relevant interface.
11666  *
11667  * # Initialization
11668  *
11669  * Use [`ChannelManager::new`] with the most recent [`BlockHash`] when creating a fresh instance.
11670  * Otherwise, if restarting, construct [`ChannelManagerReadArgs`] with the necessary parameters and
11671  * references to any deserialized [`ChannelMonitor`]s that were previously persisted. Use this to
11672  * deserialize the [`ChannelManager`] and feed it any new chain data since it was last online, as
11673  * detailed in the [`ChannelManagerReadArgs`] documentation.
11674  *
11675  * ```
11676  * use bitcoin::BlockHash;
11677  * use bitcoin::network::constants::Network;
11678  * use lightning::chain::BestBlock;
11679  * # use lightning::chain::channelmonitor::ChannelMonitor;
11680  * use lightning::ln::channelmanager::{ChainParameters, ChannelManager, ChannelManagerReadArgs};
11681  * # use lightning::routing::gossip::NetworkGraph;
11682  * use lightning::util::config::UserConfig;
11683  * use lightning::util::ser::ReadableArgs;
11684  *
11685  * # fn read_channel_monitors() -> Vec<ChannelMonitor<lightning::sign::InMemorySigner>> { vec![] }
11686  * # fn example<
11687  * #     'a,
11688  * #     L: lightning::util::logger::Logger,
11689  * #     ES: lightning::sign::EntropySource,
11690  * #     S: for <'b> lightning::routing::scoring::LockableScore<'b, ScoreLookUp = SL>,
11691  * #     SL: lightning::routing::scoring::ScoreLookUp<ScoreParams = SP>,
11692  * #     SP: Sized,
11693  * #     R: lightning::io::Read,
11694  * # >(
11695  * #     fee_estimator: &dyn lightning::chain::chaininterface::FeeEstimator,
11696  * #     chain_monitor: &dyn lightning::chain::Watch<lightning::sign::InMemorySigner>,
11697  * #     tx_broadcaster: &dyn lightning::chain::chaininterface::BroadcasterInterface,
11698  * #     router: &lightning::routing::router::DefaultRouter<&NetworkGraph<&'a L>, &'a L, &ES, &S, SP, SL>,
11699  * #     logger: &L,
11700  * #     entropy_source: &ES,
11701  * #     node_signer: &dyn lightning::sign::NodeSigner,
11702  * #     signer_provider: &lightning::sign::DynSignerProvider,
11703  * #     best_block: lightning::chain::BestBlock,
11704  * #     current_timestamp: u32,
11705  * #     mut reader: R,
11706  * # ) -> Result<(), lightning::ln::msgs::DecodeError> {
11707  * // Fresh start with no channels
11708  * let params = ChainParameters {
11709  *     network: Network::Bitcoin,
11710  *     best_block,
11711  * };
11712  * let default_config = UserConfig::default();
11713  * let channel_manager = ChannelManager::new(
11714  *     fee_estimator, chain_monitor, tx_broadcaster, router, logger, entropy_source, node_signer,
11715  *     signer_provider, default_config, params, current_timestamp
11716  * );
11717  *
11718  * // Restart from deserialized data
11719  * let mut channel_monitors = read_channel_monitors();
11720  * let args = ChannelManagerReadArgs::new(
11721  *     entropy_source, node_signer, signer_provider, fee_estimator, chain_monitor, tx_broadcaster,
11722  *     router, logger, default_config, channel_monitors.iter_mut().collect()
11723  * );
11724  * let (block_hash, channel_manager) =
11725  *     <(BlockHash, ChannelManager<_, _, _, _, _, _, _, _>)>::read(&mut reader, args)?;
11726  *
11727  * // Update the ChannelManager and ChannelMonitors with the latest chain data
11728  * // ...
11729  *
11730  * // Move the monitors to the ChannelManager's chain::Watch parameter
11731  * for monitor in channel_monitors {
11732  *     chain_monitor.watch_channel(monitor.get_funding_txo().0, monitor);
11733  * }
11734  * # Ok(())
11735  * # }
11736  * ```
11737  *
11738  * # Operation
11739  *
11740  * The following is required for [`ChannelManager`] to function properly:
11741  * - Handle messages from peers using its [`ChannelMessageHandler`] implementation (typically
11742  *   called by [`PeerManager::read_event`] when processing network I/O)
11743  * - Send messages to peers obtained via its [`MessageSendEventsProvider`] implementation
11744  *   (typically initiated when [`PeerManager::process_events`] is called)
11745  * - Feed on-chain activity using either its [`chain::Listen`] or [`chain::Confirm`] implementation
11746  *   as documented by those traits
11747  * - Perform any periodic channel and payment checks by calling [`timer_tick_occurred`] roughly
11748  *   every minute
11749  * - Persist to disk whenever [`get_and_clear_needs_persistence`] returns `true` using a
11750  *   [`Persister`] such as a [`KVStore`] implementation
11751  * - Handle [`Event`]s obtained via its [`EventsProvider`] implementation
11752  *
11753  * The [`Future`] returned by [`get_event_or_persistence_needed_future`] is useful in determining
11754  * when the last two requirements need to be checked.
11755  *
11756  * The [`lightning-block-sync`] and [`lightning-transaction-sync`] crates provide utilities that
11757  * simplify feeding in on-chain activity using the [`chain::Listen`] and [`chain::Confirm`] traits,
11758  * respectively. The remaining requirements can be met using the [`lightning-background-processor`]
11759  * crate. For languages other than Rust, the availability of similar utilities may vary.
11760  *
11761  * # Channels
11762  *
11763  * [`ChannelManager`]'s primary function involves managing a channel state. Without channels,
11764  * payments can't be sent. Use [`list_channels`] or [`list_usable_channels`] for a snapshot of the
11765  * currently open channels.
11766  *
11767  * ```
11768  * # use lightning::ln::channelmanager::AChannelManager;
11769  * #
11770  * # fn example<T: AChannelManager>(channel_manager: T) {
11771  * # let channel_manager = channel_manager.get_cm();
11772  * let channels = channel_manager.list_usable_channels();
11773  * for details in channels {
11774  *     println!(\"{:?}\", details);
11775  * }
11776  * # }
11777  * ```
11778  *
11779  * Each channel is identified using a [`ChannelId`], which will change throughout the channel's
11780  * life cycle. Additionally, channels are assigned a `user_channel_id`, which is given in
11781  * [`Event`]s associated with the channel and serves as a fixed identifier but is otherwise unused
11782  * by [`ChannelManager`].
11783  *
11784  * ## Opening Channels
11785  *
11786  * To an open a channel with a peer, call [`create_channel`]. This will initiate the process of
11787  * opening an outbound channel, which requires self-funding when handling
11788  * [`Event::FundingGenerationReady`].
11789  *
11790  * ```
11791  * # use bitcoin::{ScriptBuf, Transaction};
11792  * # use bitcoin::secp256k1::PublicKey;
11793  * # use lightning::ln::channelmanager::AChannelManager;
11794  * # use lightning::events::{Event, EventsProvider};
11795  * #
11796  * # trait Wallet {
11797  * #     fn create_funding_transaction(
11798  * #         &self, _amount_sats: u64, _output_script: ScriptBuf
11799  * #     ) -> Transaction;
11800  * # }
11801  * #
11802  * # fn example<T: AChannelManager, W: Wallet>(channel_manager: T, wallet: W, peer_id: PublicKey) {
11803  * # let channel_manager = channel_manager.get_cm();
11804  * let value_sats = 1_000_000;
11805  * let push_msats = 10_000_000;
11806  * match channel_manager.create_channel(peer_id, value_sats, push_msats, 42, None, None) {
11807  *     Ok(channel_id) => println!(\"Opening channel {}\", channel_id),
11808  *     Err(e) => println!(\"Error opening channel: {:?}\", e),
11809  * }
11810  *
11811  * // On the event processing thread once the peer has responded
11812  * channel_manager.process_pending_events(&|event| match event {
11813  *     Event::FundingGenerationReady {
11814  *         temporary_channel_id, counterparty_node_id, channel_value_satoshis, output_script,
11815  *         user_channel_id, ..
11816  *     } => {
11817  *         assert_eq!(user_channel_id, 42);
11818  *         let funding_transaction = wallet.create_funding_transaction(
11819  *             channel_value_satoshis, output_script
11820  *         );
11821  *         match channel_manager.funding_transaction_generated(
11822  *             &temporary_channel_id, &counterparty_node_id, funding_transaction
11823  *         ) {
11824  *             Ok(()) => println!(\"Funding channel {}\", temporary_channel_id),
11825  *             Err(e) => println!(\"Error funding channel {}: {:?}\", temporary_channel_id, e),
11826  *         }
11827  *     },
11828  *     Event::ChannelPending { channel_id, user_channel_id, former_temporary_channel_id, .. } => {
11829  *         assert_eq!(user_channel_id, 42);
11830  *         println!(
11831  *             \"Channel {} now {} pending (funding transaction has been broadcasted)\", channel_id,
11832  *             former_temporary_channel_id.unwrap()
11833  *         );
11834  *     },
11835  *     Event::ChannelReady { channel_id, user_channel_id, .. } => {
11836  *         assert_eq!(user_channel_id, 42);
11837  *         println!(\"Channel {} ready\", channel_id);
11838  *     },
11839  *     // ...
11840  * #     _ => {},
11841  * });
11842  * # }
11843  * ```
11844  *
11845  * ## Accepting Channels
11846  *
11847  * Inbound channels are initiated by peers and are automatically accepted unless [`ChannelManager`]
11848  * has [`UserConfig::manually_accept_inbound_channels`] set. In that case, the channel may be
11849  * either accepted or rejected when handling [`Event::OpenChannelRequest`].
11850  *
11851  * ```
11852  * # use bitcoin::secp256k1::PublicKey;
11853  * # use lightning::ln::channelmanager::AChannelManager;
11854  * # use lightning::events::{Event, EventsProvider};
11855  * #
11856  * # fn is_trusted(counterparty_node_id: PublicKey) -> bool {
11857  * #     // ...
11858  * #     unimplemented!()
11859  * # }
11860  * #
11861  * # fn example<T: AChannelManager>(channel_manager: T) {
11862  * # let channel_manager = channel_manager.get_cm();
11863  * channel_manager.process_pending_events(&|event| match event {
11864  *     Event::OpenChannelRequest { temporary_channel_id, counterparty_node_id, ..  } => {
11865  *         if !is_trusted(counterparty_node_id) {
11866  *             match channel_manager.force_close_without_broadcasting_txn(
11867  *                 &temporary_channel_id, &counterparty_node_id
11868  *             ) {
11869  *                 Ok(()) => println!(\"Rejecting channel {}\", temporary_channel_id),
11870  *                 Err(e) => println!(\"Error rejecting channel {}: {:?}\", temporary_channel_id, e),
11871  *             }
11872  *             return;
11873  *         }
11874  *
11875  *         let user_channel_id = 43;
11876  *         match channel_manager.accept_inbound_channel(
11877  *             &temporary_channel_id, &counterparty_node_id, user_channel_id
11878  *         ) {
11879  *             Ok(()) => println!(\"Accepting channel {}\", temporary_channel_id),
11880  *             Err(e) => println!(\"Error accepting channel {}: {:?}\", temporary_channel_id, e),
11881  *         }
11882  *     },
11883  *     // ...
11884  * #     _ => {},
11885  * });
11886  * # }
11887  * ```
11888  *
11889  * ## Closing Channels
11890  *
11891  * There are two ways to close a channel: either cooperatively using [`close_channel`] or
11892  * unilaterally using [`force_close_broadcasting_latest_txn`]. The former is ideal as it makes for
11893  * lower fees and immediate access to funds. However, the latter may be necessary if the
11894  * counterparty isn't behaving properly or has gone offline. [`Event::ChannelClosed`] is generated
11895  * once the channel has been closed successfully.
11896  *
11897  * ```
11898  * # use bitcoin::secp256k1::PublicKey;
11899  * # use lightning::ln::types::ChannelId;
11900  * # use lightning::ln::channelmanager::AChannelManager;
11901  * # use lightning::events::{Event, EventsProvider};
11902  * #
11903  * # fn example<T: AChannelManager>(
11904  * #     channel_manager: T, channel_id: ChannelId, counterparty_node_id: PublicKey
11905  * # ) {
11906  * # let channel_manager = channel_manager.get_cm();
11907  * match channel_manager.close_channel(&channel_id, &counterparty_node_id) {
11908  *     Ok(()) => println!(\"Closing channel {}\", channel_id),
11909  *     Err(e) => println!(\"Error closing channel {}: {:?}\", channel_id, e),
11910  * }
11911  *
11912  * // On the event processing thread
11913  * channel_manager.process_pending_events(&|event| match event {
11914  *     Event::ChannelClosed { channel_id, user_channel_id, ..  } => {
11915  *         assert_eq!(user_channel_id, 42);
11916  *         println!(\"Channel {} closed\", channel_id);
11917  *     },
11918  *     // ...
11919  * #     _ => {},
11920  * });
11921  * # }
11922  * ```
11923  *
11924  * # Payments
11925  *
11926  * [`ChannelManager`] is responsible for sending, forwarding, and receiving payments through its
11927  * channels. A payment is typically initiated from a [BOLT 11] invoice or a [BOLT 12] offer, though
11928  * spontaneous (i.e., keysend) payments are also possible. Incoming payments don't require
11929  * maintaining any additional state as [`ChannelManager`] can reconstruct the [`PaymentPreimage`]
11930  * from the [`PaymentSecret`]. Sending payments, however, require tracking in order to retry failed
11931  * HTLCs.
11932  *
11933  * After a payment is initiated, it will appear in [`list_recent_payments`] until a short time
11934  * after either an [`Event::PaymentSent`] or [`Event::PaymentFailed`] is handled. Failed HTLCs
11935  * for a payment will be retried according to the payment's [`Retry`] strategy or until
11936  * [`abandon_payment`] is called.
11937  *
11938  * ## BOLT 11 Invoices
11939  *
11940  * The [`lightning-invoice`] crate is useful for creating BOLT 11 invoices. Specifically, use the
11941  * functions in its `utils` module for constructing invoices that are compatible with
11942  * [`ChannelManager`]. These functions serve as a convenience for building invoices with the
11943  * [`PaymentHash`] and [`PaymentSecret`] returned from [`create_inbound_payment`]. To provide your
11944  * own [`PaymentHash`], use [`create_inbound_payment_for_hash`] or the corresponding functions in
11945  * the [`lightning-invoice`] `utils` module.
11946  *
11947  * [`ChannelManager`] generates an [`Event::PaymentClaimable`] once the full payment has been
11948  * received. Call [`claim_funds`] to release the [`PaymentPreimage`], which in turn will result in
11949  * an [`Event::PaymentClaimed`].
11950  *
11951  * ```
11952  * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
11953  * # use lightning::ln::channelmanager::AChannelManager;
11954  * #
11955  * # fn example<T: AChannelManager>(channel_manager: T) {
11956  * # let channel_manager = channel_manager.get_cm();
11957  * // Or use utils::create_invoice_from_channelmanager
11958  * let known_payment_hash = match channel_manager.create_inbound_payment(
11959  *     Some(10_000_000), 3600, None
11960  * ) {
11961  *     Ok((payment_hash, _payment_secret)) => {
11962  *         println!(\"Creating inbound payment {}\", payment_hash);
11963  *         payment_hash
11964  *     },
11965  *     Err(()) => panic!(\"Error creating inbound payment\"),
11966  * };
11967  *
11968  * // On the event processing thread
11969  * channel_manager.process_pending_events(&|event| match event {
11970  *     Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
11971  *         PaymentPurpose::Bolt11InvoicePayment { payment_preimage: Some(payment_preimage), .. } => {
11972  *             assert_eq!(payment_hash, known_payment_hash);
11973  *             println!(\"Claiming payment {}\", payment_hash);
11974  *             channel_manager.claim_funds(payment_preimage);
11975  *         },
11976  *         PaymentPurpose::Bolt11InvoicePayment { payment_preimage: None, .. } => {
11977  *             println!(\"Unknown payment hash: {}\", payment_hash);
11978  *         },
11979  *         PaymentPurpose::SpontaneousPayment(payment_preimage) => {
11980  *             assert_ne!(payment_hash, known_payment_hash);
11981  *             println!(\"Claiming spontaneous payment {}\", payment_hash);
11982  *             channel_manager.claim_funds(payment_preimage);
11983  *         },
11984  *         // ...
11985  * #         _ => {},
11986  *     },
11987  *     Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
11988  *         assert_eq!(payment_hash, known_payment_hash);
11989  *         println!(\"Claimed {} msats\", amount_msat);
11990  *     },
11991  *     // ...
11992  * #     _ => {},
11993  * });
11994  * # }
11995  * ```
11996  *
11997  * For paying an invoice, [`lightning-invoice`] provides a `payment` module with convenience
11998  * functions for use with [`send_payment`].
11999  *
12000  * ```
12001  * # use lightning::events::{Event, EventsProvider};
12002  * # use lightning::ln::types::PaymentHash;
12003  * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry};
12004  * # use lightning::routing::router::RouteParameters;
12005  * #
12006  * # fn example<T: AChannelManager>(
12007  * #     channel_manager: T, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields,
12008  * #     route_params: RouteParameters, retry: Retry
12009  * # ) {
12010  * # let channel_manager = channel_manager.get_cm();
12011  * // let (payment_hash, recipient_onion, route_params) =
12012  * //     payment::payment_parameters_from_invoice(&invoice);
12013  * let payment_id = PaymentId([42; 32]);
12014  * match channel_manager.send_payment(
12015  *     payment_hash, recipient_onion, payment_id, route_params, retry
12016  * ) {
12017  *     Ok(()) => println!(\"Sending payment with hash {}\", payment_hash),
12018  *     Err(e) => println!(\"Failed sending payment with hash {}: {:?}\", payment_hash, e),
12019  * }
12020  *
12021  * let expected_payment_id = payment_id;
12022  * let expected_payment_hash = payment_hash;
12023  * assert!(
12024  *     channel_manager.list_recent_payments().iter().find(|details| matches!(
12025  *         details,
12026  *         RecentPaymentDetails::Pending {
12027  *             payment_id: expected_payment_id,
12028  *             payment_hash: expected_payment_hash,
12029  *             ..
12030  *         }
12031  *     )).is_some()
12032  * );
12033  *
12034  * // On the event processing thread
12035  * channel_manager.process_pending_events(&|event| match event {
12036  *     Event::PaymentSent { payment_hash, .. } => println!(\"Paid {}\", payment_hash),
12037  *     Event::PaymentFailed { payment_hash, .. } => println!(\"Failed paying {}\", payment_hash),
12038  *     // ...
12039  * #     _ => {},
12040  * });
12041  * # }
12042  * ```
12043  *
12044  * ## BOLT 12 Offers
12045  *
12046  * The [`offers`] module is useful for creating BOLT 12 offers. An [`Offer`] is a precursor to a
12047  * [`Bolt12Invoice`], which must first be requested by the payer. The interchange of these messages
12048  * as defined in the specification is handled by [`ChannelManager`] and its implementation of
12049  * [`OffersMessageHandler`]. However, this only works with an [`Offer`] created using a builder
12050  * returned by [`create_offer_builder`]. With this approach, BOLT 12 offers and invoices are
12051  * stateless just as BOLT 11 invoices are.
12052  *
12053  * ```
12054  * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
12055  * # use lightning::ln::channelmanager::AChannelManager;
12056  * # use lightning::offers::parse::Bolt12SemanticError;
12057  * #
12058  * # fn example<T: AChannelManager>(channel_manager: T) -> Result<(), Bolt12SemanticError> {
12059  * # let channel_manager = channel_manager.get_cm();
12060  * let offer = channel_manager
12061  *     .create_offer_builder()?
12062  * # ;
12063  * # // Needed for compiling for c_bindings
12064  * # let builder: lightning::offers::offer::OfferBuilder<_, _> = offer.into();
12065  * # let offer = builder
12066  *     .description(\"coffee\".to_string())
12067  *     .amount_msats(10_000_000)
12068  *     .build()?;
12069  * let bech32_offer = offer.to_string();
12070  *
12071  * // On the event processing thread
12072  * channel_manager.process_pending_events(&|event| match event {
12073  *     Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
12074  *         PaymentPurpose::Bolt12OfferPayment { payment_preimage: Some(payment_preimage), .. } => {
12075  *             println!(\"Claiming payment {}\", payment_hash);
12076  *             channel_manager.claim_funds(payment_preimage);
12077  *         },
12078  *         PaymentPurpose::Bolt12OfferPayment { payment_preimage: None, .. } => {
12079  *             println!(\"Unknown payment hash: {}\", payment_hash);
12080  *         },
12081  *         // ...
12082  * #         _ => {},
12083  *     },
12084  *     Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
12085  *         println!(\"Claimed {} msats\", amount_msat);
12086  *     },
12087  *     // ...
12088  * #     _ => {},
12089  * });
12090  * # Ok(())
12091  * # }
12092  * ```
12093  *
12094  * Use [`pay_for_offer`] to initiated payment, which sends an [`InvoiceRequest`] for an [`Offer`]
12095  * and pays the [`Bolt12Invoice`] response. In addition to success and failure events,
12096  * [`ChannelManager`] may also generate an [`Event::InvoiceRequestFailed`].
12097  *
12098  * ```
12099  * # use lightning::events::{Event, EventsProvider};
12100  * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry};
12101  * # use lightning::offers::offer::Offer;
12102  * #
12103  * # fn example<T: AChannelManager>(
12104  * #     channel_manager: T, offer: &Offer, quantity: Option<u64>, amount_msats: Option<u64>,
12105  * #     payer_note: Option<String>, retry: Retry, max_total_routing_fee_msat: Option<u64>
12106  * # ) {
12107  * # let channel_manager = channel_manager.get_cm();
12108  * let payment_id = PaymentId([42; 32]);
12109  * match channel_manager.pay_for_offer(
12110  *     offer, quantity, amount_msats, payer_note, payment_id, retry, max_total_routing_fee_msat
12111  * ) {
12112  *     Ok(()) => println!(\"Requesting invoice for offer\"),
12113  *     Err(e) => println!(\"Unable to request invoice for offer: {:?}\", e),
12114  * }
12115  *
12116  * // First the payment will be waiting on an invoice
12117  * let expected_payment_id = payment_id;
12118  * assert!(
12119  *     channel_manager.list_recent_payments().iter().find(|details| matches!(
12120  *         details,
12121  *         RecentPaymentDetails::AwaitingInvoice { payment_id: expected_payment_id }
12122  *     )).is_some()
12123  * );
12124  *
12125  * // Once the invoice is received, a payment will be sent
12126  * assert!(
12127  *     channel_manager.list_recent_payments().iter().find(|details| matches!(
12128  *         details,
12129  *         RecentPaymentDetails::Pending { payment_id: expected_payment_id, ..  }
12130  *     )).is_some()
12131  * );
12132  *
12133  * // On the event processing thread
12134  * channel_manager.process_pending_events(&|event| match event {
12135  *     Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
12136  *     Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12137  *     Event::InvoiceRequestFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12138  *     // ...
12139  * #     _ => {},
12140  * });
12141  * # }
12142  * ```
12143  *
12144  * ## BOLT 12 Refunds
12145  *
12146  * A [`Refund`] is a request for an invoice to be paid. Like *paying* for an [`Offer`], *creating*
12147  * a [`Refund`] involves maintaining state since it represents a future outbound payment.
12148  * Therefore, use [`create_refund_builder`] when creating one, otherwise [`ChannelManager`] will
12149  * refuse to pay any corresponding [`Bolt12Invoice`] that it receives.
12150  *
12151  * ```
12152  * # use core::time::Duration;
12153  * # use lightning::events::{Event, EventsProvider};
12154  * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry};
12155  * # use lightning::offers::parse::Bolt12SemanticError;
12156  * #
12157  * # fn example<T: AChannelManager>(
12158  * #     channel_manager: T, amount_msats: u64, absolute_expiry: Duration, retry: Retry,
12159  * #     max_total_routing_fee_msat: Option<u64>
12160  * # ) -> Result<(), Bolt12SemanticError> {
12161  * # let channel_manager = channel_manager.get_cm();
12162  * let payment_id = PaymentId([42; 32]);
12163  * let refund = channel_manager
12164  *     .create_refund_builder(
12165  *         amount_msats, absolute_expiry, payment_id, retry, max_total_routing_fee_msat
12166  *     )?
12167  * # ;
12168  * # // Needed for compiling for c_bindings
12169  * # let builder: lightning::offers::refund::RefundBuilder<_> = refund.into();
12170  * # let refund = builder
12171  *     .description(\"coffee\".to_string())
12172  *     .payer_note(\"refund for order 1234\".to_string())
12173  *     .build()?;
12174  * let bech32_refund = refund.to_string();
12175  *
12176  * // First the payment will be waiting on an invoice
12177  * let expected_payment_id = payment_id;
12178  * assert!(
12179  *     channel_manager.list_recent_payments().iter().find(|details| matches!(
12180  *         details,
12181  *         RecentPaymentDetails::AwaitingInvoice { payment_id: expected_payment_id }
12182  *     )).is_some()
12183  * );
12184  *
12185  * // Once the invoice is received, a payment will be sent
12186  * assert!(
12187  *     channel_manager.list_recent_payments().iter().find(|details| matches!(
12188  *         details,
12189  *         RecentPaymentDetails::Pending { payment_id: expected_payment_id, ..  }
12190  *     )).is_some()
12191  * );
12192  *
12193  * // On the event processing thread
12194  * channel_manager.process_pending_events(&|event| match event {
12195  *     Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id),
12196  *     Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id),
12197  *     // ...
12198  * #     _ => {},
12199  * });
12200  * # Ok(())
12201  * # }
12202  * ```
12203  *
12204  * Use [`request_refund_payment`] to send a [`Bolt12Invoice`] for receiving the refund. Similar to
12205  * *creating* an [`Offer`], this is stateless as it represents an inbound payment.
12206  *
12207  * ```
12208  * # use lightning::events::{Event, EventsProvider, PaymentPurpose};
12209  * # use lightning::ln::channelmanager::AChannelManager;
12210  * # use lightning::offers::refund::Refund;
12211  * #
12212  * # fn example<T: AChannelManager>(channel_manager: T, refund: &Refund) {
12213  * # let channel_manager = channel_manager.get_cm();
12214  * let known_payment_hash = match channel_manager.request_refund_payment(refund) {
12215  *     Ok(invoice) => {
12216  *         let payment_hash = invoice.payment_hash();
12217  *         println!(\"Requesting refund payment {}\", payment_hash);
12218  *         payment_hash
12219  *     },
12220  *     Err(e) => panic!(\"Unable to request payment for refund: {:?}\", e),
12221  * };
12222  *
12223  * // On the event processing thread
12224  * channel_manager.process_pending_events(&|event| match event {
12225  *     Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose {
12226  *     \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: Some(payment_preimage), .. } => {
12227  *             assert_eq!(payment_hash, known_payment_hash);
12228  *             println!(\"Claiming payment {}\", payment_hash);
12229  *             channel_manager.claim_funds(payment_preimage);
12230  *         },
12231  *     \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: None, .. } => {
12232  *             println!(\"Unknown payment hash: {}\", payment_hash);
12233  *     \t},
12234  *         // ...
12235  * #         _ => {},
12236  *     },
12237  *     Event::PaymentClaimed { payment_hash, amount_msat, .. } => {
12238  *         assert_eq!(payment_hash, known_payment_hash);
12239  *         println!(\"Claimed {} msats\", amount_msat);
12240  *     },
12241  *     // ...
12242  * #     _ => {},
12243  * });
12244  * # }
12245  * ```
12246  *
12247  * # Persistence
12248  *
12249  * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
12250  * all peers during write/read (though does not modify this instance, only the instance being
12251  * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
12252  * called [`funding_transaction_generated`] for outbound channels) being closed.
12253  *
12254  * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
12255  * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST durably write each
12256  * [`ChannelMonitorUpdate`] before returning from
12257  * [`chain::Watch::watch_channel`]/[`update_channel`] or before completing async writes. With
12258  * `ChannelManager`s, writing updates happens out-of-band (and will prevent any other
12259  * `ChannelManager` operations from occurring during the serialization process). If the
12260  * deserialized version is out-of-date compared to the [`ChannelMonitor`] passed by reference to
12261  * [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
12262  * will be lost (modulo on-chain transaction fees).
12263  *
12264  * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
12265  * tells you the last block hash which was connected. You should get the best block tip before using the manager.
12266  * See [`chain::Listen`] and [`chain::Confirm`] for more details.
12267  *
12268  * # `ChannelUpdate` Messages
12269  *
12270  * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
12271  * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
12272  * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
12273  * offline for a full minute. In order to track this, you must call
12274  * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
12275  *
12276  * # DoS Mitigation
12277  *
12278  * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
12279  * inbound channels without confirmed funding transactions. This may result in nodes which we do
12280  * not have a channel with being unable to connect to us or open new channels with us if we have
12281  * many peers with unfunded channels.
12282  *
12283  * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
12284  * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
12285  * never limited. Please ensure you limit the count of such channels yourself.
12286  *
12287  * # Type Aliases
12288  *
12289  * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
12290  * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
12291  * essentially you should default to using a [`SimpleRefChannelManager`], and use a
12292  * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
12293  * you're using lightning-net-tokio.
12294  *
12295  * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
12296  * [`MessageHandler`]: crate::ln::peer_handler::MessageHandler
12297  * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
12298  * [`PeerManager::read_event`]: crate::ln::peer_handler::PeerManager::read_event
12299  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
12300  * [`timer_tick_occurred`]: Self::timer_tick_occurred
12301  * [`get_and_clear_needs_persistence`]: Self::get_and_clear_needs_persistence
12302  * [`Persister`]: crate::util::persist::Persister
12303  * [`KVStore`]: crate::util::persist::KVStore
12304  * [`get_event_or_persistence_needed_future`]: Self::get_event_or_persistence_needed_future
12305  * [`lightning-block-sync`]: https://docs.rs/lightning_block_sync/latest/lightning_block_sync
12306  * [`lightning-transaction-sync`]: https://docs.rs/lightning_transaction_sync/latest/lightning_transaction_sync
12307  * [`lightning-background-processor`]: https://docs.rs/lightning_background_processor/lightning_background_processor
12308  * [`list_channels`]: Self::list_channels
12309  * [`list_usable_channels`]: Self::list_usable_channels
12310  * [`create_channel`]: Self::create_channel
12311  * [`close_channel`]: Self::force_close_broadcasting_latest_txn
12312  * [`force_close_broadcasting_latest_txn`]: Self::force_close_broadcasting_latest_txn
12313  * [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
12314  * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md
12315  * [`list_recent_payments`]: Self::list_recent_payments
12316  * [`abandon_payment`]: Self::abandon_payment
12317  * [`lightning-invoice`]: https://docs.rs/lightning_invoice/latest/lightning_invoice
12318  * [`create_inbound_payment`]: Self::create_inbound_payment
12319  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
12320  * [`claim_funds`]: Self::claim_funds
12321  * [`send_payment`]: Self::send_payment
12322  * [`offers`]: crate::offers
12323  * [`create_offer_builder`]: Self::create_offer_builder
12324  * [`pay_for_offer`]: Self::pay_for_offer
12325  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
12326  * [`create_refund_builder`]: Self::create_refund_builder
12327  * [`request_refund_payment`]: Self::request_refund_payment
12328  * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
12329  * [`funding_created`]: msgs::FundingCreated
12330  * [`funding_transaction_generated`]: Self::funding_transaction_generated
12331  * [`BlockHash`]: bitcoin::hash_types::BlockHash
12332  * [`update_channel`]: chain::Watch::update_channel
12333  * [`ChannelUpdate`]: msgs::ChannelUpdate
12334  * [`read`]: ReadableArgs::read
12335  */
12336 typedef struct MUST_USE_STRUCT LDKChannelManager {
12337    /**
12338     * A pointer to the opaque Rust object.
12339     * Nearly everywhere, inner must be non-null, however in places where
12340     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12341     */
12342    LDKnativeChannelManager *inner;
12343    /**
12344     * Indicates that this is the only struct which contains the same pointer.
12345     * Rust functions which take ownership of an object provided via an argument require
12346     * this to be true and invalidate the object pointed to by inner.
12347     */
12348    bool is_owned;
12349 } LDKChannelManager;
12350
12351 /**
12352  * A tuple of 2 elements. See the individual fields for the types contained.
12353  */
12354 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ {
12355    /**
12356     * The element at position 0
12357     */
12358    struct LDKThirtyTwoBytes a;
12359    /**
12360     * The element at position 1
12361     */
12362    struct LDKChannelManager b;
12363 } LDKC2Tuple_ThirtyTwoBytesChannelManagerZ;
12364
12365 /**
12366  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ
12367  */
12368 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr {
12369    /**
12370     * A pointer to the contents in the success state.
12371     * Reading from this pointer when `result_ok` is not set is undefined.
12372     */
12373    struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *result;
12374    /**
12375     * A pointer to the contents in the error state.
12376     * Reading from this pointer when `result_ok` is set is undefined.
12377     */
12378    struct LDKDecodeError *err;
12379 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr;
12380
12381 /**
12382  * A CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents the result of a fallible operation,
12383  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12384  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12385  */
12386 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
12387    /**
12388     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ, accessible via either
12389     * `err` or `result` depending on the state of `result_ok`.
12390     */
12391    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr contents;
12392    /**
12393     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents a success state.
12394     */
12395    bool result_ok;
12396 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ;
12397
12398 /**
12399  * Options for how to set the max dust exposure allowed on a channel. See
12400  * [`ChannelConfig::max_dust_htlc_exposure`] for details.
12401  */
12402 typedef enum LDKMaxDustHTLCExposure_Tag {
12403    /**
12404     * This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low
12405     * may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this
12406     * limit is very important to prevent stealing of large amounts of dust HTLCs by miners
12407     * through [fee griefing
12408     * attacks](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-May/002714.html).
12409     *
12410     * Note that if the feerate increases significantly, without a manual increase
12411     * to this maximum the channel may be unable to send/receive HTLCs between the maximum dust
12412     * exposure and the new minimum value for HTLCs to be economically viable to claim.
12413     */
12414    LDKMaxDustHTLCExposure_FixedLimitMsat,
12415    /**
12416     * This sets a multiplier on the [`ConfirmationTarget::OnChainSweep`] feerate (in sats/KW) to
12417     * determine the maximum allowed dust exposure. If this variant is used then the maximum dust
12418     * exposure in millisatoshis is calculated as:
12419     * `feerate_per_kw * value`. For example, with our default value
12420     * `FeeRateMultiplier(10_000)`:
12421     *
12422     * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
12423     * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
12424     * be 253 * 10_000 = 2,530,000 msats.
12425     * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
12426     * 7500 * 50_000 = 75,000,000 msats (0.00075 BTC).
12427     *
12428     * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
12429     * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
12430     * causing you to accept more dust HTLCs than you would otherwise.
12431     *
12432     * This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included
12433     * on HTLC outputs means your channel may be subject to more dust exposure in the event of
12434     * increases in fee rate.
12435     *
12436     * # Backwards Compatibility
12437     * This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
12438     * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
12439     *
12440     * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
12441     * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
12442     */
12443    LDKMaxDustHTLCExposure_FeeRateMultiplier,
12444    /**
12445     * Must be last for serialization purposes
12446     */
12447    LDKMaxDustHTLCExposure_Sentinel,
12448 } LDKMaxDustHTLCExposure_Tag;
12449
12450 typedef struct MUST_USE_STRUCT LDKMaxDustHTLCExposure {
12451    LDKMaxDustHTLCExposure_Tag tag;
12452    union {
12453       struct {
12454          uint64_t fixed_limit_msat;
12455       };
12456       struct {
12457          uint64_t fee_rate_multiplier;
12458       };
12459    };
12460 } LDKMaxDustHTLCExposure;
12461
12462 /**
12463  * The contents of CResult_MaxDustHTLCExposureDecodeErrorZ
12464  */
12465 typedef union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr {
12466    /**
12467     * A pointer to the contents in the success state.
12468     * Reading from this pointer when `result_ok` is not set is undefined.
12469     */
12470    struct LDKMaxDustHTLCExposure *result;
12471    /**
12472     * A pointer to the contents in the error state.
12473     * Reading from this pointer when `result_ok` is set is undefined.
12474     */
12475    struct LDKDecodeError *err;
12476 } LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr;
12477
12478 /**
12479  * A CResult_MaxDustHTLCExposureDecodeErrorZ represents the result of a fallible operation,
12480  * containing a crate::lightning::util::config::MaxDustHTLCExposure on success and a crate::lightning::ln::msgs::DecodeError on failure.
12481  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12482  */
12483 typedef struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ {
12484    /**
12485     * The contents of this CResult_MaxDustHTLCExposureDecodeErrorZ, accessible via either
12486     * `err` or `result` depending on the state of `result_ok`.
12487     */
12488    union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr contents;
12489    /**
12490     * Whether this CResult_MaxDustHTLCExposureDecodeErrorZ represents a success state.
12491     */
12492    bool result_ok;
12493 } LDKCResult_MaxDustHTLCExposureDecodeErrorZ;
12494
12495
12496
12497 /**
12498  * Options which apply on a per-channel basis and may change at runtime or based on negotiation
12499  * with our counterparty.
12500  */
12501 typedef struct MUST_USE_STRUCT LDKChannelConfig {
12502    /**
12503     * A pointer to the opaque Rust object.
12504     * Nearly everywhere, inner must be non-null, however in places where
12505     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12506     */
12507    LDKnativeChannelConfig *inner;
12508    /**
12509     * Indicates that this is the only struct which contains the same pointer.
12510     * Rust functions which take ownership of an object provided via an argument require
12511     * this to be true and invalidate the object pointed to by inner.
12512     */
12513    bool is_owned;
12514 } LDKChannelConfig;
12515
12516 /**
12517  * The contents of CResult_ChannelConfigDecodeErrorZ
12518  */
12519 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
12520    /**
12521     * A pointer to the contents in the success state.
12522     * Reading from this pointer when `result_ok` is not set is undefined.
12523     */
12524    struct LDKChannelConfig *result;
12525    /**
12526     * A pointer to the contents in the error state.
12527     * Reading from this pointer when `result_ok` is set is undefined.
12528     */
12529    struct LDKDecodeError *err;
12530 } LDKCResult_ChannelConfigDecodeErrorZPtr;
12531
12532 /**
12533  * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
12534  * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
12535  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12536  */
12537 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
12538    /**
12539     * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
12540     * `err` or `result` depending on the state of `result_ok`.
12541     */
12542    union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
12543    /**
12544     * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
12545     */
12546    bool result_ok;
12547 } LDKCResult_ChannelConfigDecodeErrorZ;
12548
12549 /**
12550  * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not
12551  */
12552 typedef enum LDKCOption_MaxDustHTLCExposureZ_Tag {
12553    /**
12554     * When we're in this state, this COption_MaxDustHTLCExposureZ contains a crate::lightning::util::config::MaxDustHTLCExposure
12555     */
12556    LDKCOption_MaxDustHTLCExposureZ_Some,
12557    /**
12558     * When we're in this state, this COption_MaxDustHTLCExposureZ contains nothing
12559     */
12560    LDKCOption_MaxDustHTLCExposureZ_None,
12561    /**
12562     * Must be last for serialization purposes
12563     */
12564    LDKCOption_MaxDustHTLCExposureZ_Sentinel,
12565 } LDKCOption_MaxDustHTLCExposureZ_Tag;
12566
12567 typedef struct LDKCOption_MaxDustHTLCExposureZ {
12568    LDKCOption_MaxDustHTLCExposureZ_Tag tag;
12569    union {
12570       struct {
12571          struct LDKMaxDustHTLCExposure some;
12572       };
12573    };
12574 } LDKCOption_MaxDustHTLCExposureZ;
12575
12576 /**
12577  * An enum which can either contain a crate::lightning::util::errors::APIError or not
12578  */
12579 typedef enum LDKCOption_APIErrorZ_Tag {
12580    /**
12581     * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
12582     */
12583    LDKCOption_APIErrorZ_Some,
12584    /**
12585     * When we're in this state, this COption_APIErrorZ contains nothing
12586     */
12587    LDKCOption_APIErrorZ_None,
12588    /**
12589     * Must be last for serialization purposes
12590     */
12591    LDKCOption_APIErrorZ_Sentinel,
12592 } LDKCOption_APIErrorZ_Tag;
12593
12594 typedef struct LDKCOption_APIErrorZ {
12595    LDKCOption_APIErrorZ_Tag tag;
12596    union {
12597       struct {
12598          struct LDKAPIError some;
12599       };
12600    };
12601 } LDKCOption_APIErrorZ;
12602
12603 /**
12604  * The contents of CResult_COption_APIErrorZDecodeErrorZ
12605  */
12606 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
12607    /**
12608     * A pointer to the contents in the success state.
12609     * Reading from this pointer when `result_ok` is not set is undefined.
12610     */
12611    struct LDKCOption_APIErrorZ *result;
12612    /**
12613     * A pointer to the contents in the error state.
12614     * Reading from this pointer when `result_ok` is set is undefined.
12615     */
12616    struct LDKDecodeError *err;
12617 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
12618
12619 /**
12620  * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
12621  * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12622  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12623  */
12624 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
12625    /**
12626     * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
12627     * `err` or `result` depending on the state of `result_ok`.
12628     */
12629    union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
12630    /**
12631     * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
12632     */
12633    bool result_ok;
12634 } LDKCResult_COption_APIErrorZDecodeErrorZ;
12635
12636 /**
12637  * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
12638  */
12639 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
12640    /**
12641     * A pointer to the contents in the success state.
12642     * Reading from this pointer when `result_ok` is not set is undefined.
12643     */
12644    struct LDKChannelMonitorUpdate *result;
12645    /**
12646     * A pointer to the contents in the error state.
12647     * Reading from this pointer when `result_ok` is set is undefined.
12648     */
12649    struct LDKDecodeError *err;
12650 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
12651
12652 /**
12653  * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
12654  * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12655  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12656  */
12657 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
12658    /**
12659     * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
12660     * `err` or `result` depending on the state of `result_ok`.
12661     */
12662    union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
12663    /**
12664     * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
12665     */
12666    bool result_ok;
12667 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
12668
12669 /**
12670  * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
12671  */
12672 typedef enum LDKCOption_MonitorEventZ_Tag {
12673    /**
12674     * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
12675     */
12676    LDKCOption_MonitorEventZ_Some,
12677    /**
12678     * When we're in this state, this COption_MonitorEventZ contains nothing
12679     */
12680    LDKCOption_MonitorEventZ_None,
12681    /**
12682     * Must be last for serialization purposes
12683     */
12684    LDKCOption_MonitorEventZ_Sentinel,
12685 } LDKCOption_MonitorEventZ_Tag;
12686
12687 typedef struct LDKCOption_MonitorEventZ {
12688    LDKCOption_MonitorEventZ_Tag tag;
12689    union {
12690       struct {
12691          struct LDKMonitorEvent some;
12692       };
12693    };
12694 } LDKCOption_MonitorEventZ;
12695
12696 /**
12697  * The contents of CResult_COption_MonitorEventZDecodeErrorZ
12698  */
12699 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
12700    /**
12701     * A pointer to the contents in the success state.
12702     * Reading from this pointer when `result_ok` is not set is undefined.
12703     */
12704    struct LDKCOption_MonitorEventZ *result;
12705    /**
12706     * A pointer to the contents in the error state.
12707     * Reading from this pointer when `result_ok` is set is undefined.
12708     */
12709    struct LDKDecodeError *err;
12710 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
12711
12712 /**
12713  * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
12714  * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
12715  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12716  */
12717 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
12718    /**
12719     * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
12720     * `err` or `result` depending on the state of `result_ok`.
12721     */
12722    union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
12723    /**
12724     * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
12725     */
12726    bool result_ok;
12727 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
12728
12729 /**
12730  * The contents of CResult_HTLCUpdateDecodeErrorZ
12731  */
12732 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
12733    /**
12734     * A pointer to the contents in the success state.
12735     * Reading from this pointer when `result_ok` is not set is undefined.
12736     */
12737    struct LDKHTLCUpdate *result;
12738    /**
12739     * A pointer to the contents in the error state.
12740     * Reading from this pointer when `result_ok` is set is undefined.
12741     */
12742    struct LDKDecodeError *err;
12743 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
12744
12745 /**
12746  * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
12747  * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12748  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12749  */
12750 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
12751    /**
12752     * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
12753     * `err` or `result` depending on the state of `result_ok`.
12754     */
12755    union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
12756    /**
12757     * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
12758     */
12759    bool result_ok;
12760 } LDKCResult_HTLCUpdateDecodeErrorZ;
12761
12762 /**
12763  * A tuple of 2 elements. See the individual fields for the types contained.
12764  */
12765 typedef struct LDKC2Tuple_OutPointCVec_u8ZZ {
12766    /**
12767     * The element at position 0
12768     */
12769    struct LDKOutPoint a;
12770    /**
12771     * The element at position 1
12772     */
12773    struct LDKCVec_u8Z b;
12774 } LDKC2Tuple_OutPointCVec_u8ZZ;
12775
12776 /**
12777  * A tuple of 2 elements. See the individual fields for the types contained.
12778  */
12779 typedef struct LDKC2Tuple_u32CVec_u8ZZ {
12780    /**
12781     * The element at position 0
12782     */
12783    uint32_t a;
12784    /**
12785     * The element at position 1
12786     */
12787    struct LDKCVec_u8Z b;
12788 } LDKC2Tuple_u32CVec_u8ZZ;
12789
12790 /**
12791  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32CVec_u8ZZs of arbitrary size.
12792  * This corresponds to std::vector in C++
12793  */
12794 typedef struct LDKCVec_C2Tuple_u32CVec_u8ZZZ {
12795    /**
12796     * The elements in the array.
12797     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12798     */
12799    struct LDKC2Tuple_u32CVec_u8ZZ *data;
12800    /**
12801     * The number of elements pointed to by `data`.
12802     */
12803    uintptr_t datalen;
12804 } LDKCVec_C2Tuple_u32CVec_u8ZZZ;
12805
12806 /**
12807  * A tuple of 2 elements. See the individual fields for the types contained.
12808  */
12809 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ {
12810    /**
12811     * The element at position 0
12812     */
12813    struct LDKThirtyTwoBytes a;
12814    /**
12815     * The element at position 1
12816     */
12817    struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b;
12818 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ;
12819
12820 /**
12821  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZs of arbitrary size.
12822  * This corresponds to std::vector in C++
12823  */
12824 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ {
12825    /**
12826     * The elements in the array.
12827     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12828     */
12829    struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *data;
12830    /**
12831     * The number of elements pointed to by `data`.
12832     */
12833    uintptr_t datalen;
12834 } LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ;
12835
12836 /**
12837  * A dynamically-allocated array of crate::lightning::ln::chan_utils::CommitmentTransactions of arbitrary size.
12838  * This corresponds to std::vector in C++
12839  */
12840 typedef struct LDKCVec_CommitmentTransactionZ {
12841    /**
12842     * The elements in the array.
12843     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12844     */
12845    struct LDKCommitmentTransaction *data;
12846    /**
12847     * The number of elements pointed to by `data`.
12848     */
12849    uintptr_t datalen;
12850 } LDKCVec_CommitmentTransactionZ;
12851
12852 /**
12853  * A tuple of 2 elements. See the individual fields for the types contained.
12854  */
12855 typedef struct LDKC2Tuple_u32TxOutZ {
12856    /**
12857     * The element at position 0
12858     */
12859    uint32_t a;
12860    /**
12861     * The element at position 1
12862     */
12863    struct LDKTxOut b;
12864 } LDKC2Tuple_u32TxOutZ;
12865
12866 /**
12867  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
12868  * This corresponds to std::vector in C++
12869  */
12870 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
12871    /**
12872     * The elements in the array.
12873     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12874     */
12875    struct LDKC2Tuple_u32TxOutZ *data;
12876    /**
12877     * The number of elements pointed to by `data`.
12878     */
12879    uintptr_t datalen;
12880 } LDKCVec_C2Tuple_u32TxOutZZ;
12881
12882 /**
12883  * A tuple of 2 elements. See the individual fields for the types contained.
12884  */
12885 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ {
12886    /**
12887     * The element at position 0
12888     */
12889    struct LDKThirtyTwoBytes a;
12890    /**
12891     * The element at position 1
12892     */
12893    struct LDKCVec_C2Tuple_u32TxOutZZ b;
12894 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ;
12895
12896 /**
12897  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
12898  * This corresponds to std::vector in C++
12899  */
12900 typedef struct LDKCVec_TransactionOutputsZ {
12901    /**
12902     * The elements in the array.
12903     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12904     */
12905    struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *data;
12906    /**
12907     * The number of elements pointed to by `data`.
12908     */
12909    uintptr_t datalen;
12910 } LDKCVec_TransactionOutputsZ;
12911
12912 /**
12913  * Details about the balance(s) available for spending once the channel appears on chain.
12914  *
12915  * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
12916  * be provided.
12917  */
12918 typedef enum LDKBalance_Tag {
12919    /**
12920     * The channel is not yet closed (or the commitment or closing transaction has not yet
12921     * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
12922     * force-closed now.
12923     */
12924    LDKBalance_ClaimableOnChannelClose,
12925    /**
12926     * The channel has been closed, and the given balance is ours but awaiting confirmations until
12927     * we consider it spendable.
12928     */
12929    LDKBalance_ClaimableAwaitingConfirmations,
12930    /**
12931     * The channel has been closed, and the given balance should be ours but awaiting spending
12932     * transaction confirmation. If the spending transaction does not confirm in time, it is
12933     * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
12934     *
12935     * Once the spending transaction confirms, before it has reached enough confirmations to be
12936     * considered safe from chain reorganizations, the balance will instead be provided via
12937     * [`Balance::ClaimableAwaitingConfirmations`].
12938     */
12939    LDKBalance_ContentiousClaimable,
12940    /**
12941     * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
12942     * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
12943     * likely to be claimed by our counterparty before we do.
12944     */
12945    LDKBalance_MaybeTimeoutClaimableHTLC,
12946    /**
12947     * HTLCs which we received from our counterparty which are claimable with a preimage which we
12948     * do not currently have. This will only be claimable if we receive the preimage from the node
12949     * to which we forwarded this HTLC before the timeout.
12950     */
12951    LDKBalance_MaybePreimageClaimableHTLC,
12952    /**
12953     * The channel has been closed, and our counterparty broadcasted a revoked commitment
12954     * transaction.
12955     *
12956     * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
12957     * following amount.
12958     */
12959    LDKBalance_CounterpartyRevokedOutputClaimable,
12960    /**
12961     * Must be last for serialization purposes
12962     */
12963    LDKBalance_Sentinel,
12964 } LDKBalance_Tag;
12965
12966 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
12967    /**
12968     * The amount available to claim, in satoshis, excluding the on-chain fees which will be
12969     * required to do so.
12970     */
12971    uint64_t amount_satoshis;
12972 } LDKBalance_LDKClaimableOnChannelClose_Body;
12973
12974 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
12975    /**
12976     * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
12977     * were spent in broadcasting the transaction.
12978     */
12979    uint64_t amount_satoshis;
12980    /**
12981     * The height at which an [`Event::SpendableOutputs`] event will be generated for this
12982     * amount.
12983     */
12984    uint32_t confirmation_height;
12985 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
12986
12987 typedef struct LDKBalance_LDKContentiousClaimable_Body {
12988    /**
12989     * The amount available to claim, in satoshis, excluding the on-chain fees which will be
12990     * required to do so.
12991     */
12992    uint64_t amount_satoshis;
12993    /**
12994     * The height at which the counterparty may be able to claim the balance if we have not
12995     * done so.
12996     */
12997    uint32_t timeout_height;
12998    /**
12999     * The payment hash that locks this HTLC.
13000     */
13001    struct LDKThirtyTwoBytes payment_hash;
13002    /**
13003     * The preimage that can be used to claim this HTLC.
13004     */
13005    struct LDKThirtyTwoBytes payment_preimage;
13006 } LDKBalance_LDKContentiousClaimable_Body;
13007
13008 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
13009    /**
13010     * The amount potentially available to claim, in satoshis, excluding the on-chain fees
13011     * which will be required to do so.
13012     */
13013    uint64_t amount_satoshis;
13014    /**
13015     * The height at which we will be able to claim the balance if our counterparty has not
13016     * done so.
13017     */
13018    uint32_t claimable_height;
13019    /**
13020     * The payment hash whose preimage our counterparty needs to claim this HTLC.
13021     */
13022    struct LDKThirtyTwoBytes payment_hash;
13023 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
13024
13025 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
13026    /**
13027     * The amount potentially available to claim, in satoshis, excluding the on-chain fees
13028     * which will be required to do so.
13029     */
13030    uint64_t amount_satoshis;
13031    /**
13032     * The height at which our counterparty will be able to claim the balance if we have not
13033     * yet received the preimage and claimed it ourselves.
13034     */
13035    uint32_t expiry_height;
13036    /**
13037     * The payment hash whose preimage we need to claim this HTLC.
13038     */
13039    struct LDKThirtyTwoBytes payment_hash;
13040 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
13041
13042 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
13043    /**
13044     * The amount, in satoshis, of the output which we can claim.
13045     *
13046     * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
13047     * were already spent.
13048     */
13049    uint64_t amount_satoshis;
13050 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
13051
13052 typedef struct MUST_USE_STRUCT LDKBalance {
13053    LDKBalance_Tag tag;
13054    union {
13055       LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
13056       LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
13057       LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
13058       LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
13059       LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
13060       LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
13061    };
13062 } LDKBalance;
13063
13064 /**
13065  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
13066  * This corresponds to std::vector in C++
13067  */
13068 typedef struct LDKCVec_BalanceZ {
13069    /**
13070     * The elements in the array.
13071     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13072     */
13073    struct LDKBalance *data;
13074    /**
13075     * The number of elements pointed to by `data`.
13076     */
13077    uintptr_t datalen;
13078 } LDKCVec_BalanceZ;
13079
13080 /**
13081  * A tuple of 2 elements. See the individual fields for the types contained.
13082  */
13083 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ {
13084    /**
13085     * The element at position 0
13086     */
13087    struct LDKThirtyTwoBytes a;
13088    /**
13089     * The element at position 1
13090     */
13091    struct LDKChannelMonitor b;
13092 } LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ;
13093
13094 /**
13095  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ
13096  */
13097 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr {
13098    /**
13099     * A pointer to the contents in the success state.
13100     * Reading from this pointer when `result_ok` is not set is undefined.
13101     */
13102    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
13103    /**
13104     * A pointer to the contents in the error state.
13105     * Reading from this pointer when `result_ok` is set is undefined.
13106     */
13107    struct LDKDecodeError *err;
13108 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr;
13109
13110 /**
13111  * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
13112  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13113  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13114  */
13115 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ {
13116    /**
13117     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ, accessible via either
13118     * `err` or `result` depending on the state of `result_ok`.
13119     */
13120    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr contents;
13121    /**
13122     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents a success state.
13123     */
13124    bool result_ok;
13125 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ;
13126
13127 /**
13128  * Defines a type identifier for sending messages over the wire.
13129  *
13130  * Messages implementing this trait specify a type and must be [`Writeable`].
13131  */
13132 typedef struct LDKType {
13133    /**
13134     * An opaque pointer which is passed to your function implementations as an argument.
13135     * This has no meaning in the LDK, and can be NULL or any other value.
13136     */
13137    void *this_arg;
13138    /**
13139     * Returns the type identifying the message payload.
13140     */
13141    uint16_t (*type_id)(const void *this_arg);
13142    /**
13143     * Return a human-readable "debug" string describing this object
13144     */
13145    struct LDKStr (*debug_str)(const void *this_arg);
13146    /**
13147     * Serialize the object into a byte array
13148     */
13149    struct LDKCVec_u8Z (*write)(const void *this_arg);
13150    /**
13151     * Called, if set, after this Type has been cloned into a duplicate object.
13152     * The new Type is provided, and should be mutated as needed to perform a
13153     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13154     */
13155    void (*cloned)(struct LDKType *NONNULL_PTR new_Type);
13156    /**
13157     * Frees any resources associated with this object given its this_arg pointer.
13158     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13159     */
13160    void (*free)(void *this_arg);
13161 } LDKType;
13162
13163 /**
13164  * A tuple of 2 elements. See the individual fields for the types contained.
13165  */
13166 typedef struct LDKC2Tuple_PublicKeyTypeZ {
13167    /**
13168     * The element at position 0
13169     */
13170    struct LDKPublicKey a;
13171    /**
13172     * The element at position 1
13173     */
13174    struct LDKType b;
13175 } LDKC2Tuple_PublicKeyTypeZ;
13176
13177 /**
13178  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
13179  * This corresponds to std::vector in C++
13180  */
13181 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
13182    /**
13183     * The elements in the array.
13184     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13185     */
13186    struct LDKC2Tuple_PublicKeyTypeZ *data;
13187    /**
13188     * The number of elements pointed to by `data`.
13189     */
13190    uintptr_t datalen;
13191 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
13192
13193 /**
13194  * A tuple of 2 elements. See the individual fields for the types contained.
13195  */
13196 typedef struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ {
13197    /**
13198     * The element at position 0
13199     */
13200    struct LDKPublicKey a;
13201    /**
13202     * The element at position 1
13203     */
13204    struct LDKCVec_SocketAddressZ b;
13205 } LDKC2Tuple_PublicKeyCVec_SocketAddressZZ;
13206
13207 /**
13208  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCVec_SocketAddressZZs of arbitrary size.
13209  * This corresponds to std::vector in C++
13210  */
13211 typedef struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ {
13212    /**
13213     * The elements in the array.
13214     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13215     */
13216    struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *data;
13217    /**
13218     * The number of elements pointed to by `data`.
13219     */
13220    uintptr_t datalen;
13221 } LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ;
13222
13223 /**
13224  * The contents of an onion message.
13225  */
13226 typedef struct LDKOnionMessageContents {
13227    /**
13228     * An opaque pointer which is passed to your function implementations as an argument.
13229     * This has no meaning in the LDK, and can be NULL or any other value.
13230     */
13231    void *this_arg;
13232    /**
13233     * Returns the TLV type identifying the message contents. MUST be >= 64.
13234     */
13235    uint64_t (*tlv_type)(const void *this_arg);
13236    /**
13237     * Serialize the object into a byte array
13238     */
13239    struct LDKCVec_u8Z (*write)(const void *this_arg);
13240    /**
13241     * Return a human-readable "debug" string describing this object
13242     */
13243    struct LDKStr (*debug_str)(const void *this_arg);
13244    /**
13245     * Called, if set, after this OnionMessageContents has been cloned into a duplicate object.
13246     * The new OnionMessageContents is provided, and should be mutated as needed to perform a
13247     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
13248     */
13249    void (*cloned)(struct LDKOnionMessageContents *NONNULL_PTR new_OnionMessageContents);
13250    /**
13251     * Frees any resources associated with this object given its this_arg pointer.
13252     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13253     */
13254    void (*free)(void *this_arg);
13255 } LDKOnionMessageContents;
13256
13257 /**
13258  * An enum which can either contain a crate::lightning::onion_message::packet::OnionMessageContents or not
13259  */
13260 typedef enum LDKCOption_OnionMessageContentsZ_Tag {
13261    /**
13262     * When we're in this state, this COption_OnionMessageContentsZ contains a crate::lightning::onion_message::packet::OnionMessageContents
13263     */
13264    LDKCOption_OnionMessageContentsZ_Some,
13265    /**
13266     * When we're in this state, this COption_OnionMessageContentsZ contains nothing
13267     */
13268    LDKCOption_OnionMessageContentsZ_None,
13269    /**
13270     * Must be last for serialization purposes
13271     */
13272    LDKCOption_OnionMessageContentsZ_Sentinel,
13273 } LDKCOption_OnionMessageContentsZ_Tag;
13274
13275 typedef struct LDKCOption_OnionMessageContentsZ {
13276    LDKCOption_OnionMessageContentsZ_Tag tag;
13277    union {
13278       struct {
13279          struct LDKOnionMessageContents some;
13280       };
13281    };
13282 } LDKCOption_OnionMessageContentsZ;
13283
13284 /**
13285  * The contents of CResult_COption_OnionMessageContentsZDecodeErrorZ
13286  */
13287 typedef union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr {
13288    /**
13289     * A pointer to the contents in the success state.
13290     * Reading from this pointer when `result_ok` is not set is undefined.
13291     */
13292    struct LDKCOption_OnionMessageContentsZ *result;
13293    /**
13294     * A pointer to the contents in the error state.
13295     * Reading from this pointer when `result_ok` is set is undefined.
13296     */
13297    struct LDKDecodeError *err;
13298 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr;
13299
13300 /**
13301  * A CResult_COption_OnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
13302  * containing a crate::c_types::derived::COption_OnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13303  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13304  */
13305 typedef struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ {
13306    /**
13307     * The contents of this CResult_COption_OnionMessageContentsZDecodeErrorZ, accessible via either
13308     * `err` or `result` depending on the state of `result_ok`.
13309     */
13310    union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr contents;
13311    /**
13312     * Whether this CResult_COption_OnionMessageContentsZDecodeErrorZ represents a success state.
13313     */
13314    bool result_ok;
13315 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZ;
13316
13317 /**
13318  * A tuple of 3 elements. See the individual fields for the types contained.
13319  */
13320 typedef struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ {
13321    /**
13322     * The element at position 0
13323     */
13324    struct LDKOnionMessageContents a;
13325    /**
13326     * The element at position 1
13327     */
13328    struct LDKDestination b;
13329    /**
13330     * The element at position 2
13331     */
13332    struct LDKBlindedPath c;
13333 } LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ;
13334
13335 /**
13336  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OnionMessageContentsDestinationBlindedPathZs of arbitrary size.
13337  * This corresponds to std::vector in C++
13338  */
13339 typedef struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ {
13340    /**
13341     * The elements in the array.
13342     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13343     */
13344    struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *data;
13345    /**
13346     * The number of elements pointed to by `data`.
13347     */
13348    uintptr_t datalen;
13349 } LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ;
13350
13351 /**
13352  * An enum which can either contain a crate::lightning::ln::wire::Type or not
13353  */
13354 typedef enum LDKCOption_TypeZ_Tag {
13355    /**
13356     * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
13357     */
13358    LDKCOption_TypeZ_Some,
13359    /**
13360     * When we're in this state, this COption_TypeZ contains nothing
13361     */
13362    LDKCOption_TypeZ_None,
13363    /**
13364     * Must be last for serialization purposes
13365     */
13366    LDKCOption_TypeZ_Sentinel,
13367 } LDKCOption_TypeZ_Tag;
13368
13369 typedef struct LDKCOption_TypeZ {
13370    LDKCOption_TypeZ_Tag tag;
13371    union {
13372       struct {
13373          struct LDKType some;
13374       };
13375    };
13376 } LDKCOption_TypeZ;
13377
13378 /**
13379  * The contents of CResult_COption_TypeZDecodeErrorZ
13380  */
13381 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
13382    /**
13383     * A pointer to the contents in the success state.
13384     * Reading from this pointer when `result_ok` is not set is undefined.
13385     */
13386    struct LDKCOption_TypeZ *result;
13387    /**
13388     * A pointer to the contents in the error state.
13389     * Reading from this pointer when `result_ok` is set is undefined.
13390     */
13391    struct LDKDecodeError *err;
13392 } LDKCResult_COption_TypeZDecodeErrorZPtr;
13393
13394 /**
13395  * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
13396  * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13397  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13398  */
13399 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
13400    /**
13401     * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
13402     * `err` or `result` depending on the state of `result_ok`.
13403     */
13404    union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
13405    /**
13406     * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
13407     */
13408    bool result_ok;
13409 } LDKCResult_COption_TypeZDecodeErrorZ;
13410
13411 /**
13412  * An enum which can either contain a crate::lightning::ln::msgs::SocketAddress or not
13413  */
13414 typedef enum LDKCOption_SocketAddressZ_Tag {
13415    /**
13416     * When we're in this state, this COption_SocketAddressZ contains a crate::lightning::ln::msgs::SocketAddress
13417     */
13418    LDKCOption_SocketAddressZ_Some,
13419    /**
13420     * When we're in this state, this COption_SocketAddressZ contains nothing
13421     */
13422    LDKCOption_SocketAddressZ_None,
13423    /**
13424     * Must be last for serialization purposes
13425     */
13426    LDKCOption_SocketAddressZ_Sentinel,
13427 } LDKCOption_SocketAddressZ_Tag;
13428
13429 typedef struct LDKCOption_SocketAddressZ {
13430    LDKCOption_SocketAddressZ_Tag tag;
13431    union {
13432       struct {
13433          struct LDKSocketAddress some;
13434       };
13435    };
13436 } LDKCOption_SocketAddressZ;
13437
13438
13439
13440 /**
13441  * Details of a connected peer as returned by [`PeerManager::list_peers`].
13442  */
13443 typedef struct MUST_USE_STRUCT LDKPeerDetails {
13444    /**
13445     * A pointer to the opaque Rust object.
13446     * Nearly everywhere, inner must be non-null, however in places where
13447     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13448     */
13449    LDKnativePeerDetails *inner;
13450    /**
13451     * Indicates that this is the only struct which contains the same pointer.
13452     * Rust functions which take ownership of an object provided via an argument require
13453     * this to be true and invalidate the object pointed to by inner.
13454     */
13455    bool is_owned;
13456 } LDKPeerDetails;
13457
13458 /**
13459  * A dynamically-allocated array of crate::lightning::ln::peer_handler::PeerDetailss of arbitrary size.
13460  * This corresponds to std::vector in C++
13461  */
13462 typedef struct LDKCVec_PeerDetailsZ {
13463    /**
13464     * The elements in the array.
13465     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13466     */
13467    struct LDKPeerDetails *data;
13468    /**
13469     * The number of elements pointed to by `data`.
13470     */
13471    uintptr_t datalen;
13472 } LDKCVec_PeerDetailsZ;
13473
13474
13475
13476 /**
13477  * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
13478  * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
13479  * descriptor.
13480  */
13481 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
13482    /**
13483     * A pointer to the opaque Rust object.
13484     * Nearly everywhere, inner must be non-null, however in places where
13485     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13486     */
13487    LDKnativePeerHandleError *inner;
13488    /**
13489     * Indicates that this is the only struct which contains the same pointer.
13490     * Rust functions which take ownership of an object provided via an argument require
13491     * this to be true and invalidate the object pointed to by inner.
13492     */
13493    bool is_owned;
13494 } LDKPeerHandleError;
13495
13496 /**
13497  * The contents of CResult_CVec_u8ZPeerHandleErrorZ
13498  */
13499 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
13500    /**
13501     * A pointer to the contents in the success state.
13502     * Reading from this pointer when `result_ok` is not set is undefined.
13503     */
13504    struct LDKCVec_u8Z *result;
13505    /**
13506     * A pointer to the contents in the error state.
13507     * Reading from this pointer when `result_ok` is set is undefined.
13508     */
13509    struct LDKPeerHandleError *err;
13510 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
13511
13512 /**
13513  * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
13514  * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13515  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13516  */
13517 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
13518    /**
13519     * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
13520     * `err` or `result` depending on the state of `result_ok`.
13521     */
13522    union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
13523    /**
13524     * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
13525     */
13526    bool result_ok;
13527 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
13528
13529 /**
13530  * The contents of CResult_NonePeerHandleErrorZ
13531  */
13532 typedef union LDKCResult_NonePeerHandleErrorZPtr {
13533    /**
13534     * Note that this value is always NULL, as there are no contents in the OK variant
13535     */
13536    void *result;
13537    /**
13538     * A pointer to the contents in the error state.
13539     * Reading from this pointer when `result_ok` is set is undefined.
13540     */
13541    struct LDKPeerHandleError *err;
13542 } LDKCResult_NonePeerHandleErrorZPtr;
13543
13544 /**
13545  * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
13546  * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13547  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13548  */
13549 typedef struct LDKCResult_NonePeerHandleErrorZ {
13550    /**
13551     * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
13552     * `err` or `result` depending on the state of `result_ok`.
13553     */
13554    union LDKCResult_NonePeerHandleErrorZPtr contents;
13555    /**
13556     * Whether this CResult_NonePeerHandleErrorZ represents a success state.
13557     */
13558    bool result_ok;
13559 } LDKCResult_NonePeerHandleErrorZ;
13560
13561 /**
13562  * The contents of CResult_boolPeerHandleErrorZ
13563  */
13564 typedef union LDKCResult_boolPeerHandleErrorZPtr {
13565    /**
13566     * A pointer to the contents in the success state.
13567     * Reading from this pointer when `result_ok` is not set is undefined.
13568     */
13569    bool *result;
13570    /**
13571     * A pointer to the contents in the error state.
13572     * Reading from this pointer when `result_ok` is set is undefined.
13573     */
13574    struct LDKPeerHandleError *err;
13575 } LDKCResult_boolPeerHandleErrorZPtr;
13576
13577 /**
13578  * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
13579  * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
13580  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13581  */
13582 typedef struct LDKCResult_boolPeerHandleErrorZ {
13583    /**
13584     * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
13585     * `err` or `result` depending on the state of `result_ok`.
13586     */
13587    union LDKCResult_boolPeerHandleErrorZPtr contents;
13588    /**
13589     * Whether this CResult_boolPeerHandleErrorZ represents a success state.
13590     */
13591    bool result_ok;
13592 } LDKCResult_boolPeerHandleErrorZ;
13593
13594 /**
13595  * All-encompassing standard error type that processing can return
13596  */
13597 typedef enum LDKGraphSyncError_Tag {
13598    /**
13599     * Error trying to read the update data, typically due to an erroneous data length indication
13600     * that is greater than the actual amount of data provided
13601     */
13602    LDKGraphSyncError_DecodeError,
13603    /**
13604     * Error applying the patch to the network graph, usually the result of updates that are too
13605     * old or missing prerequisite data to the application of updates out of order
13606     */
13607    LDKGraphSyncError_LightningError,
13608    /**
13609     * Must be last for serialization purposes
13610     */
13611    LDKGraphSyncError_Sentinel,
13612 } LDKGraphSyncError_Tag;
13613
13614 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
13615    LDKGraphSyncError_Tag tag;
13616    union {
13617       struct {
13618          struct LDKDecodeError decode_error;
13619       };
13620       struct {
13621          struct LDKLightningError lightning_error;
13622       };
13623    };
13624 } LDKGraphSyncError;
13625
13626 /**
13627  * The contents of CResult_u32GraphSyncErrorZ
13628  */
13629 typedef union LDKCResult_u32GraphSyncErrorZPtr {
13630    /**
13631     * A pointer to the contents in the success state.
13632     * Reading from this pointer when `result_ok` is not set is undefined.
13633     */
13634    uint32_t *result;
13635    /**
13636     * A pointer to the contents in the error state.
13637     * Reading from this pointer when `result_ok` is set is undefined.
13638     */
13639    struct LDKGraphSyncError *err;
13640 } LDKCResult_u32GraphSyncErrorZPtr;
13641
13642 /**
13643  * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
13644  * containing a u32 on success and a crate::lightning_rapid_gossip_sync::GraphSyncError on failure.
13645  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13646  */
13647 typedef struct LDKCResult_u32GraphSyncErrorZ {
13648    /**
13649     * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
13650     * `err` or `result` depending on the state of `result_ok`.
13651     */
13652    union LDKCResult_u32GraphSyncErrorZPtr contents;
13653    /**
13654     * Whether this CResult_u32GraphSyncErrorZ represents a success state.
13655     */
13656    bool result_ok;
13657 } LDKCResult_u32GraphSyncErrorZ;
13658
13659 /**
13660  * The contents of CResult_CVec_u8ZIOErrorZ
13661  */
13662 typedef union LDKCResult_CVec_u8ZIOErrorZPtr {
13663    /**
13664     * A pointer to the contents in the success state.
13665     * Reading from this pointer when `result_ok` is not set is undefined.
13666     */
13667    struct LDKCVec_u8Z *result;
13668    /**
13669     * A pointer to the contents in the error state.
13670     * Reading from this pointer when `result_ok` is set is undefined.
13671     */
13672    enum LDKIOError *err;
13673 } LDKCResult_CVec_u8ZIOErrorZPtr;
13674
13675 /**
13676  * A CResult_CVec_u8ZIOErrorZ represents the result of a fallible operation,
13677  * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::IOError on failure.
13678  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13679  */
13680 typedef struct LDKCResult_CVec_u8ZIOErrorZ {
13681    /**
13682     * The contents of this CResult_CVec_u8ZIOErrorZ, accessible via either
13683     * `err` or `result` depending on the state of `result_ok`.
13684     */
13685    union LDKCResult_CVec_u8ZIOErrorZPtr contents;
13686    /**
13687     * Whether this CResult_CVec_u8ZIOErrorZ represents a success state.
13688     */
13689    bool result_ok;
13690 } LDKCResult_CVec_u8ZIOErrorZ;
13691
13692 /**
13693  * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
13694  * This corresponds to std::vector in C++
13695  */
13696 typedef struct LDKCVec_StrZ {
13697    /**
13698     * The elements in the array.
13699     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13700     */
13701    struct LDKStr *data;
13702    /**
13703     * The number of elements pointed to by `data`.
13704     */
13705    uintptr_t datalen;
13706 } LDKCVec_StrZ;
13707
13708 /**
13709  * The contents of CResult_CVec_StrZIOErrorZ
13710  */
13711 typedef union LDKCResult_CVec_StrZIOErrorZPtr {
13712    /**
13713     * A pointer to the contents in the success state.
13714     * Reading from this pointer when `result_ok` is not set is undefined.
13715     */
13716    struct LDKCVec_StrZ *result;
13717    /**
13718     * A pointer to the contents in the error state.
13719     * Reading from this pointer when `result_ok` is set is undefined.
13720     */
13721    enum LDKIOError *err;
13722 } LDKCResult_CVec_StrZIOErrorZPtr;
13723
13724 /**
13725  * A CResult_CVec_StrZIOErrorZ represents the result of a fallible operation,
13726  * containing a crate::c_types::derived::CVec_StrZ on success and a crate::c_types::IOError on failure.
13727  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13728  */
13729 typedef struct LDKCResult_CVec_StrZIOErrorZ {
13730    /**
13731     * The contents of this CResult_CVec_StrZIOErrorZ, accessible via either
13732     * `err` or `result` depending on the state of `result_ok`.
13733     */
13734    union LDKCResult_CVec_StrZIOErrorZPtr contents;
13735    /**
13736     * Whether this CResult_CVec_StrZIOErrorZ represents a success state.
13737     */
13738    bool result_ok;
13739 } LDKCResult_CVec_StrZIOErrorZ;
13740
13741 /**
13742  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZs of arbitrary size.
13743  * This corresponds to std::vector in C++
13744  */
13745 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ {
13746    /**
13747     * The elements in the array.
13748     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13749     */
13750    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *data;
13751    /**
13752     * The number of elements pointed to by `data`.
13753     */
13754    uintptr_t datalen;
13755 } LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ;
13756
13757 /**
13758  * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ
13759  */
13760 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr {
13761    /**
13762     * A pointer to the contents in the success state.
13763     * Reading from this pointer when `result_ok` is not set is undefined.
13764     */
13765    struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *result;
13766    /**
13767     * A pointer to the contents in the error state.
13768     * Reading from this pointer when `result_ok` is set is undefined.
13769     */
13770    enum LDKIOError *err;
13771 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr;
13772
13773 /**
13774  * A CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents the result of a fallible operation,
13775  * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ on success and a crate::c_types::IOError on failure.
13776  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13777  */
13778 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ {
13779    /**
13780     * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ, accessible via either
13781     * `err` or `result` depending on the state of `result_ok`.
13782     */
13783    union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr contents;
13784    /**
13785     * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents a success state.
13786     */
13787    bool result_ok;
13788 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ;
13789
13790 /**
13791  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ
13792  */
13793 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr {
13794    /**
13795     * A pointer to the contents in the success state.
13796     * Reading from this pointer when `result_ok` is not set is undefined.
13797     */
13798    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
13799    /**
13800     * A pointer to the contents in the error state.
13801     * Reading from this pointer when `result_ok` is set is undefined.
13802     */
13803    enum LDKIOError *err;
13804 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr;
13805
13806 /**
13807  * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents the result of a fallible operation,
13808  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::c_types::IOError on failure.
13809  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13810  */
13811 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ {
13812    /**
13813     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ, accessible via either
13814     * `err` or `result` depending on the state of `result_ok`.
13815     */
13816    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr contents;
13817    /**
13818     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents a success state.
13819     */
13820    bool result_ok;
13821 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ;
13822
13823 /**
13824  * The contents of CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ
13825  */
13826 typedef union LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr {
13827    /**
13828     * A pointer to the contents in the success state.
13829     * Reading from this pointer when `result_ok` is not set is undefined.
13830     */
13831    struct LDKUnsignedInvoiceRequest *result;
13832    /**
13833     * A pointer to the contents in the error state.
13834     * Reading from this pointer when `result_ok` is set is undefined.
13835     */
13836    enum LDKBolt12SemanticError *err;
13837 } LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr;
13838
13839 /**
13840  * A CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ represents the result of a fallible operation,
13841  * containing a crate::lightning::offers::invoice_request::UnsignedInvoiceRequest on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13842  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13843  */
13844 typedef struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ {
13845    /**
13846     * The contents of this CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ, accessible via either
13847     * `err` or `result` depending on the state of `result_ok`.
13848     */
13849    union LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr contents;
13850    /**
13851     * Whether this CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ represents a success state.
13852     */
13853    bool result_ok;
13854 } LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ;
13855
13856 /**
13857  * The contents of CResult_InvoiceRequestBolt12SemanticErrorZ
13858  */
13859 typedef union LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr {
13860    /**
13861     * A pointer to the contents in the success state.
13862     * Reading from this pointer when `result_ok` is not set is undefined.
13863     */
13864    struct LDKInvoiceRequest *result;
13865    /**
13866     * A pointer to the contents in the error state.
13867     * Reading from this pointer when `result_ok` is set is undefined.
13868     */
13869    enum LDKBolt12SemanticError *err;
13870 } LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr;
13871
13872 /**
13873  * A CResult_InvoiceRequestBolt12SemanticErrorZ represents the result of a fallible operation,
13874  * containing a crate::lightning::offers::invoice_request::InvoiceRequest on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13875  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13876  */
13877 typedef struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ {
13878    /**
13879     * The contents of this CResult_InvoiceRequestBolt12SemanticErrorZ, accessible via either
13880     * `err` or `result` depending on the state of `result_ok`.
13881     */
13882    union LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr contents;
13883    /**
13884     * Whether this CResult_InvoiceRequestBolt12SemanticErrorZ represents a success state.
13885     */
13886    bool result_ok;
13887 } LDKCResult_InvoiceRequestBolt12SemanticErrorZ;
13888
13889 /**
13890  * Represents a valid secp256k1 secret key serialized as a 32 byte array.
13891  */
13892 typedef struct LDKSecretKey {
13893    /**
13894     * The bytes of the secret key
13895     */
13896    uint8_t bytes[32];
13897 } LDKSecretKey;
13898
13899 /**
13900  * An enum which can either contain a crate::c_types::SecretKey or not
13901  */
13902 typedef enum LDKCOption_SecretKeyZ_Tag {
13903    /**
13904     * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey
13905     */
13906    LDKCOption_SecretKeyZ_Some,
13907    /**
13908     * When we're in this state, this COption_SecretKeyZ contains nothing
13909     */
13910    LDKCOption_SecretKeyZ_None,
13911    /**
13912     * Must be last for serialization purposes
13913     */
13914    LDKCOption_SecretKeyZ_Sentinel,
13915 } LDKCOption_SecretKeyZ_Tag;
13916
13917 typedef struct LDKCOption_SecretKeyZ {
13918    LDKCOption_SecretKeyZ_Tag tag;
13919    union {
13920       struct {
13921          struct LDKSecretKey some;
13922       };
13923    };
13924 } LDKCOption_SecretKeyZ;
13925
13926
13927
13928 /**
13929  * Builds a [`Bolt12Invoice`] from either:
13930  * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
13931  * - a [`Refund`] for the \"offer for money\" flow.
13932  *
13933  * See [module-level documentation] for usage.
13934  *
13935  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
13936  * [`Refund`]: crate::offers::refund::Refund
13937  * [module-level documentation]: self
13938  */
13939 typedef struct MUST_USE_STRUCT LDKInvoiceWithExplicitSigningPubkeyBuilder {
13940    /**
13941     * A pointer to the opaque Rust object.
13942     * Nearly everywhere, inner must be non-null, however in places where
13943     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13944     */
13945    LDKnativeInvoiceWithExplicitSigningPubkeyBuilder *inner;
13946    /**
13947     * Indicates that this is the only struct which contains the same pointer.
13948     * Rust functions which take ownership of an object provided via an argument require
13949     * this to be true and invalidate the object pointed to by inner.
13950     */
13951    bool is_owned;
13952 } LDKInvoiceWithExplicitSigningPubkeyBuilder;
13953
13954 /**
13955  * The contents of CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ
13956  */
13957 typedef union LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr {
13958    /**
13959     * A pointer to the contents in the success state.
13960     * Reading from this pointer when `result_ok` is not set is undefined.
13961     */
13962    struct LDKInvoiceWithExplicitSigningPubkeyBuilder *result;
13963    /**
13964     * A pointer to the contents in the error state.
13965     * Reading from this pointer when `result_ok` is set is undefined.
13966     */
13967    enum LDKBolt12SemanticError *err;
13968 } LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr;
13969
13970 /**
13971  * A CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
13972  * containing a crate::lightning::offers::invoice::InvoiceWithExplicitSigningPubkeyBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
13973  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13974  */
13975 typedef struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ {
13976    /**
13977     * The contents of this CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ, accessible via either
13978     * `err` or `result` depending on the state of `result_ok`.
13979     */
13980    union LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr contents;
13981    /**
13982     * Whether this CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ represents a success state.
13983     */
13984    bool result_ok;
13985 } LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ;
13986
13987
13988
13989 /**
13990  * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
13991  * ways to respond depending on whether the signing keys were derived.
13992  */
13993 typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
13994    /**
13995     * A pointer to the opaque Rust object.
13996     * Nearly everywhere, inner must be non-null, however in places where
13997     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13998     */
13999    LDKnativeVerifiedInvoiceRequest *inner;
14000    /**
14001     * Indicates that this is the only struct which contains the same pointer.
14002     * Rust functions which take ownership of an object provided via an argument require
14003     * this to be true and invalidate the object pointed to by inner.
14004     */
14005    bool is_owned;
14006 } LDKVerifiedInvoiceRequest;
14007
14008 /**
14009  * The contents of CResult_VerifiedInvoiceRequestNoneZ
14010  */
14011 typedef union LDKCResult_VerifiedInvoiceRequestNoneZPtr {
14012    /**
14013     * A pointer to the contents in the success state.
14014     * Reading from this pointer when `result_ok` is not set is undefined.
14015     */
14016    struct LDKVerifiedInvoiceRequest *result;
14017    /**
14018     * Note that this value is always NULL, as there are no contents in the Err variant
14019     */
14020    void *err;
14021 } LDKCResult_VerifiedInvoiceRequestNoneZPtr;
14022
14023 /**
14024  * A CResult_VerifiedInvoiceRequestNoneZ represents the result of a fallible operation,
14025  * containing a crate::lightning::offers::invoice_request::VerifiedInvoiceRequest on success and a () on failure.
14026  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14027  */
14028 typedef struct LDKCResult_VerifiedInvoiceRequestNoneZ {
14029    /**
14030     * The contents of this CResult_VerifiedInvoiceRequestNoneZ, accessible via either
14031     * `err` or `result` depending on the state of `result_ok`.
14032     */
14033    union LDKCResult_VerifiedInvoiceRequestNoneZPtr contents;
14034    /**
14035     * Whether this CResult_VerifiedInvoiceRequestNoneZ represents a success state.
14036     */
14037    bool result_ok;
14038 } LDKCResult_VerifiedInvoiceRequestNoneZ;
14039
14040
14041
14042 /**
14043  * Builds a [`Bolt12Invoice`] from either:
14044  * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
14045  * - a [`Refund`] for the \"offer for money\" flow.
14046  *
14047  * See [module-level documentation] for usage.
14048  *
14049  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
14050  * [`Refund`]: crate::offers::refund::Refund
14051  * [module-level documentation]: self
14052  */
14053 typedef struct MUST_USE_STRUCT LDKInvoiceWithDerivedSigningPubkeyBuilder {
14054    /**
14055     * A pointer to the opaque Rust object.
14056     * Nearly everywhere, inner must be non-null, however in places where
14057     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14058     */
14059    LDKnativeInvoiceWithDerivedSigningPubkeyBuilder *inner;
14060    /**
14061     * Indicates that this is the only struct which contains the same pointer.
14062     * Rust functions which take ownership of an object provided via an argument require
14063     * this to be true and invalidate the object pointed to by inner.
14064     */
14065    bool is_owned;
14066 } LDKInvoiceWithDerivedSigningPubkeyBuilder;
14067
14068 /**
14069  * The contents of CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ
14070  */
14071 typedef union LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr {
14072    /**
14073     * A pointer to the contents in the success state.
14074     * Reading from this pointer when `result_ok` is not set is undefined.
14075     */
14076    struct LDKInvoiceWithDerivedSigningPubkeyBuilder *result;
14077    /**
14078     * A pointer to the contents in the error state.
14079     * Reading from this pointer when `result_ok` is set is undefined.
14080     */
14081    enum LDKBolt12SemanticError *err;
14082 } LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr;
14083
14084 /**
14085  * A CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
14086  * containing a crate::lightning::offers::invoice::InvoiceWithDerivedSigningPubkeyBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
14087  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14088  */
14089 typedef struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ {
14090    /**
14091     * The contents of this CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ, accessible via either
14092     * `err` or `result` depending on the state of `result_ok`.
14093     */
14094    union LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr contents;
14095    /**
14096     * Whether this CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ represents a success state.
14097     */
14098    bool result_ok;
14099 } LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ;
14100
14101
14102
14103 /**
14104  * Fields sent in an [`InvoiceRequest`] message to include in [`PaymentContext::Bolt12Offer`].
14105  *
14106  * [`PaymentContext::Bolt12Offer`]: crate::blinded_path::payment::PaymentContext::Bolt12Offer
14107  */
14108 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFields {
14109    /**
14110     * A pointer to the opaque Rust object.
14111     * Nearly everywhere, inner must be non-null, however in places where
14112     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14113     */
14114    LDKnativeInvoiceRequestFields *inner;
14115    /**
14116     * Indicates that this is the only struct which contains the same pointer.
14117     * Rust functions which take ownership of an object provided via an argument require
14118     * this to be true and invalidate the object pointed to by inner.
14119     */
14120    bool is_owned;
14121 } LDKInvoiceRequestFields;
14122
14123 /**
14124  * The contents of CResult_InvoiceRequestFieldsDecodeErrorZ
14125  */
14126 typedef union LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr {
14127    /**
14128     * A pointer to the contents in the success state.
14129     * Reading from this pointer when `result_ok` is not set is undefined.
14130     */
14131    struct LDKInvoiceRequestFields *result;
14132    /**
14133     * A pointer to the contents in the error state.
14134     * Reading from this pointer when `result_ok` is set is undefined.
14135     */
14136    struct LDKDecodeError *err;
14137 } LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr;
14138
14139 /**
14140  * A CResult_InvoiceRequestFieldsDecodeErrorZ represents the result of a fallible operation,
14141  * containing a crate::lightning::offers::invoice_request::InvoiceRequestFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
14142  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14143  */
14144 typedef struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ {
14145    /**
14146     * The contents of this CResult_InvoiceRequestFieldsDecodeErrorZ, accessible via either
14147     * `err` or `result` depending on the state of `result_ok`.
14148     */
14149    union LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr contents;
14150    /**
14151     * Whether this CResult_InvoiceRequestFieldsDecodeErrorZ represents a success state.
14152     */
14153    bool result_ok;
14154 } LDKCResult_InvoiceRequestFieldsDecodeErrorZ;
14155
14156 /**
14157  * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
14158  * This corresponds to std::vector in C++
14159  */
14160 typedef struct LDKCVec_WitnessZ {
14161    /**
14162     * The elements in the array.
14163     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14164     */
14165    struct LDKWitness *data;
14166    /**
14167     * The number of elements pointed to by `data`.
14168     */
14169    uintptr_t datalen;
14170 } LDKCVec_WitnessZ;
14171
14172 /**
14173  * An enum which can either contain a crate::c_types::ECDSASignature or not
14174  */
14175 typedef enum LDKCOption_ECDSASignatureZ_Tag {
14176    /**
14177     * When we're in this state, this COption_ECDSASignatureZ contains a crate::c_types::ECDSASignature
14178     */
14179    LDKCOption_ECDSASignatureZ_Some,
14180    /**
14181     * When we're in this state, this COption_ECDSASignatureZ contains nothing
14182     */
14183    LDKCOption_ECDSASignatureZ_None,
14184    /**
14185     * Must be last for serialization purposes
14186     */
14187    LDKCOption_ECDSASignatureZ_Sentinel,
14188 } LDKCOption_ECDSASignatureZ_Tag;
14189
14190 typedef struct LDKCOption_ECDSASignatureZ {
14191    LDKCOption_ECDSASignatureZ_Tag tag;
14192    union {
14193       struct {
14194          struct LDKECDSASignature some;
14195       };
14196    };
14197 } LDKCOption_ECDSASignatureZ;
14198
14199 /**
14200  * An enum which can either contain a i64 or not
14201  */
14202 typedef enum LDKCOption_i64Z_Tag {
14203    /**
14204     * When we're in this state, this COption_i64Z contains a i64
14205     */
14206    LDKCOption_i64Z_Some,
14207    /**
14208     * When we're in this state, this COption_i64Z contains nothing
14209     */
14210    LDKCOption_i64Z_None,
14211    /**
14212     * Must be last for serialization purposes
14213     */
14214    LDKCOption_i64Z_Sentinel,
14215 } LDKCOption_i64Z_Tag;
14216
14217 typedef struct LDKCOption_i64Z {
14218    LDKCOption_i64Z_Tag tag;
14219    union {
14220       struct {
14221          int64_t some;
14222       };
14223    };
14224 } LDKCOption_i64Z;
14225
14226 /**
14227  * The contents of CResult_SocketAddressDecodeErrorZ
14228  */
14229 typedef union LDKCResult_SocketAddressDecodeErrorZPtr {
14230    /**
14231     * A pointer to the contents in the success state.
14232     * Reading from this pointer when `result_ok` is not set is undefined.
14233     */
14234    struct LDKSocketAddress *result;
14235    /**
14236     * A pointer to the contents in the error state.
14237     * Reading from this pointer when `result_ok` is set is undefined.
14238     */
14239    struct LDKDecodeError *err;
14240 } LDKCResult_SocketAddressDecodeErrorZPtr;
14241
14242 /**
14243  * A CResult_SocketAddressDecodeErrorZ represents the result of a fallible operation,
14244  * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
14245  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14246  */
14247 typedef struct LDKCResult_SocketAddressDecodeErrorZ {
14248    /**
14249     * The contents of this CResult_SocketAddressDecodeErrorZ, accessible via either
14250     * `err` or `result` depending on the state of `result_ok`.
14251     */
14252    union LDKCResult_SocketAddressDecodeErrorZPtr contents;
14253    /**
14254     * Whether this CResult_SocketAddressDecodeErrorZ represents a success state.
14255     */
14256    bool result_ok;
14257 } LDKCResult_SocketAddressDecodeErrorZ;
14258
14259 /**
14260  * The contents of CResult_SocketAddressSocketAddressParseErrorZ
14261  */
14262 typedef union LDKCResult_SocketAddressSocketAddressParseErrorZPtr {
14263    /**
14264     * A pointer to the contents in the success state.
14265     * Reading from this pointer when `result_ok` is not set is undefined.
14266     */
14267    struct LDKSocketAddress *result;
14268    /**
14269     * A pointer to the contents in the error state.
14270     * Reading from this pointer when `result_ok` is set is undefined.
14271     */
14272    enum LDKSocketAddressParseError *err;
14273 } LDKCResult_SocketAddressSocketAddressParseErrorZPtr;
14274
14275 /**
14276  * A CResult_SocketAddressSocketAddressParseErrorZ represents the result of a fallible operation,
14277  * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::SocketAddressParseError on failure.
14278  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14279  */
14280 typedef struct LDKCResult_SocketAddressSocketAddressParseErrorZ {
14281    /**
14282     * The contents of this CResult_SocketAddressSocketAddressParseErrorZ, accessible via either
14283     * `err` or `result` depending on the state of `result_ok`.
14284     */
14285    union LDKCResult_SocketAddressSocketAddressParseErrorZPtr contents;
14286    /**
14287     * Whether this CResult_SocketAddressSocketAddressParseErrorZ represents a success state.
14288     */
14289    bool result_ok;
14290 } LDKCResult_SocketAddressSocketAddressParseErrorZ;
14291
14292
14293
14294 /**
14295  * An [`update_add_htlc`] message to be sent to or received from a peer.
14296  *
14297  * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
14298  */
14299 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
14300    /**
14301     * A pointer to the opaque Rust object.
14302     * Nearly everywhere, inner must be non-null, however in places where
14303     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14304     */
14305    LDKnativeUpdateAddHTLC *inner;
14306    /**
14307     * Indicates that this is the only struct which contains the same pointer.
14308     * Rust functions which take ownership of an object provided via an argument require
14309     * this to be true and invalidate the object pointed to by inner.
14310     */
14311    bool is_owned;
14312 } LDKUpdateAddHTLC;
14313
14314 /**
14315  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
14316  * This corresponds to std::vector in C++
14317  */
14318 typedef struct LDKCVec_UpdateAddHTLCZ {
14319    /**
14320     * The elements in the array.
14321     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14322     */
14323    struct LDKUpdateAddHTLC *data;
14324    /**
14325     * The number of elements pointed to by `data`.
14326     */
14327    uintptr_t datalen;
14328 } LDKCVec_UpdateAddHTLCZ;
14329
14330
14331
14332 /**
14333  * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
14334  *
14335  * [`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
14336  */
14337 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
14338    /**
14339     * A pointer to the opaque Rust object.
14340     * Nearly everywhere, inner must be non-null, however in places where
14341     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14342     */
14343    LDKnativeUpdateFulfillHTLC *inner;
14344    /**
14345     * Indicates that this is the only struct which contains the same pointer.
14346     * Rust functions which take ownership of an object provided via an argument require
14347     * this to be true and invalidate the object pointed to by inner.
14348     */
14349    bool is_owned;
14350 } LDKUpdateFulfillHTLC;
14351
14352 /**
14353  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
14354  * This corresponds to std::vector in C++
14355  */
14356 typedef struct LDKCVec_UpdateFulfillHTLCZ {
14357    /**
14358     * The elements in the array.
14359     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14360     */
14361    struct LDKUpdateFulfillHTLC *data;
14362    /**
14363     * The number of elements pointed to by `data`.
14364     */
14365    uintptr_t datalen;
14366 } LDKCVec_UpdateFulfillHTLCZ;
14367
14368
14369
14370 /**
14371  * An [`update_fail_htlc`] message to be sent to or received from a peer.
14372  *
14373  * [`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
14374  */
14375 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
14376    /**
14377     * A pointer to the opaque Rust object.
14378     * Nearly everywhere, inner must be non-null, however in places where
14379     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14380     */
14381    LDKnativeUpdateFailHTLC *inner;
14382    /**
14383     * Indicates that this is the only struct which contains the same pointer.
14384     * Rust functions which take ownership of an object provided via an argument require
14385     * this to be true and invalidate the object pointed to by inner.
14386     */
14387    bool is_owned;
14388 } LDKUpdateFailHTLC;
14389
14390 /**
14391  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
14392  * This corresponds to std::vector in C++
14393  */
14394 typedef struct LDKCVec_UpdateFailHTLCZ {
14395    /**
14396     * The elements in the array.
14397     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14398     */
14399    struct LDKUpdateFailHTLC *data;
14400    /**
14401     * The number of elements pointed to by `data`.
14402     */
14403    uintptr_t datalen;
14404 } LDKCVec_UpdateFailHTLCZ;
14405
14406
14407
14408 /**
14409  * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
14410  *
14411  * [`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
14412  */
14413 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
14414    /**
14415     * A pointer to the opaque Rust object.
14416     * Nearly everywhere, inner must be non-null, however in places where
14417     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14418     */
14419    LDKnativeUpdateFailMalformedHTLC *inner;
14420    /**
14421     * Indicates that this is the only struct which contains the same pointer.
14422     * Rust functions which take ownership of an object provided via an argument require
14423     * this to be true and invalidate the object pointed to by inner.
14424     */
14425    bool is_owned;
14426 } LDKUpdateFailMalformedHTLC;
14427
14428 /**
14429  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
14430  * This corresponds to std::vector in C++
14431  */
14432 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
14433    /**
14434     * The elements in the array.
14435     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14436     */
14437    struct LDKUpdateFailMalformedHTLC *data;
14438    /**
14439     * The number of elements pointed to by `data`.
14440     */
14441    uintptr_t datalen;
14442 } LDKCVec_UpdateFailMalformedHTLCZ;
14443
14444 /**
14445  * The contents of CResult_AcceptChannelDecodeErrorZ
14446  */
14447 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
14448    /**
14449     * A pointer to the contents in the success state.
14450     * Reading from this pointer when `result_ok` is not set is undefined.
14451     */
14452    struct LDKAcceptChannel *result;
14453    /**
14454     * A pointer to the contents in the error state.
14455     * Reading from this pointer when `result_ok` is set is undefined.
14456     */
14457    struct LDKDecodeError *err;
14458 } LDKCResult_AcceptChannelDecodeErrorZPtr;
14459
14460 /**
14461  * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
14462  * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
14463  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14464  */
14465 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
14466    /**
14467     * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
14468     * `err` or `result` depending on the state of `result_ok`.
14469     */
14470    union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
14471    /**
14472     * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
14473     */
14474    bool result_ok;
14475 } LDKCResult_AcceptChannelDecodeErrorZ;
14476
14477 /**
14478  * The contents of CResult_AcceptChannelV2DecodeErrorZ
14479  */
14480 typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
14481    /**
14482     * A pointer to the contents in the success state.
14483     * Reading from this pointer when `result_ok` is not set is undefined.
14484     */
14485    struct LDKAcceptChannelV2 *result;
14486    /**
14487     * A pointer to the contents in the error state.
14488     * Reading from this pointer when `result_ok` is set is undefined.
14489     */
14490    struct LDKDecodeError *err;
14491 } LDKCResult_AcceptChannelV2DecodeErrorZPtr;
14492
14493 /**
14494  * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
14495  * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
14496  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14497  */
14498 typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
14499    /**
14500     * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
14501     * `err` or `result` depending on the state of `result_ok`.
14502     */
14503    union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
14504    /**
14505     * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
14506     */
14507    bool result_ok;
14508 } LDKCResult_AcceptChannelV2DecodeErrorZ;
14509
14510 /**
14511  * The contents of CResult_StfuDecodeErrorZ
14512  */
14513 typedef union LDKCResult_StfuDecodeErrorZPtr {
14514    /**
14515     * A pointer to the contents in the success state.
14516     * Reading from this pointer when `result_ok` is not set is undefined.
14517     */
14518    struct LDKStfu *result;
14519    /**
14520     * A pointer to the contents in the error state.
14521     * Reading from this pointer when `result_ok` is set is undefined.
14522     */
14523    struct LDKDecodeError *err;
14524 } LDKCResult_StfuDecodeErrorZPtr;
14525
14526 /**
14527  * A CResult_StfuDecodeErrorZ represents the result of a fallible operation,
14528  * containing a crate::lightning::ln::msgs::Stfu on success and a crate::lightning::ln::msgs::DecodeError on failure.
14529  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14530  */
14531 typedef struct LDKCResult_StfuDecodeErrorZ {
14532    /**
14533     * The contents of this CResult_StfuDecodeErrorZ, accessible via either
14534     * `err` or `result` depending on the state of `result_ok`.
14535     */
14536    union LDKCResult_StfuDecodeErrorZPtr contents;
14537    /**
14538     * Whether this CResult_StfuDecodeErrorZ represents a success state.
14539     */
14540    bool result_ok;
14541 } LDKCResult_StfuDecodeErrorZ;
14542
14543 /**
14544  * The contents of CResult_SpliceDecodeErrorZ
14545  */
14546 typedef union LDKCResult_SpliceDecodeErrorZPtr {
14547    /**
14548     * A pointer to the contents in the success state.
14549     * Reading from this pointer when `result_ok` is not set is undefined.
14550     */
14551    struct LDKSplice *result;
14552    /**
14553     * A pointer to the contents in the error state.
14554     * Reading from this pointer when `result_ok` is set is undefined.
14555     */
14556    struct LDKDecodeError *err;
14557 } LDKCResult_SpliceDecodeErrorZPtr;
14558
14559 /**
14560  * A CResult_SpliceDecodeErrorZ represents the result of a fallible operation,
14561  * containing a crate::lightning::ln::msgs::Splice on success and a crate::lightning::ln::msgs::DecodeError on failure.
14562  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14563  */
14564 typedef struct LDKCResult_SpliceDecodeErrorZ {
14565    /**
14566     * The contents of this CResult_SpliceDecodeErrorZ, accessible via either
14567     * `err` or `result` depending on the state of `result_ok`.
14568     */
14569    union LDKCResult_SpliceDecodeErrorZPtr contents;
14570    /**
14571     * Whether this CResult_SpliceDecodeErrorZ represents a success state.
14572     */
14573    bool result_ok;
14574 } LDKCResult_SpliceDecodeErrorZ;
14575
14576 /**
14577  * The contents of CResult_SpliceAckDecodeErrorZ
14578  */
14579 typedef union LDKCResult_SpliceAckDecodeErrorZPtr {
14580    /**
14581     * A pointer to the contents in the success state.
14582     * Reading from this pointer when `result_ok` is not set is undefined.
14583     */
14584    struct LDKSpliceAck *result;
14585    /**
14586     * A pointer to the contents in the error state.
14587     * Reading from this pointer when `result_ok` is set is undefined.
14588     */
14589    struct LDKDecodeError *err;
14590 } LDKCResult_SpliceAckDecodeErrorZPtr;
14591
14592 /**
14593  * A CResult_SpliceAckDecodeErrorZ represents the result of a fallible operation,
14594  * containing a crate::lightning::ln::msgs::SpliceAck on success and a crate::lightning::ln::msgs::DecodeError on failure.
14595  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14596  */
14597 typedef struct LDKCResult_SpliceAckDecodeErrorZ {
14598    /**
14599     * The contents of this CResult_SpliceAckDecodeErrorZ, accessible via either
14600     * `err` or `result` depending on the state of `result_ok`.
14601     */
14602    union LDKCResult_SpliceAckDecodeErrorZPtr contents;
14603    /**
14604     * Whether this CResult_SpliceAckDecodeErrorZ represents a success state.
14605     */
14606    bool result_ok;
14607 } LDKCResult_SpliceAckDecodeErrorZ;
14608
14609 /**
14610  * The contents of CResult_SpliceLockedDecodeErrorZ
14611  */
14612 typedef union LDKCResult_SpliceLockedDecodeErrorZPtr {
14613    /**
14614     * A pointer to the contents in the success state.
14615     * Reading from this pointer when `result_ok` is not set is undefined.
14616     */
14617    struct LDKSpliceLocked *result;
14618    /**
14619     * A pointer to the contents in the error state.
14620     * Reading from this pointer when `result_ok` is set is undefined.
14621     */
14622    struct LDKDecodeError *err;
14623 } LDKCResult_SpliceLockedDecodeErrorZPtr;
14624
14625 /**
14626  * A CResult_SpliceLockedDecodeErrorZ represents the result of a fallible operation,
14627  * containing a crate::lightning::ln::msgs::SpliceLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
14628  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14629  */
14630 typedef struct LDKCResult_SpliceLockedDecodeErrorZ {
14631    /**
14632     * The contents of this CResult_SpliceLockedDecodeErrorZ, accessible via either
14633     * `err` or `result` depending on the state of `result_ok`.
14634     */
14635    union LDKCResult_SpliceLockedDecodeErrorZPtr contents;
14636    /**
14637     * Whether this CResult_SpliceLockedDecodeErrorZ represents a success state.
14638     */
14639    bool result_ok;
14640 } LDKCResult_SpliceLockedDecodeErrorZ;
14641
14642 /**
14643  * The contents of CResult_TxAddInputDecodeErrorZ
14644  */
14645 typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
14646    /**
14647     * A pointer to the contents in the success state.
14648     * Reading from this pointer when `result_ok` is not set is undefined.
14649     */
14650    struct LDKTxAddInput *result;
14651    /**
14652     * A pointer to the contents in the error state.
14653     * Reading from this pointer when `result_ok` is set is undefined.
14654     */
14655    struct LDKDecodeError *err;
14656 } LDKCResult_TxAddInputDecodeErrorZPtr;
14657
14658 /**
14659  * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
14660  * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14661  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14662  */
14663 typedef struct LDKCResult_TxAddInputDecodeErrorZ {
14664    /**
14665     * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
14666     * `err` or `result` depending on the state of `result_ok`.
14667     */
14668    union LDKCResult_TxAddInputDecodeErrorZPtr contents;
14669    /**
14670     * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
14671     */
14672    bool result_ok;
14673 } LDKCResult_TxAddInputDecodeErrorZ;
14674
14675 /**
14676  * The contents of CResult_TxAddOutputDecodeErrorZ
14677  */
14678 typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
14679    /**
14680     * A pointer to the contents in the success state.
14681     * Reading from this pointer when `result_ok` is not set is undefined.
14682     */
14683    struct LDKTxAddOutput *result;
14684    /**
14685     * A pointer to the contents in the error state.
14686     * Reading from this pointer when `result_ok` is set is undefined.
14687     */
14688    struct LDKDecodeError *err;
14689 } LDKCResult_TxAddOutputDecodeErrorZPtr;
14690
14691 /**
14692  * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
14693  * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14694  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14695  */
14696 typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
14697    /**
14698     * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
14699     * `err` or `result` depending on the state of `result_ok`.
14700     */
14701    union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
14702    /**
14703     * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
14704     */
14705    bool result_ok;
14706 } LDKCResult_TxAddOutputDecodeErrorZ;
14707
14708 /**
14709  * The contents of CResult_TxRemoveInputDecodeErrorZ
14710  */
14711 typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
14712    /**
14713     * A pointer to the contents in the success state.
14714     * Reading from this pointer when `result_ok` is not set is undefined.
14715     */
14716    struct LDKTxRemoveInput *result;
14717    /**
14718     * A pointer to the contents in the error state.
14719     * Reading from this pointer when `result_ok` is set is undefined.
14720     */
14721    struct LDKDecodeError *err;
14722 } LDKCResult_TxRemoveInputDecodeErrorZPtr;
14723
14724 /**
14725  * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
14726  * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14727  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14728  */
14729 typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
14730    /**
14731     * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
14732     * `err` or `result` depending on the state of `result_ok`.
14733     */
14734    union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
14735    /**
14736     * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
14737     */
14738    bool result_ok;
14739 } LDKCResult_TxRemoveInputDecodeErrorZ;
14740
14741 /**
14742  * The contents of CResult_TxRemoveOutputDecodeErrorZ
14743  */
14744 typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
14745    /**
14746     * A pointer to the contents in the success state.
14747     * Reading from this pointer when `result_ok` is not set is undefined.
14748     */
14749    struct LDKTxRemoveOutput *result;
14750    /**
14751     * A pointer to the contents in the error state.
14752     * Reading from this pointer when `result_ok` is set is undefined.
14753     */
14754    struct LDKDecodeError *err;
14755 } LDKCResult_TxRemoveOutputDecodeErrorZPtr;
14756
14757 /**
14758  * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
14759  * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
14760  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14761  */
14762 typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
14763    /**
14764     * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
14765     * `err` or `result` depending on the state of `result_ok`.
14766     */
14767    union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
14768    /**
14769     * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
14770     */
14771    bool result_ok;
14772 } LDKCResult_TxRemoveOutputDecodeErrorZ;
14773
14774 /**
14775  * The contents of CResult_TxCompleteDecodeErrorZ
14776  */
14777 typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
14778    /**
14779     * A pointer to the contents in the success state.
14780     * Reading from this pointer when `result_ok` is not set is undefined.
14781     */
14782    struct LDKTxComplete *result;
14783    /**
14784     * A pointer to the contents in the error state.
14785     * Reading from this pointer when `result_ok` is set is undefined.
14786     */
14787    struct LDKDecodeError *err;
14788 } LDKCResult_TxCompleteDecodeErrorZPtr;
14789
14790 /**
14791  * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
14792  * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
14793  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14794  */
14795 typedef struct LDKCResult_TxCompleteDecodeErrorZ {
14796    /**
14797     * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
14798     * `err` or `result` depending on the state of `result_ok`.
14799     */
14800    union LDKCResult_TxCompleteDecodeErrorZPtr contents;
14801    /**
14802     * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
14803     */
14804    bool result_ok;
14805 } LDKCResult_TxCompleteDecodeErrorZ;
14806
14807 /**
14808  * The contents of CResult_TxSignaturesDecodeErrorZ
14809  */
14810 typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
14811    /**
14812     * A pointer to the contents in the success state.
14813     * Reading from this pointer when `result_ok` is not set is undefined.
14814     */
14815    struct LDKTxSignatures *result;
14816    /**
14817     * A pointer to the contents in the error state.
14818     * Reading from this pointer when `result_ok` is set is undefined.
14819     */
14820    struct LDKDecodeError *err;
14821 } LDKCResult_TxSignaturesDecodeErrorZPtr;
14822
14823 /**
14824  * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
14825  * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
14826  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14827  */
14828 typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
14829    /**
14830     * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
14831     * `err` or `result` depending on the state of `result_ok`.
14832     */
14833    union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
14834    /**
14835     * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
14836     */
14837    bool result_ok;
14838 } LDKCResult_TxSignaturesDecodeErrorZ;
14839
14840 /**
14841  * The contents of CResult_TxInitRbfDecodeErrorZ
14842  */
14843 typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
14844    /**
14845     * A pointer to the contents in the success state.
14846     * Reading from this pointer when `result_ok` is not set is undefined.
14847     */
14848    struct LDKTxInitRbf *result;
14849    /**
14850     * A pointer to the contents in the error state.
14851     * Reading from this pointer when `result_ok` is set is undefined.
14852     */
14853    struct LDKDecodeError *err;
14854 } LDKCResult_TxInitRbfDecodeErrorZPtr;
14855
14856 /**
14857  * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
14858  * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
14859  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14860  */
14861 typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
14862    /**
14863     * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
14864     * `err` or `result` depending on the state of `result_ok`.
14865     */
14866    union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
14867    /**
14868     * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
14869     */
14870    bool result_ok;
14871 } LDKCResult_TxInitRbfDecodeErrorZ;
14872
14873 /**
14874  * The contents of CResult_TxAckRbfDecodeErrorZ
14875  */
14876 typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
14877    /**
14878     * A pointer to the contents in the success state.
14879     * Reading from this pointer when `result_ok` is not set is undefined.
14880     */
14881    struct LDKTxAckRbf *result;
14882    /**
14883     * A pointer to the contents in the error state.
14884     * Reading from this pointer when `result_ok` is set is undefined.
14885     */
14886    struct LDKDecodeError *err;
14887 } LDKCResult_TxAckRbfDecodeErrorZPtr;
14888
14889 /**
14890  * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
14891  * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
14892  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14893  */
14894 typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
14895    /**
14896     * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
14897     * `err` or `result` depending on the state of `result_ok`.
14898     */
14899    union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
14900    /**
14901     * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
14902     */
14903    bool result_ok;
14904 } LDKCResult_TxAckRbfDecodeErrorZ;
14905
14906 /**
14907  * The contents of CResult_TxAbortDecodeErrorZ
14908  */
14909 typedef union LDKCResult_TxAbortDecodeErrorZPtr {
14910    /**
14911     * A pointer to the contents in the success state.
14912     * Reading from this pointer when `result_ok` is not set is undefined.
14913     */
14914    struct LDKTxAbort *result;
14915    /**
14916     * A pointer to the contents in the error state.
14917     * Reading from this pointer when `result_ok` is set is undefined.
14918     */
14919    struct LDKDecodeError *err;
14920 } LDKCResult_TxAbortDecodeErrorZPtr;
14921
14922 /**
14923  * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
14924  * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
14925  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14926  */
14927 typedef struct LDKCResult_TxAbortDecodeErrorZ {
14928    /**
14929     * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
14930     * `err` or `result` depending on the state of `result_ok`.
14931     */
14932    union LDKCResult_TxAbortDecodeErrorZPtr contents;
14933    /**
14934     * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
14935     */
14936    bool result_ok;
14937 } LDKCResult_TxAbortDecodeErrorZ;
14938
14939 /**
14940  * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
14941  */
14942 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
14943    /**
14944     * A pointer to the contents in the success state.
14945     * Reading from this pointer when `result_ok` is not set is undefined.
14946     */
14947    struct LDKAnnouncementSignatures *result;
14948    /**
14949     * A pointer to the contents in the error state.
14950     * Reading from this pointer when `result_ok` is set is undefined.
14951     */
14952    struct LDKDecodeError *err;
14953 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
14954
14955 /**
14956  * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
14957  * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
14958  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14959  */
14960 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
14961    /**
14962     * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
14963     * `err` or `result` depending on the state of `result_ok`.
14964     */
14965    union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
14966    /**
14967     * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
14968     */
14969    bool result_ok;
14970 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
14971
14972 /**
14973  * The contents of CResult_ChannelReestablishDecodeErrorZ
14974  */
14975 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
14976    /**
14977     * A pointer to the contents in the success state.
14978     * Reading from this pointer when `result_ok` is not set is undefined.
14979     */
14980    struct LDKChannelReestablish *result;
14981    /**
14982     * A pointer to the contents in the error state.
14983     * Reading from this pointer when `result_ok` is set is undefined.
14984     */
14985    struct LDKDecodeError *err;
14986 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
14987
14988 /**
14989  * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
14990  * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
14991  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14992  */
14993 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
14994    /**
14995     * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
14996     * `err` or `result` depending on the state of `result_ok`.
14997     */
14998    union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
14999    /**
15000     * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
15001     */
15002    bool result_ok;
15003 } LDKCResult_ChannelReestablishDecodeErrorZ;
15004
15005 /**
15006  * The contents of CResult_ClosingSignedDecodeErrorZ
15007  */
15008 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
15009    /**
15010     * A pointer to the contents in the success state.
15011     * Reading from this pointer when `result_ok` is not set is undefined.
15012     */
15013    struct LDKClosingSigned *result;
15014    /**
15015     * A pointer to the contents in the error state.
15016     * Reading from this pointer when `result_ok` is set is undefined.
15017     */
15018    struct LDKDecodeError *err;
15019 } LDKCResult_ClosingSignedDecodeErrorZPtr;
15020
15021 /**
15022  * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
15023  * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15024  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15025  */
15026 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
15027    /**
15028     * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
15029     * `err` or `result` depending on the state of `result_ok`.
15030     */
15031    union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
15032    /**
15033     * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
15034     */
15035    bool result_ok;
15036 } LDKCResult_ClosingSignedDecodeErrorZ;
15037
15038
15039
15040 /**
15041  * The minimum and maximum fees which the sender is willing to place on the closing transaction.
15042  *
15043  * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
15044  * to use.
15045  */
15046 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
15047    /**
15048     * A pointer to the opaque Rust object.
15049     * Nearly everywhere, inner must be non-null, however in places where
15050     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15051     */
15052    LDKnativeClosingSignedFeeRange *inner;
15053    /**
15054     * Indicates that this is the only struct which contains the same pointer.
15055     * Rust functions which take ownership of an object provided via an argument require
15056     * this to be true and invalidate the object pointed to by inner.
15057     */
15058    bool is_owned;
15059 } LDKClosingSignedFeeRange;
15060
15061 /**
15062  * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
15063  */
15064 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
15065    /**
15066     * A pointer to the contents in the success state.
15067     * Reading from this pointer when `result_ok` is not set is undefined.
15068     */
15069    struct LDKClosingSignedFeeRange *result;
15070    /**
15071     * A pointer to the contents in the error state.
15072     * Reading from this pointer when `result_ok` is set is undefined.
15073     */
15074    struct LDKDecodeError *err;
15075 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
15076
15077 /**
15078  * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
15079  * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
15080  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15081  */
15082 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
15083    /**
15084     * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
15085     * `err` or `result` depending on the state of `result_ok`.
15086     */
15087    union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
15088    /**
15089     * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
15090     */
15091    bool result_ok;
15092 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
15093
15094
15095
15096 /**
15097  * A [`commitment_signed`] message to be sent to or received from a peer.
15098  *
15099  * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
15100  */
15101 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
15102    /**
15103     * A pointer to the opaque Rust object.
15104     * Nearly everywhere, inner must be non-null, however in places where
15105     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15106     */
15107    LDKnativeCommitmentSigned *inner;
15108    /**
15109     * Indicates that this is the only struct which contains the same pointer.
15110     * Rust functions which take ownership of an object provided via an argument require
15111     * this to be true and invalidate the object pointed to by inner.
15112     */
15113    bool is_owned;
15114 } LDKCommitmentSigned;
15115
15116 /**
15117  * The contents of CResult_CommitmentSignedDecodeErrorZ
15118  */
15119 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
15120    /**
15121     * A pointer to the contents in the success state.
15122     * Reading from this pointer when `result_ok` is not set is undefined.
15123     */
15124    struct LDKCommitmentSigned *result;
15125    /**
15126     * A pointer to the contents in the error state.
15127     * Reading from this pointer when `result_ok` is set is undefined.
15128     */
15129    struct LDKDecodeError *err;
15130 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
15131
15132 /**
15133  * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
15134  * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15135  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15136  */
15137 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
15138    /**
15139     * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
15140     * `err` or `result` depending on the state of `result_ok`.
15141     */
15142    union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
15143    /**
15144     * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
15145     */
15146    bool result_ok;
15147 } LDKCResult_CommitmentSignedDecodeErrorZ;
15148
15149 /**
15150  * The contents of CResult_FundingCreatedDecodeErrorZ
15151  */
15152 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
15153    /**
15154     * A pointer to the contents in the success state.
15155     * Reading from this pointer when `result_ok` is not set is undefined.
15156     */
15157    struct LDKFundingCreated *result;
15158    /**
15159     * A pointer to the contents in the error state.
15160     * Reading from this pointer when `result_ok` is set is undefined.
15161     */
15162    struct LDKDecodeError *err;
15163 } LDKCResult_FundingCreatedDecodeErrorZPtr;
15164
15165 /**
15166  * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
15167  * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
15168  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15169  */
15170 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
15171    /**
15172     * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
15173     * `err` or `result` depending on the state of `result_ok`.
15174     */
15175    union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
15176    /**
15177     * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
15178     */
15179    bool result_ok;
15180 } LDKCResult_FundingCreatedDecodeErrorZ;
15181
15182 /**
15183  * The contents of CResult_FundingSignedDecodeErrorZ
15184  */
15185 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
15186    /**
15187     * A pointer to the contents in the success state.
15188     * Reading from this pointer when `result_ok` is not set is undefined.
15189     */
15190    struct LDKFundingSigned *result;
15191    /**
15192     * A pointer to the contents in the error state.
15193     * Reading from this pointer when `result_ok` is set is undefined.
15194     */
15195    struct LDKDecodeError *err;
15196 } LDKCResult_FundingSignedDecodeErrorZPtr;
15197
15198 /**
15199  * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
15200  * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
15201  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15202  */
15203 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
15204    /**
15205     * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
15206     * `err` or `result` depending on the state of `result_ok`.
15207     */
15208    union LDKCResult_FundingSignedDecodeErrorZPtr contents;
15209    /**
15210     * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
15211     */
15212    bool result_ok;
15213 } LDKCResult_FundingSignedDecodeErrorZ;
15214
15215 /**
15216  * The contents of CResult_ChannelReadyDecodeErrorZ
15217  */
15218 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
15219    /**
15220     * A pointer to the contents in the success state.
15221     * Reading from this pointer when `result_ok` is not set is undefined.
15222     */
15223    struct LDKChannelReady *result;
15224    /**
15225     * A pointer to the contents in the error state.
15226     * Reading from this pointer when `result_ok` is set is undefined.
15227     */
15228    struct LDKDecodeError *err;
15229 } LDKCResult_ChannelReadyDecodeErrorZPtr;
15230
15231 /**
15232  * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
15233  * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
15234  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15235  */
15236 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
15237    /**
15238     * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
15239     * `err` or `result` depending on the state of `result_ok`.
15240     */
15241    union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
15242    /**
15243     * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
15244     */
15245    bool result_ok;
15246 } LDKCResult_ChannelReadyDecodeErrorZ;
15247
15248
15249
15250 /**
15251  * An [`init`] message to be sent to or received from a peer.
15252  *
15253  * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
15254  */
15255 typedef struct MUST_USE_STRUCT LDKInit {
15256    /**
15257     * A pointer to the opaque Rust object.
15258     * Nearly everywhere, inner must be non-null, however in places where
15259     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15260     */
15261    LDKnativeInit *inner;
15262    /**
15263     * Indicates that this is the only struct which contains the same pointer.
15264     * Rust functions which take ownership of an object provided via an argument require
15265     * this to be true and invalidate the object pointed to by inner.
15266     */
15267    bool is_owned;
15268 } LDKInit;
15269
15270 /**
15271  * The contents of CResult_InitDecodeErrorZ
15272  */
15273 typedef union LDKCResult_InitDecodeErrorZPtr {
15274    /**
15275     * A pointer to the contents in the success state.
15276     * Reading from this pointer when `result_ok` is not set is undefined.
15277     */
15278    struct LDKInit *result;
15279    /**
15280     * A pointer to the contents in the error state.
15281     * Reading from this pointer when `result_ok` is set is undefined.
15282     */
15283    struct LDKDecodeError *err;
15284 } LDKCResult_InitDecodeErrorZPtr;
15285
15286 /**
15287  * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
15288  * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
15289  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15290  */
15291 typedef struct LDKCResult_InitDecodeErrorZ {
15292    /**
15293     * The contents of this CResult_InitDecodeErrorZ, accessible via either
15294     * `err` or `result` depending on the state of `result_ok`.
15295     */
15296    union LDKCResult_InitDecodeErrorZPtr contents;
15297    /**
15298     * Whether this CResult_InitDecodeErrorZ represents a success state.
15299     */
15300    bool result_ok;
15301 } LDKCResult_InitDecodeErrorZ;
15302
15303 /**
15304  * The contents of CResult_OpenChannelDecodeErrorZ
15305  */
15306 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
15307    /**
15308     * A pointer to the contents in the success state.
15309     * Reading from this pointer when `result_ok` is not set is undefined.
15310     */
15311    struct LDKOpenChannel *result;
15312    /**
15313     * A pointer to the contents in the error state.
15314     * Reading from this pointer when `result_ok` is set is undefined.
15315     */
15316    struct LDKDecodeError *err;
15317 } LDKCResult_OpenChannelDecodeErrorZPtr;
15318
15319 /**
15320  * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
15321  * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
15322  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15323  */
15324 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
15325    /**
15326     * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
15327     * `err` or `result` depending on the state of `result_ok`.
15328     */
15329    union LDKCResult_OpenChannelDecodeErrorZPtr contents;
15330    /**
15331     * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
15332     */
15333    bool result_ok;
15334 } LDKCResult_OpenChannelDecodeErrorZ;
15335
15336 /**
15337  * The contents of CResult_OpenChannelV2DecodeErrorZ
15338  */
15339 typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
15340    /**
15341     * A pointer to the contents in the success state.
15342     * Reading from this pointer when `result_ok` is not set is undefined.
15343     */
15344    struct LDKOpenChannelV2 *result;
15345    /**
15346     * A pointer to the contents in the error state.
15347     * Reading from this pointer when `result_ok` is set is undefined.
15348     */
15349    struct LDKDecodeError *err;
15350 } LDKCResult_OpenChannelV2DecodeErrorZPtr;
15351
15352 /**
15353  * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
15354  * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
15355  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15356  */
15357 typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
15358    /**
15359     * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
15360     * `err` or `result` depending on the state of `result_ok`.
15361     */
15362    union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
15363    /**
15364     * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
15365     */
15366    bool result_ok;
15367 } LDKCResult_OpenChannelV2DecodeErrorZ;
15368
15369 /**
15370  * The contents of CResult_RevokeAndACKDecodeErrorZ
15371  */
15372 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
15373    /**
15374     * A pointer to the contents in the success state.
15375     * Reading from this pointer when `result_ok` is not set is undefined.
15376     */
15377    struct LDKRevokeAndACK *result;
15378    /**
15379     * A pointer to the contents in the error state.
15380     * Reading from this pointer when `result_ok` is set is undefined.
15381     */
15382    struct LDKDecodeError *err;
15383 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
15384
15385 /**
15386  * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
15387  * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
15388  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15389  */
15390 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
15391    /**
15392     * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
15393     * `err` or `result` depending on the state of `result_ok`.
15394     */
15395    union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
15396    /**
15397     * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
15398     */
15399    bool result_ok;
15400 } LDKCResult_RevokeAndACKDecodeErrorZ;
15401
15402 /**
15403  * The contents of CResult_ShutdownDecodeErrorZ
15404  */
15405 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
15406    /**
15407     * A pointer to the contents in the success state.
15408     * Reading from this pointer when `result_ok` is not set is undefined.
15409     */
15410    struct LDKShutdown *result;
15411    /**
15412     * A pointer to the contents in the error state.
15413     * Reading from this pointer when `result_ok` is set is undefined.
15414     */
15415    struct LDKDecodeError *err;
15416 } LDKCResult_ShutdownDecodeErrorZPtr;
15417
15418 /**
15419  * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
15420  * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
15421  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15422  */
15423 typedef struct LDKCResult_ShutdownDecodeErrorZ {
15424    /**
15425     * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
15426     * `err` or `result` depending on the state of `result_ok`.
15427     */
15428    union LDKCResult_ShutdownDecodeErrorZPtr contents;
15429    /**
15430     * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
15431     */
15432    bool result_ok;
15433 } LDKCResult_ShutdownDecodeErrorZ;
15434
15435 /**
15436  * The contents of CResult_UpdateFailHTLCDecodeErrorZ
15437  */
15438 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
15439    /**
15440     * A pointer to the contents in the success state.
15441     * Reading from this pointer when `result_ok` is not set is undefined.
15442     */
15443    struct LDKUpdateFailHTLC *result;
15444    /**
15445     * A pointer to the contents in the error state.
15446     * Reading from this pointer when `result_ok` is set is undefined.
15447     */
15448    struct LDKDecodeError *err;
15449 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
15450
15451 /**
15452  * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
15453  * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15454  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15455  */
15456 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
15457    /**
15458     * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
15459     * `err` or `result` depending on the state of `result_ok`.
15460     */
15461    union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
15462    /**
15463     * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
15464     */
15465    bool result_ok;
15466 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
15467
15468 /**
15469  * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
15470  */
15471 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
15472    /**
15473     * A pointer to the contents in the success state.
15474     * Reading from this pointer when `result_ok` is not set is undefined.
15475     */
15476    struct LDKUpdateFailMalformedHTLC *result;
15477    /**
15478     * A pointer to the contents in the error state.
15479     * Reading from this pointer when `result_ok` is set is undefined.
15480     */
15481    struct LDKDecodeError *err;
15482 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
15483
15484 /**
15485  * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
15486  * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15487  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15488  */
15489 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
15490    /**
15491     * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
15492     * `err` or `result` depending on the state of `result_ok`.
15493     */
15494    union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
15495    /**
15496     * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
15497     */
15498    bool result_ok;
15499 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
15500
15501
15502
15503 /**
15504  * An [`update_fee`] message to be sent to or received from a peer
15505  *
15506  * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
15507  */
15508 typedef struct MUST_USE_STRUCT LDKUpdateFee {
15509    /**
15510     * A pointer to the opaque Rust object.
15511     * Nearly everywhere, inner must be non-null, however in places where
15512     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15513     */
15514    LDKnativeUpdateFee *inner;
15515    /**
15516     * Indicates that this is the only struct which contains the same pointer.
15517     * Rust functions which take ownership of an object provided via an argument require
15518     * this to be true and invalidate the object pointed to by inner.
15519     */
15520    bool is_owned;
15521 } LDKUpdateFee;
15522
15523 /**
15524  * The contents of CResult_UpdateFeeDecodeErrorZ
15525  */
15526 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
15527    /**
15528     * A pointer to the contents in the success state.
15529     * Reading from this pointer when `result_ok` is not set is undefined.
15530     */
15531    struct LDKUpdateFee *result;
15532    /**
15533     * A pointer to the contents in the error state.
15534     * Reading from this pointer when `result_ok` is set is undefined.
15535     */
15536    struct LDKDecodeError *err;
15537 } LDKCResult_UpdateFeeDecodeErrorZPtr;
15538
15539 /**
15540  * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
15541  * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
15542  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15543  */
15544 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
15545    /**
15546     * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
15547     * `err` or `result` depending on the state of `result_ok`.
15548     */
15549    union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
15550    /**
15551     * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
15552     */
15553    bool result_ok;
15554 } LDKCResult_UpdateFeeDecodeErrorZ;
15555
15556 /**
15557  * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
15558  */
15559 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
15560    /**
15561     * A pointer to the contents in the success state.
15562     * Reading from this pointer when `result_ok` is not set is undefined.
15563     */
15564    struct LDKUpdateFulfillHTLC *result;
15565    /**
15566     * A pointer to the contents in the error state.
15567     * Reading from this pointer when `result_ok` is set is undefined.
15568     */
15569    struct LDKDecodeError *err;
15570 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
15571
15572 /**
15573  * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
15574  * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15575  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15576  */
15577 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
15578    /**
15579     * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
15580     * `err` or `result` depending on the state of `result_ok`.
15581     */
15582    union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
15583    /**
15584     * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
15585     */
15586    bool result_ok;
15587 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
15588
15589 /**
15590  * The contents of CResult_OnionPacketDecodeErrorZ
15591  */
15592 typedef union LDKCResult_OnionPacketDecodeErrorZPtr {
15593    /**
15594     * A pointer to the contents in the success state.
15595     * Reading from this pointer when `result_ok` is not set is undefined.
15596     */
15597    struct LDKOnionPacket *result;
15598    /**
15599     * A pointer to the contents in the error state.
15600     * Reading from this pointer when `result_ok` is set is undefined.
15601     */
15602    struct LDKDecodeError *err;
15603 } LDKCResult_OnionPacketDecodeErrorZPtr;
15604
15605 /**
15606  * A CResult_OnionPacketDecodeErrorZ represents the result of a fallible operation,
15607  * containing a crate::lightning::ln::msgs::OnionPacket on success and a crate::lightning::ln::msgs::DecodeError on failure.
15608  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15609  */
15610 typedef struct LDKCResult_OnionPacketDecodeErrorZ {
15611    /**
15612     * The contents of this CResult_OnionPacketDecodeErrorZ, accessible via either
15613     * `err` or `result` depending on the state of `result_ok`.
15614     */
15615    union LDKCResult_OnionPacketDecodeErrorZPtr contents;
15616    /**
15617     * Whether this CResult_OnionPacketDecodeErrorZ represents a success state.
15618     */
15619    bool result_ok;
15620 } LDKCResult_OnionPacketDecodeErrorZ;
15621
15622 /**
15623  * The contents of CResult_UpdateAddHTLCDecodeErrorZ
15624  */
15625 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
15626    /**
15627     * A pointer to the contents in the success state.
15628     * Reading from this pointer when `result_ok` is not set is undefined.
15629     */
15630    struct LDKUpdateAddHTLC *result;
15631    /**
15632     * A pointer to the contents in the error state.
15633     * Reading from this pointer when `result_ok` is set is undefined.
15634     */
15635    struct LDKDecodeError *err;
15636 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
15637
15638 /**
15639  * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
15640  * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15641  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15642  */
15643 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
15644    /**
15645     * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
15646     * `err` or `result` depending on the state of `result_ok`.
15647     */
15648    union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
15649    /**
15650     * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
15651     */
15652    bool result_ok;
15653 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
15654
15655
15656
15657 /**
15658  * An onion message to be sent to or received from a peer.
15659  *
15660  */
15661 typedef struct MUST_USE_STRUCT LDKOnionMessage {
15662    /**
15663     * A pointer to the opaque Rust object.
15664     * Nearly everywhere, inner must be non-null, however in places where
15665     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15666     */
15667    LDKnativeOnionMessage *inner;
15668    /**
15669     * Indicates that this is the only struct which contains the same pointer.
15670     * Rust functions which take ownership of an object provided via an argument require
15671     * this to be true and invalidate the object pointed to by inner.
15672     */
15673    bool is_owned;
15674 } LDKOnionMessage;
15675
15676 /**
15677  * The contents of CResult_OnionMessageDecodeErrorZ
15678  */
15679 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
15680    /**
15681     * A pointer to the contents in the success state.
15682     * Reading from this pointer when `result_ok` is not set is undefined.
15683     */
15684    struct LDKOnionMessage *result;
15685    /**
15686     * A pointer to the contents in the error state.
15687     * Reading from this pointer when `result_ok` is set is undefined.
15688     */
15689    struct LDKDecodeError *err;
15690 } LDKCResult_OnionMessageDecodeErrorZPtr;
15691
15692 /**
15693  * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
15694  * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
15695  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15696  */
15697 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
15698    /**
15699     * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
15700     * `err` or `result` depending on the state of `result_ok`.
15701     */
15702    union LDKCResult_OnionMessageDecodeErrorZPtr contents;
15703    /**
15704     * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
15705     */
15706    bool result_ok;
15707 } LDKCResult_OnionMessageDecodeErrorZ;
15708
15709 /**
15710  * The contents of CResult_FinalOnionHopDataDecodeErrorZ
15711  */
15712 typedef union LDKCResult_FinalOnionHopDataDecodeErrorZPtr {
15713    /**
15714     * A pointer to the contents in the success state.
15715     * Reading from this pointer when `result_ok` is not set is undefined.
15716     */
15717    struct LDKFinalOnionHopData *result;
15718    /**
15719     * A pointer to the contents in the error state.
15720     * Reading from this pointer when `result_ok` is set is undefined.
15721     */
15722    struct LDKDecodeError *err;
15723 } LDKCResult_FinalOnionHopDataDecodeErrorZPtr;
15724
15725 /**
15726  * A CResult_FinalOnionHopDataDecodeErrorZ represents the result of a fallible operation,
15727  * containing a crate::lightning::ln::msgs::FinalOnionHopData on success and a crate::lightning::ln::msgs::DecodeError on failure.
15728  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15729  */
15730 typedef struct LDKCResult_FinalOnionHopDataDecodeErrorZ {
15731    /**
15732     * The contents of this CResult_FinalOnionHopDataDecodeErrorZ, accessible via either
15733     * `err` or `result` depending on the state of `result_ok`.
15734     */
15735    union LDKCResult_FinalOnionHopDataDecodeErrorZPtr contents;
15736    /**
15737     * Whether this CResult_FinalOnionHopDataDecodeErrorZ represents a success state.
15738     */
15739    bool result_ok;
15740 } LDKCResult_FinalOnionHopDataDecodeErrorZ;
15741
15742
15743
15744 /**
15745  * A [`ping`] message to be sent to or received from a peer.
15746  *
15747  * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
15748  */
15749 typedef struct MUST_USE_STRUCT LDKPing {
15750    /**
15751     * A pointer to the opaque Rust object.
15752     * Nearly everywhere, inner must be non-null, however in places where
15753     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15754     */
15755    LDKnativePing *inner;
15756    /**
15757     * Indicates that this is the only struct which contains the same pointer.
15758     * Rust functions which take ownership of an object provided via an argument require
15759     * this to be true and invalidate the object pointed to by inner.
15760     */
15761    bool is_owned;
15762 } LDKPing;
15763
15764 /**
15765  * The contents of CResult_PingDecodeErrorZ
15766  */
15767 typedef union LDKCResult_PingDecodeErrorZPtr {
15768    /**
15769     * A pointer to the contents in the success state.
15770     * Reading from this pointer when `result_ok` is not set is undefined.
15771     */
15772    struct LDKPing *result;
15773    /**
15774     * A pointer to the contents in the error state.
15775     * Reading from this pointer when `result_ok` is set is undefined.
15776     */
15777    struct LDKDecodeError *err;
15778 } LDKCResult_PingDecodeErrorZPtr;
15779
15780 /**
15781  * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
15782  * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
15783  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15784  */
15785 typedef struct LDKCResult_PingDecodeErrorZ {
15786    /**
15787     * The contents of this CResult_PingDecodeErrorZ, accessible via either
15788     * `err` or `result` depending on the state of `result_ok`.
15789     */
15790    union LDKCResult_PingDecodeErrorZPtr contents;
15791    /**
15792     * Whether this CResult_PingDecodeErrorZ represents a success state.
15793     */
15794    bool result_ok;
15795 } LDKCResult_PingDecodeErrorZ;
15796
15797
15798
15799 /**
15800  * A [`pong`] message to be sent to or received from a peer.
15801  *
15802  * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
15803  */
15804 typedef struct MUST_USE_STRUCT LDKPong {
15805    /**
15806     * A pointer to the opaque Rust object.
15807     * Nearly everywhere, inner must be non-null, however in places where
15808     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15809     */
15810    LDKnativePong *inner;
15811    /**
15812     * Indicates that this is the only struct which contains the same pointer.
15813     * Rust functions which take ownership of an object provided via an argument require
15814     * this to be true and invalidate the object pointed to by inner.
15815     */
15816    bool is_owned;
15817 } LDKPong;
15818
15819 /**
15820  * The contents of CResult_PongDecodeErrorZ
15821  */
15822 typedef union LDKCResult_PongDecodeErrorZPtr {
15823    /**
15824     * A pointer to the contents in the success state.
15825     * Reading from this pointer when `result_ok` is not set is undefined.
15826     */
15827    struct LDKPong *result;
15828    /**
15829     * A pointer to the contents in the error state.
15830     * Reading from this pointer when `result_ok` is set is undefined.
15831     */
15832    struct LDKDecodeError *err;
15833 } LDKCResult_PongDecodeErrorZPtr;
15834
15835 /**
15836  * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
15837  * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
15838  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15839  */
15840 typedef struct LDKCResult_PongDecodeErrorZ {
15841    /**
15842     * The contents of this CResult_PongDecodeErrorZ, accessible via either
15843     * `err` or `result` depending on the state of `result_ok`.
15844     */
15845    union LDKCResult_PongDecodeErrorZPtr contents;
15846    /**
15847     * Whether this CResult_PongDecodeErrorZ represents a success state.
15848     */
15849    bool result_ok;
15850 } LDKCResult_PongDecodeErrorZ;
15851
15852 /**
15853  * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
15854  */
15855 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
15856    /**
15857     * A pointer to the contents in the success state.
15858     * Reading from this pointer when `result_ok` is not set is undefined.
15859     */
15860    struct LDKUnsignedChannelAnnouncement *result;
15861    /**
15862     * A pointer to the contents in the error state.
15863     * Reading from this pointer when `result_ok` is set is undefined.
15864     */
15865    struct LDKDecodeError *err;
15866 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
15867
15868 /**
15869  * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
15870  * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
15871  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15872  */
15873 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
15874    /**
15875     * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
15876     * `err` or `result` depending on the state of `result_ok`.
15877     */
15878    union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
15879    /**
15880     * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
15881     */
15882    bool result_ok;
15883 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
15884
15885 /**
15886  * The contents of CResult_ChannelAnnouncementDecodeErrorZ
15887  */
15888 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
15889    /**
15890     * A pointer to the contents in the success state.
15891     * Reading from this pointer when `result_ok` is not set is undefined.
15892     */
15893    struct LDKChannelAnnouncement *result;
15894    /**
15895     * A pointer to the contents in the error state.
15896     * Reading from this pointer when `result_ok` is set is undefined.
15897     */
15898    struct LDKDecodeError *err;
15899 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
15900
15901 /**
15902  * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
15903  * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
15904  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15905  */
15906 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
15907    /**
15908     * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
15909     * `err` or `result` depending on the state of `result_ok`.
15910     */
15911    union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
15912    /**
15913     * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
15914     */
15915    bool result_ok;
15916 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
15917
15918 /**
15919  * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
15920  */
15921 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
15922    /**
15923     * A pointer to the contents in the success state.
15924     * Reading from this pointer when `result_ok` is not set is undefined.
15925     */
15926    struct LDKUnsignedChannelUpdate *result;
15927    /**
15928     * A pointer to the contents in the error state.
15929     * Reading from this pointer when `result_ok` is set is undefined.
15930     */
15931    struct LDKDecodeError *err;
15932 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
15933
15934 /**
15935  * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
15936  * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
15937  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15938  */
15939 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
15940    /**
15941     * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
15942     * `err` or `result` depending on the state of `result_ok`.
15943     */
15944    union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
15945    /**
15946     * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
15947     */
15948    bool result_ok;
15949 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
15950
15951 /**
15952  * The contents of CResult_ChannelUpdateDecodeErrorZ
15953  */
15954 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
15955    /**
15956     * A pointer to the contents in the success state.
15957     * Reading from this pointer when `result_ok` is not set is undefined.
15958     */
15959    struct LDKChannelUpdate *result;
15960    /**
15961     * A pointer to the contents in the error state.
15962     * Reading from this pointer when `result_ok` is set is undefined.
15963     */
15964    struct LDKDecodeError *err;
15965 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
15966
15967 /**
15968  * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
15969  * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
15970  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15971  */
15972 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
15973    /**
15974     * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
15975     * `err` or `result` depending on the state of `result_ok`.
15976     */
15977    union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
15978    /**
15979     * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
15980     */
15981    bool result_ok;
15982 } LDKCResult_ChannelUpdateDecodeErrorZ;
15983
15984 /**
15985  * The contents of CResult_ErrorMessageDecodeErrorZ
15986  */
15987 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
15988    /**
15989     * A pointer to the contents in the success state.
15990     * Reading from this pointer when `result_ok` is not set is undefined.
15991     */
15992    struct LDKErrorMessage *result;
15993    /**
15994     * A pointer to the contents in the error state.
15995     * Reading from this pointer when `result_ok` is set is undefined.
15996     */
15997    struct LDKDecodeError *err;
15998 } LDKCResult_ErrorMessageDecodeErrorZPtr;
15999
16000 /**
16001  * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
16002  * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16003  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16004  */
16005 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
16006    /**
16007     * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
16008     * `err` or `result` depending on the state of `result_ok`.
16009     */
16010    union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
16011    /**
16012     * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
16013     */
16014    bool result_ok;
16015 } LDKCResult_ErrorMessageDecodeErrorZ;
16016
16017 /**
16018  * The contents of CResult_WarningMessageDecodeErrorZ
16019  */
16020 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
16021    /**
16022     * A pointer to the contents in the success state.
16023     * Reading from this pointer when `result_ok` is not set is undefined.
16024     */
16025    struct LDKWarningMessage *result;
16026    /**
16027     * A pointer to the contents in the error state.
16028     * Reading from this pointer when `result_ok` is set is undefined.
16029     */
16030    struct LDKDecodeError *err;
16031 } LDKCResult_WarningMessageDecodeErrorZPtr;
16032
16033 /**
16034  * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
16035  * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16036  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16037  */
16038 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
16039    /**
16040     * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
16041     * `err` or `result` depending on the state of `result_ok`.
16042     */
16043    union LDKCResult_WarningMessageDecodeErrorZPtr contents;
16044    /**
16045     * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
16046     */
16047    bool result_ok;
16048 } LDKCResult_WarningMessageDecodeErrorZ;
16049
16050 /**
16051  * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
16052  */
16053 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
16054    /**
16055     * A pointer to the contents in the success state.
16056     * Reading from this pointer when `result_ok` is not set is undefined.
16057     */
16058    struct LDKUnsignedNodeAnnouncement *result;
16059    /**
16060     * A pointer to the contents in the error state.
16061     * Reading from this pointer when `result_ok` is set is undefined.
16062     */
16063    struct LDKDecodeError *err;
16064 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
16065
16066 /**
16067  * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
16068  * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
16069  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16070  */
16071 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
16072    /**
16073     * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
16074     * `err` or `result` depending on the state of `result_ok`.
16075     */
16076    union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
16077    /**
16078     * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
16079     */
16080    bool result_ok;
16081 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
16082
16083 /**
16084  * The contents of CResult_NodeAnnouncementDecodeErrorZ
16085  */
16086 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
16087    /**
16088     * A pointer to the contents in the success state.
16089     * Reading from this pointer when `result_ok` is not set is undefined.
16090     */
16091    struct LDKNodeAnnouncement *result;
16092    /**
16093     * A pointer to the contents in the error state.
16094     * Reading from this pointer when `result_ok` is set is undefined.
16095     */
16096    struct LDKDecodeError *err;
16097 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
16098
16099 /**
16100  * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
16101  * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
16102  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16103  */
16104 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
16105    /**
16106     * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
16107     * `err` or `result` depending on the state of `result_ok`.
16108     */
16109    union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
16110    /**
16111     * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
16112     */
16113    bool result_ok;
16114 } LDKCResult_NodeAnnouncementDecodeErrorZ;
16115
16116 /**
16117  * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
16118  */
16119 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
16120    /**
16121     * A pointer to the contents in the success state.
16122     * Reading from this pointer when `result_ok` is not set is undefined.
16123     */
16124    struct LDKQueryShortChannelIds *result;
16125    /**
16126     * A pointer to the contents in the error state.
16127     * Reading from this pointer when `result_ok` is set is undefined.
16128     */
16129    struct LDKDecodeError *err;
16130 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
16131
16132 /**
16133  * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
16134  * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
16135  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16136  */
16137 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
16138    /**
16139     * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
16140     * `err` or `result` depending on the state of `result_ok`.
16141     */
16142    union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
16143    /**
16144     * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
16145     */
16146    bool result_ok;
16147 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
16148
16149
16150
16151 /**
16152  * A [`reply_short_channel_ids_end`] message is sent as a reply to a
16153  * message. The query recipient makes a best
16154  * effort to respond based on their local network view which may not be
16155  * a perfect view of the network.
16156  *
16157  * [`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
16158  */
16159 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
16160    /**
16161     * A pointer to the opaque Rust object.
16162     * Nearly everywhere, inner must be non-null, however in places where
16163     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16164     */
16165    LDKnativeReplyShortChannelIdsEnd *inner;
16166    /**
16167     * Indicates that this is the only struct which contains the same pointer.
16168     * Rust functions which take ownership of an object provided via an argument require
16169     * this to be true and invalidate the object pointed to by inner.
16170     */
16171    bool is_owned;
16172 } LDKReplyShortChannelIdsEnd;
16173
16174 /**
16175  * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
16176  */
16177 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
16178    /**
16179     * A pointer to the contents in the success state.
16180     * Reading from this pointer when `result_ok` is not set is undefined.
16181     */
16182    struct LDKReplyShortChannelIdsEnd *result;
16183    /**
16184     * A pointer to the contents in the error state.
16185     * Reading from this pointer when `result_ok` is set is undefined.
16186     */
16187    struct LDKDecodeError *err;
16188 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
16189
16190 /**
16191  * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
16192  * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
16193  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16194  */
16195 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
16196    /**
16197     * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
16198     * `err` or `result` depending on the state of `result_ok`.
16199     */
16200    union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
16201    /**
16202     * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
16203     */
16204    bool result_ok;
16205 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
16206
16207 /**
16208  * The contents of CResult_QueryChannelRangeDecodeErrorZ
16209  */
16210 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
16211    /**
16212     * A pointer to the contents in the success state.
16213     * Reading from this pointer when `result_ok` is not set is undefined.
16214     */
16215    struct LDKQueryChannelRange *result;
16216    /**
16217     * A pointer to the contents in the error state.
16218     * Reading from this pointer when `result_ok` is set is undefined.
16219     */
16220    struct LDKDecodeError *err;
16221 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
16222
16223 /**
16224  * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
16225  * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
16226  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16227  */
16228 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
16229    /**
16230     * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
16231     * `err` or `result` depending on the state of `result_ok`.
16232     */
16233    union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
16234    /**
16235     * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
16236     */
16237    bool result_ok;
16238 } LDKCResult_QueryChannelRangeDecodeErrorZ;
16239
16240 /**
16241  * The contents of CResult_ReplyChannelRangeDecodeErrorZ
16242  */
16243 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
16244    /**
16245     * A pointer to the contents in the success state.
16246     * Reading from this pointer when `result_ok` is not set is undefined.
16247     */
16248    struct LDKReplyChannelRange *result;
16249    /**
16250     * A pointer to the contents in the error state.
16251     * Reading from this pointer when `result_ok` is set is undefined.
16252     */
16253    struct LDKDecodeError *err;
16254 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
16255
16256 /**
16257  * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
16258  * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
16259  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16260  */
16261 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
16262    /**
16263     * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
16264     * `err` or `result` depending on the state of `result_ok`.
16265     */
16266    union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
16267    /**
16268     * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
16269     */
16270    bool result_ok;
16271 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
16272
16273 /**
16274  * The contents of CResult_GossipTimestampFilterDecodeErrorZ
16275  */
16276 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
16277    /**
16278     * A pointer to the contents in the success state.
16279     * Reading from this pointer when `result_ok` is not set is undefined.
16280     */
16281    struct LDKGossipTimestampFilter *result;
16282    /**
16283     * A pointer to the contents in the error state.
16284     * Reading from this pointer when `result_ok` is set is undefined.
16285     */
16286    struct LDKDecodeError *err;
16287 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
16288
16289 /**
16290  * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
16291  * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
16292  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16293  */
16294 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
16295    /**
16296     * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
16297     * `err` or `result` depending on the state of `result_ok`.
16298     */
16299    union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
16300    /**
16301     * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
16302     */
16303    bool result_ok;
16304 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
16305
16306 /**
16307  * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
16308  * This corresponds to std::vector in C++
16309  */
16310 typedef struct LDKCVec_PhantomRouteHintsZ {
16311    /**
16312     * The elements in the array.
16313     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16314     */
16315    struct LDKPhantomRouteHints *data;
16316    /**
16317     * The number of elements pointed to by `data`.
16318     */
16319    uintptr_t datalen;
16320 } LDKCVec_PhantomRouteHintsZ;
16321
16322
16323
16324 /**
16325  * Represents a syntactically and semantically correct lightning BOLT11 invoice.
16326  *
16327  * There are three ways to construct a `Bolt11Invoice`:
16328  *  1. using [`InvoiceBuilder`]
16329  *  2. using [`Bolt11Invoice::from_signed`]
16330  *  3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
16331  *
16332  * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
16333  */
16334 typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
16335    /**
16336     * A pointer to the opaque Rust object.
16337     * Nearly everywhere, inner must be non-null, however in places where
16338     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16339     */
16340    LDKnativeBolt11Invoice *inner;
16341    /**
16342     * Indicates that this is the only struct which contains the same pointer.
16343     * Rust functions which take ownership of an object provided via an argument require
16344     * this to be true and invalidate the object pointed to by inner.
16345     */
16346    bool is_owned;
16347 } LDKBolt11Invoice;
16348
16349 /**
16350  * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
16351  * may occur.
16352  */
16353 typedef enum LDKSignOrCreationError_Tag {
16354    /**
16355     * An error occurred during signing
16356     */
16357    LDKSignOrCreationError_SignError,
16358    /**
16359     * An error occurred while building the transaction
16360     */
16361    LDKSignOrCreationError_CreationError,
16362    /**
16363     * Must be last for serialization purposes
16364     */
16365    LDKSignOrCreationError_Sentinel,
16366 } LDKSignOrCreationError_Tag;
16367
16368 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
16369    LDKSignOrCreationError_Tag tag;
16370    union {
16371       struct {
16372          enum LDKCreationError creation_error;
16373       };
16374    };
16375 } LDKSignOrCreationError;
16376
16377 /**
16378  * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
16379  */
16380 typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
16381    /**
16382     * A pointer to the contents in the success state.
16383     * Reading from this pointer when `result_ok` is not set is undefined.
16384     */
16385    struct LDKBolt11Invoice *result;
16386    /**
16387     * A pointer to the contents in the error state.
16388     * Reading from this pointer when `result_ok` is set is undefined.
16389     */
16390    struct LDKSignOrCreationError *err;
16391 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
16392
16393 /**
16394  * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
16395  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
16396  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16397  */
16398 typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
16399    /**
16400     * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
16401     * `err` or `result` depending on the state of `result_ok`.
16402     */
16403    union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
16404    /**
16405     * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
16406     */
16407    bool result_ok;
16408 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
16409
16410
16411
16412 /**
16413  * A simple future which can complete once, and calls some callback(s) when it does so.
16414  */
16415 typedef struct MUST_USE_STRUCT LDKFuture {
16416    /**
16417     * A pointer to the opaque Rust object.
16418     * Nearly everywhere, inner must be non-null, however in places where
16419     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16420     */
16421    LDKnativeFuture *inner;
16422    /**
16423     * Indicates that this is the only struct which contains the same pointer.
16424     * Rust functions which take ownership of an object provided via an argument require
16425     * this to be true and invalidate the object pointed to by inner.
16426     */
16427    bool is_owned;
16428 } LDKFuture;
16429
16430 /**
16431  * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
16432  * This corresponds to std::vector in C++
16433  */
16434 typedef struct LDKCVec_FutureZ {
16435    /**
16436     * The elements in the array.
16437     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16438     */
16439    struct LDKFuture *data;
16440    /**
16441     * The number of elements pointed to by `data`.
16442     */
16443    uintptr_t datalen;
16444 } LDKCVec_FutureZ;
16445
16446 /**
16447  * The contents of CResult_OffersMessageDecodeErrorZ
16448  */
16449 typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
16450    /**
16451     * A pointer to the contents in the success state.
16452     * Reading from this pointer when `result_ok` is not set is undefined.
16453     */
16454    struct LDKOffersMessage *result;
16455    /**
16456     * A pointer to the contents in the error state.
16457     * Reading from this pointer when `result_ok` is set is undefined.
16458     */
16459    struct LDKDecodeError *err;
16460 } LDKCResult_OffersMessageDecodeErrorZPtr;
16461
16462 /**
16463  * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
16464  * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
16465  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16466  */
16467 typedef struct LDKCResult_OffersMessageDecodeErrorZ {
16468    /**
16469     * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
16470     * `err` or `result` depending on the state of `result_ok`.
16471     */
16472    union LDKCResult_OffersMessageDecodeErrorZPtr contents;
16473    /**
16474     * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
16475     */
16476    bool result_ok;
16477 } LDKCResult_OffersMessageDecodeErrorZ;
16478
16479 /**
16480  * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
16481  */
16482 typedef enum LDKCOption_HTLCClaimZ_Tag {
16483    /**
16484     * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
16485     */
16486    LDKCOption_HTLCClaimZ_Some,
16487    /**
16488     * When we're in this state, this COption_HTLCClaimZ contains nothing
16489     */
16490    LDKCOption_HTLCClaimZ_None,
16491    /**
16492     * Must be last for serialization purposes
16493     */
16494    LDKCOption_HTLCClaimZ_Sentinel,
16495 } LDKCOption_HTLCClaimZ_Tag;
16496
16497 typedef struct LDKCOption_HTLCClaimZ {
16498    LDKCOption_HTLCClaimZ_Tag tag;
16499    union {
16500       struct {
16501          enum LDKHTLCClaim some;
16502       };
16503    };
16504 } LDKCOption_HTLCClaimZ;
16505
16506
16507
16508 /**
16509  * Implements the per-commitment secret storage scheme from
16510  * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
16511  *
16512  * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
16513  * or so.
16514  */
16515 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
16516    /**
16517     * A pointer to the opaque Rust object.
16518     * Nearly everywhere, inner must be non-null, however in places where
16519     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16520     */
16521    LDKnativeCounterpartyCommitmentSecrets *inner;
16522    /**
16523     * Indicates that this is the only struct which contains the same pointer.
16524     * Rust functions which take ownership of an object provided via an argument require
16525     * this to be true and invalidate the object pointed to by inner.
16526     */
16527    bool is_owned;
16528 } LDKCounterpartyCommitmentSecrets;
16529
16530 /**
16531  * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
16532  */
16533 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
16534    /**
16535     * A pointer to the contents in the success state.
16536     * Reading from this pointer when `result_ok` is not set is undefined.
16537     */
16538    struct LDKCounterpartyCommitmentSecrets *result;
16539    /**
16540     * A pointer to the contents in the error state.
16541     * Reading from this pointer when `result_ok` is set is undefined.
16542     */
16543    struct LDKDecodeError *err;
16544 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
16545
16546 /**
16547  * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
16548  * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
16549  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16550  */
16551 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
16552    /**
16553     * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
16554     * `err` or `result` depending on the state of `result_ok`.
16555     */
16556    union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
16557    /**
16558     * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
16559     */
16560    bool result_ok;
16561 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
16562
16563
16564
16565 /**
16566  * The set of public keys which are used in the creation of one commitment transaction.
16567  * These are derived from the channel base keys and per-commitment data.
16568  *
16569  * A broadcaster key is provided from potential broadcaster of the computed transaction.
16570  * A countersignatory key is coming from a protocol participant unable to broadcast the
16571  * transaction.
16572  *
16573  * These keys are assumed to be good, either because the code derived them from
16574  * channel basepoints via the new function, or they were obtained via
16575  * CommitmentTransaction.trust().keys() because we trusted the source of the
16576  * pre-calculated keys.
16577  */
16578 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
16579    /**
16580     * A pointer to the opaque Rust object.
16581     * Nearly everywhere, inner must be non-null, however in places where
16582     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16583     */
16584    LDKnativeTxCreationKeys *inner;
16585    /**
16586     * Indicates that this is the only struct which contains the same pointer.
16587     * Rust functions which take ownership of an object provided via an argument require
16588     * this to be true and invalidate the object pointed to by inner.
16589     */
16590    bool is_owned;
16591 } LDKTxCreationKeys;
16592
16593 /**
16594  * The contents of CResult_TxCreationKeysDecodeErrorZ
16595  */
16596 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
16597    /**
16598     * A pointer to the contents in the success state.
16599     * Reading from this pointer when `result_ok` is not set is undefined.
16600     */
16601    struct LDKTxCreationKeys *result;
16602    /**
16603     * A pointer to the contents in the error state.
16604     * Reading from this pointer when `result_ok` is set is undefined.
16605     */
16606    struct LDKDecodeError *err;
16607 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
16608
16609 /**
16610  * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
16611  * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
16612  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16613  */
16614 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
16615    /**
16616     * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
16617     * `err` or `result` depending on the state of `result_ok`.
16618     */
16619    union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
16620    /**
16621     * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
16622     */
16623    bool result_ok;
16624 } LDKCResult_TxCreationKeysDecodeErrorZ;
16625
16626 /**
16627  * The contents of CResult_ChannelPublicKeysDecodeErrorZ
16628  */
16629 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
16630    /**
16631     * A pointer to the contents in the success state.
16632     * Reading from this pointer when `result_ok` is not set is undefined.
16633     */
16634    struct LDKChannelPublicKeys *result;
16635    /**
16636     * A pointer to the contents in the error state.
16637     * Reading from this pointer when `result_ok` is set is undefined.
16638     */
16639    struct LDKDecodeError *err;
16640 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
16641
16642 /**
16643  * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
16644  * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
16645  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16646  */
16647 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
16648    /**
16649     * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
16650     * `err` or `result` depending on the state of `result_ok`.
16651     */
16652    union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
16653    /**
16654     * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
16655     */
16656    bool result_ok;
16657 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
16658
16659 /**
16660  * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
16661  */
16662 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
16663    /**
16664     * A pointer to the contents in the success state.
16665     * Reading from this pointer when `result_ok` is not set is undefined.
16666     */
16667    struct LDKHTLCOutputInCommitment *result;
16668    /**
16669     * A pointer to the contents in the error state.
16670     * Reading from this pointer when `result_ok` is set is undefined.
16671     */
16672    struct LDKDecodeError *err;
16673 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
16674
16675 /**
16676  * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
16677  * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
16678  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16679  */
16680 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
16681    /**
16682     * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
16683     * `err` or `result` depending on the state of `result_ok`.
16684     */
16685    union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
16686    /**
16687     * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
16688     */
16689    bool result_ok;
16690 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
16691
16692
16693
16694 /**
16695  * Late-bound per-channel counterparty data used to build transactions.
16696  */
16697 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
16698    /**
16699     * A pointer to the opaque Rust object.
16700     * Nearly everywhere, inner must be non-null, however in places where
16701     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16702     */
16703    LDKnativeCounterpartyChannelTransactionParameters *inner;
16704    /**
16705     * Indicates that this is the only struct which contains the same pointer.
16706     * Rust functions which take ownership of an object provided via an argument require
16707     * this to be true and invalidate the object pointed to by inner.
16708     */
16709    bool is_owned;
16710 } LDKCounterpartyChannelTransactionParameters;
16711
16712 /**
16713  * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
16714  */
16715 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
16716    /**
16717     * A pointer to the contents in the success state.
16718     * Reading from this pointer when `result_ok` is not set is undefined.
16719     */
16720    struct LDKCounterpartyChannelTransactionParameters *result;
16721    /**
16722     * A pointer to the contents in the error state.
16723     * Reading from this pointer when `result_ok` is set is undefined.
16724     */
16725    struct LDKDecodeError *err;
16726 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
16727
16728 /**
16729  * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
16730  * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
16731  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16732  */
16733 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
16734    /**
16735     * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
16736     * `err` or `result` depending on the state of `result_ok`.
16737     */
16738    union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
16739    /**
16740     * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
16741     */
16742    bool result_ok;
16743 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
16744
16745 /**
16746  * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
16747  */
16748 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
16749    /**
16750     * A pointer to the contents in the success state.
16751     * Reading from this pointer when `result_ok` is not set is undefined.
16752     */
16753    struct LDKChannelTransactionParameters *result;
16754    /**
16755     * A pointer to the contents in the error state.
16756     * Reading from this pointer when `result_ok` is set is undefined.
16757     */
16758    struct LDKDecodeError *err;
16759 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
16760
16761 /**
16762  * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
16763  * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
16764  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16765  */
16766 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
16767    /**
16768     * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
16769     * `err` or `result` depending on the state of `result_ok`.
16770     */
16771    union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
16772    /**
16773     * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
16774     */
16775    bool result_ok;
16776 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
16777
16778 /**
16779  * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
16780  */
16781 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
16782    /**
16783     * A pointer to the contents in the success state.
16784     * Reading from this pointer when `result_ok` is not set is undefined.
16785     */
16786    struct LDKHolderCommitmentTransaction *result;
16787    /**
16788     * A pointer to the contents in the error state.
16789     * Reading from this pointer when `result_ok` is set is undefined.
16790     */
16791    struct LDKDecodeError *err;
16792 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
16793
16794 /**
16795  * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
16796  * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
16797  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16798  */
16799 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
16800    /**
16801     * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
16802     * `err` or `result` depending on the state of `result_ok`.
16803     */
16804    union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
16805    /**
16806     * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
16807     */
16808    bool result_ok;
16809 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
16810
16811
16812
16813 /**
16814  * A pre-built Bitcoin commitment transaction and its txid.
16815  */
16816 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
16817    /**
16818     * A pointer to the opaque Rust object.
16819     * Nearly everywhere, inner must be non-null, however in places where
16820     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16821     */
16822    LDKnativeBuiltCommitmentTransaction *inner;
16823    /**
16824     * Indicates that this is the only struct which contains the same pointer.
16825     * Rust functions which take ownership of an object provided via an argument require
16826     * this to be true and invalidate the object pointed to by inner.
16827     */
16828    bool is_owned;
16829 } LDKBuiltCommitmentTransaction;
16830
16831 /**
16832  * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
16833  */
16834 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
16835    /**
16836     * A pointer to the contents in the success state.
16837     * Reading from this pointer when `result_ok` is not set is undefined.
16838     */
16839    struct LDKBuiltCommitmentTransaction *result;
16840    /**
16841     * A pointer to the contents in the error state.
16842     * Reading from this pointer when `result_ok` is set is undefined.
16843     */
16844    struct LDKDecodeError *err;
16845 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
16846
16847 /**
16848  * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
16849  * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
16850  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16851  */
16852 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
16853    /**
16854     * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
16855     * `err` or `result` depending on the state of `result_ok`.
16856     */
16857    union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
16858    /**
16859     * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
16860     */
16861    bool result_ok;
16862 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
16863
16864
16865
16866 /**
16867  * A wrapper on ClosingTransaction indicating that the built bitcoin
16868  * transaction is trusted.
16869  *
16870  * See trust() and verify() functions on CommitmentTransaction.
16871  *
16872  * This structure implements Deref.
16873  */
16874 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
16875    /**
16876     * A pointer to the opaque Rust object.
16877     * Nearly everywhere, inner must be non-null, however in places where
16878     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16879     */
16880    LDKnativeTrustedClosingTransaction *inner;
16881    /**
16882     * Indicates that this is the only struct which contains the same pointer.
16883     * Rust functions which take ownership of an object provided via an argument require
16884     * this to be true and invalidate the object pointed to by inner.
16885     */
16886    bool is_owned;
16887 } LDKTrustedClosingTransaction;
16888
16889 /**
16890  * The contents of CResult_TrustedClosingTransactionNoneZ
16891  */
16892 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
16893    /**
16894     * A pointer to the contents in the success state.
16895     * Reading from this pointer when `result_ok` is not set is undefined.
16896     */
16897    struct LDKTrustedClosingTransaction *result;
16898    /**
16899     * Note that this value is always NULL, as there are no contents in the Err variant
16900     */
16901    void *err;
16902 } LDKCResult_TrustedClosingTransactionNoneZPtr;
16903
16904 /**
16905  * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
16906  * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
16907  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16908  */
16909 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
16910    /**
16911     * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
16912     * `err` or `result` depending on the state of `result_ok`.
16913     */
16914    union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
16915    /**
16916     * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
16917     */
16918    bool result_ok;
16919 } LDKCResult_TrustedClosingTransactionNoneZ;
16920
16921 /**
16922  * The contents of CResult_CommitmentTransactionDecodeErrorZ
16923  */
16924 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
16925    /**
16926     * A pointer to the contents in the success state.
16927     * Reading from this pointer when `result_ok` is not set is undefined.
16928     */
16929    struct LDKCommitmentTransaction *result;
16930    /**
16931     * A pointer to the contents in the error state.
16932     * Reading from this pointer when `result_ok` is set is undefined.
16933     */
16934    struct LDKDecodeError *err;
16935 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
16936
16937 /**
16938  * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
16939  * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
16940  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16941  */
16942 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
16943    /**
16944     * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
16945     * `err` or `result` depending on the state of `result_ok`.
16946     */
16947    union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
16948    /**
16949     * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
16950     */
16951    bool result_ok;
16952 } LDKCResult_CommitmentTransactionDecodeErrorZ;
16953
16954
16955
16956 /**
16957  * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
16958  * transaction and the transaction creation keys) are trusted.
16959  *
16960  * See trust() and verify() functions on CommitmentTransaction.
16961  *
16962  * This structure implements Deref.
16963  */
16964 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
16965    /**
16966     * A pointer to the opaque Rust object.
16967     * Nearly everywhere, inner must be non-null, however in places where
16968     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16969     */
16970    LDKnativeTrustedCommitmentTransaction *inner;
16971    /**
16972     * Indicates that this is the only struct which contains the same pointer.
16973     * Rust functions which take ownership of an object provided via an argument require
16974     * this to be true and invalidate the object pointed to by inner.
16975     */
16976    bool is_owned;
16977 } LDKTrustedCommitmentTransaction;
16978
16979 /**
16980  * The contents of CResult_TrustedCommitmentTransactionNoneZ
16981  */
16982 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
16983    /**
16984     * A pointer to the contents in the success state.
16985     * Reading from this pointer when `result_ok` is not set is undefined.
16986     */
16987    struct LDKTrustedCommitmentTransaction *result;
16988    /**
16989     * Note that this value is always NULL, as there are no contents in the Err variant
16990     */
16991    void *err;
16992 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
16993
16994 /**
16995  * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
16996  * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
16997  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16998  */
16999 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
17000    /**
17001     * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
17002     * `err` or `result` depending on the state of `result_ok`.
17003     */
17004    union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
17005    /**
17006     * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
17007     */
17008    bool result_ok;
17009 } LDKCResult_TrustedCommitmentTransactionNoneZ;
17010
17011 /**
17012  * The contents of CResult_CVec_ECDSASignatureZNoneZ
17013  */
17014 typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
17015    /**
17016     * A pointer to the contents in the success state.
17017     * Reading from this pointer when `result_ok` is not set is undefined.
17018     */
17019    struct LDKCVec_ECDSASignatureZ *result;
17020    /**
17021     * Note that this value is always NULL, as there are no contents in the Err variant
17022     */
17023    void *err;
17024 } LDKCResult_CVec_ECDSASignatureZNoneZPtr;
17025
17026 /**
17027  * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
17028  * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
17029  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17030  */
17031 typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
17032    /**
17033     * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
17034     * `err` or `result` depending on the state of `result_ok`.
17035     */
17036    union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
17037    /**
17038     * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
17039     */
17040    bool result_ok;
17041 } LDKCResult_CVec_ECDSASignatureZNoneZ;
17042
17043 /**
17044  * An enum which can either contain a usize or not
17045  */
17046 typedef enum LDKCOption_usizeZ_Tag {
17047    /**
17048     * When we're in this state, this COption_usizeZ contains a usize
17049     */
17050    LDKCOption_usizeZ_Some,
17051    /**
17052     * When we're in this state, this COption_usizeZ contains nothing
17053     */
17054    LDKCOption_usizeZ_None,
17055    /**
17056     * Must be last for serialization purposes
17057     */
17058    LDKCOption_usizeZ_Sentinel,
17059 } LDKCOption_usizeZ_Tag;
17060
17061 typedef struct LDKCOption_usizeZ {
17062    LDKCOption_usizeZ_Tag tag;
17063    union {
17064       struct {
17065          uintptr_t some;
17066       };
17067    };
17068 } LDKCOption_usizeZ;
17069
17070 /**
17071  * The contents of CResult_ShutdownScriptDecodeErrorZ
17072  */
17073 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
17074    /**
17075     * A pointer to the contents in the success state.
17076     * Reading from this pointer when `result_ok` is not set is undefined.
17077     */
17078    struct LDKShutdownScript *result;
17079    /**
17080     * A pointer to the contents in the error state.
17081     * Reading from this pointer when `result_ok` is set is undefined.
17082     */
17083    struct LDKDecodeError *err;
17084 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
17085
17086 /**
17087  * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
17088  * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
17089  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17090  */
17091 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
17092    /**
17093     * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
17094     * `err` or `result` depending on the state of `result_ok`.
17095     */
17096    union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
17097    /**
17098     * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
17099     */
17100    bool result_ok;
17101 } LDKCResult_ShutdownScriptDecodeErrorZ;
17102
17103
17104
17105 /**
17106  * An error occurring when converting from [`ScriptBuf`] to [`ShutdownScript`].
17107  */
17108 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
17109    /**
17110     * A pointer to the opaque Rust object.
17111     * Nearly everywhere, inner must be non-null, however in places where
17112     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17113     */
17114    LDKnativeInvalidShutdownScript *inner;
17115    /**
17116     * Indicates that this is the only struct which contains the same pointer.
17117     * Rust functions which take ownership of an object provided via an argument require
17118     * this to be true and invalidate the object pointed to by inner.
17119     */
17120    bool is_owned;
17121 } LDKInvalidShutdownScript;
17122
17123 /**
17124  * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
17125  */
17126 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
17127    /**
17128     * A pointer to the contents in the success state.
17129     * Reading from this pointer when `result_ok` is not set is undefined.
17130     */
17131    struct LDKShutdownScript *result;
17132    /**
17133     * A pointer to the contents in the error state.
17134     * Reading from this pointer when `result_ok` is set is undefined.
17135     */
17136    struct LDKInvalidShutdownScript *err;
17137 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
17138
17139 /**
17140  * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
17141  * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
17142  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17143  */
17144 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
17145    /**
17146     * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
17147     * `err` or `result` depending on the state of `result_ok`.
17148     */
17149    union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
17150    /**
17151     * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
17152     */
17153    bool result_ok;
17154 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
17155
17156 /**
17157  * Some information provided on receipt of payment depends on whether the payment received is a
17158  * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
17159  */
17160 typedef enum LDKPaymentPurpose_Tag {
17161    /**
17162     * A payment for a BOLT 11 invoice.
17163     */
17164    LDKPaymentPurpose_Bolt11InvoicePayment,
17165    /**
17166     * A payment for a BOLT 12 [`Offer`].
17167     *
17168     * [`Offer`]: crate::offers::offer::Offer
17169     */
17170    LDKPaymentPurpose_Bolt12OfferPayment,
17171    /**
17172     * A payment for a BOLT 12 [`Refund`].
17173     *
17174     * [`Refund`]: crate::offers::refund::Refund
17175     */
17176    LDKPaymentPurpose_Bolt12RefundPayment,
17177    /**
17178     * Because this is a spontaneous payment, the payer generated their own preimage rather than us
17179     * (the payee) providing a preimage.
17180     */
17181    LDKPaymentPurpose_SpontaneousPayment,
17182    /**
17183     * Must be last for serialization purposes
17184     */
17185    LDKPaymentPurpose_Sentinel,
17186 } LDKPaymentPurpose_Tag;
17187
17188 typedef struct LDKPaymentPurpose_LDKBolt11InvoicePayment_Body {
17189    /**
17190     * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
17191     * [`ChannelManager::create_inbound_payment`]. When handling [`Event::PaymentClaimable`],
17192     * this can be passed directly to [`ChannelManager::claim_funds`] to claim the payment. No
17193     * action is needed when seen in [`Event::PaymentClaimed`].
17194     *
17195     * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
17196     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17197     */
17198    struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17199    /**
17200     * The \"payment secret\". This authenticates the sender to the recipient, preventing a
17201     * number of deanonymization attacks during the routing process.
17202     * It is provided here for your reference, however its accuracy is enforced directly by
17203     * [`ChannelManager`] using the values you previously provided to
17204     * [`ChannelManager::create_inbound_payment`] or
17205     * [`ChannelManager::create_inbound_payment_for_hash`].
17206     *
17207     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17208     * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
17209     * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
17210     */
17211    struct LDKThirtyTwoBytes payment_secret;
17212 } LDKPaymentPurpose_LDKBolt11InvoicePayment_Body;
17213
17214 typedef struct LDKPaymentPurpose_LDKBolt12OfferPayment_Body {
17215    /**
17216     * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
17217     * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
17218     * when seen in [`Event::PaymentClaimed`].
17219     *
17220     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17221     */
17222    struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17223    /**
17224     * The secret used to authenticate the sender to the recipient, preventing a number of
17225     * de-anonymization attacks while routing a payment.
17226     *
17227     * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
17228     */
17229    struct LDKThirtyTwoBytes payment_secret;
17230    /**
17231     * The context of the payment such as information about the corresponding [`Offer`] and
17232     * [`InvoiceRequest`].
17233     *
17234     * [`Offer`]: crate::offers::offer::Offer
17235     * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
17236     */
17237    struct LDKBolt12OfferContext payment_context;
17238 } LDKPaymentPurpose_LDKBolt12OfferPayment_Body;
17239
17240 typedef struct LDKPaymentPurpose_LDKBolt12RefundPayment_Body {
17241    /**
17242     * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
17243     * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
17244     * when seen in [`Event::PaymentClaimed`].
17245     *
17246     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
17247     */
17248    struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
17249    /**
17250     * The secret used to authenticate the sender to the recipient, preventing a number of
17251     * de-anonymization attacks while routing a payment.
17252     *
17253     * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
17254     */
17255    struct LDKThirtyTwoBytes payment_secret;
17256    /**
17257     * The context of the payment such as information about the corresponding [`Refund`].
17258     *
17259     * [`Refund`]: crate::offers::refund::Refund
17260     */
17261    struct LDKBolt12RefundContext payment_context;
17262 } LDKPaymentPurpose_LDKBolt12RefundPayment_Body;
17263
17264 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
17265    LDKPaymentPurpose_Tag tag;
17266    union {
17267       LDKPaymentPurpose_LDKBolt11InvoicePayment_Body bolt11_invoice_payment;
17268       LDKPaymentPurpose_LDKBolt12OfferPayment_Body bolt12_offer_payment;
17269       LDKPaymentPurpose_LDKBolt12RefundPayment_Body bolt12_refund_payment;
17270       struct {
17271          struct LDKThirtyTwoBytes spontaneous_payment;
17272       };
17273    };
17274 } LDKPaymentPurpose;
17275
17276 /**
17277  * The contents of CResult_PaymentPurposeDecodeErrorZ
17278  */
17279 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
17280    /**
17281     * A pointer to the contents in the success state.
17282     * Reading from this pointer when `result_ok` is not set is undefined.
17283     */
17284    struct LDKPaymentPurpose *result;
17285    /**
17286     * A pointer to the contents in the error state.
17287     * Reading from this pointer when `result_ok` is set is undefined.
17288     */
17289    struct LDKDecodeError *err;
17290 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
17291
17292 /**
17293  * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
17294  * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
17295  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17296  */
17297 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
17298    /**
17299     * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
17300     * `err` or `result` depending on the state of `result_ok`.
17301     */
17302    union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
17303    /**
17304     * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
17305     */
17306    bool result_ok;
17307 } LDKCResult_PaymentPurposeDecodeErrorZ;
17308
17309
17310
17311 /**
17312  * Information about an HTLC that is part of a payment that can be claimed.
17313  */
17314 typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
17315    /**
17316     * A pointer to the opaque Rust object.
17317     * Nearly everywhere, inner must be non-null, however in places where
17318     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17319     */
17320    LDKnativeClaimedHTLC *inner;
17321    /**
17322     * Indicates that this is the only struct which contains the same pointer.
17323     * Rust functions which take ownership of an object provided via an argument require
17324     * this to be true and invalidate the object pointed to by inner.
17325     */
17326    bool is_owned;
17327 } LDKClaimedHTLC;
17328
17329 /**
17330  * The contents of CResult_ClaimedHTLCDecodeErrorZ
17331  */
17332 typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
17333    /**
17334     * A pointer to the contents in the success state.
17335     * Reading from this pointer when `result_ok` is not set is undefined.
17336     */
17337    struct LDKClaimedHTLC *result;
17338    /**
17339     * A pointer to the contents in the error state.
17340     * Reading from this pointer when `result_ok` is set is undefined.
17341     */
17342    struct LDKDecodeError *err;
17343 } LDKCResult_ClaimedHTLCDecodeErrorZPtr;
17344
17345 /**
17346  * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
17347  * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
17348  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17349  */
17350 typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
17351    /**
17352     * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
17353     * `err` or `result` depending on the state of `result_ok`.
17354     */
17355    union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
17356    /**
17357     * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
17358     */
17359    bool result_ok;
17360 } LDKCResult_ClaimedHTLCDecodeErrorZ;
17361
17362 /**
17363  * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
17364  * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
17365  *
17366  * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
17367  * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
17368  */
17369 typedef enum LDKPathFailure_Tag {
17370    /**
17371     * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
17372     * error.
17373     */
17374    LDKPathFailure_InitialSend,
17375    /**
17376     * A hop on the path failed to forward our payment.
17377     */
17378    LDKPathFailure_OnPath,
17379    /**
17380     * Must be last for serialization purposes
17381     */
17382    LDKPathFailure_Sentinel,
17383 } LDKPathFailure_Tag;
17384
17385 typedef struct LDKPathFailure_LDKInitialSend_Body {
17386    /**
17387     * The error surfaced from initial send.
17388     */
17389    struct LDKAPIError err;
17390 } LDKPathFailure_LDKInitialSend_Body;
17391
17392 typedef struct LDKPathFailure_LDKOnPath_Body {
17393    /**
17394     * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
17395     * decisions can take into account the update.
17396     *
17397     * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
17398     * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
17399     */
17400    struct LDKCOption_NetworkUpdateZ network_update;
17401 } LDKPathFailure_LDKOnPath_Body;
17402
17403 typedef struct MUST_USE_STRUCT LDKPathFailure {
17404    LDKPathFailure_Tag tag;
17405    union {
17406       LDKPathFailure_LDKInitialSend_Body initial_send;
17407       LDKPathFailure_LDKOnPath_Body on_path;
17408    };
17409 } LDKPathFailure;
17410
17411 /**
17412  * An enum which can either contain a crate::lightning::events::PathFailure or not
17413  */
17414 typedef enum LDKCOption_PathFailureZ_Tag {
17415    /**
17416     * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
17417     */
17418    LDKCOption_PathFailureZ_Some,
17419    /**
17420     * When we're in this state, this COption_PathFailureZ contains nothing
17421     */
17422    LDKCOption_PathFailureZ_None,
17423    /**
17424     * Must be last for serialization purposes
17425     */
17426    LDKCOption_PathFailureZ_Sentinel,
17427 } LDKCOption_PathFailureZ_Tag;
17428
17429 typedef struct LDKCOption_PathFailureZ {
17430    LDKCOption_PathFailureZ_Tag tag;
17431    union {
17432       struct {
17433          struct LDKPathFailure some;
17434       };
17435    };
17436 } LDKCOption_PathFailureZ;
17437
17438 /**
17439  * The contents of CResult_COption_PathFailureZDecodeErrorZ
17440  */
17441 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
17442    /**
17443     * A pointer to the contents in the success state.
17444     * Reading from this pointer when `result_ok` is not set is undefined.
17445     */
17446    struct LDKCOption_PathFailureZ *result;
17447    /**
17448     * A pointer to the contents in the error state.
17449     * Reading from this pointer when `result_ok` is set is undefined.
17450     */
17451    struct LDKDecodeError *err;
17452 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
17453
17454 /**
17455  * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
17456  * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17457  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17458  */
17459 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
17460    /**
17461     * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
17462     * `err` or `result` depending on the state of `result_ok`.
17463     */
17464    union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
17465    /**
17466     * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
17467     */
17468    bool result_ok;
17469 } LDKCResult_COption_PathFailureZDecodeErrorZ;
17470
17471 /**
17472  * An enum which can either contain a crate::lightning::events::ClosureReason or not
17473  */
17474 typedef enum LDKCOption_ClosureReasonZ_Tag {
17475    /**
17476     * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
17477     */
17478    LDKCOption_ClosureReasonZ_Some,
17479    /**
17480     * When we're in this state, this COption_ClosureReasonZ contains nothing
17481     */
17482    LDKCOption_ClosureReasonZ_None,
17483    /**
17484     * Must be last for serialization purposes
17485     */
17486    LDKCOption_ClosureReasonZ_Sentinel,
17487 } LDKCOption_ClosureReasonZ_Tag;
17488
17489 typedef struct LDKCOption_ClosureReasonZ {
17490    LDKCOption_ClosureReasonZ_Tag tag;
17491    union {
17492       struct {
17493          struct LDKClosureReason some;
17494       };
17495    };
17496 } LDKCOption_ClosureReasonZ;
17497
17498 /**
17499  * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
17500  */
17501 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
17502    /**
17503     * A pointer to the contents in the success state.
17504     * Reading from this pointer when `result_ok` is not set is undefined.
17505     */
17506    struct LDKCOption_ClosureReasonZ *result;
17507    /**
17508     * A pointer to the contents in the error state.
17509     * Reading from this pointer when `result_ok` is set is undefined.
17510     */
17511    struct LDKDecodeError *err;
17512 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
17513
17514 /**
17515  * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
17516  * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17517  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17518  */
17519 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
17520    /**
17521     * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
17522     * `err` or `result` depending on the state of `result_ok`.
17523     */
17524    union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
17525    /**
17526     * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
17527     */
17528    bool result_ok;
17529 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
17530
17531 /**
17532  * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
17533  */
17534 typedef enum LDKHTLCDestination_Tag {
17535    /**
17536     * We tried forwarding to a channel but failed to do so. An example of such an instance is when
17537     * there is insufficient capacity in our outbound channel.
17538     */
17539    LDKHTLCDestination_NextHopChannel,
17540    /**
17541     * Scenario where we are unsure of the next node to forward the HTLC to.
17542     */
17543    LDKHTLCDestination_UnknownNextHop,
17544    /**
17545     * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
17546     * intercept HTLC.
17547     */
17548    LDKHTLCDestination_InvalidForward,
17549    /**
17550     * We couldn't decode the incoming onion to obtain the forwarding details.
17551     */
17552    LDKHTLCDestination_InvalidOnion,
17553    /**
17554     * Failure scenario where an HTLC may have been forwarded to be intended for us,
17555     * but is invalid for some reason, so we reject it.
17556     *
17557     * Some of the reasons may include:
17558     * * HTLC Timeouts
17559     * * Excess HTLCs for a payment that we have already fully received, over-paying for the
17560     *   payment,
17561     * * The counterparty node modified the HTLC in transit,
17562     * * A probing attack where an intermediary node is trying to detect if we are the ultimate
17563     *   recipient for a payment.
17564     */
17565    LDKHTLCDestination_FailedPayment,
17566    /**
17567     * Must be last for serialization purposes
17568     */
17569    LDKHTLCDestination_Sentinel,
17570 } LDKHTLCDestination_Tag;
17571
17572 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
17573    /**
17574     * The `node_id` of the next node. For backwards compatibility, this field is
17575     * marked as optional, versions prior to 0.0.110 may not always be able to provide
17576     * counterparty node information.
17577     *
17578     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
17579     */
17580    struct LDKPublicKey node_id;
17581    /**
17582     * The outgoing `channel_id` between us and the next node.
17583     */
17584    struct LDKChannelId channel_id;
17585 } LDKHTLCDestination_LDKNextHopChannel_Body;
17586
17587 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
17588    /**
17589     * Short channel id we are requesting to forward an HTLC to.
17590     */
17591    uint64_t requested_forward_scid;
17592 } LDKHTLCDestination_LDKUnknownNextHop_Body;
17593
17594 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
17595    /**
17596     * Short channel id we are requesting to forward an HTLC to.
17597     */
17598    uint64_t requested_forward_scid;
17599 } LDKHTLCDestination_LDKInvalidForward_Body;
17600
17601 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
17602    /**
17603     * The payment hash of the payment we attempted to process.
17604     */
17605    struct LDKThirtyTwoBytes payment_hash;
17606 } LDKHTLCDestination_LDKFailedPayment_Body;
17607
17608 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
17609    LDKHTLCDestination_Tag tag;
17610    union {
17611       LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
17612       LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
17613       LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
17614       LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
17615    };
17616 } LDKHTLCDestination;
17617
17618 /**
17619  * An enum which can either contain a crate::lightning::events::HTLCDestination or not
17620  */
17621 typedef enum LDKCOption_HTLCDestinationZ_Tag {
17622    /**
17623     * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
17624     */
17625    LDKCOption_HTLCDestinationZ_Some,
17626    /**
17627     * When we're in this state, this COption_HTLCDestinationZ contains nothing
17628     */
17629    LDKCOption_HTLCDestinationZ_None,
17630    /**
17631     * Must be last for serialization purposes
17632     */
17633    LDKCOption_HTLCDestinationZ_Sentinel,
17634 } LDKCOption_HTLCDestinationZ_Tag;
17635
17636 typedef struct LDKCOption_HTLCDestinationZ {
17637    LDKCOption_HTLCDestinationZ_Tag tag;
17638    union {
17639       struct {
17640          struct LDKHTLCDestination some;
17641       };
17642    };
17643 } LDKCOption_HTLCDestinationZ;
17644
17645 /**
17646  * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
17647  */
17648 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
17649    /**
17650     * A pointer to the contents in the success state.
17651     * Reading from this pointer when `result_ok` is not set is undefined.
17652     */
17653    struct LDKCOption_HTLCDestinationZ *result;
17654    /**
17655     * A pointer to the contents in the error state.
17656     * Reading from this pointer when `result_ok` is set is undefined.
17657     */
17658    struct LDKDecodeError *err;
17659 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
17660
17661 /**
17662  * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
17663  * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
17664  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17665  */
17666 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
17667    /**
17668     * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
17669     * `err` or `result` depending on the state of `result_ok`.
17670     */
17671    union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
17672    /**
17673     * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
17674     */
17675    bool result_ok;
17676 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
17677
17678 /**
17679  * The contents of CResult_PaymentFailureReasonDecodeErrorZ
17680  */
17681 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
17682    /**
17683     * A pointer to the contents in the success state.
17684     * Reading from this pointer when `result_ok` is not set is undefined.
17685     */
17686    enum LDKPaymentFailureReason *result;
17687    /**
17688     * A pointer to the contents in the error state.
17689     * Reading from this pointer when `result_ok` is set is undefined.
17690     */
17691    struct LDKDecodeError *err;
17692 } LDKCResult_PaymentFailureReasonDecodeErrorZPtr;
17693
17694 /**
17695  * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
17696  * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
17697  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17698  */
17699 typedef struct LDKCResult_PaymentFailureReasonDecodeErrorZ {
17700    /**
17701     * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
17702     * `err` or `result` depending on the state of `result_ok`.
17703     */
17704    union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
17705    /**
17706     * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
17707     */
17708    bool result_ok;
17709 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
17710
17711 /**
17712  * An enum which can either contain a crate::c_types::U128 or not
17713  */
17714 typedef enum LDKCOption_U128Z_Tag {
17715    /**
17716     * When we're in this state, this COption_U128Z contains a crate::c_types::U128
17717     */
17718    LDKCOption_U128Z_Some,
17719    /**
17720     * When we're in this state, this COption_U128Z contains nothing
17721     */
17722    LDKCOption_U128Z_None,
17723    /**
17724     * Must be last for serialization purposes
17725     */
17726    LDKCOption_U128Z_Sentinel,
17727 } LDKCOption_U128Z_Tag;
17728
17729 typedef struct LDKCOption_U128Z {
17730    LDKCOption_U128Z_Tag tag;
17731    union {
17732       struct {
17733          struct LDKU128 some;
17734       };
17735    };
17736 } LDKCOption_U128Z;
17737
17738 /**
17739  * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
17740  * This corresponds to std::vector in C++
17741  */
17742 typedef struct LDKCVec_ClaimedHTLCZ {
17743    /**
17744     * The elements in the array.
17745     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17746     */
17747    struct LDKClaimedHTLC *data;
17748    /**
17749     * The number of elements pointed to by `data`.
17750     */
17751    uintptr_t datalen;
17752 } LDKCVec_ClaimedHTLCZ;
17753
17754 /**
17755  * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
17756  */
17757 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
17758    /**
17759     * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
17760     */
17761    LDKCOption_PaymentFailureReasonZ_Some,
17762    /**
17763     * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
17764     */
17765    LDKCOption_PaymentFailureReasonZ_None,
17766    /**
17767     * Must be last for serialization purposes
17768     */
17769    LDKCOption_PaymentFailureReasonZ_Sentinel,
17770 } LDKCOption_PaymentFailureReasonZ_Tag;
17771
17772 typedef struct LDKCOption_PaymentFailureReasonZ {
17773    LDKCOption_PaymentFailureReasonZ_Tag tag;
17774    union {
17775       struct {
17776          enum LDKPaymentFailureReason some;
17777       };
17778    };
17779 } LDKCOption_PaymentFailureReasonZ;
17780
17781
17782
17783 /**
17784  * A descriptor used to sign for a commitment transaction's anchor output.
17785  */
17786 typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
17787    /**
17788     * A pointer to the opaque Rust object.
17789     * Nearly everywhere, inner must be non-null, however in places where
17790     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17791     */
17792    LDKnativeAnchorDescriptor *inner;
17793    /**
17794     * Indicates that this is the only struct which contains the same pointer.
17795     * Rust functions which take ownership of an object provided via an argument require
17796     * this to be true and invalidate the object pointed to by inner.
17797     */
17798    bool is_owned;
17799 } LDKAnchorDescriptor;
17800
17801 /**
17802  * Represents the different types of transactions, originating from LDK, to be bumped.
17803  */
17804 typedef enum LDKBumpTransactionEvent_Tag {
17805    /**
17806     * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
17807     * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
17808     * they may need additional fees to be attached through a child transaction using the popular
17809     * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
17810     * child transaction must include the anchor input described within `anchor_descriptor` along
17811     * with additional inputs to meet the target feerate. Failure to meet the target feerate
17812     * decreases the confirmation odds of the transaction package (which includes the commitment
17813     * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
17814     * is constructed, it must be fully signed for and broadcast by the consumer of the event
17815     * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
17816     * broadcast first, as the child anchor transaction depends on it.
17817     *
17818     * The consumer should be able to sign for any of the additional inputs included within the
17819     * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
17820     * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
17821     * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
17822     * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
17823     * full witness required to spend.
17824     *
17825     * It is possible to receive more than one instance of this event if a valid child anchor
17826     * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
17827     * be taken by the consumer of the event to ensure any future iterations of the child anchor
17828     * transaction adhere to the [Replace-By-Fee
17829     * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
17830     * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
17831     * these events is not user-controlled, users may ignore/drop the event if they are no longer
17832     * able to commit external confirmed funds to the child anchor transaction.
17833     *
17834     * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
17835     * determine whether a significant portion of the channel's funds are allocated to HTLCs,
17836     * enabling users to make their own decisions regarding the importance of the commitment
17837     * transaction's confirmation. Note that this is not required, but simply exists as an option
17838     * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
17839     * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
17840     * be not urgent.
17841     *
17842     * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
17843     * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_anchor_input
17844     * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
17845     */
17846    LDKBumpTransactionEvent_ChannelClose,
17847    /**
17848     * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
17849     * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
17850     * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
17851     * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
17852     * for a timely confirmation within the chain. These additional inputs and/or outputs must be
17853     * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
17854     * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
17855     * loss of funds. Once the transaction meets the target feerate, it must be signed for and
17856     * broadcast by the consumer of the event.
17857     *
17858     * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
17859     * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
17860     * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
17861     * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
17862     * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
17863     * to spend.
17864     *
17865     * It is possible to receive more than one instance of this event if a valid HTLC transaction
17866     * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
17867     * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
17868     * the [Replace-By-Fee
17869     * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
17870     * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
17871     * these events is not user-controlled, users may ignore/drop the event if either they are no
17872     * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
17873     * to the HTLC transaction is greater in value than the HTLCs being claimed.
17874     *
17875     * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
17876     * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_htlc_transaction
17877     */
17878    LDKBumpTransactionEvent_HTLCResolution,
17879    /**
17880     * Must be last for serialization purposes
17881     */
17882    LDKBumpTransactionEvent_Sentinel,
17883 } LDKBumpTransactionEvent_Tag;
17884
17885 typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
17886    /**
17887     * The `channel_id` of the channel which has been closed.
17888     */
17889    struct LDKChannelId channel_id;
17890    /**
17891     * Counterparty in the closed channel.
17892     */
17893    struct LDKPublicKey counterparty_node_id;
17894    /**
17895     * The unique identifier for the claim of the anchor output in the commitment transaction.
17896     *
17897     * The identifier must map to the set of external UTXOs assigned to the claim, such that
17898     * they can be reused when a new claim with the same identifier needs to be made, resulting
17899     * in a fee-bumping attempt.
17900     */
17901    struct LDKThirtyTwoBytes claim_id;
17902    /**
17903     * The target feerate that the transaction package, which consists of the commitment
17904     * transaction and the to-be-crafted child anchor transaction, must meet.
17905     */
17906    uint32_t package_target_feerate_sat_per_1000_weight;
17907    /**
17908     * The channel's commitment transaction to bump the fee of. This transaction should be
17909     * broadcast along with the anchor transaction constructed as a result of consuming this
17910     * event.
17911     */
17912    struct LDKTransaction commitment_tx;
17913    /**
17914     * The absolute fee in satoshis of the commitment transaction. This can be used along the
17915     * with weight of the commitment transaction to determine its feerate.
17916     */
17917    uint64_t commitment_tx_fee_satoshis;
17918    /**
17919     * The descriptor to sign the anchor input of the anchor transaction constructed as a
17920     * result of consuming this event.
17921     */
17922    struct LDKAnchorDescriptor anchor_descriptor;
17923    /**
17924     * The set of pending HTLCs on the commitment transaction that need to be resolved once the
17925     * commitment transaction confirms.
17926     */
17927    struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
17928 } LDKBumpTransactionEvent_LDKChannelClose_Body;
17929
17930 typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
17931    /**
17932     * The `channel_id` of the channel which has been closed.
17933     */
17934    struct LDKChannelId channel_id;
17935    /**
17936     * Counterparty in the closed channel.
17937     */
17938    struct LDKPublicKey counterparty_node_id;
17939    /**
17940     * The unique identifier for the claim of the HTLCs in the confirmed commitment
17941     * transaction.
17942     *
17943     * The identifier must map to the set of external UTXOs assigned to the claim, such that
17944     * they can be reused when a new claim with the same identifier needs to be made, resulting
17945     * in a fee-bumping attempt.
17946     */
17947    struct LDKThirtyTwoBytes claim_id;
17948    /**
17949     * The target feerate that the resulting HTLC transaction must meet.
17950     */
17951    uint32_t target_feerate_sat_per_1000_weight;
17952    /**
17953     * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
17954     * by the same transaction.
17955     */
17956    struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
17957    /**
17958     * The locktime required for the resulting HTLC transaction.
17959     */
17960    uint32_t tx_lock_time;
17961 } LDKBumpTransactionEvent_LDKHTLCResolution_Body;
17962
17963 typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
17964    LDKBumpTransactionEvent_Tag tag;
17965    union {
17966       LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
17967       LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
17968    };
17969 } LDKBumpTransactionEvent;
17970
17971 /**
17972  * An Event which you should probably take some action in response to.
17973  *
17974  * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
17975  * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
17976  * written as it makes no sense to respond to it after reconnecting to peers).
17977  */
17978 typedef enum LDKEvent_Tag {
17979    /**
17980     * Used to indicate that the client should generate a funding transaction with the given
17981     * parameters and then call [`ChannelManager::funding_transaction_generated`].
17982     * Generated in [`ChannelManager`] message handling.
17983     * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
17984     * counterparty can steal your funds!
17985     *
17986     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17987     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
17988     */
17989    LDKEvent_FundingGenerationReady,
17990    /**
17991     * Indicates that we've been offered a payment and it needs to be claimed via calling
17992     * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
17993     *
17994     * Note that if the preimage is not known, you should call
17995     * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
17996     * to free up resources for this HTLC and avoid network congestion.
17997     *
17998     * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
17999     * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
18000     * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
18001     * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
18002     * If you don't intend to check for custom TLVs, you can simply use
18003     * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
18004     *
18005     * If you fail to call [`ChannelManager::claim_funds`],
18006     * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
18007     * [`ChannelManager::fail_htlc_backwards`], or
18008     * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
18009     * be automatically failed.
18010     *
18011     * # Note
18012     * LDK will not stop an inbound payment from being paid multiple times, so multiple
18013     * `PaymentClaimable` events may be generated for the same payment. In such a case it is
18014     * polite (and required in the lightning specification) to fail the payment the second time
18015     * and give the sender their money back rather than accepting double payment.
18016     *
18017     * # Note
18018     * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
18019     *
18020     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18021     * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
18022     * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
18023     * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
18024     * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
18025     */
18026    LDKEvent_PaymentClaimable,
18027    /**
18028     * Indicates a payment has been claimed and we've received money!
18029     *
18030     * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
18031     * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
18032     * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
18033     * [`Event::PaymentClaimable`] event.
18034     *
18035     * # Note
18036     * LDK will not stop an inbound payment from being paid multiple times, so multiple
18037     * `PaymentClaimable` events may be generated for the same payment. If you then call
18038     * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
18039     * multiple `PaymentClaimed` events.
18040     *
18041     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18042     */
18043    LDKEvent_PaymentClaimed,
18044    /**
18045     * Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
18046     *
18047     * Typically, this happens when a [`MessageRouter`] is unable to find a complete path to a
18048     * [`Destination`]. Once a connection is established, any messages buffered by an
18049     * [`OnionMessageHandler`] may be sent.
18050     *
18051     * This event will not be generated for onion message forwards; only for sends including
18052     * replies. Handlers should connect to the node otherwise any buffered messages may be lost.
18053     *
18054     * [`OnionMessage`]: msgs::OnionMessage
18055     * [`MessageRouter`]: crate::onion_message::messenger::MessageRouter
18056     * [`Destination`]: crate::onion_message::messenger::Destination
18057     * [`OnionMessageHandler`]: crate::ln::msgs::OnionMessageHandler
18058     */
18059    LDKEvent_ConnectionNeeded,
18060    /**
18061     * Indicates a request for an invoice failed to yield a response in a reasonable amount of time
18062     * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
18063     * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
18064     *
18065     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18066     * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
18067     * [`Offer`]: crate::offers::offer::Offer
18068     * [`Refund`]: crate::offers::refund::Refund
18069     */
18070    LDKEvent_InvoiceRequestFailed,
18071    /**
18072     * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
18073     * and we got back the payment preimage for it).
18074     *
18075     * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
18076     * event. In this situation, you SHOULD treat this payment as having succeeded.
18077     */
18078    LDKEvent_PaymentSent,
18079    /**
18080     * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
18081     * provide failure information for each path attempt in the payment, including retries.
18082     *
18083     * This event is provided once there are no further pending HTLCs for the payment and the
18084     * payment is no longer retryable, due either to the [`Retry`] provided or
18085     * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
18086     *
18087     * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
18088     * a payment after an [`Event::PaymentSent`] event for this same payment has already been
18089     * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
18090     * and the payment MUST be treated as having succeeded.
18091     *
18092     * [`Retry`]: crate::ln::channelmanager::Retry
18093     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18094     */
18095    LDKEvent_PaymentFailed,
18096    /**
18097     * Indicates that a path for an outbound payment was successful.
18098     *
18099     * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
18100     * [`Event::PaymentSent`] for obtaining the payment preimage.
18101     */
18102    LDKEvent_PaymentPathSuccessful,
18103    /**
18104     * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
18105     * handle the HTLC.
18106     *
18107     * Note that this does *not* indicate that all paths for an MPP payment have failed, see
18108     * [`Event::PaymentFailed`].
18109     *
18110     * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
18111     * been exhausted.
18112     *
18113     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18114     */
18115    LDKEvent_PaymentPathFailed,
18116    /**
18117     * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
18118     */
18119    LDKEvent_ProbeSuccessful,
18120    /**
18121     * Indicates that a probe payment we sent failed at an intermediary node on the path.
18122     */
18123    LDKEvent_ProbeFailed,
18124    /**
18125     * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
18126     * a time in the future.
18127     *
18128     * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
18129     */
18130    LDKEvent_PendingHTLCsForwardable,
18131    /**
18132     * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
18133     * you've encoded an intercept scid in the receiver's invoice route hints using
18134     * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
18135     *
18136     * [`ChannelManager::forward_intercepted_htlc`] or
18137     * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
18138     * their docs for more information.
18139     *
18140     * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
18141     * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
18142     * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
18143     * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
18144     */
18145    LDKEvent_HTLCIntercepted,
18146    /**
18147     * Used to indicate that an output which you should know how to spend was confirmed on chain
18148     * and is now spendable.
18149     *
18150     * Such an output will *never* be spent directly by LDK, and are not at risk of your
18151     * counterparty spending them due to some kind of timeout. Thus, you need to store them
18152     * somewhere and spend them when you create on-chain transactions.
18153     *
18154     * You may hand them to the [`OutputSweeper`] utility which will store and (re-)generate spending
18155     * transactions for you.
18156     *
18157     * [`OutputSweeper`]: crate::util::sweep::OutputSweeper
18158     */
18159    LDKEvent_SpendableOutputs,
18160    /**
18161     * This event is generated when a payment has been successfully forwarded through us and a
18162     * forwarding fee earned.
18163     */
18164    LDKEvent_PaymentForwarded,
18165    /**
18166     * Used to indicate that a channel with the given `channel_id` is being opened and pending
18167     * confirmation on-chain.
18168     *
18169     * This event is emitted when the funding transaction has been signed and is broadcast to the
18170     * network. For 0conf channels it will be immediately followed by the corresponding
18171     * [`Event::ChannelReady`] event.
18172     */
18173    LDKEvent_ChannelPending,
18174    /**
18175     * Used to indicate that a channel with the given `channel_id` is ready to
18176     * be used. This event is emitted either when the funding transaction has been confirmed
18177     * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
18178     * establishment.
18179     */
18180    LDKEvent_ChannelReady,
18181    /**
18182     * Used to indicate that a channel that got past the initial handshake with the given `channel_id` is in the
18183     * process of closure. This includes previously opened channels, and channels that time out from not being funded.
18184     *
18185     * Note that this event is only triggered for accepted channels: if the
18186     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
18187     * rejected, no `ChannelClosed` event will be sent.
18188     *
18189     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18190     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18191     */
18192    LDKEvent_ChannelClosed,
18193    /**
18194     * Used to indicate to the user that they can abandon the funding transaction and recycle the
18195     * inputs for another purpose.
18196     *
18197     * This event is not guaranteed to be generated for channels that are closed due to a restart.
18198     */
18199    LDKEvent_DiscardFunding,
18200    /**
18201     * Indicates a request to open a new channel by a peer.
18202     *
18203     * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
18204     * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
18205     * event will _not_ be triggered if the channel is rejected.
18206     *
18207     * The event is only triggered when a new open channel request is received and the
18208     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
18209     *
18210     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18211     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
18212     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18213     */
18214    LDKEvent_OpenChannelRequest,
18215    /**
18216     * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
18217     * forward it.
18218     *
18219     * Some scenarios where this event may be sent include:
18220     * * Insufficient capacity in the outbound channel
18221     * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
18222     * * When an unknown SCID is requested for forwarding a payment.
18223     * * Expected MPP amount has already been reached
18224     * * The HTLC has timed out
18225     *
18226     * This event, however, does not get generated if an HTLC fails to meet the forwarding
18227     * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
18228     */
18229    LDKEvent_HTLCHandlingFailed,
18230    /**
18231     * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
18232     * requires confirmed external funds to be readily available to spend.
18233     *
18234     * LDK does not currently generate this event unless the
18235     * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
18236     * It is limited to the scope of channels with anchor outputs.
18237     *
18238     * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
18239     */
18240    LDKEvent_BumpTransaction,
18241    /**
18242     * Must be last for serialization purposes
18243     */
18244    LDKEvent_Sentinel,
18245 } LDKEvent_Tag;
18246
18247 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
18248    /**
18249     * The random channel_id we picked which you'll need to pass into
18250     * [`ChannelManager::funding_transaction_generated`].
18251     *
18252     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18253     */
18254    struct LDKChannelId temporary_channel_id;
18255    /**
18256     * The counterparty's node_id, which you'll need to pass back into
18257     * [`ChannelManager::funding_transaction_generated`].
18258     *
18259     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
18260     */
18261    struct LDKPublicKey counterparty_node_id;
18262    /**
18263     * The value, in satoshis, that the output should have.
18264     */
18265    uint64_t channel_value_satoshis;
18266    /**
18267     * The script which should be used in the transaction output.
18268     */
18269    struct LDKCVec_u8Z output_script;
18270    /**
18271     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18272     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18273     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18274     * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
18275     * serialized with LDK versions prior to 0.0.113.
18276     *
18277     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18278     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18279     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18280     */
18281    struct LDKU128 user_channel_id;
18282 } LDKEvent_LDKFundingGenerationReady_Body;
18283
18284 typedef struct LDKEvent_LDKPaymentClaimable_Body {
18285    /**
18286     * The node that will receive the payment after it has been claimed.
18287     * This is useful to identify payments received via [phantom nodes].
18288     * This field will always be filled in when the event was generated by LDK versions
18289     * 0.0.113 and above.
18290     *
18291     * [phantom nodes]: crate::sign::PhantomKeysManager
18292     *
18293     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18294     */
18295    struct LDKPublicKey receiver_node_id;
18296    /**
18297     * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
18298     * not stop you from registering duplicate payment hashes for inbound payments.
18299     */
18300    struct LDKThirtyTwoBytes payment_hash;
18301    /**
18302     * The fields in the onion which were received with each HTLC. Only fields which were
18303     * identical in each HTLC involved in the payment will be included here.
18304     *
18305     * Payments received on LDK versions prior to 0.0.115 will have this field unset.
18306     *
18307     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18308     */
18309    struct LDKRecipientOnionFields onion_fields;
18310    /**
18311     * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
18312     * than the invoice amount.
18313     *
18314     * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
18315     * and the previous hop took an extra fee.
18316     *
18317     * # Note
18318     * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
18319     * field, you may lose money!
18320     *
18321     * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
18322     */
18323    uint64_t amount_msat;
18324    /**
18325     * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
18326     * taken by our channel counterparty.
18327     *
18328     * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
18329     *
18330     * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
18331     */
18332    uint64_t counterparty_skimmed_fee_msat;
18333    /**
18334     * Information for claiming this received payment, based on whether the purpose of the
18335     * payment is to pay an invoice or to send a spontaneous payment.
18336     */
18337    struct LDKPaymentPurpose purpose;
18338    /**
18339     * The `channel_id` indicating over which channel we received the payment.
18340     *
18341     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18342     */
18343    struct LDKChannelId via_channel_id;
18344    /**
18345     * The `user_channel_id` indicating over which channel we received the payment.
18346     */
18347    struct LDKCOption_U128Z via_user_channel_id;
18348    /**
18349     * The block height at which this payment will be failed back and will no longer be
18350     * eligible for claiming.
18351     *
18352     * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
18353     * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
18354     *
18355     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
18356     */
18357    struct LDKCOption_u32Z claim_deadline;
18358 } LDKEvent_LDKPaymentClaimable_Body;
18359
18360 typedef struct LDKEvent_LDKPaymentClaimed_Body {
18361    /**
18362     * The node that received the payment.
18363     * This is useful to identify payments which were received via [phantom nodes].
18364     * This field will always be filled in when the event was generated by LDK versions
18365     * 0.0.113 and above.
18366     *
18367     * [phantom nodes]: crate::sign::PhantomKeysManager
18368     *
18369     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18370     */
18371    struct LDKPublicKey receiver_node_id;
18372    /**
18373     * The payment hash of the claimed payment. Note that LDK will not stop you from
18374     * registering duplicate payment hashes for inbound payments.
18375     */
18376    struct LDKThirtyTwoBytes payment_hash;
18377    /**
18378     * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
18379     * invoice amount.
18380     */
18381    uint64_t amount_msat;
18382    /**
18383     * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
18384     * spontaneous payment.
18385     */
18386    struct LDKPaymentPurpose purpose;
18387    /**
18388     * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
18389     * to LDK version 0.0.117.
18390     */
18391    struct LDKCVec_ClaimedHTLCZ htlcs;
18392    /**
18393     * The sender-intended sum total of all the MPP parts. This will be `None` for events
18394     * serialized prior to LDK version 0.0.117.
18395     */
18396    struct LDKCOption_u64Z sender_intended_total_msat;
18397 } LDKEvent_LDKPaymentClaimed_Body;
18398
18399 typedef struct LDKEvent_LDKConnectionNeeded_Body {
18400    /**
18401     * The node id for the node needing a connection.
18402     */
18403    struct LDKPublicKey node_id;
18404    /**
18405     * Sockets for connecting to the node.
18406     */
18407    struct LDKCVec_SocketAddressZ addresses;
18408 } LDKEvent_LDKConnectionNeeded_Body;
18409
18410 typedef struct LDKEvent_LDKInvoiceRequestFailed_Body {
18411    /**
18412     * The `payment_id` to have been associated with payment for the requested invoice.
18413     */
18414    struct LDKThirtyTwoBytes payment_id;
18415 } LDKEvent_LDKInvoiceRequestFailed_Body;
18416
18417 typedef struct LDKEvent_LDKPaymentSent_Body {
18418    /**
18419     * The `payment_id` passed to [`ChannelManager::send_payment`].
18420     *
18421     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18422     */
18423    struct LDKCOption_ThirtyTwoBytesZ payment_id;
18424    /**
18425     * The preimage to the hash given to ChannelManager::send_payment.
18426     * Note that this serves as a payment receipt, if you wish to have such a thing, you must
18427     * store it somehow!
18428     */
18429    struct LDKThirtyTwoBytes payment_preimage;
18430    /**
18431     * The hash that was given to [`ChannelManager::send_payment`].
18432     *
18433     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18434     */
18435    struct LDKThirtyTwoBytes payment_hash;
18436    /**
18437     * The total fee which was spent at intermediate hops in this payment, across all paths.
18438     *
18439     * Note that, like [`Route::get_total_fees`] this does *not* include any potential
18440     * overpayment to the recipient node.
18441     *
18442     * If the recipient or an intermediate node misbehaves and gives us free money, this may
18443     * overstate the amount paid, though this is unlikely.
18444     *
18445     * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
18446     */
18447    struct LDKCOption_u64Z fee_paid_msat;
18448 } LDKEvent_LDKPaymentSent_Body;
18449
18450 typedef struct LDKEvent_LDKPaymentFailed_Body {
18451    /**
18452     * The `payment_id` passed to [`ChannelManager::send_payment`].
18453     *
18454     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18455     */
18456    struct LDKThirtyTwoBytes payment_id;
18457    /**
18458     * The hash that was given to [`ChannelManager::send_payment`].
18459     *
18460     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18461     */
18462    struct LDKThirtyTwoBytes payment_hash;
18463    /**
18464     * The reason the payment failed. This is only `None` for events generated or serialized
18465     * by versions prior to 0.0.115.
18466     */
18467    struct LDKCOption_PaymentFailureReasonZ reason;
18468 } LDKEvent_LDKPaymentFailed_Body;
18469
18470 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
18471    /**
18472     * The `payment_id` passed to [`ChannelManager::send_payment`].
18473     *
18474     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18475     */
18476    struct LDKThirtyTwoBytes payment_id;
18477    /**
18478     * The hash that was given to [`ChannelManager::send_payment`].
18479     *
18480     * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
18481     *
18482     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18483     */
18484    struct LDKCOption_ThirtyTwoBytesZ payment_hash;
18485    /**
18486     * The payment path that was successful.
18487     *
18488     * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
18489     */
18490    struct LDKPath path;
18491 } LDKEvent_LDKPaymentPathSuccessful_Body;
18492
18493 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
18494    /**
18495     * The `payment_id` passed to [`ChannelManager::send_payment`].
18496     *
18497     * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
18498     *
18499     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18500     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
18501     */
18502    struct LDKCOption_ThirtyTwoBytesZ payment_id;
18503    /**
18504     * The hash that was given to [`ChannelManager::send_payment`].
18505     *
18506     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
18507     */
18508    struct LDKThirtyTwoBytes payment_hash;
18509    /**
18510     * Indicates the payment was rejected for some reason by the recipient. This implies that
18511     * the payment has failed, not just the route in question. If this is not set, the payment may
18512     * be retried via a different route.
18513     */
18514    bool payment_failed_permanently;
18515    /**
18516     * Extra error details based on the failure type. May contain an update that needs to be
18517     * applied to the [`NetworkGraph`].
18518     *
18519     * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
18520     */
18521    struct LDKPathFailure failure;
18522    /**
18523     * The payment path that failed.
18524     */
18525    struct LDKPath path;
18526    /**
18527     * The channel responsible for the failed payment path.
18528     *
18529     * Note that for route hints or for the first hop in a path this may be an SCID alias and
18530     * may not refer to a channel in the public network graph. These aliases may also collide
18531     * with channels in the public network graph.
18532     *
18533     * If this is `Some`, then the corresponding channel should be avoided when the payment is
18534     * retried. May be `None` for older [`Event`] serializations.
18535     */
18536    struct LDKCOption_u64Z short_channel_id;
18537 } LDKEvent_LDKPaymentPathFailed_Body;
18538
18539 typedef struct LDKEvent_LDKProbeSuccessful_Body {
18540    /**
18541     * The id returned by [`ChannelManager::send_probe`].
18542     *
18543     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18544     */
18545    struct LDKThirtyTwoBytes payment_id;
18546    /**
18547     * The hash generated by [`ChannelManager::send_probe`].
18548     *
18549     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18550     */
18551    struct LDKThirtyTwoBytes payment_hash;
18552    /**
18553     * The payment path that was successful.
18554     */
18555    struct LDKPath path;
18556 } LDKEvent_LDKProbeSuccessful_Body;
18557
18558 typedef struct LDKEvent_LDKProbeFailed_Body {
18559    /**
18560     * The id returned by [`ChannelManager::send_probe`].
18561     *
18562     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18563     */
18564    struct LDKThirtyTwoBytes payment_id;
18565    /**
18566     * The hash generated by [`ChannelManager::send_probe`].
18567     *
18568     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
18569     */
18570    struct LDKThirtyTwoBytes payment_hash;
18571    /**
18572     * The payment path that failed.
18573     */
18574    struct LDKPath path;
18575    /**
18576     * The channel responsible for the failed probe.
18577     *
18578     * Note that for route hints or for the first hop in a path this may be an SCID alias and
18579     * may not refer to a channel in the public network graph. These aliases may also collide
18580     * with channels in the public network graph.
18581     */
18582    struct LDKCOption_u64Z short_channel_id;
18583 } LDKEvent_LDKProbeFailed_Body;
18584
18585 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
18586    /**
18587     * The minimum amount of time that should be waited prior to calling
18588     * process_pending_htlc_forwards. To increase the effort required to correlate payments,
18589     * you should wait a random amount of time in roughly the range (now + time_forwardable,
18590     * now + 5*time_forwardable).
18591     */
18592    uint64_t time_forwardable;
18593 } LDKEvent_LDKPendingHTLCsForwardable_Body;
18594
18595 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
18596    /**
18597     * An id to help LDK identify which HTLC is being forwarded or failed.
18598     */
18599    struct LDKThirtyTwoBytes intercept_id;
18600    /**
18601     * The fake scid that was programmed as the next hop's scid, generated using
18602     * [`ChannelManager::get_intercept_scid`].
18603     *
18604     * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
18605     */
18606    uint64_t requested_next_hop_scid;
18607    /**
18608     * The payment hash used for this HTLC.
18609     */
18610    struct LDKThirtyTwoBytes payment_hash;
18611    /**
18612     * How many msats were received on the inbound edge of this HTLC.
18613     */
18614    uint64_t inbound_amount_msat;
18615    /**
18616     * How many msats the payer intended to route to the next node. Depending on the reason you are
18617     * intercepting this payment, you might take a fee by forwarding less than this amount.
18618     * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
18619     *
18620     * Note that LDK will NOT check that expected fees were factored into this value. You MUST
18621     * check that whatever fee you want has been included here or subtract it as required. Further,
18622     * LDK will not stop you from forwarding more than you received.
18623     */
18624    uint64_t expected_outbound_amount_msat;
18625 } LDKEvent_LDKHTLCIntercepted_Body;
18626
18627 typedef struct LDKEvent_LDKSpendableOutputs_Body {
18628    /**
18629     * The outputs which you should store as spendable by you.
18630     */
18631    struct LDKCVec_SpendableOutputDescriptorZ outputs;
18632    /**
18633     * The `channel_id` indicating which channel the spendable outputs belong to.
18634     *
18635     * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
18636     *
18637     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18638     */
18639    struct LDKChannelId channel_id;
18640 } LDKEvent_LDKSpendableOutputs_Body;
18641
18642 typedef struct LDKEvent_LDKPaymentForwarded_Body {
18643    /**
18644     * The channel id of the incoming channel between the previous node and us.
18645     *
18646     * This is only `None` for events generated or serialized by versions prior to 0.0.107.
18647     *
18648     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18649     */
18650    struct LDKChannelId prev_channel_id;
18651    /**
18652     * The channel id of the outgoing channel between the next node and us.
18653     *
18654     * This is only `None` for events generated or serialized by versions prior to 0.0.107.
18655     *
18656     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18657     */
18658    struct LDKChannelId next_channel_id;
18659    /**
18660     * The `user_channel_id` of the incoming channel between the previous node and us.
18661     *
18662     * This is only `None` for events generated or serialized by versions prior to 0.0.122.
18663     */
18664    struct LDKCOption_U128Z prev_user_channel_id;
18665    /**
18666     * The `user_channel_id` of the outgoing channel between the next node and us.
18667     *
18668     * This will be `None` if the payment was settled via an on-chain transaction. See the
18669     * caveat described for the `total_fee_earned_msat` field. Moreover it will be `None` for
18670     * events generated or serialized by versions prior to 0.0.122.
18671     */
18672    struct LDKCOption_U128Z next_user_channel_id;
18673    /**
18674     * The total fee, in milli-satoshis, which was earned as a result of the payment.
18675     *
18676     * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
18677     * was pending, the amount the next hop claimed will have been rounded down to the nearest
18678     * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
18679     * claimed the full value in millisatoshis from the source. In this case,
18680     * `claim_from_onchain_tx` will be set.
18681     *
18682     * If the channel which sent us the payment has been force-closed, we will claim the funds
18683     * via an on-chain transaction. In that case we do not yet know the on-chain transaction
18684     * fees which we will spend and will instead set this to `None`. It is possible duplicate
18685     * `PaymentForwarded` events are generated for the same payment iff `total_fee_earned_msat` is
18686     * `None`.
18687     */
18688    struct LDKCOption_u64Z total_fee_earned_msat;
18689    /**
18690     * The share of the total fee, in milli-satoshis, which was withheld in addition to the
18691     * forwarding fee.
18692     *
18693     * This will only be `Some` if we forwarded an intercepted HTLC with less than the
18694     * expected amount. This means our counterparty accepted to receive less than the invoice
18695     * amount, e.g., by claiming the payment featuring a corresponding
18696     * [`PaymentClaimable::counterparty_skimmed_fee_msat`].
18697     *
18698     * Will also always be `None` for events serialized with LDK prior to version 0.0.122.
18699     *
18700     * The caveat described above the `total_fee_earned_msat` field applies here as well.
18701     *
18702     * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: Self::PaymentClaimable::counterparty_skimmed_fee_msat
18703     */
18704    struct LDKCOption_u64Z skimmed_fee_msat;
18705    /**
18706     * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
18707     * transaction.
18708     */
18709    bool claim_from_onchain_tx;
18710    /**
18711     * The final amount forwarded, in milli-satoshis, after the fee is deducted.
18712     *
18713     * The caveat described above the `total_fee_earned_msat` field applies here as well.
18714     */
18715    struct LDKCOption_u64Z outbound_amount_forwarded_msat;
18716 } LDKEvent_LDKPaymentForwarded_Body;
18717
18718 typedef struct LDKEvent_LDKChannelPending_Body {
18719    /**
18720     * The `channel_id` of the channel that is pending confirmation.
18721     */
18722    struct LDKChannelId channel_id;
18723    /**
18724     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18725     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18726     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18727     * `user_channel_id` will be randomized for an inbound channel.
18728     *
18729     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18730     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18731     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18732     */
18733    struct LDKU128 user_channel_id;
18734    /**
18735     * The `temporary_channel_id` this channel used to be known by during channel establishment.
18736     *
18737     * Will be `None` for channels created prior to LDK version 0.0.115.
18738     *
18739     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18740     */
18741    struct LDKChannelId former_temporary_channel_id;
18742    /**
18743     * The `node_id` of the channel counterparty.
18744     */
18745    struct LDKPublicKey counterparty_node_id;
18746    /**
18747     * The outpoint of the channel's funding transaction.
18748     */
18749    struct LDKOutPoint funding_txo;
18750    /**
18751     * The features that this channel will operate with.
18752     *
18753     * Will be `None` for channels created prior to LDK version 0.0.122.
18754     *
18755     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18756     */
18757    struct LDKChannelTypeFeatures channel_type;
18758 } LDKEvent_LDKChannelPending_Body;
18759
18760 typedef struct LDKEvent_LDKChannelReady_Body {
18761    /**
18762     * The `channel_id` of the channel that is ready.
18763     */
18764    struct LDKChannelId channel_id;
18765    /**
18766     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18767     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18768     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18769     * `user_channel_id` will be randomized for an inbound channel.
18770     *
18771     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18772     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18773     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18774     */
18775    struct LDKU128 user_channel_id;
18776    /**
18777     * The `node_id` of the channel counterparty.
18778     */
18779    struct LDKPublicKey counterparty_node_id;
18780    /**
18781     * The features that this channel will operate with.
18782     */
18783    struct LDKChannelTypeFeatures channel_type;
18784 } LDKEvent_LDKChannelReady_Body;
18785
18786 typedef struct LDKEvent_LDKChannelClosed_Body {
18787    /**
18788     * The `channel_id` of the channel which has been closed. Note that on-chain transactions
18789     * resolving the channel are likely still awaiting confirmation.
18790     */
18791    struct LDKChannelId channel_id;
18792    /**
18793     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
18794     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
18795     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
18796     * `user_channel_id` will be randomized for inbound channels.
18797     * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
18798     * zero for objects serialized with LDK versions prior to 0.0.102.
18799     *
18800     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
18801     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18802     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
18803     */
18804    struct LDKU128 user_channel_id;
18805    /**
18806     * The reason the channel was closed.
18807     */
18808    struct LDKClosureReason reason;
18809    /**
18810     * Counterparty in the closed channel.
18811     *
18812     * This field will be `None` for objects serialized prior to LDK 0.0.117.
18813     *
18814     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18815     */
18816    struct LDKPublicKey counterparty_node_id;
18817    /**
18818     * Channel capacity of the closing channel (sats).
18819     *
18820     * This field will be `None` for objects serialized prior to LDK 0.0.117.
18821     */
18822    struct LDKCOption_u64Z channel_capacity_sats;
18823    /**
18824     * The original channel funding TXO; this helps checking for the existence and confirmation
18825     * status of the closing tx.
18826     * Note that for instances serialized in v0.0.119 or prior this will be missing (None).
18827     *
18828     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18829     */
18830    struct LDKOutPoint channel_funding_txo;
18831 } LDKEvent_LDKChannelClosed_Body;
18832
18833 typedef struct LDKEvent_LDKDiscardFunding_Body {
18834    /**
18835     * The channel_id of the channel which has been closed.
18836     */
18837    struct LDKChannelId channel_id;
18838    /**
18839     * The full transaction received from the user
18840     */
18841    struct LDKTransaction transaction;
18842 } LDKEvent_LDKDiscardFunding_Body;
18843
18844 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
18845    /**
18846     * The temporary channel ID of the channel requested to be opened.
18847     *
18848     * When responding to the request, the `temporary_channel_id` should be passed
18849     * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
18850     * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
18851     *
18852     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18853     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
18854     */
18855    struct LDKChannelId temporary_channel_id;
18856    /**
18857     * The node_id of the counterparty requesting to open the channel.
18858     *
18859     * When responding to the request, the `counterparty_node_id` should be passed
18860     * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
18861     * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
18862     * request.
18863     *
18864     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18865     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
18866     */
18867    struct LDKPublicKey counterparty_node_id;
18868    /**
18869     * The channel value of the requested channel.
18870     */
18871    uint64_t funding_satoshis;
18872    /**
18873     * Our starting balance in the channel if the request is accepted, in milli-satoshi.
18874     */
18875    uint64_t push_msat;
18876    /**
18877     * The features that this channel will operate with. If you reject the channel, a
18878     * well-behaved counterparty may automatically re-attempt the channel with a new set of
18879     * feature flags.
18880     *
18881     * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
18882     * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
18883     * 0.0.106.
18884     *
18885     * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
18886     * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
18887     * 0.0.107. Channels setting this type also need to get manually accepted via
18888     * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
18889     * or will be rejected otherwise.
18890     *
18891     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18892     */
18893    struct LDKChannelTypeFeatures channel_type;
18894 } LDKEvent_LDKOpenChannelRequest_Body;
18895
18896 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
18897    /**
18898     * The channel over which the HTLC was received.
18899     */
18900    struct LDKChannelId prev_channel_id;
18901    /**
18902     * Destination of the HTLC that failed to be processed.
18903     */
18904    struct LDKHTLCDestination failed_next_destination;
18905 } LDKEvent_LDKHTLCHandlingFailed_Body;
18906
18907 typedef struct MUST_USE_STRUCT LDKEvent {
18908    LDKEvent_Tag tag;
18909    union {
18910       LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
18911       LDKEvent_LDKPaymentClaimable_Body payment_claimable;
18912       LDKEvent_LDKPaymentClaimed_Body payment_claimed;
18913       LDKEvent_LDKConnectionNeeded_Body connection_needed;
18914       LDKEvent_LDKInvoiceRequestFailed_Body invoice_request_failed;
18915       LDKEvent_LDKPaymentSent_Body payment_sent;
18916       LDKEvent_LDKPaymentFailed_Body payment_failed;
18917       LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
18918       LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
18919       LDKEvent_LDKProbeSuccessful_Body probe_successful;
18920       LDKEvent_LDKProbeFailed_Body probe_failed;
18921       LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
18922       LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
18923       LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
18924       LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
18925       LDKEvent_LDKChannelPending_Body channel_pending;
18926       LDKEvent_LDKChannelReady_Body channel_ready;
18927       LDKEvent_LDKChannelClosed_Body channel_closed;
18928       LDKEvent_LDKDiscardFunding_Body discard_funding;
18929       LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
18930       LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
18931       struct {
18932          struct LDKBumpTransactionEvent bump_transaction;
18933       };
18934    };
18935 } LDKEvent;
18936
18937 /**
18938  * An enum which can either contain a crate::lightning::events::Event or not
18939  */
18940 typedef enum LDKCOption_EventZ_Tag {
18941    /**
18942     * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
18943     */
18944    LDKCOption_EventZ_Some,
18945    /**
18946     * When we're in this state, this COption_EventZ contains nothing
18947     */
18948    LDKCOption_EventZ_None,
18949    /**
18950     * Must be last for serialization purposes
18951     */
18952    LDKCOption_EventZ_Sentinel,
18953 } LDKCOption_EventZ_Tag;
18954
18955 typedef struct LDKCOption_EventZ {
18956    LDKCOption_EventZ_Tag tag;
18957    union {
18958       struct {
18959          struct LDKEvent some;
18960       };
18961    };
18962 } LDKCOption_EventZ;
18963
18964 /**
18965  * The contents of CResult_COption_EventZDecodeErrorZ
18966  */
18967 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
18968    /**
18969     * A pointer to the contents in the success state.
18970     * Reading from this pointer when `result_ok` is not set is undefined.
18971     */
18972    struct LDKCOption_EventZ *result;
18973    /**
18974     * A pointer to the contents in the error state.
18975     * Reading from this pointer when `result_ok` is set is undefined.
18976     */
18977    struct LDKDecodeError *err;
18978 } LDKCResult_COption_EventZDecodeErrorZPtr;
18979
18980 /**
18981  * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
18982  * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
18983  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18984  */
18985 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
18986    /**
18987     * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
18988     * `err` or `result` depending on the state of `result_ok`.
18989     */
18990    union LDKCResult_COption_EventZDecodeErrorZPtr contents;
18991    /**
18992     * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
18993     */
18994    bool result_ok;
18995 } LDKCResult_COption_EventZDecodeErrorZ;
18996
18997 /**
18998  * Sub-errors which don't have specific information in them use this type.
18999  */
19000 typedef struct LDKError {
19001    /**
19002     * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
19003     */
19004    uint8_t _dummy;
19005 } LDKError;
19006
19007 /**
19008  * Errors that indicate what is wrong with the invoice. They have some granularity for debug
19009  * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
19010  */
19011 typedef enum LDKBolt11ParseError_Tag {
19012    LDKBolt11ParseError_Bech32Error,
19013    LDKBolt11ParseError_ParseAmountError,
19014    LDKBolt11ParseError_MalformedSignature,
19015    LDKBolt11ParseError_BadPrefix,
19016    LDKBolt11ParseError_UnknownCurrency,
19017    LDKBolt11ParseError_UnknownSiPrefix,
19018    LDKBolt11ParseError_MalformedHRP,
19019    LDKBolt11ParseError_TooShortDataPart,
19020    LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
19021    LDKBolt11ParseError_DescriptionDecodeError,
19022    LDKBolt11ParseError_PaddingError,
19023    LDKBolt11ParseError_IntegerOverflowError,
19024    LDKBolt11ParseError_InvalidSegWitProgramLength,
19025    LDKBolt11ParseError_InvalidPubKeyHashLength,
19026    LDKBolt11ParseError_InvalidScriptHashLength,
19027    LDKBolt11ParseError_InvalidRecoveryId,
19028    LDKBolt11ParseError_InvalidSliceLength,
19029    /**
19030     * Not an error, but used internally to signal that a part of the invoice should be ignored
19031     * according to BOLT11
19032     */
19033    LDKBolt11ParseError_Skip,
19034    /**
19035     * Must be last for serialization purposes
19036     */
19037    LDKBolt11ParseError_Sentinel,
19038 } LDKBolt11ParseError_Tag;
19039
19040 typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
19041    LDKBolt11ParseError_Tag tag;
19042    union {
19043       struct {
19044          struct LDKBech32Error bech32_error;
19045       };
19046       struct {
19047          struct LDKError parse_amount_error;
19048       };
19049       struct {
19050          enum LDKSecp256k1Error malformed_signature;
19051       };
19052       struct {
19053          struct LDKError description_decode_error;
19054       };
19055       struct {
19056          struct LDKStr invalid_slice_length;
19057       };
19058    };
19059 } LDKBolt11ParseError;
19060
19061 /**
19062  * The contents of CResult_SiPrefixBolt11ParseErrorZ
19063  */
19064 typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
19065    /**
19066     * A pointer to the contents in the success state.
19067     * Reading from this pointer when `result_ok` is not set is undefined.
19068     */
19069    enum LDKSiPrefix *result;
19070    /**
19071     * A pointer to the contents in the error state.
19072     * Reading from this pointer when `result_ok` is set is undefined.
19073     */
19074    struct LDKBolt11ParseError *err;
19075 } LDKCResult_SiPrefixBolt11ParseErrorZPtr;
19076
19077 /**
19078  * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
19079  * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
19080  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19081  */
19082 typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
19083    /**
19084     * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
19085     * `err` or `result` depending on the state of `result_ok`.
19086     */
19087    union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
19088    /**
19089     * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
19090     */
19091    bool result_ok;
19092 } LDKCResult_SiPrefixBolt11ParseErrorZ;
19093
19094 /**
19095  * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
19096  * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
19097  * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
19098  */
19099 typedef enum LDKParseOrSemanticError_Tag {
19100    /**
19101     * The invoice couldn't be decoded
19102     */
19103    LDKParseOrSemanticError_ParseError,
19104    /**
19105     * The invoice could be decoded but violates the BOLT11 standard
19106     */
19107    LDKParseOrSemanticError_SemanticError,
19108    /**
19109     * Must be last for serialization purposes
19110     */
19111    LDKParseOrSemanticError_Sentinel,
19112 } LDKParseOrSemanticError_Tag;
19113
19114 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
19115    LDKParseOrSemanticError_Tag tag;
19116    union {
19117       struct {
19118          struct LDKBolt11ParseError parse_error;
19119       };
19120       struct {
19121          enum LDKBolt11SemanticError semantic_error;
19122       };
19123    };
19124 } LDKParseOrSemanticError;
19125
19126 /**
19127  * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
19128  */
19129 typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
19130    /**
19131     * A pointer to the contents in the success state.
19132     * Reading from this pointer when `result_ok` is not set is undefined.
19133     */
19134    struct LDKBolt11Invoice *result;
19135    /**
19136     * A pointer to the contents in the error state.
19137     * Reading from this pointer when `result_ok` is set is undefined.
19138     */
19139    struct LDKParseOrSemanticError *err;
19140 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
19141
19142 /**
19143  * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
19144  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
19145  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19146  */
19147 typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
19148    /**
19149     * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
19150     * `err` or `result` depending on the state of `result_ok`.
19151     */
19152    union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
19153    /**
19154     * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
19155     */
19156    bool result_ok;
19157 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
19158
19159
19160
19161 /**
19162  * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
19163  * invalid.
19164  *
19165  * # Invariants
19166  * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
19167  */
19168 typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
19169    /**
19170     * A pointer to the opaque Rust object.
19171     * Nearly everywhere, inner must be non-null, however in places where
19172     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19173     */
19174    LDKnativeSignedRawBolt11Invoice *inner;
19175    /**
19176     * Indicates that this is the only struct which contains the same pointer.
19177     * Rust functions which take ownership of an object provided via an argument require
19178     * this to be true and invalidate the object pointed to by inner.
19179     */
19180    bool is_owned;
19181 } LDKSignedRawBolt11Invoice;
19182
19183 /**
19184  * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
19185  */
19186 typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
19187    /**
19188     * A pointer to the contents in the success state.
19189     * Reading from this pointer when `result_ok` is not set is undefined.
19190     */
19191    struct LDKSignedRawBolt11Invoice *result;
19192    /**
19193     * A pointer to the contents in the error state.
19194     * Reading from this pointer when `result_ok` is set is undefined.
19195     */
19196    struct LDKBolt11ParseError *err;
19197 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
19198
19199 /**
19200  * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
19201  * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
19202  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19203  */
19204 typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
19205    /**
19206     * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
19207     * `err` or `result` depending on the state of `result_ok`.
19208     */
19209    union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
19210    /**
19211     * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
19212     */
19213    bool result_ok;
19214 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
19215
19216
19217
19218 /**
19219  * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
19220  * but without the signature information.
19221  * Decoding and encoding should not lead to information loss but may lead to different hashes.
19222  *
19223  * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
19224  */
19225 typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
19226    /**
19227     * A pointer to the opaque Rust object.
19228     * Nearly everywhere, inner must be non-null, however in places where
19229     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19230     */
19231    LDKnativeRawBolt11Invoice *inner;
19232    /**
19233     * Indicates that this is the only struct which contains the same pointer.
19234     * Rust functions which take ownership of an object provided via an argument require
19235     * this to be true and invalidate the object pointed to by inner.
19236     */
19237    bool is_owned;
19238 } LDKRawBolt11Invoice;
19239
19240
19241
19242 /**
19243  * Recoverable signature
19244  */
19245 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
19246    /**
19247     * A pointer to the opaque Rust object.
19248     * Nearly everywhere, inner must be non-null, however in places where
19249     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19250     */
19251    LDKnativeBolt11InvoiceSignature *inner;
19252    /**
19253     * Indicates that this is the only struct which contains the same pointer.
19254     * Rust functions which take ownership of an object provided via an argument require
19255     * this to be true and invalidate the object pointed to by inner.
19256     */
19257    bool is_owned;
19258 } LDKBolt11InvoiceSignature;
19259
19260 /**
19261  * A tuple of 3 elements. See the individual fields for the types contained.
19262  */
19263 typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
19264    /**
19265     * The element at position 0
19266     */
19267    struct LDKRawBolt11Invoice a;
19268    /**
19269     * The element at position 1
19270     */
19271    struct LDKThirtyTwoBytes b;
19272    /**
19273     * The element at position 2
19274     */
19275    struct LDKBolt11InvoiceSignature c;
19276 } LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
19277
19278
19279
19280 /**
19281  * Payee public key
19282  */
19283 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
19284    /**
19285     * A pointer to the opaque Rust object.
19286     * Nearly everywhere, inner must be non-null, however in places where
19287     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19288     */
19289    LDKnativePayeePubKey *inner;
19290    /**
19291     * Indicates that this is the only struct which contains the same pointer.
19292     * Rust functions which take ownership of an object provided via an argument require
19293     * this to be true and invalidate the object pointed to by inner.
19294     */
19295    bool is_owned;
19296 } LDKPayeePubKey;
19297
19298 /**
19299  * The contents of CResult_PayeePubKeySecp256k1ErrorZ
19300  */
19301 typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
19302    /**
19303     * A pointer to the contents in the success state.
19304     * Reading from this pointer when `result_ok` is not set is undefined.
19305     */
19306    struct LDKPayeePubKey *result;
19307    /**
19308     * A pointer to the contents in the error state.
19309     * Reading from this pointer when `result_ok` is set is undefined.
19310     */
19311    enum LDKSecp256k1Error *err;
19312 } LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
19313
19314 /**
19315  * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
19316  * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
19317  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19318  */
19319 typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
19320    /**
19321     * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
19322     * `err` or `result` depending on the state of `result_ok`.
19323     */
19324    union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
19325    /**
19326     * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
19327     */
19328    bool result_ok;
19329 } LDKCResult_PayeePubKeySecp256k1ErrorZ;
19330
19331
19332
19333 /**
19334  * Private routing information
19335  *
19336  * # Invariants
19337  * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
19338  *
19339  */
19340 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
19341    /**
19342     * A pointer to the opaque Rust object.
19343     * Nearly everywhere, inner must be non-null, however in places where
19344     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19345     */
19346    LDKnativePrivateRoute *inner;
19347    /**
19348     * Indicates that this is the only struct which contains the same pointer.
19349     * Rust functions which take ownership of an object provided via an argument require
19350     * this to be true and invalidate the object pointed to by inner.
19351     */
19352    bool is_owned;
19353 } LDKPrivateRoute;
19354
19355 /**
19356  * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
19357  * This corresponds to std::vector in C++
19358  */
19359 typedef struct LDKCVec_PrivateRouteZ {
19360    /**
19361     * The elements in the array.
19362     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
19363     */
19364    struct LDKPrivateRoute *data;
19365    /**
19366     * The number of elements pointed to by `data`.
19367     */
19368    uintptr_t datalen;
19369 } LDKCVec_PrivateRouteZ;
19370
19371
19372
19373 /**
19374  * A timestamp that refers to a date after 1 January 1970.
19375  *
19376  * # Invariants
19377  *
19378  * The Unix timestamp representing the stored time has to be positive and no greater than
19379  * [`MAX_TIMESTAMP`].
19380  */
19381 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
19382    /**
19383     * A pointer to the opaque Rust object.
19384     * Nearly everywhere, inner must be non-null, however in places where
19385     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19386     */
19387    LDKnativePositiveTimestamp *inner;
19388    /**
19389     * Indicates that this is the only struct which contains the same pointer.
19390     * Rust functions which take ownership of an object provided via an argument require
19391     * this to be true and invalidate the object pointed to by inner.
19392     */
19393    bool is_owned;
19394 } LDKPositiveTimestamp;
19395
19396 /**
19397  * The contents of CResult_PositiveTimestampCreationErrorZ
19398  */
19399 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
19400    /**
19401     * A pointer to the contents in the success state.
19402     * Reading from this pointer when `result_ok` is not set is undefined.
19403     */
19404    struct LDKPositiveTimestamp *result;
19405    /**
19406     * A pointer to the contents in the error state.
19407     * Reading from this pointer when `result_ok` is set is undefined.
19408     */
19409    enum LDKCreationError *err;
19410 } LDKCResult_PositiveTimestampCreationErrorZPtr;
19411
19412 /**
19413  * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
19414  * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
19415  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19416  */
19417 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
19418    /**
19419     * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
19420     * `err` or `result` depending on the state of `result_ok`.
19421     */
19422    union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
19423    /**
19424     * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
19425     */
19426    bool result_ok;
19427 } LDKCResult_PositiveTimestampCreationErrorZ;
19428
19429 /**
19430  * The contents of CResult_NoneBolt11SemanticErrorZ
19431  */
19432 typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
19433    /**
19434     * Note that this value is always NULL, as there are no contents in the OK variant
19435     */
19436    void *result;
19437    /**
19438     * A pointer to the contents in the error state.
19439     * Reading from this pointer when `result_ok` is set is undefined.
19440     */
19441    enum LDKBolt11SemanticError *err;
19442 } LDKCResult_NoneBolt11SemanticErrorZPtr;
19443
19444 /**
19445  * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
19446  * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
19447  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19448  */
19449 typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
19450    /**
19451     * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
19452     * `err` or `result` depending on the state of `result_ok`.
19453     */
19454    union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
19455    /**
19456     * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
19457     */
19458    bool result_ok;
19459 } LDKCResult_NoneBolt11SemanticErrorZ;
19460
19461 /**
19462  * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
19463  */
19464 typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
19465    /**
19466     * A pointer to the contents in the success state.
19467     * Reading from this pointer when `result_ok` is not set is undefined.
19468     */
19469    struct LDKBolt11Invoice *result;
19470    /**
19471     * A pointer to the contents in the error state.
19472     * Reading from this pointer when `result_ok` is set is undefined.
19473     */
19474    enum LDKBolt11SemanticError *err;
19475 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
19476
19477 /**
19478  * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
19479  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
19480  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19481  */
19482 typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
19483    /**
19484     * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
19485     * `err` or `result` depending on the state of `result_ok`.
19486     */
19487    union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
19488    /**
19489     * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
19490     */
19491    bool result_ok;
19492 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
19493
19494
19495
19496 /**
19497  * Description string
19498  *
19499  * # Invariants
19500  * The description can be at most 639 __bytes__ long
19501  */
19502 typedef struct MUST_USE_STRUCT LDKDescription {
19503    /**
19504     * A pointer to the opaque Rust object.
19505     * Nearly everywhere, inner must be non-null, however in places where
19506     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19507     */
19508    LDKnativeDescription *inner;
19509    /**
19510     * Indicates that this is the only struct which contains the same pointer.
19511     * Rust functions which take ownership of an object provided via an argument require
19512     * this to be true and invalidate the object pointed to by inner.
19513     */
19514    bool is_owned;
19515 } LDKDescription;
19516
19517 /**
19518  * The contents of CResult_DescriptionCreationErrorZ
19519  */
19520 typedef union LDKCResult_DescriptionCreationErrorZPtr {
19521    /**
19522     * A pointer to the contents in the success state.
19523     * Reading from this pointer when `result_ok` is not set is undefined.
19524     */
19525    struct LDKDescription *result;
19526    /**
19527     * A pointer to the contents in the error state.
19528     * Reading from this pointer when `result_ok` is set is undefined.
19529     */
19530    enum LDKCreationError *err;
19531 } LDKCResult_DescriptionCreationErrorZPtr;
19532
19533 /**
19534  * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
19535  * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
19536  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19537  */
19538 typedef struct LDKCResult_DescriptionCreationErrorZ {
19539    /**
19540     * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
19541     * `err` or `result` depending on the state of `result_ok`.
19542     */
19543    union LDKCResult_DescriptionCreationErrorZPtr contents;
19544    /**
19545     * Whether this CResult_DescriptionCreationErrorZ represents a success state.
19546     */
19547    bool result_ok;
19548 } LDKCResult_DescriptionCreationErrorZ;
19549
19550 /**
19551  * The contents of CResult_PrivateRouteCreationErrorZ
19552  */
19553 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
19554    /**
19555     * A pointer to the contents in the success state.
19556     * Reading from this pointer when `result_ok` is not set is undefined.
19557     */
19558    struct LDKPrivateRoute *result;
19559    /**
19560     * A pointer to the contents in the error state.
19561     * Reading from this pointer when `result_ok` is set is undefined.
19562     */
19563    enum LDKCreationError *err;
19564 } LDKCResult_PrivateRouteCreationErrorZPtr;
19565
19566 /**
19567  * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
19568  * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
19569  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19570  */
19571 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
19572    /**
19573     * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
19574     * `err` or `result` depending on the state of `result_ok`.
19575     */
19576    union LDKCResult_PrivateRouteCreationErrorZPtr contents;
19577    /**
19578     * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
19579     */
19580    bool result_ok;
19581 } LDKCResult_PrivateRouteCreationErrorZ;
19582
19583 /**
19584  * The contents of CResult_OutPointDecodeErrorZ
19585  */
19586 typedef union LDKCResult_OutPointDecodeErrorZPtr {
19587    /**
19588     * A pointer to the contents in the success state.
19589     * Reading from this pointer when `result_ok` is not set is undefined.
19590     */
19591    struct LDKOutPoint *result;
19592    /**
19593     * A pointer to the contents in the error state.
19594     * Reading from this pointer when `result_ok` is set is undefined.
19595     */
19596    struct LDKDecodeError *err;
19597 } LDKCResult_OutPointDecodeErrorZPtr;
19598
19599 /**
19600  * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
19601  * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
19602  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19603  */
19604 typedef struct LDKCResult_OutPointDecodeErrorZ {
19605    /**
19606     * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
19607     * `err` or `result` depending on the state of `result_ok`.
19608     */
19609    union LDKCResult_OutPointDecodeErrorZPtr contents;
19610    /**
19611     * Whether this CResult_OutPointDecodeErrorZ represents a success state.
19612     */
19613    bool result_ok;
19614 } LDKCResult_OutPointDecodeErrorZ;
19615
19616
19617
19618 /**
19619  * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
19620  * variable-length integers except that it is serialized in big-endian instead of little-endian.
19621  *
19622  * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
19623  * encoded in several different ways, which we must check for at deserialization-time. Thus, if
19624  * you're looking for an example of a variable-length integer to use for your own project, move
19625  * along, this is a rather poor design.
19626  */
19627 typedef struct MUST_USE_STRUCT LDKBigSize {
19628    /**
19629     * A pointer to the opaque Rust object.
19630     * Nearly everywhere, inner must be non-null, however in places where
19631     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19632     */
19633    LDKnativeBigSize *inner;
19634    /**
19635     * Indicates that this is the only struct which contains the same pointer.
19636     * Rust functions which take ownership of an object provided via an argument require
19637     * this to be true and invalidate the object pointed to by inner.
19638     */
19639    bool is_owned;
19640 } LDKBigSize;
19641
19642 /**
19643  * The contents of CResult_BigSizeDecodeErrorZ
19644  */
19645 typedef union LDKCResult_BigSizeDecodeErrorZPtr {
19646    /**
19647     * A pointer to the contents in the success state.
19648     * Reading from this pointer when `result_ok` is not set is undefined.
19649     */
19650    struct LDKBigSize *result;
19651    /**
19652     * A pointer to the contents in the error state.
19653     * Reading from this pointer when `result_ok` is set is undefined.
19654     */
19655    struct LDKDecodeError *err;
19656 } LDKCResult_BigSizeDecodeErrorZPtr;
19657
19658 /**
19659  * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
19660  * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
19661  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19662  */
19663 typedef struct LDKCResult_BigSizeDecodeErrorZ {
19664    /**
19665     * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
19666     * `err` or `result` depending on the state of `result_ok`.
19667     */
19668    union LDKCResult_BigSizeDecodeErrorZPtr contents;
19669    /**
19670     * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
19671     */
19672    bool result_ok;
19673 } LDKCResult_BigSizeDecodeErrorZ;
19674
19675 /**
19676  * The contents of CResult_HostnameDecodeErrorZ
19677  */
19678 typedef union LDKCResult_HostnameDecodeErrorZPtr {
19679    /**
19680     * A pointer to the contents in the success state.
19681     * Reading from this pointer when `result_ok` is not set is undefined.
19682     */
19683    struct LDKHostname *result;
19684    /**
19685     * A pointer to the contents in the error state.
19686     * Reading from this pointer when `result_ok` is set is undefined.
19687     */
19688    struct LDKDecodeError *err;
19689 } LDKCResult_HostnameDecodeErrorZPtr;
19690
19691 /**
19692  * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
19693  * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
19694  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19695  */
19696 typedef struct LDKCResult_HostnameDecodeErrorZ {
19697    /**
19698     * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
19699     * `err` or `result` depending on the state of `result_ok`.
19700     */
19701    union LDKCResult_HostnameDecodeErrorZPtr contents;
19702    /**
19703     * Whether this CResult_HostnameDecodeErrorZ represents a success state.
19704     */
19705    bool result_ok;
19706 } LDKCResult_HostnameDecodeErrorZ;
19707
19708
19709
19710 /**
19711  * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
19712  * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
19713  *
19714  * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
19715  */
19716 typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
19717    /**
19718     * A pointer to the opaque Rust object.
19719     * Nearly everywhere, inner must be non-null, however in places where
19720     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19721     */
19722    LDKnativeTransactionU16LenLimited *inner;
19723    /**
19724     * Indicates that this is the only struct which contains the same pointer.
19725     * Rust functions which take ownership of an object provided via an argument require
19726     * this to be true and invalidate the object pointed to by inner.
19727     */
19728    bool is_owned;
19729 } LDKTransactionU16LenLimited;
19730
19731 /**
19732  * The contents of CResult_TransactionU16LenLimitedNoneZ
19733  */
19734 typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
19735    /**
19736     * A pointer to the contents in the success state.
19737     * Reading from this pointer when `result_ok` is not set is undefined.
19738     */
19739    struct LDKTransactionU16LenLimited *result;
19740    /**
19741     * Note that this value is always NULL, as there are no contents in the Err variant
19742     */
19743    void *err;
19744 } LDKCResult_TransactionU16LenLimitedNoneZPtr;
19745
19746 /**
19747  * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
19748  * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
19749  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19750  */
19751 typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
19752    /**
19753     * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
19754     * `err` or `result` depending on the state of `result_ok`.
19755     */
19756    union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
19757    /**
19758     * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
19759     */
19760    bool result_ok;
19761 } LDKCResult_TransactionU16LenLimitedNoneZ;
19762
19763 /**
19764  * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
19765  */
19766 typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
19767    /**
19768     * A pointer to the contents in the success state.
19769     * Reading from this pointer when `result_ok` is not set is undefined.
19770     */
19771    struct LDKTransactionU16LenLimited *result;
19772    /**
19773     * A pointer to the contents in the error state.
19774     * Reading from this pointer when `result_ok` is set is undefined.
19775     */
19776    struct LDKDecodeError *err;
19777 } LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
19778
19779 /**
19780  * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
19781  * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
19782  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19783  */
19784 typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
19785    /**
19786     * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
19787     * `err` or `result` depending on the state of `result_ok`.
19788     */
19789    union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
19790    /**
19791     * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
19792     */
19793    bool result_ok;
19794 } LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
19795
19796 /**
19797  * The contents of CResult_UntrustedStringDecodeErrorZ
19798  */
19799 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
19800    /**
19801     * A pointer to the contents in the success state.
19802     * Reading from this pointer when `result_ok` is not set is undefined.
19803     */
19804    struct LDKUntrustedString *result;
19805    /**
19806     * A pointer to the contents in the error state.
19807     * Reading from this pointer when `result_ok` is set is undefined.
19808     */
19809    struct LDKDecodeError *err;
19810 } LDKCResult_UntrustedStringDecodeErrorZPtr;
19811
19812 /**
19813  * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
19814  * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
19815  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19816  */
19817 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
19818    /**
19819     * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
19820     * `err` or `result` depending on the state of `result_ok`.
19821     */
19822    union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
19823    /**
19824     * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
19825     */
19826    bool result_ok;
19827 } LDKCResult_UntrustedStringDecodeErrorZ;
19828
19829 /**
19830  * The contents of CResult_ChannelIdDecodeErrorZ
19831  */
19832 typedef union LDKCResult_ChannelIdDecodeErrorZPtr {
19833    /**
19834     * A pointer to the contents in the success state.
19835     * Reading from this pointer when `result_ok` is not set is undefined.
19836     */
19837    struct LDKChannelId *result;
19838    /**
19839     * A pointer to the contents in the error state.
19840     * Reading from this pointer when `result_ok` is set is undefined.
19841     */
19842    struct LDKDecodeError *err;
19843 } LDKCResult_ChannelIdDecodeErrorZPtr;
19844
19845 /**
19846  * A CResult_ChannelIdDecodeErrorZ represents the result of a fallible operation,
19847  * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::ln::msgs::DecodeError on failure.
19848  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19849  */
19850 typedef struct LDKCResult_ChannelIdDecodeErrorZ {
19851    /**
19852     * The contents of this CResult_ChannelIdDecodeErrorZ, accessible via either
19853     * `err` or `result` depending on the state of `result_ok`.
19854     */
19855    union LDKCResult_ChannelIdDecodeErrorZPtr contents;
19856    /**
19857     * Whether this CResult_ChannelIdDecodeErrorZ represents a success state.
19858     */
19859    bool result_ok;
19860 } LDKCResult_ChannelIdDecodeErrorZ;
19861
19862 /**
19863  * A tuple of 2 elements. See the individual fields for the types contained.
19864  */
19865 typedef struct LDKC2Tuple__u832u16Z {
19866    /**
19867     * The element at position 0
19868     */
19869    struct LDKThirtyTwoBytes a;
19870    /**
19871     * The element at position 1
19872     */
19873    uint16_t b;
19874 } LDKC2Tuple__u832u16Z;
19875
19876
19877
19878 /**
19879  * Parameters for relaying over a given [`BlindedHop`].
19880  *
19881  * [`BlindedHop`]: crate::blinded_path::BlindedHop
19882  */
19883 typedef struct MUST_USE_STRUCT LDKPaymentRelay {
19884    /**
19885     * A pointer to the opaque Rust object.
19886     * Nearly everywhere, inner must be non-null, however in places where
19887     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19888     */
19889    LDKnativePaymentRelay *inner;
19890    /**
19891     * Indicates that this is the only struct which contains the same pointer.
19892     * Rust functions which take ownership of an object provided via an argument require
19893     * this to be true and invalidate the object pointed to by inner.
19894     */
19895    bool is_owned;
19896 } LDKPaymentRelay;
19897
19898 /**
19899  * The contents of CResult_PaymentRelayDecodeErrorZ
19900  */
19901 typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
19902    /**
19903     * A pointer to the contents in the success state.
19904     * Reading from this pointer when `result_ok` is not set is undefined.
19905     */
19906    struct LDKPaymentRelay *result;
19907    /**
19908     * A pointer to the contents in the error state.
19909     * Reading from this pointer when `result_ok` is set is undefined.
19910     */
19911    struct LDKDecodeError *err;
19912 } LDKCResult_PaymentRelayDecodeErrorZPtr;
19913
19914 /**
19915  * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
19916  * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
19917  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19918  */
19919 typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
19920    /**
19921     * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
19922     * `err` or `result` depending on the state of `result_ok`.
19923     */
19924    union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
19925    /**
19926     * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
19927     */
19928    bool result_ok;
19929 } LDKCResult_PaymentRelayDecodeErrorZ;
19930
19931
19932
19933 /**
19934  * Constraints for relaying over a given [`BlindedHop`].
19935  *
19936  * [`BlindedHop`]: crate::blinded_path::BlindedHop
19937  */
19938 typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
19939    /**
19940     * A pointer to the opaque Rust object.
19941     * Nearly everywhere, inner must be non-null, however in places where
19942     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19943     */
19944    LDKnativePaymentConstraints *inner;
19945    /**
19946     * Indicates that this is the only struct which contains the same pointer.
19947     * Rust functions which take ownership of an object provided via an argument require
19948     * this to be true and invalidate the object pointed to by inner.
19949     */
19950    bool is_owned;
19951 } LDKPaymentConstraints;
19952
19953 /**
19954  * The contents of CResult_PaymentConstraintsDecodeErrorZ
19955  */
19956 typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
19957    /**
19958     * A pointer to the contents in the success state.
19959     * Reading from this pointer when `result_ok` is not set is undefined.
19960     */
19961    struct LDKPaymentConstraints *result;
19962    /**
19963     * A pointer to the contents in the error state.
19964     * Reading from this pointer when `result_ok` is set is undefined.
19965     */
19966    struct LDKDecodeError *err;
19967 } LDKCResult_PaymentConstraintsDecodeErrorZPtr;
19968
19969 /**
19970  * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
19971  * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
19972  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19973  */
19974 typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
19975    /**
19976     * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
19977     * `err` or `result` depending on the state of `result_ok`.
19978     */
19979    union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
19980    /**
19981     * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
19982     */
19983    bool result_ok;
19984 } LDKCResult_PaymentConstraintsDecodeErrorZ;
19985
19986 /**
19987  * The contents of CResult_PaymentContextDecodeErrorZ
19988  */
19989 typedef union LDKCResult_PaymentContextDecodeErrorZPtr {
19990    /**
19991     * A pointer to the contents in the success state.
19992     * Reading from this pointer when `result_ok` is not set is undefined.
19993     */
19994    struct LDKPaymentContext *result;
19995    /**
19996     * A pointer to the contents in the error state.
19997     * Reading from this pointer when `result_ok` is set is undefined.
19998     */
19999    struct LDKDecodeError *err;
20000 } LDKCResult_PaymentContextDecodeErrorZPtr;
20001
20002 /**
20003  * A CResult_PaymentContextDecodeErrorZ represents the result of a fallible operation,
20004  * containing a crate::lightning::blinded_path::payment::PaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20005  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20006  */
20007 typedef struct LDKCResult_PaymentContextDecodeErrorZ {
20008    /**
20009     * The contents of this CResult_PaymentContextDecodeErrorZ, accessible via either
20010     * `err` or `result` depending on the state of `result_ok`.
20011     */
20012    union LDKCResult_PaymentContextDecodeErrorZPtr contents;
20013    /**
20014     * Whether this CResult_PaymentContextDecodeErrorZ represents a success state.
20015     */
20016    bool result_ok;
20017 } LDKCResult_PaymentContextDecodeErrorZ;
20018
20019 /**
20020  * The contents of CResult_UnknownPaymentContextDecodeErrorZ
20021  */
20022 typedef union LDKCResult_UnknownPaymentContextDecodeErrorZPtr {
20023    /**
20024     * A pointer to the contents in the success state.
20025     * Reading from this pointer when `result_ok` is not set is undefined.
20026     */
20027    struct LDKUnknownPaymentContext *result;
20028    /**
20029     * A pointer to the contents in the error state.
20030     * Reading from this pointer when `result_ok` is set is undefined.
20031     */
20032    struct LDKDecodeError *err;
20033 } LDKCResult_UnknownPaymentContextDecodeErrorZPtr;
20034
20035 /**
20036  * A CResult_UnknownPaymentContextDecodeErrorZ represents the result of a fallible operation,
20037  * containing a crate::lightning::blinded_path::payment::UnknownPaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20038  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20039  */
20040 typedef struct LDKCResult_UnknownPaymentContextDecodeErrorZ {
20041    /**
20042     * The contents of this CResult_UnknownPaymentContextDecodeErrorZ, accessible via either
20043     * `err` or `result` depending on the state of `result_ok`.
20044     */
20045    union LDKCResult_UnknownPaymentContextDecodeErrorZPtr contents;
20046    /**
20047     * Whether this CResult_UnknownPaymentContextDecodeErrorZ represents a success state.
20048     */
20049    bool result_ok;
20050 } LDKCResult_UnknownPaymentContextDecodeErrorZ;
20051
20052 /**
20053  * The contents of CResult_Bolt12OfferContextDecodeErrorZ
20054  */
20055 typedef union LDKCResult_Bolt12OfferContextDecodeErrorZPtr {
20056    /**
20057     * A pointer to the contents in the success state.
20058     * Reading from this pointer when `result_ok` is not set is undefined.
20059     */
20060    struct LDKBolt12OfferContext *result;
20061    /**
20062     * A pointer to the contents in the error state.
20063     * Reading from this pointer when `result_ok` is set is undefined.
20064     */
20065    struct LDKDecodeError *err;
20066 } LDKCResult_Bolt12OfferContextDecodeErrorZPtr;
20067
20068 /**
20069  * A CResult_Bolt12OfferContextDecodeErrorZ represents the result of a fallible operation,
20070  * containing a crate::lightning::blinded_path::payment::Bolt12OfferContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20071  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20072  */
20073 typedef struct LDKCResult_Bolt12OfferContextDecodeErrorZ {
20074    /**
20075     * The contents of this CResult_Bolt12OfferContextDecodeErrorZ, accessible via either
20076     * `err` or `result` depending on the state of `result_ok`.
20077     */
20078    union LDKCResult_Bolt12OfferContextDecodeErrorZPtr contents;
20079    /**
20080     * Whether this CResult_Bolt12OfferContextDecodeErrorZ represents a success state.
20081     */
20082    bool result_ok;
20083 } LDKCResult_Bolt12OfferContextDecodeErrorZ;
20084
20085 /**
20086  * The contents of CResult_Bolt12RefundContextDecodeErrorZ
20087  */
20088 typedef union LDKCResult_Bolt12RefundContextDecodeErrorZPtr {
20089    /**
20090     * A pointer to the contents in the success state.
20091     * Reading from this pointer when `result_ok` is not set is undefined.
20092     */
20093    struct LDKBolt12RefundContext *result;
20094    /**
20095     * A pointer to the contents in the error state.
20096     * Reading from this pointer when `result_ok` is set is undefined.
20097     */
20098    struct LDKDecodeError *err;
20099 } LDKCResult_Bolt12RefundContextDecodeErrorZPtr;
20100
20101 /**
20102  * A CResult_Bolt12RefundContextDecodeErrorZ represents the result of a fallible operation,
20103  * containing a crate::lightning::blinded_path::payment::Bolt12RefundContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
20104  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20105  */
20106 typedef struct LDKCResult_Bolt12RefundContextDecodeErrorZ {
20107    /**
20108     * The contents of this CResult_Bolt12RefundContextDecodeErrorZ, accessible via either
20109     * `err` or `result` depending on the state of `result_ok`.
20110     */
20111    union LDKCResult_Bolt12RefundContextDecodeErrorZPtr contents;
20112    /**
20113     * Whether this CResult_Bolt12RefundContextDecodeErrorZ represents a success state.
20114     */
20115    bool result_ok;
20116 } LDKCResult_Bolt12RefundContextDecodeErrorZ;
20117
20118 /**
20119  * The contents of CResult_StrSecp256k1ErrorZ
20120  */
20121 typedef union LDKCResult_StrSecp256k1ErrorZPtr {
20122    /**
20123     * A pointer to the contents in the success state.
20124     * Reading from this pointer when `result_ok` is not set is undefined.
20125     */
20126    struct LDKStr *result;
20127    /**
20128     * A pointer to the contents in the error state.
20129     * Reading from this pointer when `result_ok` is set is undefined.
20130     */
20131    enum LDKSecp256k1Error *err;
20132 } LDKCResult_StrSecp256k1ErrorZPtr;
20133
20134 /**
20135  * A CResult_StrSecp256k1ErrorZ represents the result of a fallible operation,
20136  * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
20137  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20138  */
20139 typedef struct LDKCResult_StrSecp256k1ErrorZ {
20140    /**
20141     * The contents of this CResult_StrSecp256k1ErrorZ, accessible via either
20142     * `err` or `result` depending on the state of `result_ok`.
20143     */
20144    union LDKCResult_StrSecp256k1ErrorZPtr contents;
20145    /**
20146     * Whether this CResult_StrSecp256k1ErrorZ represents a success state.
20147     */
20148    bool result_ok;
20149 } LDKCResult_StrSecp256k1ErrorZ;
20150
20151 /**
20152  * A tuple of 3 elements. See the individual fields for the types contained.
20153  */
20154 typedef struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ {
20155    /**
20156     * The element at position 0
20157     */
20158    struct LDKThirtyTwoBytes a;
20159    /**
20160     * The element at position 1
20161     */
20162    struct LDKRecipientOnionFields b;
20163    /**
20164     * The element at position 2
20165     */
20166    struct LDKRouteParameters c;
20167 } LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ;
20168
20169 /**
20170  * The contents of CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ
20171  */
20172 typedef union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr {
20173    /**
20174     * A pointer to the contents in the success state.
20175     * Reading from this pointer when `result_ok` is not set is undefined.
20176     */
20177    struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *result;
20178    /**
20179     * Note that this value is always NULL, as there are no contents in the Err variant
20180     */
20181    void *err;
20182 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr;
20183
20184 /**
20185  * A CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents the result of a fallible operation,
20186  * containing a crate::c_types::derived::C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ on success and a () on failure.
20187  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20188  */
20189 typedef struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ {
20190    /**
20191     * The contents of this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ, accessible via either
20192     * `err` or `result` depending on the state of `result_ok`.
20193     */
20194    union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr contents;
20195    /**
20196     * Whether this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents a success state.
20197     */
20198    bool result_ok;
20199 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ;
20200
20201 /**
20202  * A tuple of 3 elements. See the individual fields for the types contained.
20203  */
20204 typedef struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ {
20205    /**
20206     * The element at position 0
20207     */
20208    struct LDKPublicKey a;
20209    /**
20210     * The element at position 1
20211     */
20212    struct LDKOnionMessage b;
20213    /**
20214     * The element at position 2
20215     */
20216    struct LDKCOption_CVec_SocketAddressZZ c;
20217 } LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ;
20218
20219 /**
20220  * Errors that may occur when [sending an onion message].
20221  *
20222  * [sending an onion message]: OnionMessenger::send_onion_message
20223  */
20224 typedef enum LDKSendError_Tag {
20225    /**
20226     * Errored computing onion message packet keys.
20227     */
20228    LDKSendError_Secp256k1,
20229    /**
20230     * Because implementations such as Eclair will drop onion messages where the message packet
20231     * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
20232     */
20233    LDKSendError_TooBigPacket,
20234    /**
20235     * The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded
20236     * hops.
20237     */
20238    LDKSendError_TooFewBlindedHops,
20239    /**
20240     * The first hop is not a peer and doesn't have a known [`SocketAddress`].
20241     */
20242    LDKSendError_InvalidFirstHop,
20243    /**
20244     * A path from the sender to the destination could not be found by the [`MessageRouter`].
20245     */
20246    LDKSendError_PathNotFound,
20247    /**
20248     * Onion message contents must have a TLV type >= 64.
20249     */
20250    LDKSendError_InvalidMessage,
20251    /**
20252     * Our next-hop peer's buffer was full or our total outbound buffer was full.
20253     */
20254    LDKSendError_BufferFull,
20255    /**
20256     * Failed to retrieve our node id from the provided [`NodeSigner`].
20257     *
20258     * [`NodeSigner`]: crate::sign::NodeSigner
20259     */
20260    LDKSendError_GetNodeIdFailed,
20261    /**
20262     * The provided [`Destination`] has a blinded path with an unresolved introduction node. An
20263     * attempt to resolve it in the [`MessageRouter`] when finding an [`OnionMessagePath`] likely
20264     * failed.
20265     */
20266    LDKSendError_UnresolvedIntroductionNode,
20267    /**
20268     * We attempted to send to a blinded path where we are the introduction node, and failed to
20269     * advance the blinded path to make the second hop the new introduction node. Either
20270     * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
20271     * new blinding point, or we were attempting to send to ourselves.
20272     */
20273    LDKSendError_BlindedPathAdvanceFailed,
20274    /**
20275     * Must be last for serialization purposes
20276     */
20277    LDKSendError_Sentinel,
20278 } LDKSendError_Tag;
20279
20280 typedef struct MUST_USE_STRUCT LDKSendError {
20281    LDKSendError_Tag tag;
20282    union {
20283       struct {
20284          enum LDKSecp256k1Error secp256k1;
20285       };
20286       struct {
20287          struct LDKPublicKey invalid_first_hop;
20288       };
20289    };
20290 } LDKSendError;
20291
20292 /**
20293  * The contents of CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ
20294  */
20295 typedef union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr {
20296    /**
20297     * A pointer to the contents in the success state.
20298     * Reading from this pointer when `result_ok` is not set is undefined.
20299     */
20300    struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *result;
20301    /**
20302     * A pointer to the contents in the error state.
20303     * Reading from this pointer when `result_ok` is set is undefined.
20304     */
20305    struct LDKSendError *err;
20306 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr;
20307
20308 /**
20309  * A CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents the result of a fallible operation,
20310  * containing a crate::c_types::derived::C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
20311  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20312  */
20313 typedef struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ {
20314    /**
20315     * The contents of this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ, accessible via either
20316     * `err` or `result` depending on the state of `result_ok`.
20317     */
20318    union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr contents;
20319    /**
20320     * Whether this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents a success state.
20321     */
20322    bool result_ok;
20323 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ;
20324
20325 /**
20326  * The next hop to forward an onion message along its path.
20327  *
20328  * Note that payment blinded paths always specify their next hop using an explicit node id.
20329  */
20330 typedef enum LDKNextMessageHop_Tag {
20331    /**
20332     * The node id of the next hop.
20333     */
20334    LDKNextMessageHop_NodeId,
20335    /**
20336     * The short channel id leading to the next hop.
20337     */
20338    LDKNextMessageHop_ShortChannelId,
20339    /**
20340     * Must be last for serialization purposes
20341     */
20342    LDKNextMessageHop_Sentinel,
20343 } LDKNextMessageHop_Tag;
20344
20345 typedef struct MUST_USE_STRUCT LDKNextMessageHop {
20346    LDKNextMessageHop_Tag tag;
20347    union {
20348       struct {
20349          struct LDKPublicKey node_id;
20350       };
20351       struct {
20352          uint64_t short_channel_id;
20353       };
20354    };
20355 } LDKNextMessageHop;
20356
20357 /**
20358  * The contents of an [`OnionMessage`] as read from the wire.
20359  *
20360  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
20361  */
20362 typedef enum LDKParsedOnionMessageContents_Tag {
20363    /**
20364     * A message related to BOLT 12 Offers.
20365     */
20366    LDKParsedOnionMessageContents_Offers,
20367    /**
20368     * A custom onion message specified by the user.
20369     */
20370    LDKParsedOnionMessageContents_Custom,
20371    /**
20372     * Must be last for serialization purposes
20373     */
20374    LDKParsedOnionMessageContents_Sentinel,
20375 } LDKParsedOnionMessageContents_Tag;
20376
20377 typedef struct MUST_USE_STRUCT LDKParsedOnionMessageContents {
20378    LDKParsedOnionMessageContents_Tag tag;
20379    union {
20380       struct {
20381          struct LDKOffersMessage offers;
20382       };
20383       struct {
20384          struct LDKOnionMessageContents custom;
20385       };
20386    };
20387 } LDKParsedOnionMessageContents;
20388
20389 /**
20390  * A processed incoming onion message, containing either a Forward (another onion message)
20391  * or a Receive payload with decrypted contents.
20392  */
20393 typedef enum LDKPeeledOnion_Tag {
20394    /**
20395     * Forwarded onion, with the next node id and a new onion
20396     */
20397    LDKPeeledOnion_Forward,
20398    /**
20399     * Received onion message, with decrypted contents, path_id, and reply path
20400     */
20401    LDKPeeledOnion_Receive,
20402    /**
20403     * Must be last for serialization purposes
20404     */
20405    LDKPeeledOnion_Sentinel,
20406 } LDKPeeledOnion_Tag;
20407
20408 typedef struct LDKPeeledOnion_LDKForward_Body {
20409    struct LDKNextMessageHop _0;
20410    struct LDKOnionMessage _1;
20411 } LDKPeeledOnion_LDKForward_Body;
20412
20413 typedef struct LDKPeeledOnion_LDKReceive_Body {
20414    struct LDKParsedOnionMessageContents _0;
20415    /**
20416     *
20417     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
20418     */
20419    struct LDKThirtyTwoBytes _1;
20420    /**
20421     *
20422     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
20423     */
20424    struct LDKBlindedPath _2;
20425 } LDKPeeledOnion_LDKReceive_Body;
20426
20427 typedef struct MUST_USE_STRUCT LDKPeeledOnion {
20428    LDKPeeledOnion_Tag tag;
20429    union {
20430       LDKPeeledOnion_LDKForward_Body forward;
20431       LDKPeeledOnion_LDKReceive_Body receive;
20432    };
20433 } LDKPeeledOnion;
20434
20435 /**
20436  * The contents of CResult_PeeledOnionNoneZ
20437  */
20438 typedef union LDKCResult_PeeledOnionNoneZPtr {
20439    /**
20440     * A pointer to the contents in the success state.
20441     * Reading from this pointer when `result_ok` is not set is undefined.
20442     */
20443    struct LDKPeeledOnion *result;
20444    /**
20445     * Note that this value is always NULL, as there are no contents in the Err variant
20446     */
20447    void *err;
20448 } LDKCResult_PeeledOnionNoneZPtr;
20449
20450 /**
20451  * A CResult_PeeledOnionNoneZ represents the result of a fallible operation,
20452  * containing a crate::lightning::onion_message::messenger::PeeledOnion on success and a () on failure.
20453  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20454  */
20455 typedef struct LDKCResult_PeeledOnionNoneZ {
20456    /**
20457     * The contents of this CResult_PeeledOnionNoneZ, accessible via either
20458     * `err` or `result` depending on the state of `result_ok`.
20459     */
20460    union LDKCResult_PeeledOnionNoneZPtr contents;
20461    /**
20462     * Whether this CResult_PeeledOnionNoneZ represents a success state.
20463     */
20464    bool result_ok;
20465 } LDKCResult_PeeledOnionNoneZ;
20466
20467 /**
20468  * Result of successfully [sending an onion message].
20469  *
20470  * [sending an onion message]: OnionMessenger::send_onion_message
20471  */
20472 typedef enum LDKSendSuccess_Tag {
20473    /**
20474     * The message was buffered and will be sent once it is processed by
20475     * [`OnionMessageHandler::next_onion_message_for_peer`].
20476     */
20477    LDKSendSuccess_Buffered,
20478    /**
20479     * The message was buffered and will be sent once the node is connected as a peer and it is
20480     * processed by [`OnionMessageHandler::next_onion_message_for_peer`].
20481     */
20482    LDKSendSuccess_BufferedAwaitingConnection,
20483    /**
20484     * Must be last for serialization purposes
20485     */
20486    LDKSendSuccess_Sentinel,
20487 } LDKSendSuccess_Tag;
20488
20489 typedef struct MUST_USE_STRUCT LDKSendSuccess {
20490    LDKSendSuccess_Tag tag;
20491    union {
20492       struct {
20493          struct LDKPublicKey buffered_awaiting_connection;
20494       };
20495    };
20496 } LDKSendSuccess;
20497
20498 /**
20499  * The contents of CResult_SendSuccessSendErrorZ
20500  */
20501 typedef union LDKCResult_SendSuccessSendErrorZPtr {
20502    /**
20503     * A pointer to the contents in the success state.
20504     * Reading from this pointer when `result_ok` is not set is undefined.
20505     */
20506    struct LDKSendSuccess *result;
20507    /**
20508     * A pointer to the contents in the error state.
20509     * Reading from this pointer when `result_ok` is set is undefined.
20510     */
20511    struct LDKSendError *err;
20512 } LDKCResult_SendSuccessSendErrorZPtr;
20513
20514 /**
20515  * A CResult_SendSuccessSendErrorZ represents the result of a fallible operation,
20516  * containing a crate::lightning::onion_message::messenger::SendSuccess on success and a crate::lightning::onion_message::messenger::SendError on failure.
20517  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20518  */
20519 typedef struct LDKCResult_SendSuccessSendErrorZ {
20520    /**
20521     * The contents of this CResult_SendSuccessSendErrorZ, accessible via either
20522     * `err` or `result` depending on the state of `result_ok`.
20523     */
20524    union LDKCResult_SendSuccessSendErrorZPtr contents;
20525    /**
20526     * Whether this CResult_SendSuccessSendErrorZ represents a success state.
20527     */
20528    bool result_ok;
20529 } LDKCResult_SendSuccessSendErrorZ;
20530
20531 /**
20532  * The contents of CResult_BlindedPathNoneZ
20533  */
20534 typedef union LDKCResult_BlindedPathNoneZPtr {
20535    /**
20536     * A pointer to the contents in the success state.
20537     * Reading from this pointer when `result_ok` is not set is undefined.
20538     */
20539    struct LDKBlindedPath *result;
20540    /**
20541     * Note that this value is always NULL, as there are no contents in the Err variant
20542     */
20543    void *err;
20544 } LDKCResult_BlindedPathNoneZPtr;
20545
20546 /**
20547  * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
20548  * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
20549  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20550  */
20551 typedef struct LDKCResult_BlindedPathNoneZ {
20552    /**
20553     * The contents of this CResult_BlindedPathNoneZ, accessible via either
20554     * `err` or `result` depending on the state of `result_ok`.
20555     */
20556    union LDKCResult_BlindedPathNoneZPtr contents;
20557    /**
20558     * Whether this CResult_BlindedPathNoneZ represents a success state.
20559     */
20560    bool result_ok;
20561 } LDKCResult_BlindedPathNoneZ;
20562
20563 /**
20564  * The contents of CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ
20565  */
20566 typedef union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr {
20567    /**
20568     * A pointer to the contents in the success state.
20569     * Reading from this pointer when `result_ok` is not set is undefined.
20570     */
20571    struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *result;
20572    /**
20573     * Note that this value is always NULL, as there are no contents in the Err variant
20574     */
20575    void *err;
20576 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr;
20577
20578 /**
20579  * A CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents the result of a fallible operation,
20580  * containing a crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZ on success and a () on failure.
20581  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20582  */
20583 typedef struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
20584    /**
20585     * The contents of this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ, accessible via either
20586     * `err` or `result` depending on the state of `result_ok`.
20587     */
20588    union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr contents;
20589    /**
20590     * Whether this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents a success state.
20591     */
20592    bool result_ok;
20593 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ;
20594
20595
20596
20597 /**
20598  * An intermediate node, its outbound channel, and relay parameters.
20599  */
20600 typedef struct MUST_USE_STRUCT LDKForwardNode {
20601    /**
20602     * A pointer to the opaque Rust object.
20603     * Nearly everywhere, inner must be non-null, however in places where
20604     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20605     */
20606    LDKnativeForwardNode *inner;
20607    /**
20608     * Indicates that this is the only struct which contains the same pointer.
20609     * Rust functions which take ownership of an object provided via an argument require
20610     * this to be true and invalidate the object pointed to by inner.
20611     */
20612    bool is_owned;
20613 } LDKForwardNode;
20614
20615 /**
20616  * A dynamically-allocated array of crate::lightning::blinded_path::payment::ForwardNodes of arbitrary size.
20617  * This corresponds to std::vector in C++
20618  */
20619 typedef struct LDKCVec_ForwardNodeZ {
20620    /**
20621     * The elements in the array.
20622     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
20623     */
20624    struct LDKForwardNode *data;
20625    /**
20626     * The number of elements pointed to by `data`.
20627     */
20628    uintptr_t datalen;
20629 } LDKCVec_ForwardNodeZ;
20630
20631 /**
20632  * The contents of CResult_BlindedPathDecodeErrorZ
20633  */
20634 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
20635    /**
20636     * A pointer to the contents in the success state.
20637     * Reading from this pointer when `result_ok` is not set is undefined.
20638     */
20639    struct LDKBlindedPath *result;
20640    /**
20641     * A pointer to the contents in the error state.
20642     * Reading from this pointer when `result_ok` is set is undefined.
20643     */
20644    struct LDKDecodeError *err;
20645 } LDKCResult_BlindedPathDecodeErrorZPtr;
20646
20647 /**
20648  * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
20649  * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
20650  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20651  */
20652 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
20653    /**
20654     * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
20655     * `err` or `result` depending on the state of `result_ok`.
20656     */
20657    union LDKCResult_BlindedPathDecodeErrorZPtr contents;
20658    /**
20659     * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
20660     */
20661    bool result_ok;
20662 } LDKCResult_BlindedPathDecodeErrorZ;
20663
20664 /**
20665  * The contents of CResult_BlindedHopDecodeErrorZ
20666  */
20667 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
20668    /**
20669     * A pointer to the contents in the success state.
20670     * Reading from this pointer when `result_ok` is not set is undefined.
20671     */
20672    struct LDKBlindedHop *result;
20673    /**
20674     * A pointer to the contents in the error state.
20675     * Reading from this pointer when `result_ok` is set is undefined.
20676     */
20677    struct LDKDecodeError *err;
20678 } LDKCResult_BlindedHopDecodeErrorZPtr;
20679
20680 /**
20681  * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
20682  * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
20683  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20684  */
20685 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
20686    /**
20687     * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
20688     * `err` or `result` depending on the state of `result_ok`.
20689     */
20690    union LDKCResult_BlindedHopDecodeErrorZPtr contents;
20691    /**
20692     * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
20693     */
20694    bool result_ok;
20695 } LDKCResult_BlindedHopDecodeErrorZ;
20696
20697 /**
20698  * The contents of CResult_InvoiceErrorDecodeErrorZ
20699  */
20700 typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
20701    /**
20702     * A pointer to the contents in the success state.
20703     * Reading from this pointer when `result_ok` is not set is undefined.
20704     */
20705    struct LDKInvoiceError *result;
20706    /**
20707     * A pointer to the contents in the error state.
20708     * Reading from this pointer when `result_ok` is set is undefined.
20709     */
20710    struct LDKDecodeError *err;
20711 } LDKCResult_InvoiceErrorDecodeErrorZPtr;
20712
20713 /**
20714  * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
20715  * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
20716  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20717  */
20718 typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
20719    /**
20720     * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
20721     * `err` or `result` depending on the state of `result_ok`.
20722     */
20723    union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
20724    /**
20725     * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
20726     */
20727    bool result_ok;
20728 } LDKCResult_InvoiceErrorDecodeErrorZ;
20729
20730
20731
20732 /**
20733  * The state of a spendable output currently tracked by an [`OutputSweeper`].
20734  */
20735 typedef struct MUST_USE_STRUCT LDKTrackedSpendableOutput {
20736    /**
20737     * A pointer to the opaque Rust object.
20738     * Nearly everywhere, inner must be non-null, however in places where
20739     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20740     */
20741    LDKnativeTrackedSpendableOutput *inner;
20742    /**
20743     * Indicates that this is the only struct which contains the same pointer.
20744     * Rust functions which take ownership of an object provided via an argument require
20745     * this to be true and invalidate the object pointed to by inner.
20746     */
20747    bool is_owned;
20748 } LDKTrackedSpendableOutput;
20749
20750 /**
20751  * The contents of CResult_TrackedSpendableOutputDecodeErrorZ
20752  */
20753 typedef union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr {
20754    /**
20755     * A pointer to the contents in the success state.
20756     * Reading from this pointer when `result_ok` is not set is undefined.
20757     */
20758    struct LDKTrackedSpendableOutput *result;
20759    /**
20760     * A pointer to the contents in the error state.
20761     * Reading from this pointer when `result_ok` is set is undefined.
20762     */
20763    struct LDKDecodeError *err;
20764 } LDKCResult_TrackedSpendableOutputDecodeErrorZPtr;
20765
20766 /**
20767  * A CResult_TrackedSpendableOutputDecodeErrorZ represents the result of a fallible operation,
20768  * containing a crate::lightning::util::sweep::TrackedSpendableOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
20769  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20770  */
20771 typedef struct LDKCResult_TrackedSpendableOutputDecodeErrorZ {
20772    /**
20773     * The contents of this CResult_TrackedSpendableOutputDecodeErrorZ, accessible via either
20774     * `err` or `result` depending on the state of `result_ok`.
20775     */
20776    union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr contents;
20777    /**
20778     * Whether this CResult_TrackedSpendableOutputDecodeErrorZ represents a success state.
20779     */
20780    bool result_ok;
20781 } LDKCResult_TrackedSpendableOutputDecodeErrorZ;
20782
20783 /**
20784  * The current status of the output spend.
20785  */
20786 typedef enum LDKOutputSpendStatus_Tag {
20787    /**
20788     * The output is tracked but an initial spending transaction hasn't been generated and
20789     * broadcasted yet.
20790     */
20791    LDKOutputSpendStatus_PendingInitialBroadcast,
20792    /**
20793     * A transaction spending the output has been broadcasted but is pending its first confirmation on-chain.
20794     */
20795    LDKOutputSpendStatus_PendingFirstConfirmation,
20796    /**
20797     * A transaction spending the output has been confirmed on-chain but will be tracked until it
20798     * reaches [`ANTI_REORG_DELAY`] confirmations.
20799     */
20800    LDKOutputSpendStatus_PendingThresholdConfirmations,
20801    /**
20802     * Must be last for serialization purposes
20803     */
20804    LDKOutputSpendStatus_Sentinel,
20805 } LDKOutputSpendStatus_Tag;
20806
20807 typedef struct LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body {
20808    /**
20809     * The height at which we will first generate and broadcast a spending transaction.
20810     */
20811    struct LDKCOption_u32Z delayed_until_height;
20812 } LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body;
20813
20814 typedef struct LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body {
20815    /**
20816     * The hash of the chain tip when we first broadcast a transaction spending this output.
20817     */
20818    struct LDKThirtyTwoBytes first_broadcast_hash;
20819    /**
20820     * The best height when we last broadcast a transaction spending this output.
20821     */
20822    uint32_t latest_broadcast_height;
20823    /**
20824     * The transaction spending this output we last broadcasted.
20825     */
20826    struct LDKTransaction latest_spending_tx;
20827 } LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body;
20828
20829 typedef struct LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body {
20830    /**
20831     * The hash of the chain tip when we first broadcast a transaction spending this output.
20832     */
20833    struct LDKThirtyTwoBytes first_broadcast_hash;
20834    /**
20835     * The best height when we last broadcast a transaction spending this output.
20836     */
20837    uint32_t latest_broadcast_height;
20838    /**
20839     * The transaction spending this output we saw confirmed on-chain.
20840     */
20841    struct LDKTransaction latest_spending_tx;
20842    /**
20843     * The height at which the spending transaction was confirmed.
20844     */
20845    uint32_t confirmation_height;
20846    /**
20847     * The hash of the block in which the spending transaction was confirmed.
20848     */
20849    struct LDKThirtyTwoBytes confirmation_hash;
20850 } LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body;
20851
20852 typedef struct MUST_USE_STRUCT LDKOutputSpendStatus {
20853    LDKOutputSpendStatus_Tag tag;
20854    union {
20855       LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body pending_initial_broadcast;
20856       LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body pending_first_confirmation;
20857       LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body pending_threshold_confirmations;
20858    };
20859 } LDKOutputSpendStatus;
20860
20861 /**
20862  * The contents of CResult_OutputSpendStatusDecodeErrorZ
20863  */
20864 typedef union LDKCResult_OutputSpendStatusDecodeErrorZPtr {
20865    /**
20866     * A pointer to the contents in the success state.
20867     * Reading from this pointer when `result_ok` is not set is undefined.
20868     */
20869    struct LDKOutputSpendStatus *result;
20870    /**
20871     * A pointer to the contents in the error state.
20872     * Reading from this pointer when `result_ok` is set is undefined.
20873     */
20874    struct LDKDecodeError *err;
20875 } LDKCResult_OutputSpendStatusDecodeErrorZPtr;
20876
20877 /**
20878  * A CResult_OutputSpendStatusDecodeErrorZ represents the result of a fallible operation,
20879  * containing a crate::lightning::util::sweep::OutputSpendStatus on success and a crate::lightning::ln::msgs::DecodeError on failure.
20880  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
20881  */
20882 typedef struct LDKCResult_OutputSpendStatusDecodeErrorZ {
20883    /**
20884     * The contents of this CResult_OutputSpendStatusDecodeErrorZ, accessible via either
20885     * `err` or `result` depending on the state of `result_ok`.
20886     */
20887    union LDKCResult_OutputSpendStatusDecodeErrorZPtr contents;
20888    /**
20889     * Whether this CResult_OutputSpendStatusDecodeErrorZ represents a success state.
20890     */
20891    bool result_ok;
20892 } LDKCResult_OutputSpendStatusDecodeErrorZ;
20893
20894
20895
20896 /**
20897  * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
20898  *
20899  * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
20900  * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
20901  * [`Confirm::transactions_confirmed`].
20902  *
20903  * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
20904  * may have been spent there. See [`Filter::register_output`] for details.
20905  *
20906  * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
20907  * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
20908  */
20909 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
20910    /**
20911     * A pointer to the opaque Rust object.
20912     * Nearly everywhere, inner must be non-null, however in places where
20913     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20914     */
20915    LDKnativeWatchedOutput *inner;
20916    /**
20917     * Indicates that this is the only struct which contains the same pointer.
20918     * Rust functions which take ownership of an object provided via an argument require
20919     * this to be true and invalidate the object pointed to by inner.
20920     */
20921    bool is_owned;
20922 } LDKWatchedOutput;
20923
20924 /**
20925  * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
20926  * channels.
20927  *
20928  * This is useful in order to have a [`Watch`] implementation convey to a chain source which
20929  * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
20930  * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
20931  * receiving full blocks from a chain source, any further filtering is unnecessary.
20932  *
20933  * After an output has been registered, subsequent block retrievals from the chain source must not
20934  * exclude any transactions matching the new criteria nor any in-block descendants of such
20935  * transactions.
20936  *
20937  * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
20938  * should not block on I/O. Implementations should instead queue the newly monitored data to be
20939  * processed later. Then, in order to block until the data has been processed, any [`Watch`]
20940  * invocation that has called the `Filter` must return [`InProgress`].
20941  *
20942  * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
20943  * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
20944  * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
20945  */
20946 typedef struct LDKFilter {
20947    /**
20948     * An opaque pointer which is passed to your function implementations as an argument.
20949     * This has no meaning in the LDK, and can be NULL or any other value.
20950     */
20951    void *this_arg;
20952    /**
20953     * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
20954     * a spending condition.
20955     */
20956    void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
20957    /**
20958     * Registers interest in spends of a transaction output.
20959     *
20960     * Note that this method might be called during processing of a new block. You therefore need
20961     * to ensure that also dependent output spents within an already connected block are correctly
20962     * handled, e.g., by re-scanning the block in question whenever new outputs have been
20963     * registered mid-processing.
20964     */
20965    void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
20966    /**
20967     * Frees any resources associated with this object given its this_arg pointer.
20968     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20969     */
20970    void (*free)(void *this_arg);
20971 } LDKFilter;
20972
20973 /**
20974  * An enum which can either contain a crate::lightning::chain::Filter or not
20975  */
20976 typedef enum LDKCOption_FilterZ_Tag {
20977    /**
20978     * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
20979     */
20980    LDKCOption_FilterZ_Some,
20981    /**
20982     * When we're in this state, this COption_FilterZ contains nothing
20983     */
20984    LDKCOption_FilterZ_None,
20985    /**
20986     * Must be last for serialization purposes
20987     */
20988    LDKCOption_FilterZ_Sentinel,
20989 } LDKCOption_FilterZ_Tag;
20990
20991 typedef struct LDKCOption_FilterZ {
20992    LDKCOption_FilterZ_Tag tag;
20993    union {
20994       struct {
20995          struct LDKFilter some;
20996       };
20997    };
20998 } LDKCOption_FilterZ;
20999
21000 /**
21001  * A dynamically-allocated array of crate::lightning::util::sweep::TrackedSpendableOutputs of arbitrary size.
21002  * This corresponds to std::vector in C++
21003  */
21004 typedef struct LDKCVec_TrackedSpendableOutputZ {
21005    /**
21006     * The elements in the array.
21007     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21008     */
21009    struct LDKTrackedSpendableOutput *data;
21010    /**
21011     * The number of elements pointed to by `data`.
21012     */
21013    uintptr_t datalen;
21014 } LDKCVec_TrackedSpendableOutputZ;
21015
21016 /**
21017  * A helper trait that describes an on-chain wallet capable of returning a (change) destination
21018  * script.
21019  */
21020 typedef struct LDKChangeDestinationSource {
21021    /**
21022     * An opaque pointer which is passed to your function implementations as an argument.
21023     * This has no meaning in the LDK, and can be NULL or any other value.
21024     */
21025    void *this_arg;
21026    /**
21027     * Returns a script pubkey which can be used as a change destination for
21028     * [`OutputSpender::spend_spendable_outputs`].
21029     *
21030     * This method should return a different value each time it is called, to avoid linking
21031     * on-chain funds controlled to the same user.
21032     */
21033    struct LDKCResult_CVec_u8ZNoneZ (*get_change_destination_script)(const void *this_arg);
21034    /**
21035     * Frees any resources associated with this object given its this_arg pointer.
21036     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21037     */
21038    void (*free)(void *this_arg);
21039 } LDKChangeDestinationSource;
21040
21041 /**
21042  * Provides an interface that allows storage and retrieval of persisted values that are associated
21043  * with given keys.
21044  *
21045  * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
21046  * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
21047  * ways, as long as per-namespace key uniqueness is asserted.
21048  *
21049  * Keys and namespaces are required to be valid ASCII strings in the range of
21050  * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
21051  * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
21052  * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
21053  * that concerns should always be separated by primary namespace first, before secondary
21054  * namespaces are used. While the number of primary namespaces will be relatively small and is
21055  * determined at compile time, there may be many secondary namespaces per primary namespace. Note
21056  * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
21057  * namespace, i.e., conflicts between keys and equally named
21058  * primary namespaces/secondary namespaces must be avoided.
21059  *
21060  * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
21061  * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
21062  * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
21063  */
21064 typedef struct LDKKVStore {
21065    /**
21066     * An opaque pointer which is passed to your function implementations as an argument.
21067     * This has no meaning in the LDK, and can be NULL or any other value.
21068     */
21069    void *this_arg;
21070    /**
21071     * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
21072     * `key`.
21073     *
21074     * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
21075     * `primary_namespace` and `secondary_namespace`.
21076     *
21077     * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
21078     */
21079    struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
21080    /**
21081     * Persists the given data under the given `key`.
21082     *
21083     * Will create the given `primary_namespace` and `secondary_namespace` if not already present
21084     * in the store.
21085     */
21086    struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
21087    /**
21088     * Removes any data that had previously been persisted under the given `key`.
21089     *
21090     * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
21091     * remove the given `key` at some point in time after the method returns, e.g., as part of an
21092     * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
21093     * [`KVStore::list`] might include the removed key until the changes are actually persisted.
21094     *
21095     * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
21096     * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
21097     * potentially get lost on crash after the method returns. Therefore, this flag should only be
21098     * set for `remove` operations that can be safely replayed at a later time.
21099     *
21100     * Returns successfully if no data will be stored for the given `primary_namespace`,
21101     * `secondary_namespace`, and `key`, independently of whether it was present before its
21102     * invokation or not.
21103     */
21104    struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
21105    /**
21106     * Returns a list of keys that are stored under the given `secondary_namespace` in
21107     * `primary_namespace`.
21108     *
21109     * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
21110     * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
21111     */
21112    struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
21113    /**
21114     * Frees any resources associated with this object given its this_arg pointer.
21115     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21116     */
21117    void (*free)(void *this_arg);
21118 } LDKKVStore;
21119
21120 /**
21121  * A trait that describes a wallet capable of creating a spending [`Transaction`] from a set of
21122  * [`SpendableOutputDescriptor`]s.
21123  */
21124 typedef struct LDKOutputSpender {
21125    /**
21126     * An opaque pointer which is passed to your function implementations as an argument.
21127     * This has no meaning in the LDK, and can be NULL or any other value.
21128     */
21129    void *this_arg;
21130    /**
21131     * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
21132     * output to the given change destination (if sufficient change value remains). The
21133     * transaction will have a feerate, at least, of the given value.
21134     *
21135     * The `locktime` argument is used to set the transaction's locktime. If `None`, the
21136     * transaction will have a locktime of 0. It it recommended to set this to the current block
21137     * height to avoid fee sniping, unless you have some specific reason to use a different
21138     * locktime.
21139     *
21140     * Returns `Err(())` if the output value is greater than the input value minus required fee,
21141     * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
21142     * does not match the one we can spend.
21143     */
21144    struct LDKCResult_TransactionNoneZ (*spend_spendable_outputs)(const void *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);
21145    /**
21146     * Frees any resources associated with this object given its this_arg pointer.
21147     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21148     */
21149    void (*free)(void *this_arg);
21150 } LDKOutputSpender;
21151
21152
21153
21154 /**
21155  * A utility that keeps track of [`SpendableOutputDescriptor`]s, persists them in a given
21156  * [`KVStore`] and regularly retries sweeping them based on a callback given to the constructor
21157  * methods.
21158  *
21159  * Users should call [`Self::track_spendable_outputs`] for any [`SpendableOutputDescriptor`]s received via [`Event::SpendableOutputs`].
21160  *
21161  * This needs to be notified of chain state changes either via its [`Listen`] or [`Confirm`]
21162  * implementation and hence has to be connected with the utilized chain data sources.
21163  *
21164  * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users are
21165  * required to give their chain data sources (i.e., [`Filter`] implementation) to the respective
21166  * constructor.
21167  *
21168  * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
21169  */
21170 typedef struct MUST_USE_STRUCT LDKOutputSweeper {
21171    /**
21172     * A pointer to the opaque Rust object.
21173     * Nearly everywhere, inner must be non-null, however in places where
21174     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21175     */
21176    LDKnativeOutputSweeper *inner;
21177    /**
21178     * Indicates that this is the only struct which contains the same pointer.
21179     * Rust functions which take ownership of an object provided via an argument require
21180     * this to be true and invalidate the object pointed to by inner.
21181     */
21182    bool is_owned;
21183 } LDKOutputSweeper;
21184
21185 /**
21186  * The contents of CResult_OutputSweeperDecodeErrorZ
21187  */
21188 typedef union LDKCResult_OutputSweeperDecodeErrorZPtr {
21189    /**
21190     * A pointer to the contents in the success state.
21191     * Reading from this pointer when `result_ok` is not set is undefined.
21192     */
21193    struct LDKOutputSweeper *result;
21194    /**
21195     * A pointer to the contents in the error state.
21196     * Reading from this pointer when `result_ok` is set is undefined.
21197     */
21198    struct LDKDecodeError *err;
21199 } LDKCResult_OutputSweeperDecodeErrorZPtr;
21200
21201 /**
21202  * A CResult_OutputSweeperDecodeErrorZ represents the result of a fallible operation,
21203  * containing a crate::lightning::util::sweep::OutputSweeper on success and a crate::lightning::ln::msgs::DecodeError on failure.
21204  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21205  */
21206 typedef struct LDKCResult_OutputSweeperDecodeErrorZ {
21207    /**
21208     * The contents of this CResult_OutputSweeperDecodeErrorZ, accessible via either
21209     * `err` or `result` depending on the state of `result_ok`.
21210     */
21211    union LDKCResult_OutputSweeperDecodeErrorZPtr contents;
21212    /**
21213     * Whether this CResult_OutputSweeperDecodeErrorZ represents a success state.
21214     */
21215    bool result_ok;
21216 } LDKCResult_OutputSweeperDecodeErrorZ;
21217
21218 /**
21219  * A tuple of 2 elements. See the individual fields for the types contained.
21220  */
21221 typedef struct LDKC2Tuple_BestBlockOutputSweeperZ {
21222    /**
21223     * The element at position 0
21224     */
21225    struct LDKBestBlock a;
21226    /**
21227     * The element at position 1
21228     */
21229    struct LDKOutputSweeper b;
21230 } LDKC2Tuple_BestBlockOutputSweeperZ;
21231
21232 /**
21233  * The contents of CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ
21234  */
21235 typedef union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr {
21236    /**
21237     * A pointer to the contents in the success state.
21238     * Reading from this pointer when `result_ok` is not set is undefined.
21239     */
21240    struct LDKC2Tuple_BestBlockOutputSweeperZ *result;
21241    /**
21242     * A pointer to the contents in the error state.
21243     * Reading from this pointer when `result_ok` is set is undefined.
21244     */
21245    struct LDKDecodeError *err;
21246 } LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr;
21247
21248 /**
21249  * A CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents the result of a fallible operation,
21250  * containing a crate::c_types::derived::C2Tuple_BestBlockOutputSweeperZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
21251  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21252  */
21253 typedef struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ {
21254    /**
21255     * The contents of this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ, accessible via either
21256     * `err` or `result` depending on the state of `result_ok`.
21257     */
21258    union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr contents;
21259    /**
21260     * Whether this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents a success state.
21261     */
21262    bool result_ok;
21263 } LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ;
21264
21265
21266
21267 /**
21268  * Base key used in conjunction with a `per_commitment_point` to generate a [`DelayedPaymentKey`].
21269  *
21270  * The delayed payment key is used to pay the commitment state broadcaster their
21271  * non-HTLC-encumbered funds after a delay to give their counterparty a chance to punish if the
21272  * state broadcasted was previously revoked.
21273  */
21274 typedef struct MUST_USE_STRUCT LDKDelayedPaymentBasepoint {
21275    /**
21276     * A pointer to the opaque Rust object.
21277     * Nearly everywhere, inner must be non-null, however in places where
21278     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21279     */
21280    LDKnativeDelayedPaymentBasepoint *inner;
21281    /**
21282     * Indicates that this is the only struct which contains the same pointer.
21283     * Rust functions which take ownership of an object provided via an argument require
21284     * this to be true and invalidate the object pointed to by inner.
21285     */
21286    bool is_owned;
21287 } LDKDelayedPaymentBasepoint;
21288
21289 /**
21290  * The contents of CResult_DelayedPaymentBasepointDecodeErrorZ
21291  */
21292 typedef union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr {
21293    /**
21294     * A pointer to the contents in the success state.
21295     * Reading from this pointer when `result_ok` is not set is undefined.
21296     */
21297    struct LDKDelayedPaymentBasepoint *result;
21298    /**
21299     * A pointer to the contents in the error state.
21300     * Reading from this pointer when `result_ok` is set is undefined.
21301     */
21302    struct LDKDecodeError *err;
21303 } LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr;
21304
21305 /**
21306  * A CResult_DelayedPaymentBasepointDecodeErrorZ represents the result of a fallible operation,
21307  * containing a crate::lightning::ln::channel_keys::DelayedPaymentBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21308  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21309  */
21310 typedef struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ {
21311    /**
21312     * The contents of this CResult_DelayedPaymentBasepointDecodeErrorZ, accessible via either
21313     * `err` or `result` depending on the state of `result_ok`.
21314     */
21315    union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr contents;
21316    /**
21317     * Whether this CResult_DelayedPaymentBasepointDecodeErrorZ represents a success state.
21318     */
21319    bool result_ok;
21320 } LDKCResult_DelayedPaymentBasepointDecodeErrorZ;
21321
21322
21323
21324 /**
21325  * A derived key built from a [`DelayedPaymentBasepoint`] and `per_commitment_point`.
21326  *
21327  * The delayed payment key is used to pay the commitment state broadcaster their
21328  * non-HTLC-encumbered funds after a delay. This delay gives their counterparty a chance to
21329  * punish and claim all the channel funds if the state broadcasted was previously revoked.
21330  *
21331  * [See the BOLT specs]
21332  * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
21333  * for more information on key derivation details.
21334  */
21335 typedef struct MUST_USE_STRUCT LDKDelayedPaymentKey {
21336    /**
21337     * A pointer to the opaque Rust object.
21338     * Nearly everywhere, inner must be non-null, however in places where
21339     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21340     */
21341    LDKnativeDelayedPaymentKey *inner;
21342    /**
21343     * Indicates that this is the only struct which contains the same pointer.
21344     * Rust functions which take ownership of an object provided via an argument require
21345     * this to be true and invalidate the object pointed to by inner.
21346     */
21347    bool is_owned;
21348 } LDKDelayedPaymentKey;
21349
21350 /**
21351  * The contents of CResult_DelayedPaymentKeyDecodeErrorZ
21352  */
21353 typedef union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr {
21354    /**
21355     * A pointer to the contents in the success state.
21356     * Reading from this pointer when `result_ok` is not set is undefined.
21357     */
21358    struct LDKDelayedPaymentKey *result;
21359    /**
21360     * A pointer to the contents in the error state.
21361     * Reading from this pointer when `result_ok` is set is undefined.
21362     */
21363    struct LDKDecodeError *err;
21364 } LDKCResult_DelayedPaymentKeyDecodeErrorZPtr;
21365
21366 /**
21367  * A CResult_DelayedPaymentKeyDecodeErrorZ represents the result of a fallible operation,
21368  * containing a crate::lightning::ln::channel_keys::DelayedPaymentKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21369  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21370  */
21371 typedef struct LDKCResult_DelayedPaymentKeyDecodeErrorZ {
21372    /**
21373     * The contents of this CResult_DelayedPaymentKeyDecodeErrorZ, accessible via either
21374     * `err` or `result` depending on the state of `result_ok`.
21375     */
21376    union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr contents;
21377    /**
21378     * Whether this CResult_DelayedPaymentKeyDecodeErrorZ represents a success state.
21379     */
21380    bool result_ok;
21381 } LDKCResult_DelayedPaymentKeyDecodeErrorZ;
21382
21383
21384
21385 /**
21386  * Base key used in conjunction with a `per_commitment_point` to generate an [`HtlcKey`].
21387  *
21388  * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
21389  * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
21390  * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
21391  */
21392 typedef struct MUST_USE_STRUCT LDKHtlcBasepoint {
21393    /**
21394     * A pointer to the opaque Rust object.
21395     * Nearly everywhere, inner must be non-null, however in places where
21396     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21397     */
21398    LDKnativeHtlcBasepoint *inner;
21399    /**
21400     * Indicates that this is the only struct which contains the same pointer.
21401     * Rust functions which take ownership of an object provided via an argument require
21402     * this to be true and invalidate the object pointed to by inner.
21403     */
21404    bool is_owned;
21405 } LDKHtlcBasepoint;
21406
21407 /**
21408  * The contents of CResult_HtlcBasepointDecodeErrorZ
21409  */
21410 typedef union LDKCResult_HtlcBasepointDecodeErrorZPtr {
21411    /**
21412     * A pointer to the contents in the success state.
21413     * Reading from this pointer when `result_ok` is not set is undefined.
21414     */
21415    struct LDKHtlcBasepoint *result;
21416    /**
21417     * A pointer to the contents in the error state.
21418     * Reading from this pointer when `result_ok` is set is undefined.
21419     */
21420    struct LDKDecodeError *err;
21421 } LDKCResult_HtlcBasepointDecodeErrorZPtr;
21422
21423 /**
21424  * A CResult_HtlcBasepointDecodeErrorZ represents the result of a fallible operation,
21425  * containing a crate::lightning::ln::channel_keys::HtlcBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21426  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21427  */
21428 typedef struct LDKCResult_HtlcBasepointDecodeErrorZ {
21429    /**
21430     * The contents of this CResult_HtlcBasepointDecodeErrorZ, accessible via either
21431     * `err` or `result` depending on the state of `result_ok`.
21432     */
21433    union LDKCResult_HtlcBasepointDecodeErrorZPtr contents;
21434    /**
21435     * Whether this CResult_HtlcBasepointDecodeErrorZ represents a success state.
21436     */
21437    bool result_ok;
21438 } LDKCResult_HtlcBasepointDecodeErrorZ;
21439
21440
21441
21442 /**
21443  * A derived key built from a [`HtlcBasepoint`] and `per_commitment_point`.
21444  *
21445  * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
21446  * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
21447  * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
21448  *
21449  * [See the BOLT specs]
21450  * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
21451  * for more information on key derivation details.
21452  */
21453 typedef struct MUST_USE_STRUCT LDKHtlcKey {
21454    /**
21455     * A pointer to the opaque Rust object.
21456     * Nearly everywhere, inner must be non-null, however in places where
21457     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21458     */
21459    LDKnativeHtlcKey *inner;
21460    /**
21461     * Indicates that this is the only struct which contains the same pointer.
21462     * Rust functions which take ownership of an object provided via an argument require
21463     * this to be true and invalidate the object pointed to by inner.
21464     */
21465    bool is_owned;
21466 } LDKHtlcKey;
21467
21468 /**
21469  * The contents of CResult_HtlcKeyDecodeErrorZ
21470  */
21471 typedef union LDKCResult_HtlcKeyDecodeErrorZPtr {
21472    /**
21473     * A pointer to the contents in the success state.
21474     * Reading from this pointer when `result_ok` is not set is undefined.
21475     */
21476    struct LDKHtlcKey *result;
21477    /**
21478     * A pointer to the contents in the error state.
21479     * Reading from this pointer when `result_ok` is set is undefined.
21480     */
21481    struct LDKDecodeError *err;
21482 } LDKCResult_HtlcKeyDecodeErrorZPtr;
21483
21484 /**
21485  * A CResult_HtlcKeyDecodeErrorZ represents the result of a fallible operation,
21486  * containing a crate::lightning::ln::channel_keys::HtlcKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21487  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21488  */
21489 typedef struct LDKCResult_HtlcKeyDecodeErrorZ {
21490    /**
21491     * The contents of this CResult_HtlcKeyDecodeErrorZ, accessible via either
21492     * `err` or `result` depending on the state of `result_ok`.
21493     */
21494    union LDKCResult_HtlcKeyDecodeErrorZPtr contents;
21495    /**
21496     * Whether this CResult_HtlcKeyDecodeErrorZ represents a success state.
21497     */
21498    bool result_ok;
21499 } LDKCResult_HtlcKeyDecodeErrorZ;
21500
21501
21502
21503 /**
21504  * 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.
21505  * A watcher can be given a [RevocationBasepoint] to generate per commitment [RevocationKey] to create justice transactions.
21506  */
21507 typedef struct MUST_USE_STRUCT LDKRevocationBasepoint {
21508    /**
21509     * A pointer to the opaque Rust object.
21510     * Nearly everywhere, inner must be non-null, however in places where
21511     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21512     */
21513    LDKnativeRevocationBasepoint *inner;
21514    /**
21515     * Indicates that this is the only struct which contains the same pointer.
21516     * Rust functions which take ownership of an object provided via an argument require
21517     * this to be true and invalidate the object pointed to by inner.
21518     */
21519    bool is_owned;
21520 } LDKRevocationBasepoint;
21521
21522 /**
21523  * The contents of CResult_RevocationBasepointDecodeErrorZ
21524  */
21525 typedef union LDKCResult_RevocationBasepointDecodeErrorZPtr {
21526    /**
21527     * A pointer to the contents in the success state.
21528     * Reading from this pointer when `result_ok` is not set is undefined.
21529     */
21530    struct LDKRevocationBasepoint *result;
21531    /**
21532     * A pointer to the contents in the error state.
21533     * Reading from this pointer when `result_ok` is set is undefined.
21534     */
21535    struct LDKDecodeError *err;
21536 } LDKCResult_RevocationBasepointDecodeErrorZPtr;
21537
21538 /**
21539  * A CResult_RevocationBasepointDecodeErrorZ represents the result of a fallible operation,
21540  * containing a crate::lightning::ln::channel_keys::RevocationBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
21541  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21542  */
21543 typedef struct LDKCResult_RevocationBasepointDecodeErrorZ {
21544    /**
21545     * The contents of this CResult_RevocationBasepointDecodeErrorZ, accessible via either
21546     * `err` or `result` depending on the state of `result_ok`.
21547     */
21548    union LDKCResult_RevocationBasepointDecodeErrorZPtr contents;
21549    /**
21550     * Whether this CResult_RevocationBasepointDecodeErrorZ represents a success state.
21551     */
21552    bool result_ok;
21553 } LDKCResult_RevocationBasepointDecodeErrorZ;
21554
21555
21556
21557 /**
21558  * The revocation key is used to allow a channel party to revoke their state - giving their
21559  * counterparty the required material to claim all of their funds if they broadcast that state.
21560  *
21561  * Each commitment transaction has a revocation key based on the basepoint and
21562  * per_commitment_point which is used in both commitment and HTLC transactions.
21563  *
21564  * See [the BOLT spec for derivation details]
21565  * (https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation)
21566  */
21567 typedef struct MUST_USE_STRUCT LDKRevocationKey {
21568    /**
21569     * A pointer to the opaque Rust object.
21570     * Nearly everywhere, inner must be non-null, however in places where
21571     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21572     */
21573    LDKnativeRevocationKey *inner;
21574    /**
21575     * Indicates that this is the only struct which contains the same pointer.
21576     * Rust functions which take ownership of an object provided via an argument require
21577     * this to be true and invalidate the object pointed to by inner.
21578     */
21579    bool is_owned;
21580 } LDKRevocationKey;
21581
21582 /**
21583  * The contents of CResult_RevocationKeyDecodeErrorZ
21584  */
21585 typedef union LDKCResult_RevocationKeyDecodeErrorZPtr {
21586    /**
21587     * A pointer to the contents in the success state.
21588     * Reading from this pointer when `result_ok` is not set is undefined.
21589     */
21590    struct LDKRevocationKey *result;
21591    /**
21592     * A pointer to the contents in the error state.
21593     * Reading from this pointer when `result_ok` is set is undefined.
21594     */
21595    struct LDKDecodeError *err;
21596 } LDKCResult_RevocationKeyDecodeErrorZPtr;
21597
21598 /**
21599  * A CResult_RevocationKeyDecodeErrorZ represents the result of a fallible operation,
21600  * containing a crate::lightning::ln::channel_keys::RevocationKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
21601  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21602  */
21603 typedef struct LDKCResult_RevocationKeyDecodeErrorZ {
21604    /**
21605     * The contents of this CResult_RevocationKeyDecodeErrorZ, accessible via either
21606     * `err` or `result` depending on the state of `result_ok`.
21607     */
21608    union LDKCResult_RevocationKeyDecodeErrorZPtr contents;
21609    /**
21610     * Whether this CResult_RevocationKeyDecodeErrorZ represents a success state.
21611     */
21612    bool result_ok;
21613 } LDKCResult_RevocationKeyDecodeErrorZ;
21614
21615
21616
21617 /**
21618  * A read-only reference to a current ChannelMonitor.
21619  *
21620  * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
21621  * released.
21622  */
21623 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
21624    /**
21625     * A pointer to the opaque Rust object.
21626     * Nearly everywhere, inner must be non-null, however in places where
21627     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21628     */
21629    LDKnativeLockedChannelMonitor *inner;
21630    /**
21631     * Indicates that this is the only struct which contains the same pointer.
21632     * Rust functions which take ownership of an object provided via an argument require
21633     * this to be true and invalidate the object pointed to by inner.
21634     */
21635    bool is_owned;
21636 } LDKLockedChannelMonitor;
21637
21638 /**
21639  * The contents of CResult_LockedChannelMonitorNoneZ
21640  */
21641 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
21642    /**
21643     * A pointer to the contents in the success state.
21644     * Reading from this pointer when `result_ok` is not set is undefined.
21645     */
21646    struct LDKLockedChannelMonitor *result;
21647    /**
21648     * Note that this value is always NULL, as there are no contents in the Err variant
21649     */
21650    void *err;
21651 } LDKCResult_LockedChannelMonitorNoneZPtr;
21652
21653 /**
21654  * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
21655  * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
21656  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
21657  */
21658 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
21659    /**
21660     * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
21661     * `err` or `result` depending on the state of `result_ok`.
21662     */
21663    union LDKCResult_LockedChannelMonitorNoneZPtr contents;
21664    /**
21665     * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
21666     */
21667    bool result_ok;
21668 } LDKCResult_LockedChannelMonitorNoneZ;
21669
21670 /**
21671  * A tuple of 2 elements. See the individual fields for the types contained.
21672  */
21673 typedef struct LDKC2Tuple_OutPointChannelIdZ {
21674    /**
21675     * The element at position 0
21676     */
21677    struct LDKOutPoint a;
21678    /**
21679     * The element at position 1
21680     */
21681    struct LDKChannelId b;
21682 } LDKC2Tuple_OutPointChannelIdZ;
21683
21684 /**
21685  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointChannelIdZs of arbitrary size.
21686  * This corresponds to std::vector in C++
21687  */
21688 typedef struct LDKCVec_C2Tuple_OutPointChannelIdZZ {
21689    /**
21690     * The elements in the array.
21691     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21692     */
21693    struct LDKC2Tuple_OutPointChannelIdZ *data;
21694    /**
21695     * The number of elements pointed to by `data`.
21696     */
21697    uintptr_t datalen;
21698 } LDKCVec_C2Tuple_OutPointChannelIdZZ;
21699
21700
21701
21702 /**
21703  * An opaque identifier describing a specific [`Persist`] method call.
21704  */
21705 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
21706    /**
21707     * A pointer to the opaque Rust object.
21708     * Nearly everywhere, inner must be non-null, however in places where
21709     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21710     */
21711    LDKnativeMonitorUpdateId *inner;
21712    /**
21713     * Indicates that this is the only struct which contains the same pointer.
21714     * Rust functions which take ownership of an object provided via an argument require
21715     * this to be true and invalidate the object pointed to by inner.
21716     */
21717    bool is_owned;
21718 } LDKMonitorUpdateId;
21719
21720 /**
21721  * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
21722  * This corresponds to std::vector in C++
21723  */
21724 typedef struct LDKCVec_MonitorUpdateIdZ {
21725    /**
21726     * The elements in the array.
21727     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21728     */
21729    struct LDKMonitorUpdateId *data;
21730    /**
21731     * The number of elements pointed to by `data`.
21732     */
21733    uintptr_t datalen;
21734 } LDKCVec_MonitorUpdateIdZ;
21735
21736 /**
21737  * A tuple of 2 elements. See the individual fields for the types contained.
21738  */
21739 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
21740    /**
21741     * The element at position 0
21742     */
21743    struct LDKOutPoint a;
21744    /**
21745     * The element at position 1
21746     */
21747    struct LDKCVec_MonitorUpdateIdZ b;
21748 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
21749
21750 /**
21751  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
21752  * This corresponds to std::vector in C++
21753  */
21754 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
21755    /**
21756     * The elements in the array.
21757     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
21758     */
21759    struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
21760    /**
21761     * The number of elements pointed to by `data`.
21762     */
21763    uintptr_t datalen;
21764 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
21765
21766 /**
21767  * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
21768  *
21769  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
21770  */
21771 typedef struct LDKPersister {
21772    /**
21773     * An opaque pointer which is passed to your function implementations as an argument.
21774     * This has no meaning in the LDK, and can be NULL or any other value.
21775     */
21776    void *this_arg;
21777    /**
21778     * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
21779     *
21780     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
21781     */
21782    struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
21783    /**
21784     * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
21785     */
21786    struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
21787    /**
21788     * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
21789     */
21790    struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
21791    /**
21792     * Frees any resources associated with this object given its this_arg pointer.
21793     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21794     */
21795    void (*free)(void *this_arg);
21796 } LDKPersister;
21797
21798
21799
21800 /**
21801  * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
21802  * [`ChannelMonitorUpdate`]s.
21803  *
21804  * # Overview
21805  *
21806  * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
21807  * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
21808  * deleting) and complexity. This is because it writes channel monitor differential updates,
21809  * whereas the other (default) implementation rewrites the entire monitor on each update. For
21810  * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
21811  * of megabytes (or more). Updates can be as small as a few hundred bytes.
21812  *
21813  * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
21814  * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
21815  * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
21816  * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
21817  * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
21818  * sentinel bytes.
21819  *
21820  * # Storing monitors
21821  *
21822  * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
21823  *
21824  *   - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
21825  *   - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
21826  *
21827  * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
21828  * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
21829  *
21830  * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
21831  *
21832  *   - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
21833  *   - secondary namespace: [the monitor's encoded outpoint name]
21834  *
21835  * Under that secondary namespace, each update is stored with a number string, like `21`, which
21836  * represents its `update_id` value.
21837  *
21838  * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
21839  *
21840  *   - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
21841  *   - Index: `1`
21842  *
21843  * Full channel monitors would be stored at a single key:
21844  *
21845  * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
21846  *
21847  * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
21848  *
21849  * ```text
21850  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
21851  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
21852  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
21853  * ```
21854  * ... and so on.
21855  *
21856  * # Reading channel state from storage
21857  *
21858  * Channel state can be reconstructed by calling
21859  * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
21860  * list channel monitors themselves and load channels individually using
21861  * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
21862  *
21863  * ## EXTREMELY IMPORTANT
21864  *
21865  * It is extremely important that your [`KVStore::read`] implementation uses the
21866  * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
21867  * that circumstance (not when there is really a permissions error, for example). This is because
21868  * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
21869  * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
21870  * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
21871  *
21872  * # Pruning stale channel updates
21873  *
21874  * Stale updates are pruned when the consolidation threshold is reached according to `maximum_pending_updates`.
21875  * Monitor updates in the range between the latest `update_id` and `update_id - maximum_pending_updates`
21876  * are deleted.
21877  * The `lazy` flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
21878  * will complete. However, stale updates are not a problem for data integrity, since updates are
21879  * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
21880  *
21881  * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
21882  * would like to get rid of them, consider using the
21883  * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
21884  */
21885 typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
21886    /**
21887     * A pointer to the opaque Rust object.
21888     * Nearly everywhere, inner must be non-null, however in places where
21889     * the Rust equivalent takes an Option, it may be set to null to indicate None.
21890     */
21891    LDKnativeMonitorUpdatingPersister *inner;
21892    /**
21893     * Indicates that this is the only struct which contains the same pointer.
21894     * Rust functions which take ownership of an object provided via an argument require
21895     * this to be true and invalidate the object pointed to by inner.
21896     */
21897    bool is_owned;
21898 } LDKMonitorUpdatingPersister;
21899
21900 /**
21901  * `Persist` defines behavior for persisting channel monitors: this could mean
21902  * writing once to disk, and/or uploading to one or more backup services.
21903  *
21904  * Persistence can happen in one of two ways - synchronously completing before the trait method
21905  * calls return or asynchronously in the background.
21906  *
21907  * # For those implementing synchronous persistence
21908  *
21909  *  * If persistence completes fully (including any relevant `fsync()` calls), the implementation
21910  *    should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
21911  *    should continue.
21912  *
21913  *  * If persistence fails for some reason, implementations should consider returning
21914  *    [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
21915  *    the background with [`ChainMonitor::list_pending_monitor_updates`] and
21916  *    [`ChainMonitor::get_monitor`].
21917  *
21918  *    Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
21919  *    be marked as complete via [`ChainMonitor::channel_monitor_updated`].
21920  *
21921  *    If at some point no further progress can be made towards persisting the pending updates, the
21922  *    node should simply shut down.
21923  *
21924  *  * If the persistence has failed and cannot be retried further (e.g. because of an outage),
21925  *    [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
21926  *    an immediate panic and future operations in LDK generally failing.
21927  *
21928  * # For those implementing asynchronous persistence
21929  *
21930  *  All calls should generally spawn a background task and immediately return
21931  *  [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
21932  *  [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
21933  *  [`MonitorUpdateId`].
21934  *
21935  *  Note that unlike the direct [`chain::Watch`] interface,
21936  *  [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
21937  *
21938  *  If at some point no further progress can be made towards persisting a pending update, the node
21939  *  should simply shut down. Until then, the background task should either loop indefinitely, or
21940  *  persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
21941  *  and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
21942  *  monitor updates may be marked completed).
21943  *
21944  * # Using remote watchtowers
21945  *
21946  * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
21947  * update process described above while the watchtower is being updated. The following methods are
21948  * provided for bulding transactions for a watchtower:
21949  * [`ChannelMonitor::initial_counterparty_commitment_tx`],
21950  * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
21951  * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
21952  * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
21953  *
21954  * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
21955  * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
21956  */
21957 typedef struct LDKPersist {
21958    /**
21959     * An opaque pointer which is passed to your function implementations as an argument.
21960     * This has no meaning in the LDK, and can be NULL or any other value.
21961     */
21962    void *this_arg;
21963    /**
21964     * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
21965     * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
21966     *
21967     * The data can be stored any way you want, but the identifier provided by LDK is the
21968     * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
21969     * and the stored channel data). Note that you **must** persist every new monitor to disk.
21970     *
21971     * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
21972     * if you return [`ChannelMonitorUpdateStatus::InProgress`].
21973     *
21974     * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
21975     * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
21976     *
21977     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
21978     * [`Writeable::write`]: crate::util::ser::Writeable::write
21979     */
21980    enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
21981    /**
21982     * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
21983     * update.
21984     *
21985     * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
21986     * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
21987     * details.
21988     *
21989     * During blockchain synchronization operations, and in some rare cases, this may be called with
21990     * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
21991     * Note that after the full [`ChannelMonitor`] is persisted any previous
21992     * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
21993     * applied to the persisted [`ChannelMonitor`] as they were already applied.
21994     *
21995     * If an implementer chooses to persist the updates only, they need to make
21996     * sure that all the updates are applied to the `ChannelMonitors` *before*
21997     * the set of channel monitors is given to the `ChannelManager`
21998     * deserialization routine. See [`ChannelMonitor::update_monitor`] for
21999     * applying a monitor update to a monitor. If full `ChannelMonitors` are
22000     * persisted, then there is no need to persist individual updates.
22001     *
22002     * Note that there could be a performance tradeoff between persisting complete
22003     * channel monitors on every update vs. persisting only updates and applying
22004     * them in batches. The size of each monitor grows `O(number of state updates)`
22005     * whereas updates are small and `O(1)`.
22006     *
22007     * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
22008     * if you return [`ChannelMonitorUpdateStatus::InProgress`].
22009     *
22010     * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
22011     * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
22012     * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
22013     *
22014     * [`Writeable::write`]: crate::util::ser::Writeable::write
22015     *
22016     * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
22017     */
22018    enum LDKChannelMonitorUpdateStatus (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, struct LDKChannelMonitorUpdate update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
22019    /**
22020     * Prevents the channel monitor from being loaded on startup.
22021     *
22022     * Archiving the data in a backup location (rather than deleting it fully) is useful for
22023     * hedging against data loss in case of unexpected failure.
22024     */
22025    void (*archive_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint);
22026    /**
22027     * Frees any resources associated with this object given its this_arg pointer.
22028     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22029     */
22030    void (*free)(void *this_arg);
22031 } LDKPersist;
22032
22033
22034
22035 /**
22036  * A string that displays only printable characters, replacing control characters with
22037  * [`core::char::REPLACEMENT_CHARACTER`].
22038  */
22039 typedef struct MUST_USE_STRUCT LDKPrintableString {
22040    /**
22041     * A pointer to the opaque Rust object.
22042     * Nearly everywhere, inner must be non-null, however in places where
22043     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22044     */
22045    LDKnativePrintableString *inner;
22046    /**
22047     * Indicates that this is the only struct which contains the same pointer.
22048     * Rust functions which take ownership of an object provided via an argument require
22049     * this to be true and invalidate the object pointed to by inner.
22050     */
22051    bool is_owned;
22052 } LDKPrintableString;
22053
22054 /**
22055  * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
22056  * chain.
22057  *
22058  * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
22059  * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
22060  * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
22061  * when needed.
22062  *
22063  * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
22064  * entire header chain and only blocks with matching transaction data using BIP 157 filters or
22065  * other similar filtering.
22066  */
22067 typedef struct LDKListen {
22068    /**
22069     * An opaque pointer which is passed to your function implementations as an argument.
22070     * This has no meaning in the LDK, and can be NULL or any other value.
22071     */
22072    void *this_arg;
22073    /**
22074     * Notifies the listener that a block was added at the given height, with the transaction data
22075     * possibly filtered.
22076     */
22077    void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
22078    /**
22079     * Notifies the listener that a block was added at the given height.
22080     */
22081    void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
22082    /**
22083     * Notifies the listener that a block was removed at the given height.
22084     */
22085    void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
22086    /**
22087     * Frees any resources associated with this object given its this_arg pointer.
22088     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22089     */
22090    void (*free)(void *this_arg);
22091 } LDKListen;
22092
22093 /**
22094  * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
22095  * chain or unconfirmed during a chain reorganization.
22096  *
22097  * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
22098  * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
22099  * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
22100  * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
22101  * with reference to the confirmation status of the monitored objects.
22102  *
22103  * # Use
22104  * The intended use is as follows:
22105  * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
22106  *   outputs are, respectively, confirmed or spent on chain.
22107  * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
22108  *   [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
22109  * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
22110  *
22111  * # Order
22112  *
22113  * Clients must call these methods in chain order. Specifically:
22114  * - Transactions which are confirmed in a particular block must be given before transactions
22115  *   confirmed in a later block.
22116  * - Dependent transactions within the same block must be given in topological order, possibly in
22117  *   separate calls.
22118  * - All unconfirmed transactions must be given after the original confirmations and before *any*
22119  *   reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
22120  *   never be interleaved, but always conduced *en bloc*.
22121  * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
22122  *   in regard to the new block.
22123  *
22124  * See individual method documentation for further details.
22125  *
22126  * [`transactions_confirmed`]: Self::transactions_confirmed
22127  * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
22128  * [`best_block_updated`]: Self::best_block_updated
22129  * [`get_relevant_txids`]: Self::get_relevant_txids
22130  */
22131 typedef struct LDKConfirm {
22132    /**
22133     * An opaque pointer which is passed to your function implementations as an argument.
22134     * This has no meaning in the LDK, and can be NULL or any other value.
22135     */
22136    void *this_arg;
22137    /**
22138     * Notifies LDK of transactions confirmed in a block with a given header and height.
22139     *
22140     * Must be called for any transactions registered by [`Filter::register_tx`] or any
22141     * transactions spending an output registered by [`Filter::register_output`]. Such transactions
22142     * appearing in the same block do not need to be included in the same call; instead, multiple
22143     * calls with additional transactions may be made so long as they are made in [chain order].
22144     *
22145     * May be called before or after [`best_block_updated`] for the corresponding block. However,
22146     * in the event of a chain reorganization, it must not be called with a `header` that is no
22147     * longer in the chain as of the last call to [`best_block_updated`].
22148     *
22149     * [chain order]: Confirm#order
22150     * [`best_block_updated`]: Self::best_block_updated
22151     */
22152    void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
22153    /**
22154     * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
22155     *
22156     * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
22157     * reorganized out of the best chain or if it is no longer confirmed in the block with the
22158     * given block hash. Once called, the given transaction will not be returned
22159     * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
22160     *
22161     * [`get_relevant_txids`]: Self::get_relevant_txids
22162     * [`transactions_confirmed`]: Self::transactions_confirmed
22163     */
22164    void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
22165    /**
22166     * Notifies LDK of an update to the best header connected at the given height.
22167     *
22168     * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
22169     * blocks.
22170     */
22171    void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
22172    /**
22173     * Returns transactions that must be monitored for reorganization out of the chain along
22174     * with the height and the hash of the block as part of which it had been previously confirmed.
22175     *
22176     * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
22177     * 0.0.112 and prior, in which case you need to manually track previous confirmations.
22178     *
22179     * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
22180     * confirmations to be safe from a chain reorganization. Will not include any transactions
22181     * passed to [`transaction_unconfirmed`], unless later reconfirmed.
22182     *
22183     * Must be called to determine the subset of transactions that must be monitored for
22184     * reorganization. Will be idempotent between calls but may change as a result of calls to the
22185     * other interface methods. Thus, this is useful to determine which transactions must be
22186     * given to [`transaction_unconfirmed`].
22187     *
22188     * If any of the returned transactions are confirmed in a block other than the one with the
22189     * given hash at the given height, they need to be unconfirmed and reconfirmed via
22190     * [`transaction_unconfirmed`] and [`transactions_confirmed`], respectively.
22191     *
22192     * [`transactions_confirmed`]: Self::transactions_confirmed
22193     * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
22194     */
22195    struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
22196    /**
22197     * Frees any resources associated with this object given its this_arg pointer.
22198     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22199     */
22200    void (*free)(void *this_arg);
22201 } LDKConfirm;
22202
22203 /**
22204  * A `enum` signalling to the [`OutputSweeper`] that it should delay spending an output until a
22205  * future block height is reached.
22206  */
22207 typedef enum LDKSpendingDelay_Tag {
22208    /**
22209     * A relative delay indicating we shouldn't spend the output before `cur_height + num_blocks`
22210     * is reached.
22211     */
22212    LDKSpendingDelay_Relative,
22213    /**
22214     * An absolute delay indicating we shouldn't spend the output before `height` is reached.
22215     */
22216    LDKSpendingDelay_Absolute,
22217    /**
22218     * Must be last for serialization purposes
22219     */
22220    LDKSpendingDelay_Sentinel,
22221 } LDKSpendingDelay_Tag;
22222
22223 typedef struct LDKSpendingDelay_LDKRelative_Body {
22224    /**
22225     * The number of blocks until we'll generate and broadcast the spending transaction.
22226     */
22227    uint32_t num_blocks;
22228 } LDKSpendingDelay_LDKRelative_Body;
22229
22230 typedef struct LDKSpendingDelay_LDKAbsolute_Body {
22231    /**
22232     * The height at which we'll generate and broadcast the spending transaction.
22233     */
22234    uint32_t height;
22235 } LDKSpendingDelay_LDKAbsolute_Body;
22236
22237 typedef struct MUST_USE_STRUCT LDKSpendingDelay {
22238    LDKSpendingDelay_Tag tag;
22239    union {
22240       LDKSpendingDelay_LDKRelative_Body relative;
22241       LDKSpendingDelay_LDKAbsolute_Body absolute;
22242    };
22243 } LDKSpendingDelay;
22244
22245 /**
22246  * A callback which is called when a [`Future`] completes.
22247  *
22248  * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
22249  * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
22250  * instead.
22251  *
22252  * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
22253  * futures when they receive a wake, rather than immediately executing them.
22254  */
22255 typedef struct LDKFutureCallback {
22256    /**
22257     * An opaque pointer which is passed to your function implementations as an argument.
22258     * This has no meaning in the LDK, and can be NULL or any other value.
22259     */
22260    void *this_arg;
22261    /**
22262     * The method which is called.
22263     */
22264    void (*call)(const void *this_arg);
22265    /**
22266     * Frees any resources associated with this object given its this_arg pointer.
22267     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22268     */
22269    void (*free)(void *this_arg);
22270 } LDKFutureCallback;
22271
22272
22273
22274 /**
22275  * A struct which can be used to select across many [`Future`]s at once without relying on a full
22276  * async context.
22277  */
22278 typedef struct MUST_USE_STRUCT LDKSleeper {
22279    /**
22280     * A pointer to the opaque Rust object.
22281     * Nearly everywhere, inner must be non-null, however in places where
22282     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22283     */
22284    LDKnativeSleeper *inner;
22285    /**
22286     * Indicates that this is the only struct which contains the same pointer.
22287     * Rust functions which take ownership of an object provided via an argument require
22288     * this to be true and invalidate the object pointed to by inner.
22289     */
22290    bool is_owned;
22291 } LDKSleeper;
22292
22293
22294
22295 /**
22296  * Configuration we set when applicable.
22297  *
22298  * Default::default() provides sane defaults.
22299  */
22300 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
22301    /**
22302     * A pointer to the opaque Rust object.
22303     * Nearly everywhere, inner must be non-null, however in places where
22304     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22305     */
22306    LDKnativeChannelHandshakeConfig *inner;
22307    /**
22308     * Indicates that this is the only struct which contains the same pointer.
22309     * Rust functions which take ownership of an object provided via an argument require
22310     * this to be true and invalidate the object pointed to by inner.
22311     */
22312    bool is_owned;
22313 } LDKChannelHandshakeConfig;
22314
22315
22316
22317 /**
22318  * Optional channel limits which are applied during channel creation.
22319  *
22320  * These limits are only applied to our counterparty's limits, not our own.
22321  *
22322  * Use 0/`<type>::max_value()` as appropriate to skip checking.
22323  *
22324  * Provides sane defaults for most configurations.
22325  *
22326  * Most additional limits are disabled except those with which specify a default in individual
22327  * field documentation. Note that this may result in barely-usable channels, but since they
22328  * are applied mostly only to incoming channels that's not much of a problem.
22329  */
22330 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
22331    /**
22332     * A pointer to the opaque Rust object.
22333     * Nearly everywhere, inner must be non-null, however in places where
22334     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22335     */
22336    LDKnativeChannelHandshakeLimits *inner;
22337    /**
22338     * Indicates that this is the only struct which contains the same pointer.
22339     * Rust functions which take ownership of an object provided via an argument require
22340     * this to be true and invalidate the object pointed to by inner.
22341     */
22342    bool is_owned;
22343 } LDKChannelHandshakeLimits;
22344
22345
22346
22347 /**
22348  * A parallel struct to [`ChannelConfig`] to define partial updates.
22349  */
22350 typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
22351    /**
22352     * A pointer to the opaque Rust object.
22353     * Nearly everywhere, inner must be non-null, however in places where
22354     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22355     */
22356    LDKnativeChannelConfigUpdate *inner;
22357    /**
22358     * Indicates that this is the only struct which contains the same pointer.
22359     * Rust functions which take ownership of an object provided via an argument require
22360     * this to be true and invalidate the object pointed to by inner.
22361     */
22362    bool is_owned;
22363 } LDKChannelConfigUpdate;
22364
22365
22366
22367 /**
22368  * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
22369  *
22370  * Default::default() provides sane defaults for most configurations
22371  * (but currently with 0 relay fees!)
22372  */
22373 typedef struct MUST_USE_STRUCT LDKUserConfig {
22374    /**
22375     * A pointer to the opaque Rust object.
22376     * Nearly everywhere, inner must be non-null, however in places where
22377     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22378     */
22379    LDKnativeUserConfig *inner;
22380    /**
22381     * Indicates that this is the only struct which contains the same pointer.
22382     * Rust functions which take ownership of an object provided via an argument require
22383     * this to be true and invalidate the object pointed to by inner.
22384     */
22385    bool is_owned;
22386 } LDKUserConfig;
22387
22388
22389
22390 /**
22391  * An implementation of [`chain::Watch`] for monitoring channels.
22392  *
22393  * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
22394  * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
22395  * or used independently to monitor channels remotely. See the [module-level documentation] for
22396  * details.
22397  *
22398  * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
22399  * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
22400  * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
22401  * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
22402  * environment with spotty connections, like on mobile.
22403  *
22404  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
22405  * [module-level documentation]: crate::chain::chainmonitor
22406  * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
22407  */
22408 typedef struct MUST_USE_STRUCT LDKChainMonitor {
22409    /**
22410     * A pointer to the opaque Rust object.
22411     * Nearly everywhere, inner must be non-null, however in places where
22412     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22413     */
22414    LDKnativeChainMonitor *inner;
22415    /**
22416     * Indicates that this is the only struct which contains the same pointer.
22417     * Rust functions which take ownership of an object provided via an argument require
22418     * this to be true and invalidate the object pointed to by inner.
22419     */
22420    bool is_owned;
22421 } LDKChainMonitor;
22422
22423 /**
22424  * A trait implemented for objects handling events from [`EventsProvider`].
22425  *
22426  * An async variation also exists for implementations of [`EventsProvider`] that support async
22427  * event handling. The async event handler should satisfy the generic bounds: `F:
22428  * core::future::Future, H: Fn(Event) -> F`.
22429  */
22430 typedef struct LDKEventHandler {
22431    /**
22432     * An opaque pointer which is passed to your function implementations as an argument.
22433     * This has no meaning in the LDK, and can be NULL or any other value.
22434     */
22435    void *this_arg;
22436    /**
22437     * Handles the given [`Event`].
22438     *
22439     * See [`EventsProvider`] for details that must be considered when implementing this method.
22440     */
22441    void (*handle_event)(const void *this_arg, struct LDKEvent event);
22442    /**
22443     * Frees any resources associated with this object given its this_arg pointer.
22444     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22445     */
22446    void (*free)(void *this_arg);
22447 } LDKEventHandler;
22448
22449 /**
22450  * A trait indicating an object may generate events.
22451  *
22452  * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
22453  *
22454  * Implementations of this trait may also feature an async version of event handling, as shown with
22455  * [`ChannelManager::process_pending_events_async`] and
22456  * [`ChainMonitor::process_pending_events_async`].
22457  *
22458  * # Requirements
22459  *
22460  * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
22461  * event since the last invocation.
22462  *
22463  * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
22464  * and replay any unhandled events on startup. An [`Event`] is considered handled when
22465  * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
22466  * relevant changes to disk *before* returning.
22467  *
22468  * Further, because an application may crash between an [`Event`] being handled and the
22469  * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
22470  * effect, [`Event`]s may be replayed.
22471  *
22472  * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
22473  * consult the provider's documentation on the implication of processing events and how a handler
22474  * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
22475  * [`ChainMonitor::process_pending_events`]).
22476  *
22477  * (C-not implementable) As there is likely no reason for a user to implement this trait on their
22478  * own type(s).
22479  *
22480  * [`process_pending_events`]: Self::process_pending_events
22481  * [`handle_event`]: EventHandler::handle_event
22482  * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
22483  * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
22484  * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
22485  * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
22486  */
22487 typedef struct LDKEventsProvider {
22488    /**
22489     * An opaque pointer which is passed to your function implementations as an argument.
22490     * This has no meaning in the LDK, and can be NULL or any other value.
22491     */
22492    void *this_arg;
22493    /**
22494     * Processes any events generated since the last call using the given event handler.
22495     *
22496     * See the trait-level documentation for requirements.
22497     */
22498    void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
22499    /**
22500     * Frees any resources associated with this object given its this_arg pointer.
22501     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22502     */
22503    void (*free)(void *this_arg);
22504 } LDKEventsProvider;
22505
22506 /**
22507  * This enum is used to specify which error data to send to peers when failing back an HTLC
22508  * using [`ChannelManager::fail_htlc_backwards_with_reason`].
22509  *
22510  * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
22511  */
22512 typedef enum LDKFailureCode_Tag {
22513    /**
22514     * We had a temporary error processing the payment. Useful if no other error codes fit
22515     * and you want to indicate that the payer may want to retry.
22516     */
22517    LDKFailureCode_TemporaryNodeFailure,
22518    /**
22519     * We have a required feature which was not in this onion. For example, you may require
22520     * some additional metadata that was not provided with this payment.
22521     */
22522    LDKFailureCode_RequiredNodeFeatureMissing,
22523    /**
22524     * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
22525     * the HTLC is too close to the current block height for safe handling.
22526     * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
22527     * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
22528     */
22529    LDKFailureCode_IncorrectOrUnknownPaymentDetails,
22530    /**
22531     * We failed to process the payload after the onion was decrypted. You may wish to
22532     * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
22533     *
22534     * If available, the tuple data may include the type number and byte offset in the
22535     * decrypted byte stream where the failure occurred.
22536     */
22537    LDKFailureCode_InvalidOnionPayload,
22538    /**
22539     * Must be last for serialization purposes
22540     */
22541    LDKFailureCode_Sentinel,
22542 } LDKFailureCode_Tag;
22543
22544 typedef struct MUST_USE_STRUCT LDKFailureCode {
22545    LDKFailureCode_Tag tag;
22546    union {
22547       struct {
22548          struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
22549       };
22550    };
22551 } LDKFailureCode;
22552
22553
22554
22555 /**
22556  * Chain-related parameters used to construct a new `ChannelManager`.
22557  *
22558  * Typically, the block-specific parameters are derived from the best block hash for the network,
22559  * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
22560  * are not needed when deserializing a previously constructed `ChannelManager`.
22561  */
22562 typedef struct MUST_USE_STRUCT LDKChainParameters {
22563    /**
22564     * A pointer to the opaque Rust object.
22565     * Nearly everywhere, inner must be non-null, however in places where
22566     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22567     */
22568    LDKnativeChainParameters *inner;
22569    /**
22570     * Indicates that this is the only struct which contains the same pointer.
22571     * Rust functions which take ownership of an object provided via an argument require
22572     * this to be true and invalidate the object pointed to by inner.
22573     */
22574    bool is_owned;
22575 } LDKChainParameters;
22576
22577 /**
22578  * A trait indicating an object may generate message send events
22579  */
22580 typedef struct LDKMessageSendEventsProvider {
22581    /**
22582     * An opaque pointer which is passed to your function implementations as an argument.
22583     * This has no meaning in the LDK, and can be NULL or any other value.
22584     */
22585    void *this_arg;
22586    /**
22587     * Gets the list of pending events which were generated by previous actions, clearing the list
22588     * in the process.
22589     */
22590    struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
22591    /**
22592     * Frees any resources associated with this object given its this_arg pointer.
22593     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22594     */
22595    void (*free)(void *this_arg);
22596 } LDKMessageSendEventsProvider;
22597
22598 /**
22599  * A trait to describe an object which can receive channel messages.
22600  *
22601  * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
22602  * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
22603  */
22604 typedef struct LDKChannelMessageHandler {
22605    /**
22606     * An opaque pointer which is passed to your function implementations as an argument.
22607     * This has no meaning in the LDK, and can be NULL or any other value.
22608     */
22609    void *this_arg;
22610    /**
22611     * Handle an incoming `open_channel` message from the given peer.
22612     */
22613    void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
22614    /**
22615     * Handle an incoming `open_channel2` message from the given peer.
22616     */
22617    void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
22618    /**
22619     * Handle an incoming `accept_channel` message from the given peer.
22620     */
22621    void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
22622    /**
22623     * Handle an incoming `accept_channel2` message from the given peer.
22624     */
22625    void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
22626    /**
22627     * Handle an incoming `funding_created` message from the given peer.
22628     */
22629    void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
22630    /**
22631     * Handle an incoming `funding_signed` message from the given peer.
22632     */
22633    void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
22634    /**
22635     * Handle an incoming `channel_ready` message from the given peer.
22636     */
22637    void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
22638    /**
22639     * Handle an incoming `shutdown` message from the given peer.
22640     */
22641    void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
22642    /**
22643     * Handle an incoming `closing_signed` message from the given peer.
22644     */
22645    void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
22646    /**
22647     * Handle an incoming `stfu` message from the given peer.
22648     */
22649    void (*handle_stfu)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKStfu *NONNULL_PTR msg);
22650    /**
22651     * Handle an incoming `tx_add_input message` from the given peer.
22652     */
22653    void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
22654    /**
22655     * Handle an incoming `tx_add_output` message from the given peer.
22656     */
22657    void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
22658    /**
22659     * Handle an incoming `tx_remove_input` message from the given peer.
22660     */
22661    void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
22662    /**
22663     * Handle an incoming `tx_remove_output` message from the given peer.
22664     */
22665    void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
22666    /**
22667     * Handle an incoming `tx_complete message` from the given peer.
22668     */
22669    void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
22670    /**
22671     * Handle an incoming `tx_signatures` message from the given peer.
22672     */
22673    void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
22674    /**
22675     * Handle an incoming `tx_init_rbf` message from the given peer.
22676     */
22677    void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
22678    /**
22679     * Handle an incoming `tx_ack_rbf` message from the given peer.
22680     */
22681    void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
22682    /**
22683     * Handle an incoming `tx_abort message` from the given peer.
22684     */
22685    void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
22686    /**
22687     * Handle an incoming `update_add_htlc` message from the given peer.
22688     */
22689    void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
22690    /**
22691     * Handle an incoming `update_fulfill_htlc` message from the given peer.
22692     */
22693    void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
22694    /**
22695     * Handle an incoming `update_fail_htlc` message from the given peer.
22696     */
22697    void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
22698    /**
22699     * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
22700     */
22701    void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
22702    /**
22703     * Handle an incoming `commitment_signed` message from the given peer.
22704     */
22705    void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
22706    /**
22707     * Handle an incoming `revoke_and_ack` message from the given peer.
22708     */
22709    void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
22710    /**
22711     * Handle an incoming `update_fee` message from the given peer.
22712     */
22713    void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
22714    /**
22715     * Handle an incoming `announcement_signatures` message from the given peer.
22716     */
22717    void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
22718    /**
22719     * Indicates a connection to the peer failed/an existing connection was lost.
22720     */
22721    void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
22722    /**
22723     * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
22724     *
22725     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
22726     * with us. Implementors should be somewhat conservative about doing so, however, as other
22727     * message handlers may still wish to communicate with this peer.
22728     */
22729    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
22730    /**
22731     * Handle an incoming `channel_reestablish` message from the given peer.
22732     */
22733    void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
22734    /**
22735     * Handle an incoming `channel_update` message from the given peer.
22736     */
22737    void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
22738    /**
22739     * Handle an incoming `error` message from the given peer.
22740     */
22741    void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
22742    /**
22743     * Gets the node feature flags which this handler itself supports. All available handlers are
22744     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
22745     * which are broadcasted in our [`NodeAnnouncement`] message.
22746     */
22747    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
22748    /**
22749     * Gets the init feature flags which should be sent to the given peer. All available handlers
22750     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
22751     * which are sent in our [`Init`] message.
22752     *
22753     * Note that this method is called before [`Self::peer_connected`].
22754     */
22755    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
22756    /**
22757     * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
22758     *
22759     * If it's `None`, then no particular network chain hash compatibility will be enforced when
22760     * connecting to peers.
22761     */
22762    struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_chain_hashes)(const void *this_arg);
22763    /**
22764     * Implementation of MessageSendEventsProvider for this object.
22765     */
22766    struct LDKMessageSendEventsProvider MessageSendEventsProvider;
22767    /**
22768     * Frees any resources associated with this object given its this_arg pointer.
22769     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22770     */
22771    void (*free)(void *this_arg);
22772 } LDKChannelMessageHandler;
22773
22774 /**
22775  * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
22776  *
22777  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
22778  */
22779 typedef struct LDKOffersMessageHandler {
22780    /**
22781     * An opaque pointer which is passed to your function implementations as an argument.
22782     * This has no meaning in the LDK, and can be NULL or any other value.
22783     */
22784    void *this_arg;
22785    /**
22786     * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
22787     * or replying with an error.
22788     *
22789     * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
22790     *
22791     * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
22792     */
22793    struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
22794    /**
22795     * Releases any [`OffersMessage`]s that need to be sent.
22796     *
22797     * Typically, this is used for messages initiating a payment flow rather than in response to
22798     * another message. The latter should use the return value of [`Self::handle_message`].
22799     */
22800    struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ (*release_pending_messages)(const void *this_arg);
22801    /**
22802     * Frees any resources associated with this object given its this_arg pointer.
22803     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22804     */
22805    void (*free)(void *this_arg);
22806 } LDKOffersMessageHandler;
22807
22808 /**
22809  * An interface for looking up the node id of a channel counterparty for the purpose of forwarding
22810  * an [`OnionMessage`].
22811  *
22812  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
22813  */
22814 typedef struct LDKNodeIdLookUp {
22815    /**
22816     * An opaque pointer which is passed to your function implementations as an argument.
22817     * This has no meaning in the LDK, and can be NULL or any other value.
22818     */
22819    void *this_arg;
22820    /**
22821     * Returns the node id of the forwarding node's channel counterparty with `short_channel_id`.
22822     *
22823     * Here, the forwarding node is referring to the node of the [`OnionMessenger`] parameterized
22824     * by the [`NodeIdLookUp`] and the counterparty to one of that node's peers.
22825     *
22826     * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
22827     *
22828     * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22829     */
22830    struct LDKPublicKey (*next_node_id)(const void *this_arg, uint64_t short_channel_id);
22831    /**
22832     * Frees any resources associated with this object given its this_arg pointer.
22833     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
22834     */
22835    void (*free)(void *this_arg);
22836 } LDKNodeIdLookUp;
22837
22838
22839
22840 /**
22841  * Arguments for the creation of a ChannelManager that are not deserialized.
22842  *
22843  * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
22844  * is:
22845  * 1) Deserialize all stored [`ChannelMonitor`]s.
22846  * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
22847  *    `<(BlockHash, ChannelManager)>::read(reader, args)`
22848  *    This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
22849  *    [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
22850  * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
22851  *    same way you would handle a [`chain::Filter`] call using
22852  *    [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
22853  * 4) Reconnect blocks on your [`ChannelMonitor`]s.
22854  * 5) Disconnect/connect blocks on the [`ChannelManager`].
22855  * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
22856  *    Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
22857  *    will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
22858  *    the next step.
22859  * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
22860  *    [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
22861  *
22862  * Note that the ordering of #4-7 is not of importance, however all four must occur before you
22863  * call any other methods on the newly-deserialized [`ChannelManager`].
22864  *
22865  * Note that because some channels may be closed during deserialization, it is critical that you
22866  * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
22867  * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
22868  * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
22869  * not force-close the same channels but consider them live), you may end up revoking a state for
22870  * which you've already broadcasted the transaction.
22871  *
22872  * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
22873  */
22874 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
22875    /**
22876     * A pointer to the opaque Rust object.
22877     * Nearly everywhere, inner must be non-null, however in places where
22878     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22879     */
22880    LDKnativeChannelManagerReadArgs *inner;
22881    /**
22882     * Indicates that this is the only struct which contains the same pointer.
22883     * Rust functions which take ownership of an object provided via an argument require
22884     * this to be true and invalidate the object pointed to by inner.
22885     */
22886    bool is_owned;
22887 } LDKChannelManagerReadArgs;
22888
22889
22890
22891 /**
22892  * A set of keys that were HKDF-expanded from an initial call to
22893  * [`NodeSigner::get_inbound_payment_key_material`].
22894  *
22895  * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
22896  */
22897 typedef struct MUST_USE_STRUCT LDKExpandedKey {
22898    /**
22899     * A pointer to the opaque Rust object.
22900     * Nearly everywhere, inner must be non-null, however in places where
22901     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22902     */
22903    LDKnativeExpandedKey *inner;
22904    /**
22905     * Indicates that this is the only struct which contains the same pointer.
22906     * Rust functions which take ownership of an object provided via an argument require
22907     * this to be true and invalidate the object pointed to by inner.
22908     */
22909    bool is_owned;
22910 } LDKExpandedKey;
22911
22912
22913
22914 /**
22915  * Contains fields that are both common to [`open_channel`] and `open_channel2` messages.
22916  *
22917  * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
22918  */
22919 typedef struct MUST_USE_STRUCT LDKCommonOpenChannelFields {
22920    /**
22921     * A pointer to the opaque Rust object.
22922     * Nearly everywhere, inner must be non-null, however in places where
22923     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22924     */
22925    LDKnativeCommonOpenChannelFields *inner;
22926    /**
22927     * Indicates that this is the only struct which contains the same pointer.
22928     * Rust functions which take ownership of an object provided via an argument require
22929     * this to be true and invalidate the object pointed to by inner.
22930     */
22931    bool is_owned;
22932 } LDKCommonOpenChannelFields;
22933
22934
22935
22936 /**
22937  * Contains fields that are both common to [`accept_channel`] and `accept_channel2` messages.
22938  *
22939  * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
22940  */
22941 typedef struct MUST_USE_STRUCT LDKCommonAcceptChannelFields {
22942    /**
22943     * A pointer to the opaque Rust object.
22944     * Nearly everywhere, inner must be non-null, however in places where
22945     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22946     */
22947    LDKnativeCommonAcceptChannelFields *inner;
22948    /**
22949     * Indicates that this is the only struct which contains the same pointer.
22950     * Rust functions which take ownership of an object provided via an argument require
22951     * this to be true and invalidate the object pointed to by inner.
22952     */
22953    bool is_owned;
22954 } LDKCommonAcceptChannelFields;
22955
22956
22957
22958 /**
22959  * Packet of hop data for next peer
22960  */
22961 typedef struct MUST_USE_STRUCT LDKPacket {
22962    /**
22963     * A pointer to the opaque Rust object.
22964     * Nearly everywhere, inner must be non-null, however in places where
22965     * the Rust equivalent takes an Option, it may be set to null to indicate None.
22966     */
22967    LDKnativePacket *inner;
22968    /**
22969     * Indicates that this is the only struct which contains the same pointer.
22970     * Rust functions which take ownership of an object provided via an argument require
22971     * this to be true and invalidate the object pointed to by inner.
22972     */
22973    bool is_owned;
22974 } LDKPacket;
22975
22976 /**
22977  * A trait to describe an object which can receive routing messages.
22978  *
22979  * # Implementor DoS Warnings
22980  *
22981  * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
22982  * handling inbound queries. Implementors using an on-disk network graph should be aware of
22983  * repeated disk I/O for queries accessing different parts of the network graph.
22984  */
22985 typedef struct LDKRoutingMessageHandler {
22986    /**
22987     * An opaque pointer which is passed to your function implementations as an argument.
22988     * This has no meaning in the LDK, and can be NULL or any other value.
22989     */
22990    void *this_arg;
22991    /**
22992     * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
22993     * `false` or returning an `Err` otherwise.
22994     */
22995    struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
22996    /**
22997     * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
22998     * or returning an `Err` otherwise.
22999     */
23000    struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
23001    /**
23002     * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
23003     * `false` or returning an `Err` otherwise.
23004     */
23005    struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
23006    /**
23007     * Gets channel announcements and updates required to dump our routing table to a remote node,
23008     * starting at the `short_channel_id` indicated by `starting_point` and including announcements
23009     * for a single channel.
23010     */
23011    struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
23012    /**
23013     * Gets a node announcement required to dump our routing table to a remote node, starting at
23014     * the node *after* the provided pubkey and including up to one announcement immediately
23015     * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
23016     * If `None` is provided for `starting_point`, we start at the first node.
23017     *
23018     * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
23019     * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23020     */
23021    struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
23022    /**
23023     * Called when a connection is established with a peer. This can be used to
23024     * perform routing table synchronization using a strategy defined by the
23025     * implementor.
23026     *
23027     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
23028     * with us. Implementors should be somewhat conservative about doing so, however, as other
23029     * message handlers may still wish to communicate with this peer.
23030     */
23031    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
23032    /**
23033     * Handles the reply of a query we initiated to learn about channels
23034     * for a given range of blocks. We can expect to receive one or more
23035     * replies to a single query.
23036     */
23037    struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
23038    /**
23039     * Handles the reply of a query we initiated asking for routing gossip
23040     * messages for a list of channels. We should receive this message when
23041     * a node has completed its best effort to send us the pertaining routing
23042     * gossip messages.
23043     */
23044    struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
23045    /**
23046     * Handles when a peer asks us to send a list of `short_channel_id`s
23047     * for the requested range of blocks.
23048     */
23049    struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
23050    /**
23051     * Handles when a peer asks us to send routing gossip messages for a
23052     * list of `short_channel_id`s.
23053     */
23054    struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
23055    /**
23056     * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
23057     * pending some async action. While there is no guarantee of the rate of future messages, the
23058     * caller should seek to reduce the rate of new gossip messages handled, especially
23059     * [`ChannelAnnouncement`]s.
23060     */
23061    bool (*processing_queue_high)(const void *this_arg);
23062    /**
23063     * Gets the node feature flags which this handler itself supports. All available handlers are
23064     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23065     * which are broadcasted in our [`NodeAnnouncement`] message.
23066     */
23067    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23068    /**
23069     * Gets the init feature flags which should be sent to the given peer. All available handlers
23070     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23071     * which are sent in our [`Init`] message.
23072     *
23073     * Note that this method is called before [`Self::peer_connected`].
23074     */
23075    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23076    /**
23077     * Implementation of MessageSendEventsProvider for this object.
23078     */
23079    struct LDKMessageSendEventsProvider MessageSendEventsProvider;
23080    /**
23081     * Frees any resources associated with this object given its this_arg pointer.
23082     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23083     */
23084    void (*free)(void *this_arg);
23085 } LDKRoutingMessageHandler;
23086
23087 /**
23088  * A handler for received [`OnionMessage`]s and for providing generated ones to send.
23089  */
23090 typedef struct LDKOnionMessageHandler {
23091    /**
23092     * An opaque pointer which is passed to your function implementations as an argument.
23093     * This has no meaning in the LDK, and can be NULL or any other value.
23094     */
23095    void *this_arg;
23096    /**
23097     * Because much of the lightning network does not yet support forwarding onion messages, we
23098     * may need to directly connect to a node which will forward a message for us. In such a case,
23099     * this method will return the set of nodes which need connection by node_id and the
23100     * corresponding socket addresses where they may accept incoming connections.
23101     *
23102     * Thus, this method should be polled regularly to detect messages await such a direct
23103     * connection.
23104     */
23105    struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ (*get_and_clear_connections_needed)(const void *this_arg);
23106    /**
23107     * Handle an incoming `onion_message` message from the given peer.
23108     */
23109    void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
23110    /**
23111     * Returns the next pending onion message for the peer with the given node id.
23112     *
23113     * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23114     */
23115    struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
23116    /**
23117     * Called when a connection is established with a peer. Can be used to track which peers
23118     * advertise onion message support and are online.
23119     *
23120     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
23121     * with us. Implementors should be somewhat conservative about doing so, however, as other
23122     * message handlers may still wish to communicate with this peer.
23123     */
23124    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
23125    /**
23126     * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
23127     * drop and refuse to forward onion messages to this peer.
23128     */
23129    void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
23130    /**
23131     * Performs actions that should happen roughly every ten seconds after startup. Allows handlers
23132     * to drop any buffered onion messages intended for prospective peers.
23133     */
23134    void (*timer_tick_occurred)(const void *this_arg);
23135    /**
23136     * Gets the node feature flags which this handler itself supports. All available handlers are
23137     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23138     * which are broadcasted in our [`NodeAnnouncement`] message.
23139     */
23140    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23141    /**
23142     * Gets the init feature flags which should be sent to the given peer. All available handlers
23143     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23144     * which are sent in our [`Init`] message.
23145     *
23146     * Note that this method is called before [`Self::peer_connected`].
23147     */
23148    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23149    /**
23150     * Frees any resources associated with this object given its this_arg pointer.
23151     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23152     */
23153    void (*free)(void *this_arg);
23154 } LDKOnionMessageHandler;
23155
23156
23157
23158 /**
23159  * BOLT 4 onion packet including hop data for the next peer.
23160  */
23161 typedef struct MUST_USE_STRUCT LDKTrampolineOnionPacket {
23162    /**
23163     * A pointer to the opaque Rust object.
23164     * Nearly everywhere, inner must be non-null, however in places where
23165     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23166     */
23167    LDKnativeTrampolineOnionPacket *inner;
23168    /**
23169     * Indicates that this is the only struct which contains the same pointer.
23170     * Rust functions which take ownership of an object provided via an argument require
23171     * this to be true and invalidate the object pointed to by inner.
23172     */
23173    bool is_owned;
23174 } LDKTrampolineOnionPacket;
23175
23176 /**
23177  * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
23178  * decoders.
23179  */
23180 typedef struct LDKCustomMessageReader {
23181    /**
23182     * An opaque pointer which is passed to your function implementations as an argument.
23183     * This has no meaning in the LDK, and can be NULL or any other value.
23184     */
23185    void *this_arg;
23186    /**
23187     * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
23188     * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
23189     * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
23190     * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
23191     */
23192    struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
23193    /**
23194     * Frees any resources associated with this object given its this_arg pointer.
23195     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23196     */
23197    void (*free)(void *this_arg);
23198 } LDKCustomMessageReader;
23199
23200 /**
23201  * A handler provided to [`PeerManager`] for reading and handling custom messages.
23202  *
23203  * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
23204  * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
23205  * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
23206  *
23207  * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
23208  * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
23209  */
23210 typedef struct LDKCustomMessageHandler {
23211    /**
23212     * An opaque pointer which is passed to your function implementations as an argument.
23213     * This has no meaning in the LDK, and can be NULL or any other value.
23214     */
23215    void *this_arg;
23216    /**
23217     * Handles the given message sent from `sender_node_id`, possibly producing messages for
23218     * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
23219     * to send.
23220     */
23221    struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
23222    /**
23223     * Returns the list of pending messages that were generated by the handler, clearing the list
23224     * in the process. Each message is paired with the node id of the intended recipient. If no
23225     * connection to the node exists, then the message is simply not sent.
23226     */
23227    struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
23228    /**
23229     * Gets the node feature flags which this handler itself supports. All available handlers are
23230     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
23231     * which are broadcasted in our [`NodeAnnouncement`] message.
23232     *
23233     * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
23234     */
23235    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
23236    /**
23237     * Gets the init feature flags which should be sent to the given peer. All available handlers
23238     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
23239     * which are sent in our [`Init`] message.
23240     *
23241     * [`Init`]: crate::ln::msgs::Init
23242     */
23243    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
23244    /**
23245     * Implementation of CustomMessageReader for this object.
23246     */
23247    struct LDKCustomMessageReader CustomMessageReader;
23248    /**
23249     * Frees any resources associated with this object given its this_arg pointer.
23250     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23251     */
23252    void (*free)(void *this_arg);
23253 } LDKCustomMessageHandler;
23254
23255
23256
23257 /**
23258  * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
23259  * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
23260  */
23261 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
23262    /**
23263     * A pointer to the opaque Rust object.
23264     * Nearly everywhere, inner must be non-null, however in places where
23265     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23266     */
23267    LDKnativeIgnoringMessageHandler *inner;
23268    /**
23269     * Indicates that this is the only struct which contains the same pointer.
23270     * Rust functions which take ownership of an object provided via an argument require
23271     * this to be true and invalidate the object pointed to by inner.
23272     */
23273    bool is_owned;
23274 } LDKIgnoringMessageHandler;
23275
23276 /**
23277  * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
23278  * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
23279  * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
23280  * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
23281  * message types.
23282  *
23283  * See [`OnionMessenger`] for example usage.
23284  *
23285  * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
23286  * [`CustomMessage`]: Self::CustomMessage
23287  */
23288 typedef struct LDKCustomOnionMessageHandler {
23289    /**
23290     * An opaque pointer which is passed to your function implementations as an argument.
23291     * This has no meaning in the LDK, and can be NULL or any other value.
23292     */
23293    void *this_arg;
23294    /**
23295     * Called with the custom message that was received, returning a response to send, if any.
23296     *
23297     * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
23298     */
23299    struct LDKCOption_OnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKOnionMessageContents msg);
23300    /**
23301     * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
23302     * message type is unknown.
23303     */
23304    struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
23305    /**
23306     * Releases any [`Self::CustomMessage`]s that need to be sent.
23307     *
23308     * Typically, this is used for messages initiating a message flow rather than in response to
23309     * another message. The latter should use the return value of [`Self::handle_custom_message`].
23310     */
23311    struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ (*release_pending_custom_messages)(const void *this_arg);
23312    /**
23313     * Frees any resources associated with this object given its this_arg pointer.
23314     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23315     */
23316    void (*free)(void *this_arg);
23317 } LDKCustomOnionMessageHandler;
23318
23319
23320
23321 /**
23322  * A dummy struct which implements `ChannelMessageHandler` without having any channels.
23323  * You can provide one of these as the route_handler in a MessageHandler.
23324  */
23325 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
23326    /**
23327     * A pointer to the opaque Rust object.
23328     * Nearly everywhere, inner must be non-null, however in places where
23329     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23330     */
23331    LDKnativeErroringMessageHandler *inner;
23332    /**
23333     * Indicates that this is the only struct which contains the same pointer.
23334     * Rust functions which take ownership of an object provided via an argument require
23335     * this to be true and invalidate the object pointed to by inner.
23336     */
23337    bool is_owned;
23338 } LDKErroringMessageHandler;
23339
23340
23341
23342 /**
23343  * Provides references to trait impls which handle different types of messages.
23344  */
23345 typedef struct MUST_USE_STRUCT LDKMessageHandler {
23346    /**
23347     * A pointer to the opaque Rust object.
23348     * Nearly everywhere, inner must be non-null, however in places where
23349     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23350     */
23351    LDKnativeMessageHandler *inner;
23352    /**
23353     * Indicates that this is the only struct which contains the same pointer.
23354     * Rust functions which take ownership of an object provided via an argument require
23355     * this to be true and invalidate the object pointed to by inner.
23356     */
23357    bool is_owned;
23358 } LDKMessageHandler;
23359
23360 /**
23361  * Provides an object which can be used to send data to and which uniquely identifies a connection
23362  * to a remote host. You will need to be able to generate multiple of these which meet Eq and
23363  * implement Hash to meet the PeerManager API.
23364  *
23365  * For efficiency, [`Clone`] should be relatively cheap for this type.
23366  *
23367  * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
23368  * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
23369  * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
23370  * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
23371  * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
23372  * to simply use another value which is guaranteed to be globally unique instead.
23373  */
23374 typedef struct LDKSocketDescriptor {
23375    /**
23376     * An opaque pointer which is passed to your function implementations as an argument.
23377     * This has no meaning in the LDK, and can be NULL or any other value.
23378     */
23379    void *this_arg;
23380    /**
23381     * Attempts to send some data from the given slice to the peer.
23382     *
23383     * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
23384     * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
23385     * called and further write attempts may occur until that time.
23386     *
23387     * If the returned size is smaller than `data.len()`, a
23388     * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
23389     * written. Additionally, until a `send_data` event completes fully, no further
23390     * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
23391     * prevent denial-of-service issues, you should not read or buffer any data from the socket
23392     * until then.
23393     *
23394     * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
23395     * (indicating that read events should be paused to prevent DoS in the send buffer),
23396     * `resume_read` may be set indicating that read events on this descriptor should resume. A
23397     * `resume_read` of false carries no meaning, and should not cause any action.
23398     */
23399    uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
23400    /**
23401     * Disconnect the socket pointed to by this SocketDescriptor.
23402     *
23403     * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
23404     * call (doing so is a noop).
23405     */
23406    void (*disconnect_socket)(void *this_arg);
23407    /**
23408     * Checks if two objects are equal given this object's this_arg pointer and another object.
23409     */
23410    bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
23411    /**
23412     * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
23413     * This is used, for example, for inclusion of this object in a hash map.
23414     */
23415    uint64_t (*hash)(const void *this_arg);
23416    /**
23417     * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
23418     * The new SocketDescriptor is provided, and should be mutated as needed to perform a
23419     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
23420     */
23421    void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
23422    /**
23423     * Frees any resources associated with this object given its this_arg pointer.
23424     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23425     */
23426    void (*free)(void *this_arg);
23427 } LDKSocketDescriptor;
23428
23429
23430
23431 /**
23432  * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
23433  * socket events into messages which it passes on to its [`MessageHandler`].
23434  *
23435  * Locks are taken internally, so you must never assume that reentrancy from a
23436  * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
23437  *
23438  * Calls to [`read_event`] will decode relevant messages and pass them to the
23439  * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
23440  * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
23441  * [`PeerManager`] functions related to the same connection must occur only in serial, making new
23442  * calls only after previous ones have returned.
23443  *
23444  * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
23445  * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
23446  * essentially you should default to using a [`SimpleRefPeerManager`], and use a
23447  * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
23448  * you're using lightning-net-tokio.
23449  *
23450  * [`read_event`]: PeerManager::read_event
23451  */
23452 typedef struct MUST_USE_STRUCT LDKPeerManager {
23453    /**
23454     * A pointer to the opaque Rust object.
23455     * Nearly everywhere, inner must be non-null, however in places where
23456     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23457     */
23458    LDKnativePeerManager *inner;
23459    /**
23460     * Indicates that this is the only struct which contains the same pointer.
23461     * Rust functions which take ownership of an object provided via an argument require
23462     * this to be true and invalidate the object pointed to by inner.
23463     */
23464    bool is_owned;
23465 } LDKPeerManager;
23466
23467
23468
23469 /**
23470  * Static channel fields used to build transactions given per-commitment fields, organized by
23471  * broadcaster/countersignatory.
23472  *
23473  * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
23474  * as_holder_broadcastable and as_counterparty_broadcastable functions.
23475  */
23476 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
23477    /**
23478     * A pointer to the opaque Rust object.
23479     * Nearly everywhere, inner must be non-null, however in places where
23480     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23481     */
23482    LDKnativeDirectedChannelTransactionParameters *inner;
23483    /**
23484     * Indicates that this is the only struct which contains the same pointer.
23485     * Rust functions which take ownership of an object provided via an argument require
23486     * this to be true and invalidate the object pointed to by inner.
23487     */
23488    bool is_owned;
23489 } LDKDirectedChannelTransactionParameters;
23490
23491
23492
23493 /**
23494  * Features used within an `offer`.
23495  */
23496 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
23497    /**
23498     * A pointer to the opaque Rust object.
23499     * Nearly everywhere, inner must be non-null, however in places where
23500     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23501     */
23502    LDKnativeOfferFeatures *inner;
23503    /**
23504     * Indicates that this is the only struct which contains the same pointer.
23505     * Rust functions which take ownership of an object provided via an argument require
23506     * this to be true and invalidate the object pointed to by inner.
23507     */
23508    bool is_owned;
23509 } LDKOfferFeatures;
23510
23511
23512
23513 /**
23514  * Features used within an `invoice_request`.
23515  */
23516 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
23517    /**
23518     * A pointer to the opaque Rust object.
23519     * Nearly everywhere, inner must be non-null, however in places where
23520     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23521     */
23522    LDKnativeInvoiceRequestFeatures *inner;
23523    /**
23524     * Indicates that this is the only struct which contains the same pointer.
23525     * Rust functions which take ownership of an object provided via an argument require
23526     * this to be true and invalidate the object pointed to by inner.
23527     */
23528    bool is_owned;
23529 } LDKInvoiceRequestFeatures;
23530
23531 /**
23532  * Represents a tweaked X-only public key as required for BIP 340 (Taproot).
23533  */
23534 typedef struct LDKTweakedPublicKey {
23535    /**
23536     * The bytes of the public key X coordinate
23537     */
23538    uint8_t x_coordinate[32];
23539 } LDKTweakedPublicKey;
23540
23541 /**
23542  * A function for signing an [`UnsignedBolt12Invoice`].
23543  */
23544 typedef struct LDKSignBolt12InvoiceFn {
23545    /**
23546     * An opaque pointer which is passed to your function implementations as an argument.
23547     * This has no meaning in the LDK, and can be NULL or any other value.
23548     */
23549    void *this_arg;
23550    /**
23551     * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
23552     */
23553    struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR message);
23554    /**
23555     * Frees any resources associated with this object given its this_arg pointer.
23556     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23557     */
23558    void (*free)(void *this_arg);
23559 } LDKSignBolt12InvoiceFn;
23560
23561
23562
23563 /**
23564  * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
23565  * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
23566  *
23567  * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
23568  * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
23569  */
23570 typedef struct MUST_USE_STRUCT LDKTaggedHash {
23571    /**
23572     * A pointer to the opaque Rust object.
23573     * Nearly everywhere, inner must be non-null, however in places where
23574     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23575     */
23576    LDKnativeTaggedHash *inner;
23577    /**
23578     * Indicates that this is the only struct which contains the same pointer.
23579     * Rust functions which take ownership of an object provided via an argument require
23580     * this to be true and invalidate the object pointed to by inner.
23581     */
23582    bool is_owned;
23583 } LDKTaggedHash;
23584
23585
23586
23587 /**
23588  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
23589  *
23590  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
23591  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
23592  */
23593 typedef struct MUST_USE_STRUCT LDKErroneousField {
23594    /**
23595     * A pointer to the opaque Rust object.
23596     * Nearly everywhere, inner must be non-null, however in places where
23597     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23598     */
23599    LDKnativeErroneousField *inner;
23600    /**
23601     * Indicates that this is the only struct which contains the same pointer.
23602     * Rust functions which take ownership of an object provided via an argument require
23603     * this to be true and invalidate the object pointed to by inner.
23604     */
23605    bool is_owned;
23606 } LDKErroneousField;
23607
23608 /**
23609  * A function for signing an [`UnsignedInvoiceRequest`].
23610  */
23611 typedef struct LDKSignInvoiceRequestFn {
23612    /**
23613     * An opaque pointer which is passed to your function implementations as an argument.
23614     * This has no meaning in the LDK, and can be NULL or any other value.
23615     */
23616    void *this_arg;
23617    /**
23618     * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
23619     */
23620    struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR message);
23621    /**
23622     * Frees any resources associated with this object given its this_arg pointer.
23623     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23624     */
23625    void (*free)(void *this_arg);
23626 } LDKSignInvoiceRequestFn;
23627
23628 /**
23629  * Error when signing messages.
23630  */
23631 typedef enum LDKSignError_Tag {
23632    /**
23633     * User-defined error when signing the message.
23634     */
23635    LDKSignError_Signing,
23636    /**
23637     * Error when verifying the produced signature using the given pubkey.
23638     */
23639    LDKSignError_Verification,
23640    /**
23641     * Must be last for serialization purposes
23642     */
23643    LDKSignError_Sentinel,
23644 } LDKSignError_Tag;
23645
23646 typedef struct MUST_USE_STRUCT LDKSignError {
23647    LDKSignError_Tag tag;
23648    union {
23649       struct {
23650          enum LDKSecp256k1Error verification;
23651       };
23652    };
23653 } LDKSignError;
23654
23655
23656
23657 /**
23658  * Receives and validates network updates from peers,
23659  * stores authentic and relevant data as a network graph.
23660  * This network graph is then used for routing payments.
23661  * Provides interface to help with initial routing sync by
23662  * serving historical announcements.
23663  */
23664 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
23665    /**
23666     * A pointer to the opaque Rust object.
23667     * Nearly everywhere, inner must be non-null, however in places where
23668     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23669     */
23670    LDKnativeP2PGossipSync *inner;
23671    /**
23672     * Indicates that this is the only struct which contains the same pointer.
23673     * Rust functions which take ownership of an object provided via an argument require
23674     * this to be true and invalidate the object pointed to by inner.
23675     */
23676    bool is_owned;
23677 } LDKP2PGossipSync;
23678
23679
23680
23681 /**
23682  * A read-only view of [`NetworkGraph`].
23683  */
23684 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
23685    /**
23686     * A pointer to the opaque Rust object.
23687     * Nearly everywhere, inner must be non-null, however in places where
23688     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23689     */
23690    LDKnativeReadOnlyNetworkGraph *inner;
23691    /**
23692     * Indicates that this is the only struct which contains the same pointer.
23693     * Rust functions which take ownership of an object provided via an argument require
23694     * this to be true and invalidate the object pointed to by inner.
23695     */
23696    bool is_owned;
23697 } LDKReadOnlyNetworkGraph;
23698
23699
23700
23701 /**
23702  * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
23703  * source node to a target node.
23704  */
23705 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
23706    /**
23707     * A pointer to the opaque Rust object.
23708     * Nearly everywhere, inner must be non-null, however in places where
23709     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23710     */
23711    LDKnativeDirectedChannelInfo *inner;
23712    /**
23713     * Indicates that this is the only struct which contains the same pointer.
23714     * Rust functions which take ownership of an object provided via an argument require
23715     * this to be true and invalidate the object pointed to by inner.
23716     */
23717    bool is_owned;
23718 } LDKDirectedChannelInfo;
23719
23720 /**
23721  * The effective capacity of a channel for routing purposes.
23722  *
23723  * While this may be smaller than the actual channel capacity, amounts greater than
23724  * [`Self::as_msat`] should not be routed through the channel.
23725  */
23726 typedef enum LDKEffectiveCapacity_Tag {
23727    /**
23728     * The available liquidity in the channel known from being a channel counterparty, and thus a
23729     * direct hop.
23730     */
23731    LDKEffectiveCapacity_ExactLiquidity,
23732    /**
23733     * The maximum HTLC amount in one direction as advertised on the gossip network.
23734     */
23735    LDKEffectiveCapacity_AdvertisedMaxHTLC,
23736    /**
23737     * The total capacity of the channel as determined by the funding transaction.
23738     */
23739    LDKEffectiveCapacity_Total,
23740    /**
23741     * A capacity sufficient to route any payment, typically used for private channels provided by
23742     * an invoice.
23743     */
23744    LDKEffectiveCapacity_Infinite,
23745    /**
23746     * The maximum HTLC amount as provided by an invoice route hint.
23747     */
23748    LDKEffectiveCapacity_HintMaxHTLC,
23749    /**
23750     * A capacity that is unknown possibly because either the chain state is unavailable to know
23751     * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
23752     */
23753    LDKEffectiveCapacity_Unknown,
23754    /**
23755     * Must be last for serialization purposes
23756     */
23757    LDKEffectiveCapacity_Sentinel,
23758 } LDKEffectiveCapacity_Tag;
23759
23760 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
23761    /**
23762     * Either the inbound or outbound liquidity depending on the direction, denominated in
23763     * millisatoshi.
23764     */
23765    uint64_t liquidity_msat;
23766 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
23767
23768 typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
23769    /**
23770     * The maximum HTLC amount denominated in millisatoshi.
23771     */
23772    uint64_t amount_msat;
23773 } LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
23774
23775 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
23776    /**
23777     * The funding amount denominated in millisatoshi.
23778     */
23779    uint64_t capacity_msat;
23780    /**
23781     * The maximum HTLC amount denominated in millisatoshi.
23782     */
23783    uint64_t htlc_maximum_msat;
23784 } LDKEffectiveCapacity_LDKTotal_Body;
23785
23786 typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
23787    /**
23788     * The maximum HTLC amount denominated in millisatoshi.
23789     */
23790    uint64_t amount_msat;
23791 } LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
23792
23793 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
23794    LDKEffectiveCapacity_Tag tag;
23795    union {
23796       LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
23797       LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
23798       LDKEffectiveCapacity_LDKTotal_Body total;
23799       LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
23800    };
23801 } LDKEffectiveCapacity;
23802
23803
23804
23805 /**
23806  * A [`Router`] implemented using [`find_route`].
23807  */
23808 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
23809    /**
23810     * A pointer to the opaque Rust object.
23811     * Nearly everywhere, inner must be non-null, however in places where
23812     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23813     */
23814    LDKnativeDefaultRouter *inner;
23815    /**
23816     * Indicates that this is the only struct which contains the same pointer.
23817     * Rust functions which take ownership of an object provided via an argument require
23818     * this to be true and invalidate the object pointed to by inner.
23819     */
23820    bool is_owned;
23821 } LDKDefaultRouter;
23822
23823
23824
23825 /**
23826  * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
23827  *
23828  * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
23829  * [`find_route`].
23830  *
23831  * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
23832  */
23833 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
23834    /**
23835     * A pointer to the opaque Rust object.
23836     * Nearly everywhere, inner must be non-null, however in places where
23837     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23838     */
23839    LDKnativeScorerAccountingForInFlightHtlcs *inner;
23840    /**
23841     * Indicates that this is the only struct which contains the same pointer.
23842     * Rust functions which take ownership of an object provided via an argument require
23843     * this to be true and invalidate the object pointed to by inner.
23844     */
23845    bool is_owned;
23846 } LDKScorerAccountingForInFlightHtlcs;
23847
23848 /**
23849  * The recipient of a payment, differing based on whether they've hidden their identity with route
23850  * blinding.
23851  */
23852 typedef enum LDKPayee_Tag {
23853    /**
23854     * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
23855     * will be included in the final [`Route`].
23856     */
23857    LDKPayee_Blinded,
23858    /**
23859     * The recipient included these route hints in their BOLT11 invoice.
23860     */
23861    LDKPayee_Clear,
23862    /**
23863     * Must be last for serialization purposes
23864     */
23865    LDKPayee_Sentinel,
23866 } LDKPayee_Tag;
23867
23868 typedef struct LDKPayee_LDKBlinded_Body {
23869    /**
23870     * Aggregated routing info and blinded paths, for routing to the payee without knowing their
23871     * node id.
23872     */
23873    struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
23874    /**
23875     * Features supported by the payee.
23876     *
23877     * May be set from the payee's invoice. May be `None` if the invoice does not contain any
23878     * features.
23879     *
23880     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
23881     */
23882    struct LDKBolt12InvoiceFeatures features;
23883 } LDKPayee_LDKBlinded_Body;
23884
23885 typedef struct LDKPayee_LDKClear_Body {
23886    /**
23887     * The node id of the payee.
23888     */
23889    struct LDKPublicKey node_id;
23890    /**
23891     * Hints for routing to the payee, containing channels connecting the payee to public nodes.
23892     */
23893    struct LDKCVec_RouteHintZ route_hints;
23894    /**
23895     * Features supported by the payee.
23896     *
23897     * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
23898     * does not contain any features.
23899     *
23900     * [`for_keysend`]: PaymentParameters::for_keysend
23901     *
23902     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
23903     */
23904    struct LDKBolt11InvoiceFeatures features;
23905    /**
23906     * The minimum CLTV delta at the end of the route. This value must not be zero.
23907     */
23908    uint32_t final_cltv_expiry_delta;
23909 } LDKPayee_LDKClear_Body;
23910
23911 typedef struct MUST_USE_STRUCT LDKPayee {
23912    LDKPayee_Tag tag;
23913    union {
23914       LDKPayee_LDKBlinded_Body blinded;
23915       LDKPayee_LDKClear_Body clear;
23916    };
23917 } LDKPayee;
23918
23919 /**
23920  * A trait which can both lookup and update routing channel penalty scores.
23921  *
23922  * This is used in places where both bounds are required and implemented for all types which
23923  * implement [`ScoreLookUp`] and [`ScoreUpdate`].
23924  *
23925  * Bindings users may need to manually implement this for their custom scoring implementations.
23926  */
23927 typedef struct LDKScore {
23928    /**
23929     * An opaque pointer which is passed to your function implementations as an argument.
23930     * This has no meaning in the LDK, and can be NULL or any other value.
23931     */
23932    void *this_arg;
23933    /**
23934     * Implementation of ScoreLookUp for this object.
23935     */
23936    struct LDKScoreLookUp ScoreLookUp;
23937    /**
23938     * Implementation of ScoreUpdate for this object.
23939     */
23940    struct LDKScoreUpdate ScoreUpdate;
23941    /**
23942     * Serialize the object into a byte array
23943     */
23944    struct LDKCVec_u8Z (*write)(const void *this_arg);
23945    /**
23946     * Frees any resources associated with this object given its this_arg pointer.
23947     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
23948     */
23949    void (*free)(void *this_arg);
23950 } LDKScore;
23951
23952
23953
23954 /**
23955  * A concrete implementation of [`LockableScore`] which supports multi-threading.
23956  */
23957 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
23958    /**
23959     * A pointer to the opaque Rust object.
23960     * Nearly everywhere, inner must be non-null, however in places where
23961     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23962     */
23963    LDKnativeMultiThreadedLockableScore *inner;
23964    /**
23965     * Indicates that this is the only struct which contains the same pointer.
23966     * Rust functions which take ownership of an object provided via an argument require
23967     * this to be true and invalidate the object pointed to by inner.
23968     */
23969    bool is_owned;
23970 } LDKMultiThreadedLockableScore;
23971
23972
23973
23974 /**
23975  * A locked `MultiThreadedLockableScore`.
23976  */
23977 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
23978    /**
23979     * A pointer to the opaque Rust object.
23980     * Nearly everywhere, inner must be non-null, however in places where
23981     * the Rust equivalent takes an Option, it may be set to null to indicate None.
23982     */
23983    LDKnativeMultiThreadedScoreLockRead *inner;
23984    /**
23985     * Indicates that this is the only struct which contains the same pointer.
23986     * Rust functions which take ownership of an object provided via an argument require
23987     * this to be true and invalidate the object pointed to by inner.
23988     */
23989    bool is_owned;
23990 } LDKMultiThreadedScoreLockRead;
23991
23992
23993
23994 /**
23995  * A locked `MultiThreadedLockableScore`.
23996  */
23997 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
23998    /**
23999     * A pointer to the opaque Rust object.
24000     * Nearly everywhere, inner must be non-null, however in places where
24001     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24002     */
24003    LDKnativeMultiThreadedScoreLockWrite *inner;
24004    /**
24005     * Indicates that this is the only struct which contains the same pointer.
24006     * Rust functions which take ownership of an object provided via an argument require
24007     * this to be true and invalidate the object pointed to by inner.
24008     */
24009    bool is_owned;
24010 } LDKMultiThreadedScoreLockWrite;
24011
24012
24013
24014 /**
24015  * Parameters for configuring [`ProbabilisticScorer`].
24016  *
24017  * Used to configure decay parameters that are static throughout the lifetime of the scorer.
24018  * these decay parameters affect the score of the channel penalty and are not changed on a
24019  * per-route penalty cost call.
24020  */
24021 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
24022    /**
24023     * A pointer to the opaque Rust object.
24024     * Nearly everywhere, inner must be non-null, however in places where
24025     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24026     */
24027    LDKnativeProbabilisticScoringDecayParameters *inner;
24028    /**
24029     * Indicates that this is the only struct which contains the same pointer.
24030     * Rust functions which take ownership of an object provided via an argument require
24031     * this to be true and invalidate the object pointed to by inner.
24032     */
24033    bool is_owned;
24034 } LDKProbabilisticScoringDecayParameters;
24035
24036
24037
24038 /**
24039  * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
24040  * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
24041  *
24042  * Your `node_id` is seed/0'.
24043  * Unilateral closes may use seed/1'.
24044  * Cooperative closes may use seed/2'.
24045  * The two close keys may be needed to claim on-chain funds!
24046  *
24047  * This struct cannot be used for nodes that wish to support receiving phantom payments;
24048  * [`PhantomKeysManager`] must be used instead.
24049  *
24050  * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
24051  * previously issued invoices and attempts to pay previous invoices will fail.
24052  */
24053 typedef struct MUST_USE_STRUCT LDKKeysManager {
24054    /**
24055     * A pointer to the opaque Rust object.
24056     * Nearly everywhere, inner must be non-null, however in places where
24057     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24058     */
24059    LDKnativeKeysManager *inner;
24060    /**
24061     * Indicates that this is the only struct which contains the same pointer.
24062     * Rust functions which take ownership of an object provided via an argument require
24063     * this to be true and invalidate the object pointed to by inner.
24064     */
24065    bool is_owned;
24066 } LDKKeysManager;
24067
24068
24069
24070 /**
24071  * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
24072  * payments.
24073  *
24074  * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
24075  * paid to one of multiple nodes. This works because we encode the invoice route hints such that
24076  * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
24077  * itself without ever needing to forward to this fake node.
24078  *
24079  * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
24080  * provide some fault tolerance, because payers will automatically retry paying other provided
24081  * nodes in the case that one node goes down.
24082  *
24083  * Note that multi-path payments are not supported in phantom invoices for security reasons.
24084  * Switching between this struct and [`KeysManager`] will invalidate any previously issued
24085  * invoices and attempts to pay previous invoices will fail.
24086  */
24087 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
24088    /**
24089     * A pointer to the opaque Rust object.
24090     * Nearly everywhere, inner must be non-null, however in places where
24091     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24092     */
24093    LDKnativePhantomKeysManager *inner;
24094    /**
24095     * Indicates that this is the only struct which contains the same pointer.
24096     * Rust functions which take ownership of an object provided via an argument require
24097     * this to be true and invalidate the object pointed to by inner.
24098     */
24099    bool is_owned;
24100 } LDKPhantomKeysManager;
24101
24102
24103
24104 /**
24105  * An implementation of [`EntropySource`] using ChaCha20.
24106  */
24107 typedef struct MUST_USE_STRUCT LDKRandomBytes {
24108    /**
24109     * A pointer to the opaque Rust object.
24110     * Nearly everywhere, inner must be non-null, however in places where
24111     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24112     */
24113    LDKnativeRandomBytes *inner;
24114    /**
24115     * Indicates that this is the only struct which contains the same pointer.
24116     * Rust functions which take ownership of an object provided via an argument require
24117     * this to be true and invalidate the object pointed to by inner.
24118     */
24119    bool is_owned;
24120 } LDKRandomBytes;
24121
24122
24123
24124 /**
24125  * A sender, receiver and forwarder of [`OnionMessage`]s.
24126  *
24127  * # Handling Messages
24128  *
24129  * `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
24130  * messages to peers or delegating to the appropriate handler for the message type. Currently, the
24131  * available handlers are:
24132  * * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
24133  * * [`CustomOnionMessageHandler`], for handling user-defined message types
24134  *
24135  * # Sending Messages
24136  *
24137  * [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
24138  * a message, the matched handler may return a response message which `OnionMessenger` will send
24139  * on its behalf.
24140  *
24141  * # Example
24142  *
24143  * ```
24144  * # extern crate bitcoin;
24145  * # use bitcoin::hashes::_export::_core::time::Duration;
24146  * # use bitcoin::hashes::hex::FromHex;
24147  * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self};
24148  * # use lightning::blinded_path::{BlindedPath, EmptyNodeIdLookUp};
24149  * # use lightning::sign::{EntropySource, KeysManager};
24150  * # use lightning::ln::peer_handler::IgnoringMessageHandler;
24151  * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath, OnionMessenger};
24152  * # use lightning::onion_message::packet::OnionMessageContents;
24153  * # use lightning::util::logger::{Logger, Record};
24154  * # use lightning::util::ser::{Writeable, Writer};
24155  * # use lightning::io;
24156  * # use std::sync::Arc;
24157  * # struct FakeLogger;
24158  * # impl Logger for FakeLogger {
24159  * #     fn log(&self, record: Record) { println!(\"{:?}\" , record); }
24160  * # }
24161  * # struct FakeMessageRouter {}
24162  * # impl MessageRouter for FakeMessageRouter {
24163  * #     fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
24164  * #         let secp_ctx = Secp256k1::new();
24165  * #         let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
24166  * #         let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
24167  * #         let hop_node_id2 = hop_node_id1;
24168  * #         Ok(OnionMessagePath {
24169  * #             intermediate_nodes: vec![hop_node_id1, hop_node_id2],
24170  * #             destination,
24171  * #             first_node_addresses: None,
24172  * #         })
24173  * #     }
24174  * #     fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
24175  * #         &self, _recipient: PublicKey, _peers: Vec<PublicKey>, _secp_ctx: &Secp256k1<T>
24176  * #     ) -> Result<Vec<BlindedPath>, ()> {
24177  * #         unreachable!()
24178  * #     }
24179  * # }
24180  * # let seed = [42u8; 32];
24181  * # let time = Duration::from_secs(123456);
24182  * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
24183  * # let logger = Arc::new(FakeLogger {});
24184  * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
24185  * # let secp_ctx = Secp256k1::new();
24186  * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
24187  * # let (hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1);
24188  * # let destination_node_id = hop_node_id1;
24189  * # let node_id_lookup = EmptyNodeIdLookUp {};
24190  * # let message_router = Arc::new(FakeMessageRouter {});
24191  * # let custom_message_handler = IgnoringMessageHandler {};
24192  * # let offers_message_handler = IgnoringMessageHandler {};
24193  * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
24194  * // ChannelManager.
24195  * let onion_messenger = OnionMessenger::new(
24196  *     &keys_manager, &keys_manager, logger, &node_id_lookup, message_router,
24197  *     &offers_message_handler, &custom_message_handler
24198  * );
24199  *
24200  * # #[derive(Debug, Clone)]
24201  * # struct YourCustomMessage {}
24202  * impl Writeable for YourCustomMessage {
24203  * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
24204  * \t\t# Ok(())
24205  * \t\t// Write your custom onion message to `w`
24206  * \t}
24207  * }
24208  * impl OnionMessageContents for YourCustomMessage {
24209  * \tfn tlv_type(&self) -> u64 {
24210  * \t\t# let your_custom_message_type = 42;
24211  * \t\tyour_custom_message_type
24212  * \t}
24213  * }
24214  * // Send a custom onion message to a node id.
24215  * let destination = Destination::Node(destination_node_id);
24216  * let reply_path = None;
24217  * # let message = YourCustomMessage {};
24218  * onion_messenger.send_onion_message(message, destination, reply_path);
24219  *
24220  * // Create a blinded path to yourself, for someone to send an onion message to.
24221  * # let your_node_id = hop_node_id1;
24222  * let hops = [hop_node_id3, hop_node_id4, your_node_id];
24223  * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
24224  *
24225  * // Send a custom onion message to a blinded path.
24226  * let destination = Destination::BlindedPath(blinded_path);
24227  * let reply_path = None;
24228  * # let message = YourCustomMessage {};
24229  * onion_messenger.send_onion_message(message, destination, reply_path);
24230  * ```
24231  *
24232  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
24233  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
24234  */
24235 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
24236    /**
24237     * A pointer to the opaque Rust object.
24238     * Nearly everywhere, inner must be non-null, however in places where
24239     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24240     */
24241    LDKnativeOnionMessenger *inner;
24242    /**
24243     * Indicates that this is the only struct which contains the same pointer.
24244     * Rust functions which take ownership of an object provided via an argument require
24245     * this to be true and invalidate the object pointed to by inner.
24246     */
24247    bool is_owned;
24248 } LDKOnionMessenger;
24249
24250
24251
24252 /**
24253  * A [`MessageRouter`] that can only route to a directly connected [`Destination`].
24254  */
24255 typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
24256    /**
24257     * A pointer to the opaque Rust object.
24258     * Nearly everywhere, inner must be non-null, however in places where
24259     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24260     */
24261    LDKnativeDefaultMessageRouter *inner;
24262    /**
24263     * Indicates that this is the only struct which contains the same pointer.
24264     * Rust functions which take ownership of an object provided via an argument require
24265     * this to be true and invalidate the object pointed to by inner.
24266     */
24267    bool is_owned;
24268 } LDKDefaultMessageRouter;
24269
24270 /**
24271  * The unblinded node in a [`BlindedPath`].
24272  */
24273 typedef enum LDKIntroductionNode_Tag {
24274    /**
24275     * The node id of the introduction node.
24276     */
24277    LDKIntroductionNode_NodeId,
24278    /**
24279     * The short channel id of the channel leading to the introduction node. The [`Direction`]
24280     * identifies which side of the channel is the introduction node.
24281     */
24282    LDKIntroductionNode_DirectedShortChannelId,
24283    /**
24284     * Must be last for serialization purposes
24285     */
24286    LDKIntroductionNode_Sentinel,
24287 } LDKIntroductionNode_Tag;
24288
24289 typedef struct LDKIntroductionNode_LDKDirectedShortChannelId_Body {
24290    enum LDKDirection _0;
24291    uint64_t _1;
24292 } LDKIntroductionNode_LDKDirectedShortChannelId_Body;
24293
24294 typedef struct MUST_USE_STRUCT LDKIntroductionNode {
24295    LDKIntroductionNode_Tag tag;
24296    union {
24297       struct {
24298          struct LDKPublicKey node_id;
24299       };
24300       LDKIntroductionNode_LDKDirectedShortChannelId_Body directed_short_channel_id;
24301    };
24302 } LDKIntroductionNode;
24303
24304
24305
24306 /**
24307  * A [`NodeIdLookUp`] that always returns `None`.
24308  */
24309 typedef struct MUST_USE_STRUCT LDKEmptyNodeIdLookUp {
24310    /**
24311     * A pointer to the opaque Rust object.
24312     * Nearly everywhere, inner must be non-null, however in places where
24313     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24314     */
24315    LDKnativeEmptyNodeIdLookUp *inner;
24316    /**
24317     * Indicates that this is the only struct which contains the same pointer.
24318     * Rust functions which take ownership of an object provided via an argument require
24319     * this to be true and invalidate the object pointed to by inner.
24320     */
24321    bool is_owned;
24322 } LDKEmptyNodeIdLookUp;
24323
24324
24325
24326 /**
24327  * Data to construct a [`BlindedHop`] for forwarding a payment.
24328  */
24329 typedef struct MUST_USE_STRUCT LDKForwardTlvs {
24330    /**
24331     * A pointer to the opaque Rust object.
24332     * Nearly everywhere, inner must be non-null, however in places where
24333     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24334     */
24335    LDKnativeForwardTlvs *inner;
24336    /**
24337     * Indicates that this is the only struct which contains the same pointer.
24338     * Rust functions which take ownership of an object provided via an argument require
24339     * this to be true and invalidate the object pointed to by inner.
24340     */
24341    bool is_owned;
24342 } LDKForwardTlvs;
24343
24344 /**
24345  * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
24346  * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
24347  * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
24348  * which can provide a default implementation of this trait when used with [`Wallet`].
24349  */
24350 typedef struct LDKCoinSelectionSource {
24351    /**
24352     * An opaque pointer which is passed to your function implementations as an argument.
24353     * This has no meaning in the LDK, and can be NULL or any other value.
24354     */
24355    void *this_arg;
24356    /**
24357     * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
24358     * available to spend. Implementations are free to pick their coin selection algorithm of
24359     * choice, as long as the following requirements are met:
24360     *
24361     * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
24362     *    throughout coin selection, but must not be returned as part of the result.
24363     * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
24364     *    throughout coin selection. In some cases, like when funding an anchor transaction, this
24365     *    set is empty. Implementations should ensure they handle this correctly on their end,
24366     *    e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
24367     *    provided, in which case a zero-value empty OP_RETURN output can be used instead.
24368     * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
24369     *    inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
24370     *
24371     * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
24372     * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
24373     * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
24374     * delaying block inclusion.
24375     *
24376     * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
24377     * can be re-used within new fee-bumped iterations of the original claiming transaction,
24378     * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
24379     * transaction associated with it, and all of the available UTXOs have already been assigned to
24380     * other claims, implementations must be willing to double spend their UTXOs. The choice of
24381     * which UTXOs to double spend is left to the implementation, but it must strive to keep the
24382     * set of other claims being double spent to a minimum.
24383     */
24384    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);
24385    /**
24386     * Signs and provides the full witness for all inputs within the transaction known to the
24387     * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
24388     *
24389     * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
24390     * unsigned transaction and then sign it with your wallet.
24391     */
24392    struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
24393    /**
24394     * Frees any resources associated with this object given its this_arg pointer.
24395     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24396     */
24397    void (*free)(void *this_arg);
24398 } LDKCoinSelectionSource;
24399
24400 /**
24401  * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
24402  * provide a default implementation to [`CoinSelectionSource`].
24403  */
24404 typedef struct LDKWalletSource {
24405    /**
24406     * An opaque pointer which is passed to your function implementations as an argument.
24407     * This has no meaning in the LDK, and can be NULL or any other value.
24408     */
24409    void *this_arg;
24410    /**
24411     * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
24412     */
24413    struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
24414    /**
24415     * Returns a script to use for change above dust resulting from a successful coin selection
24416     * attempt.
24417     */
24418    struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
24419    /**
24420     * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
24421     * the transaction known to the wallet (i.e., any provided via
24422     * [`WalletSource::list_confirmed_utxos`]).
24423     *
24424     * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
24425     * unsigned transaction and then sign it with your wallet.
24426     */
24427    struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
24428    /**
24429     * Frees any resources associated with this object given its this_arg pointer.
24430     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
24431     */
24432    void (*free)(void *this_arg);
24433 } LDKWalletSource;
24434
24435
24436
24437 /**
24438  * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
24439  * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
24440  * spends may happen.
24441  */
24442 typedef struct MUST_USE_STRUCT LDKWallet {
24443    /**
24444     * A pointer to the opaque Rust object.
24445     * Nearly everywhere, inner must be non-null, however in places where
24446     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24447     */
24448    LDKnativeWallet *inner;
24449    /**
24450     * Indicates that this is the only struct which contains the same pointer.
24451     * Rust functions which take ownership of an object provided via an argument require
24452     * this to be true and invalidate the object pointed to by inner.
24453     */
24454    bool is_owned;
24455 } LDKWallet;
24456
24457
24458
24459 /**
24460  * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
24461  * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
24462  * Replace-By-Fee (RBF).
24463  *
24464  * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
24465  */
24466 typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
24467    /**
24468     * A pointer to the opaque Rust object.
24469     * Nearly everywhere, inner must be non-null, however in places where
24470     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24471     */
24472    LDKnativeBumpTransactionEventHandler *inner;
24473    /**
24474     * Indicates that this is the only struct which contains the same pointer.
24475     * Rust functions which take ownership of an object provided via an argument require
24476     * this to be true and invalidate the object pointed to by inner.
24477     */
24478    bool is_owned;
24479 } LDKBumpTransactionEventHandler;
24480
24481
24482
24483 /**
24484  * A [`KVStore`] implementation that writes to and reads from the file system.
24485  */
24486 typedef struct MUST_USE_STRUCT LDKFilesystemStore {
24487    /**
24488     * A pointer to the opaque Rust object.
24489     * Nearly everywhere, inner must be non-null, however in places where
24490     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24491     */
24492    LDKnativeFilesystemStore *inner;
24493    /**
24494     * Indicates that this is the only struct which contains the same pointer.
24495     * Rust functions which take ownership of an object provided via an argument require
24496     * this to be true and invalidate the object pointed to by inner.
24497     */
24498    bool is_owned;
24499 } LDKFilesystemStore;
24500
24501
24502
24503 /**
24504  * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
24505  * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
24506  * responsibilities are:
24507  * * Processing [`Event`]s with a user-provided [`EventHandler`].
24508  * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
24509  *   writing it to disk/backups by invoking the callback given to it at startup.
24510  *   [`ChannelManager`] persistence should be done in the background.
24511  * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
24512  *   and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
24513  * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
24514  *   [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
24515  *
24516  * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
24517  * upon as doing so may result in high latency.
24518  *
24519  * # Note
24520  *
24521  * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
24522  * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
24523  * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
24524  * unilateral chain closure fees are at risk.
24525  *
24526  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
24527  * [`ChannelManager::timer_tick_occurred`]: lightning::ln::channelmanager::ChannelManager::timer_tick_occurred
24528  * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
24529  * [`Event`]: lightning::events::Event
24530  * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
24531  * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
24532  *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
24533  */
24534 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
24535    /**
24536     * A pointer to the opaque Rust object.
24537     * Nearly everywhere, inner must be non-null, however in places where
24538     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24539     */
24540    LDKnativeBackgroundProcessor *inner;
24541    /**
24542     * Indicates that this is the only struct which contains the same pointer.
24543     * Rust functions which take ownership of an object provided via an argument require
24544     * this to be true and invalidate the object pointed to by inner.
24545     */
24546    bool is_owned;
24547 } LDKBackgroundProcessor;
24548
24549
24550
24551 /**
24552  * The main Rapid Gossip Sync object.
24553  *
24554  * See [crate-level documentation] for usage.
24555  *
24556  * [crate-level documentation]: crate
24557  */
24558 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
24559    /**
24560     * A pointer to the opaque Rust object.
24561     * Nearly everywhere, inner must be non-null, however in places where
24562     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24563     */
24564    LDKnativeRapidGossipSync *inner;
24565    /**
24566     * Indicates that this is the only struct which contains the same pointer.
24567     * Rust functions which take ownership of an object provided via an argument require
24568     * this to be true and invalidate the object pointed to by inner.
24569     */
24570    bool is_owned;
24571 } LDKRapidGossipSync;
24572
24573 /**
24574  * Either [`P2PGossipSync`] or [`RapidGossipSync`].
24575  */
24576 typedef enum LDKGossipSync_Tag {
24577    /**
24578     * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
24579     */
24580    LDKGossipSync_P2P,
24581    /**
24582     * Rapid gossip sync from a trusted server.
24583     */
24584    LDKGossipSync_Rapid,
24585    /**
24586     * No gossip sync.
24587     */
24588    LDKGossipSync_None,
24589    /**
24590     * Must be last for serialization purposes
24591     */
24592    LDKGossipSync_Sentinel,
24593 } LDKGossipSync_Tag;
24594
24595 typedef struct MUST_USE_STRUCT LDKGossipSync {
24596    LDKGossipSync_Tag tag;
24597    union {
24598       struct {
24599          /**
24600           * Note that this field is expected to be a reference.
24601           */
24602          struct LDKP2PGossipSync p2p;
24603       };
24604       struct {
24605          /**
24606           * Note that this field is expected to be a reference.
24607           */
24608          struct LDKRapidGossipSync rapid;
24609       };
24610    };
24611 } LDKGossipSync;
24612
24613
24614
24615 /**
24616  * Data of the [`RawBolt11Invoice`] that is encoded in the data part
24617  */
24618 typedef struct MUST_USE_STRUCT LDKRawDataPart {
24619    /**
24620     * A pointer to the opaque Rust object.
24621     * Nearly everywhere, inner must be non-null, however in places where
24622     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24623     */
24624    LDKnativeRawDataPart *inner;
24625    /**
24626     * Indicates that this is the only struct which contains the same pointer.
24627     * Rust functions which take ownership of an object provided via an argument require
24628     * this to be true and invalidate the object pointed to by inner.
24629     */
24630    bool is_owned;
24631 } LDKRawDataPart;
24632
24633
24634
24635 /**
24636  * SHA-256 hash
24637  */
24638 typedef struct MUST_USE_STRUCT LDKSha256 {
24639    /**
24640     * A pointer to the opaque Rust object.
24641     * Nearly everywhere, inner must be non-null, however in places where
24642     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24643     */
24644    LDKnativeSha256 *inner;
24645    /**
24646     * Indicates that this is the only struct which contains the same pointer.
24647     * Rust functions which take ownership of an object provided via an argument require
24648     * this to be true and invalidate the object pointed to by inner.
24649     */
24650    bool is_owned;
24651 } LDKSha256;
24652
24653
24654
24655 /**
24656  * Positive duration that defines when (relatively to the timestamp) in the future the invoice
24657  * expires
24658  */
24659 typedef struct MUST_USE_STRUCT LDKExpiryTime {
24660    /**
24661     * A pointer to the opaque Rust object.
24662     * Nearly everywhere, inner must be non-null, however in places where
24663     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24664     */
24665    LDKnativeExpiryTime *inner;
24666    /**
24667     * Indicates that this is the only struct which contains the same pointer.
24668     * Rust functions which take ownership of an object provided via an argument require
24669     * this to be true and invalidate the object pointed to by inner.
24670     */
24671    bool is_owned;
24672 } LDKExpiryTime;
24673
24674
24675
24676 /**
24677  * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
24678  */
24679 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
24680    /**
24681     * A pointer to the opaque Rust object.
24682     * Nearly everywhere, inner must be non-null, however in places where
24683     * the Rust equivalent takes an Option, it may be set to null to indicate None.
24684     */
24685    LDKnativeMinFinalCltvExpiryDelta *inner;
24686    /**
24687     * Indicates that this is the only struct which contains the same pointer.
24688     * Rust functions which take ownership of an object provided via an argument require
24689     * this to be true and invalidate the object pointed to by inner.
24690     */
24691    bool is_owned;
24692 } LDKMinFinalCltvExpiryDelta;
24693
24694 /**
24695  * A 20-byte byte array.
24696  */
24697 typedef struct LDKTwentyBytes {
24698    /**
24699     * The twenty bytes
24700     */
24701    uint8_t data[20];
24702 } LDKTwentyBytes;
24703
24704 /**
24705  * Fallback address in case no LN payment is possible
24706  */
24707 typedef enum LDKFallback_Tag {
24708    LDKFallback_SegWitProgram,
24709    LDKFallback_PubKeyHash,
24710    LDKFallback_ScriptHash,
24711    /**
24712     * Must be last for serialization purposes
24713     */
24714    LDKFallback_Sentinel,
24715 } LDKFallback_Tag;
24716
24717 typedef struct LDKFallback_LDKSegWitProgram_Body {
24718    struct LDKWitnessVersion version;
24719    struct LDKCVec_u8Z program;
24720 } LDKFallback_LDKSegWitProgram_Body;
24721
24722 typedef struct MUST_USE_STRUCT LDKFallback {
24723    LDKFallback_Tag tag;
24724    union {
24725       LDKFallback_LDKSegWitProgram_Body seg_wit_program;
24726       struct {
24727          struct LDKTwentyBytes pub_key_hash;
24728       };
24729       struct {
24730          struct LDKTwentyBytes script_hash;
24731       };
24732    };
24733 } LDKFallback;
24734
24735 extern const uintptr_t MAX_BUF_SIZE;
24736
24737 extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
24738
24739 extern const uint64_t MAX_SCID_BLOCK;
24740
24741 extern const uint64_t MAX_SCID_TX_INDEX;
24742
24743 extern const uint64_t MAX_SCID_VOUT_INDEX;
24744
24745 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
24746
24747 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
24748
24749 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
24750
24751 extern const uint32_t ANTI_REORG_DELAY;
24752
24753 extern const uint16_t BREAKDOWN_TIMEOUT;
24754
24755 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
24756
24757 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
24758
24759 extern const uint16_t MAX_HTLCS;
24760
24761 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
24762
24763 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
24764
24765 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
24766
24767 extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
24768
24769 extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
24770
24771 extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
24772
24773 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
24774
24775 extern const uintptr_t PAYER_NOTE_LIMIT;
24776
24777 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
24778
24779 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
24780
24781 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
24782
24783 extern const uint64_t MAX_TIMESTAMP;
24784
24785 extern const uint64_t DEFAULT_EXPIRY_TIME;
24786
24787 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
24788
24789 extern const uint8_t TAG_PAYMENT_HASH;
24790
24791 extern const uint8_t TAG_DESCRIPTION;
24792
24793 extern const uint8_t TAG_PAYEE_PUB_KEY;
24794
24795 extern const uint8_t TAG_DESCRIPTION_HASH;
24796
24797 extern const uint8_t TAG_EXPIRY_TIME;
24798
24799 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
24800
24801 extern const uint8_t TAG_FALLBACK;
24802
24803 extern const uint8_t TAG_PRIVATE_ROUTE;
24804
24805 extern const uint8_t TAG_PAYMENT_SECRET;
24806
24807 extern const uint8_t TAG_PAYMENT_METADATA;
24808
24809 extern const uint8_t TAG_FEATURES;
24810
24811 struct LDKStr _ldk_get_compiled_version(void);
24812
24813 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
24814
24815 /**
24816  * Gets the 128-bit integer, as 16 little-endian bytes
24817  */
24818 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
24819
24820 /**
24821  * Constructs a new U128 from 16 little-endian bytes
24822  */
24823 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
24824
24825 /**
24826  * Constructs a new WitnessProgram given a version and program bytes.
24827  *
24828  * The program MUST be at least 2 bytes and no longer than 40 bytes long.
24829  * Further, if the version is 0, the program MUST be either exactly 20 or exactly 32 bytes long.
24830  */
24831 struct LDKWitnessProgram WitnessProgram_new(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
24832
24833 /**
24834  * Gets the `WitnessVersion` of the given `WitnessProgram`
24835  */
24836 struct LDKWitnessVersion WitnessProgram_get_version(const struct LDKWitnessProgram *NONNULL_PTR prog);
24837
24838 /**
24839  * Gets the witness program bytes of the given `WitnessProgram`
24840  */
24841 struct LDKu8slice WitnessProgram_get_program(const struct LDKWitnessProgram *NONNULL_PTR prog);
24842
24843 /**
24844  * Creates a new WitnessProgram which has the same data as `orig`
24845  */
24846 struct LDKWitnessProgram WitnessProgram_clone(const struct LDKWitnessProgram *NONNULL_PTR orig);
24847
24848 /**
24849  * Releases any memory held by the given `WitnessProgram` (which is currently none)
24850  */
24851 void WitnessProgram_free(struct LDKWitnessProgram o);
24852
24853 /**
24854  * Convenience function for constructing a new BigEndianScalar
24855  */
24856 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
24857
24858 /**
24859  * Creates a new Bech32Error which has the same data as `orig`
24860  */
24861 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
24862
24863 /**
24864  * Releases any memory held by the given `Bech32Error` (which is currently none)
24865  */
24866 void Bech32Error_free(struct LDKBech32Error o);
24867
24868 /**
24869  * Frees the data buffer, if data_is_owned is set and datalen > 0.
24870  */
24871 void Transaction_free(struct LDKTransaction _res);
24872
24873 /**
24874  * Creates a new Witness which has the same data as `orig` but with a new buffer.
24875  */
24876 struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
24877
24878 /**
24879  * Frees the data pointed to by data
24880  */
24881 void Witness_free(struct LDKWitness _res);
24882
24883 /**
24884  * Convenience function for constructing a new TxIn
24885  */
24886 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
24887
24888 /**
24889  * Gets the `witness` in the given `TxIn`.
24890  */
24891 struct LDKWitness TxIn_get_witness(const struct LDKTxIn *NONNULL_PTR txin);
24892
24893 /**
24894  * Gets the `script_sig` in the given `TxIn`.
24895  */
24896 struct LDKu8slice TxIn_get_script_sig(const struct LDKTxIn *NONNULL_PTR txin);
24897
24898 /**
24899  * Gets the `sequence` in the given `TxIn`.
24900  */
24901 uint32_t TxIn_get_sequence(const struct LDKTxIn *NONNULL_PTR txin);
24902
24903 /**
24904  * Gets the previous outpoint txid in the given `TxIn`.
24905  */
24906 struct LDKThirtyTwoBytes TxIn_get_previous_txid(const struct LDKTxIn *NONNULL_PTR txin);
24907
24908 /**
24909  * Gets the previout outpoint index in the given `TxIn`.
24910  */
24911 uint32_t TxIn_get_previous_vout(const struct LDKTxIn *NONNULL_PTR txin);
24912
24913 /**
24914  * Frees the witness and script_sig in a TxIn
24915  */
24916 void TxIn_free(struct LDKTxIn _res);
24917
24918 /**
24919  * Convenience function for constructing a new TxOut
24920  */
24921 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
24922
24923 /**
24924  * Gets the `script_pubkey` in the given `TxOut`.
24925  */
24926 struct LDKu8slice TxOut_get_script_pubkey(const struct LDKTxOut *NONNULL_PTR txout);
24927
24928 /**
24929  * Gets the value in the given `TxOut`.
24930  */
24931 uint64_t TxOut_get_value(const struct LDKTxOut *NONNULL_PTR txout);
24932
24933 /**
24934  * Frees the data pointed to by script_pubkey.
24935  */
24936 void TxOut_free(struct LDKTxOut _res);
24937
24938 /**
24939  * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
24940  */
24941 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
24942
24943 /**
24944  * Frees the data buffer, if chars_is_owned is set and len > 0.
24945  */
24946 void Str_free(struct LDKStr _res);
24947
24948 #if defined(LDK_DEBUG_BUILD)
24949 /**
24950  * This function exists for memory safety testing purposes. It should never be used in production
24951  * code
24952  */
24953 const void *__unmangle_inner_ptr(const void *ptr);
24954 #endif
24955
24956 /**
24957  * Frees the buffer pointed to by `data` if `datalen` is non-0.
24958  */
24959 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
24960
24961 /**
24962  * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the success state.
24963  */
24964 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKRefundMaybeWithDerivedMetadataBuilder o);
24965
24966 /**
24967  * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the error state.
24968  */
24969 struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
24970
24971 /**
24972  * Checks if the given object is currently in the success state
24973  */
24974 bool CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
24975
24976 /**
24977  * Frees any resources used by the CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.
24978  */
24979 void CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ _res);
24980
24981 /**
24982  * Creates a new CResult_RefundBolt12SemanticErrorZ in the success state.
24983  */
24984 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_ok(struct LDKRefund o);
24985
24986 /**
24987  * Creates a new CResult_RefundBolt12SemanticErrorZ in the error state.
24988  */
24989 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
24990
24991 /**
24992  * Checks if the given object is currently in the success state
24993  */
24994 bool CResult_RefundBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR o);
24995
24996 /**
24997  * Frees any resources used by the CResult_RefundBolt12SemanticErrorZ.
24998  */
24999 void CResult_RefundBolt12SemanticErrorZ_free(struct LDKCResult_RefundBolt12SemanticErrorZ _res);
25000
25001 /**
25002  * Creates a new CResult_RefundBolt12SemanticErrorZ which has the same data as `orig`
25003  * but with all dynamically-allocated buffers duplicated in new buffers.
25004  */
25005 struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_clone(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR orig);
25006
25007 /**
25008  * Constructs a new COption_u64Z containing a u64
25009  */
25010 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
25011
25012 /**
25013  * Constructs a new COption_u64Z containing nothing
25014  */
25015 struct LDKCOption_u64Z COption_u64Z_none(void);
25016
25017 /**
25018  * Frees any resources associated with the u64, if we are in the Some state
25019  */
25020 void COption_u64Z_free(struct LDKCOption_u64Z _res);
25021
25022 /**
25023  * Creates a new COption_u64Z which has the same data as `orig`
25024  * but with all dynamically-allocated buffers duplicated in new buffers.
25025  */
25026 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
25027
25028 /**
25029  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25030  */
25031 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
25032
25033 /**
25034  * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
25035  */
25036 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
25037
25038 /**
25039  * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
25040  */
25041 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
25042
25043 /**
25044  * Checks if the given object is currently in the success state
25045  */
25046 bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
25047
25048 /**
25049  * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
25050  */
25051 void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
25052
25053 /**
25054  * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
25055  * but with all dynamically-allocated buffers duplicated in new buffers.
25056  */
25057 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
25058
25059 /**
25060  * Creates a new CResult_RetryDecodeErrorZ in the success state.
25061  */
25062 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_ok(struct LDKRetry o);
25063
25064 /**
25065  * Creates a new CResult_RetryDecodeErrorZ in the error state.
25066  */
25067 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_err(struct LDKDecodeError e);
25068
25069 /**
25070  * Checks if the given object is currently in the success state
25071  */
25072 bool CResult_RetryDecodeErrorZ_is_ok(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR o);
25073
25074 /**
25075  * Frees any resources used by the CResult_RetryDecodeErrorZ.
25076  */
25077 void CResult_RetryDecodeErrorZ_free(struct LDKCResult_RetryDecodeErrorZ _res);
25078
25079 /**
25080  * Creates a new CResult_RetryDecodeErrorZ which has the same data as `orig`
25081  * but with all dynamically-allocated buffers duplicated in new buffers.
25082  */
25083 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig);
25084
25085 /**
25086  * Creates a new CResult_NoneAPIErrorZ in the success state.
25087  */
25088 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
25089
25090 /**
25091  * Creates a new CResult_NoneAPIErrorZ in the error state.
25092  */
25093 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
25094
25095 /**
25096  * Checks if the given object is currently in the success state
25097  */
25098 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
25099
25100 /**
25101  * Frees any resources used by the CResult_NoneAPIErrorZ.
25102  */
25103 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
25104
25105 /**
25106  * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
25107  * but with all dynamically-allocated buffers duplicated in new buffers.
25108  */
25109 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
25110
25111 /**
25112  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25113  */
25114 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
25115
25116 /**
25117  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25118  */
25119 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
25120
25121 /**
25122  * Constructs a new COption_ThirtyTwoBytesZ containing a crate::c_types::ThirtyTwoBytes
25123  */
25124 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o);
25125
25126 /**
25127  * Constructs a new COption_ThirtyTwoBytesZ containing nothing
25128  */
25129 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void);
25130
25131 /**
25132  * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
25133  */
25134 void COption_ThirtyTwoBytesZ_free(struct LDKCOption_ThirtyTwoBytesZ _res);
25135
25136 /**
25137  * Creates a new COption_ThirtyTwoBytesZ which has the same data as `orig`
25138  * but with all dynamically-allocated buffers duplicated in new buffers.
25139  */
25140 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig);
25141
25142 /**
25143  * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
25144  */
25145 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
25146
25147 /**
25148  * Constructs a new COption_CVec_u8ZZ containing nothing
25149  */
25150 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
25151
25152 /**
25153  * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
25154  */
25155 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
25156
25157 /**
25158  * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
25159  * but with all dynamically-allocated buffers duplicated in new buffers.
25160  */
25161 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
25162
25163 /**
25164  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
25165  */
25166 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
25167
25168 /**
25169  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
25170  */
25171 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
25172
25173 /**
25174  * Checks if the given object is currently in the success state
25175  */
25176 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
25177
25178 /**
25179  * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
25180  */
25181 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
25182
25183 /**
25184  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
25185  * but with all dynamically-allocated buffers duplicated in new buffers.
25186  */
25187 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
25188
25189 /**
25190  * Creates a new tuple which has the same data as `orig`
25191  * but with all dynamically-allocated buffers duplicated in new buffers.
25192  */
25193 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_clone(const struct LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR orig);
25194
25195 /**
25196  * Creates a new C2Tuple_u64CVec_u8ZZ from the contained elements.
25197  */
25198 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_new(uint64_t a, struct LDKCVec_u8Z b);
25199
25200 /**
25201  * Frees any resources used by the C2Tuple_u64CVec_u8ZZ.
25202  */
25203 void C2Tuple_u64CVec_u8ZZ_free(struct LDKC2Tuple_u64CVec_u8ZZ _res);
25204
25205 /**
25206  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25207  */
25208 void CVec_C2Tuple_u64CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u64CVec_u8ZZZ _res);
25209
25210 /**
25211  * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state.
25212  */
25213 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_ok(struct LDKRecipientOnionFields o);
25214
25215 /**
25216  * Creates a new CResult_RecipientOnionFieldsNoneZ in the error state.
25217  */
25218 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_err(void);
25219
25220 /**
25221  * Checks if the given object is currently in the success state
25222  */
25223 bool CResult_RecipientOnionFieldsNoneZ_is_ok(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR o);
25224
25225 /**
25226  * Frees any resources used by the CResult_RecipientOnionFieldsNoneZ.
25227  */
25228 void CResult_RecipientOnionFieldsNoneZ_free(struct LDKCResult_RecipientOnionFieldsNoneZ _res);
25229
25230 /**
25231  * Creates a new CResult_RecipientOnionFieldsNoneZ which has the same data as `orig`
25232  * but with all dynamically-allocated buffers duplicated in new buffers.
25233  */
25234 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig);
25235
25236 /**
25237  * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the success state.
25238  */
25239 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKUnsignedBolt12Invoice o);
25240
25241 /**
25242  * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the error state.
25243  */
25244 struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25245
25246 /**
25247  * Checks if the given object is currently in the success state
25248  */
25249 bool CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o);
25250
25251 /**
25252  * Frees any resources used by the CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ.
25253  */
25254 void CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ _res);
25255
25256 /**
25257  * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the success state.
25258  */
25259 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKBolt12Invoice o);
25260
25261 /**
25262  * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the error state.
25263  */
25264 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
25265
25266 /**
25267  * Checks if the given object is currently in the success state
25268  */
25269 bool CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o);
25270
25271 /**
25272  * Frees any resources used by the CResult_Bolt12InvoiceBolt12SemanticErrorZ.
25273  */
25274 void CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ _res);
25275
25276 /**
25277  * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ which has the same data as `orig`
25278  * but with all dynamically-allocated buffers duplicated in new buffers.
25279  */
25280 struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR orig);
25281
25282 /**
25283  * Creates a new CResult_SchnorrSignatureNoneZ in the success state.
25284  */
25285 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o);
25286
25287 /**
25288  * Creates a new CResult_SchnorrSignatureNoneZ in the error state.
25289  */
25290 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void);
25291
25292 /**
25293  * Checks if the given object is currently in the success state
25294  */
25295 bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o);
25296
25297 /**
25298  * Frees any resources used by the CResult_SchnorrSignatureNoneZ.
25299  */
25300 void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res);
25301
25302 /**
25303  * Creates a new CResult_SchnorrSignatureNoneZ which has the same data as `orig`
25304  * but with all dynamically-allocated buffers duplicated in new buffers.
25305  */
25306 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
25307
25308 /**
25309  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25310  */
25311 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
25312
25313 /**
25314  * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
25315  */
25316 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o);
25317
25318 /**
25319  * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
25320  */
25321 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_none(void);
25322
25323 /**
25324  * Frees any resources associated with the crate::c_types::derived::CVec_ThirtyTwoBytesZ, if we are in the Some state
25325  */
25326 void COption_CVec_ThirtyTwoBytesZZ_free(struct LDKCOption_CVec_ThirtyTwoBytesZZ _res);
25327
25328 /**
25329  * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
25330  * but with all dynamically-allocated buffers duplicated in new buffers.
25331  */
25332 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig);
25333
25334 /**
25335  * Constructs a new COption_AmountZ containing a crate::lightning::offers::offer::Amount
25336  */
25337 struct LDKCOption_AmountZ COption_AmountZ_some(struct LDKAmount o);
25338
25339 /**
25340  * Constructs a new COption_AmountZ containing nothing
25341  */
25342 struct LDKCOption_AmountZ COption_AmountZ_none(void);
25343
25344 /**
25345  * Frees any resources associated with the crate::lightning::offers::offer::Amount, if we are in the Some state
25346  */
25347 void COption_AmountZ_free(struct LDKCOption_AmountZ _res);
25348
25349 /**
25350  * Creates a new COption_AmountZ which has the same data as `orig`
25351  * but with all dynamically-allocated buffers duplicated in new buffers.
25352  */
25353 struct LDKCOption_AmountZ COption_AmountZ_clone(const struct LDKCOption_AmountZ *NONNULL_PTR orig);
25354
25355 /**
25356  * Constructs a new COption_QuantityZ containing a crate::lightning::offers::offer::Quantity
25357  */
25358 struct LDKCOption_QuantityZ COption_QuantityZ_some(struct LDKQuantity o);
25359
25360 /**
25361  * Constructs a new COption_QuantityZ containing nothing
25362  */
25363 struct LDKCOption_QuantityZ COption_QuantityZ_none(void);
25364
25365 /**
25366  * Frees any resources associated with the crate::lightning::offers::offer::Quantity, if we are in the Some state
25367  */
25368 void COption_QuantityZ_free(struct LDKCOption_QuantityZ _res);
25369
25370 /**
25371  * Creates a new COption_QuantityZ which has the same data as `orig`
25372  * but with all dynamically-allocated buffers duplicated in new buffers.
25373  */
25374 struct LDKCOption_QuantityZ COption_QuantityZ_clone(const struct LDKCOption_QuantityZ *NONNULL_PTR orig);
25375
25376 /**
25377  * Creates a new CResult_ThirtyTwoBytesNoneZ in the success state.
25378  */
25379 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o);
25380
25381 /**
25382  * Creates a new CResult_ThirtyTwoBytesNoneZ in the error state.
25383  */
25384 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void);
25385
25386 /**
25387  * Checks if the given object is currently in the success state
25388  */
25389 bool CResult_ThirtyTwoBytesNoneZ_is_ok(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR o);
25390
25391 /**
25392  * Frees any resources used by the CResult_ThirtyTwoBytesNoneZ.
25393  */
25394 void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res);
25395
25396 /**
25397  * Creates a new CResult_ThirtyTwoBytesNoneZ which has the same data as `orig`
25398  * but with all dynamically-allocated buffers duplicated in new buffers.
25399  */
25400 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
25401
25402 /**
25403  * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
25404  */
25405 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
25406
25407 /**
25408  * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
25409  */
25410 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
25411
25412 /**
25413  * Checks if the given object is currently in the success state
25414  */
25415 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
25416
25417 /**
25418  * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
25419  */
25420 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
25421
25422 /**
25423  * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
25424  * but with all dynamically-allocated buffers duplicated in new buffers.
25425  */
25426 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
25427
25428 /**
25429  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
25430  */
25431 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
25432
25433 /**
25434  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
25435  */
25436 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25437
25438 /**
25439  * Checks if the given object is currently in the success state
25440  */
25441 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25442
25443 /**
25444  * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
25445  */
25446 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
25447
25448 /**
25449  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
25450  * but with all dynamically-allocated buffers duplicated in new buffers.
25451  */
25452 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25453
25454 /**
25455  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
25456  */
25457 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
25458
25459 /**
25460  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
25461  */
25462 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25463
25464 /**
25465  * Checks if the given object is currently in the success state
25466  */
25467 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25468
25469 /**
25470  * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
25471  */
25472 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
25473
25474 /**
25475  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
25476  * but with all dynamically-allocated buffers duplicated in new buffers.
25477  */
25478 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25479
25480 /**
25481  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
25482  */
25483 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
25484
25485 /**
25486  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
25487  */
25488 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25489
25490 /**
25491  * Checks if the given object is currently in the success state
25492  */
25493 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
25494
25495 /**
25496  * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
25497  */
25498 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
25499
25500 /**
25501  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
25502  * but with all dynamically-allocated buffers duplicated in new buffers.
25503  */
25504 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
25505
25506 /**
25507  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25508  */
25509 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
25510
25511 /**
25512  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25513  */
25514 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
25515
25516 /**
25517  * Constructs a new COption_u32Z containing a u32
25518  */
25519 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
25520
25521 /**
25522  * Constructs a new COption_u32Z containing nothing
25523  */
25524 struct LDKCOption_u32Z COption_u32Z_none(void);
25525
25526 /**
25527  * Frees any resources associated with the u32, if we are in the Some state
25528  */
25529 void COption_u32Z_free(struct LDKCOption_u32Z _res);
25530
25531 /**
25532  * Creates a new COption_u32Z which has the same data as `orig`
25533  * but with all dynamically-allocated buffers duplicated in new buffers.
25534  */
25535 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
25536
25537 /**
25538  * Creates a new tuple which has the same data as `orig`
25539  * but with all dynamically-allocated buffers duplicated in new buffers.
25540  */
25541 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_clone(const struct LDKC2Tuple_CVec_u8Zu64Z *NONNULL_PTR orig);
25542
25543 /**
25544  * Creates a new C2Tuple_CVec_u8Zu64Z from the contained elements.
25545  */
25546 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_new(struct LDKCVec_u8Z a, uint64_t b);
25547
25548 /**
25549  * Frees any resources used by the C2Tuple_CVec_u8Zu64Z.
25550  */
25551 void C2Tuple_CVec_u8Zu64Z_free(struct LDKC2Tuple_CVec_u8Zu64Z _res);
25552
25553 /**
25554  * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the success state.
25555  */
25556 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_ok(struct LDKC2Tuple_CVec_u8Zu64Z o);
25557
25558 /**
25559  * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the error state.
25560  */
25561 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_err(void);
25562
25563 /**
25564  * Checks if the given object is currently in the success state
25565  */
25566 bool CResult_C2Tuple_CVec_u8Zu64ZNoneZ_is_ok(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR o);
25567
25568 /**
25569  * Frees any resources used by the CResult_C2Tuple_CVec_u8Zu64ZNoneZ.
25570  */
25571 void CResult_C2Tuple_CVec_u8Zu64ZNoneZ_free(struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ _res);
25572
25573 /**
25574  * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ which has the same data as `orig`
25575  * but with all dynamically-allocated buffers duplicated in new buffers.
25576  */
25577 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR orig);
25578
25579 /**
25580  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state.
25581  */
25582 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_ok(struct LDKChannelDerivationParameters o);
25583
25584 /**
25585  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the error state.
25586  */
25587 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_err(struct LDKDecodeError e);
25588
25589 /**
25590  * Checks if the given object is currently in the success state
25591  */
25592 bool CResult_ChannelDerivationParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR o);
25593
25594 /**
25595  * Frees any resources used by the CResult_ChannelDerivationParametersDecodeErrorZ.
25596  */
25597 void CResult_ChannelDerivationParametersDecodeErrorZ_free(struct LDKCResult_ChannelDerivationParametersDecodeErrorZ _res);
25598
25599 /**
25600  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ which has the same data as `orig`
25601  * but with all dynamically-allocated buffers duplicated in new buffers.
25602  */
25603 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR orig);
25604
25605 /**
25606  * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state.
25607  */
25608 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_ok(struct LDKHTLCDescriptor o);
25609
25610 /**
25611  * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the error state.
25612  */
25613 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
25614
25615 /**
25616  * Checks if the given object is currently in the success state
25617  */
25618 bool CResult_HTLCDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR o);
25619
25620 /**
25621  * Frees any resources used by the CResult_HTLCDescriptorDecodeErrorZ.
25622  */
25623 void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDecodeErrorZ _res);
25624
25625 /**
25626  * Creates a new CResult_HTLCDescriptorDecodeErrorZ which has the same data as `orig`
25627  * but with all dynamically-allocated buffers duplicated in new buffers.
25628  */
25629 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
25630
25631 /**
25632  * Creates a new CResult_NoneNoneZ in the success state.
25633  */
25634 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
25635
25636 /**
25637  * Creates a new CResult_NoneNoneZ in the error state.
25638  */
25639 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
25640
25641 /**
25642  * Checks if the given object is currently in the success state
25643  */
25644 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
25645
25646 /**
25647  * Frees any resources used by the CResult_NoneNoneZ.
25648  */
25649 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
25650
25651 /**
25652  * Creates a new CResult_NoneNoneZ which has the same data as `orig`
25653  * but with all dynamically-allocated buffers duplicated in new buffers.
25654  */
25655 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
25656
25657 /**
25658  * Creates a new CResult_PublicKeyNoneZ in the success state.
25659  */
25660 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
25661
25662 /**
25663  * Creates a new CResult_PublicKeyNoneZ in the error state.
25664  */
25665 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
25666
25667 /**
25668  * Checks if the given object is currently in the success state
25669  */
25670 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
25671
25672 /**
25673  * Frees any resources used by the CResult_PublicKeyNoneZ.
25674  */
25675 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
25676
25677 /**
25678  * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
25679  * but with all dynamically-allocated buffers duplicated in new buffers.
25680  */
25681 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
25682
25683 /**
25684  * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
25685  */
25686 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o);
25687
25688 /**
25689  * Constructs a new COption_BigEndianScalarZ containing nothing
25690  */
25691 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void);
25692
25693 /**
25694  * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
25695  */
25696 void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
25697
25698 /**
25699  * Creates a new COption_BigEndianScalarZ which has the same data as `orig`
25700  * but with all dynamically-allocated buffers duplicated in new buffers.
25701  */
25702 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
25703
25704 /**
25705  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25706  */
25707 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
25708
25709 /**
25710  * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
25711  */
25712 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
25713
25714 /**
25715  * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
25716  */
25717 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
25718
25719 /**
25720  * Checks if the given object is currently in the success state
25721  */
25722 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
25723
25724 /**
25725  * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
25726  */
25727 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
25728
25729 /**
25730  * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
25731  * but with all dynamically-allocated buffers duplicated in new buffers.
25732  */
25733 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
25734
25735 /**
25736  * Creates a new CResult_ECDSASignatureNoneZ in the success state.
25737  */
25738 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o);
25739
25740 /**
25741  * Creates a new CResult_ECDSASignatureNoneZ in the error state.
25742  */
25743 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void);
25744
25745 /**
25746  * Checks if the given object is currently in the success state
25747  */
25748 bool CResult_ECDSASignatureNoneZ_is_ok(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR o);
25749
25750 /**
25751  * Frees any resources used by the CResult_ECDSASignatureNoneZ.
25752  */
25753 void CResult_ECDSASignatureNoneZ_free(struct LDKCResult_ECDSASignatureNoneZ _res);
25754
25755 /**
25756  * Creates a new CResult_ECDSASignatureNoneZ which has the same data as `orig`
25757  * but with all dynamically-allocated buffers duplicated in new buffers.
25758  */
25759 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig);
25760
25761 /**
25762  * Creates a new CResult_TransactionNoneZ in the success state.
25763  */
25764 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
25765
25766 /**
25767  * Creates a new CResult_TransactionNoneZ in the error state.
25768  */
25769 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
25770
25771 /**
25772  * Checks if the given object is currently in the success state
25773  */
25774 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
25775
25776 /**
25777  * Frees any resources used by the CResult_TransactionNoneZ.
25778  */
25779 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
25780
25781 /**
25782  * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
25783  * but with all dynamically-allocated buffers duplicated in new buffers.
25784  */
25785 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
25786
25787 /**
25788  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
25789  */
25790 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
25791
25792 /**
25793  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
25794  */
25795 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
25796
25797 /**
25798  * Checks if the given object is currently in the success state
25799  */
25800 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
25801
25802 /**
25803  * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
25804  */
25805 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
25806
25807 /**
25808  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
25809  * but with all dynamically-allocated buffers duplicated in new buffers.
25810  */
25811 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
25812
25813 /**
25814  * Creates a new CResult_CVec_u8ZNoneZ in the success state.
25815  */
25816 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o);
25817
25818 /**
25819  * Creates a new CResult_CVec_u8ZNoneZ in the error state.
25820  */
25821 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void);
25822
25823 /**
25824  * Checks if the given object is currently in the success state
25825  */
25826 bool CResult_CVec_u8ZNoneZ_is_ok(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR o);
25827
25828 /**
25829  * Frees any resources used by the CResult_CVec_u8ZNoneZ.
25830  */
25831 void CResult_CVec_u8ZNoneZ_free(struct LDKCResult_CVec_u8ZNoneZ _res);
25832
25833 /**
25834  * Creates a new CResult_CVec_u8ZNoneZ which has the same data as `orig`
25835  * but with all dynamically-allocated buffers duplicated in new buffers.
25836  */
25837 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_clone(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR orig);
25838
25839 /**
25840  * Creates a new CResult_ShutdownScriptNoneZ in the success state.
25841  */
25842 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
25843
25844 /**
25845  * Creates a new CResult_ShutdownScriptNoneZ in the error state.
25846  */
25847 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
25848
25849 /**
25850  * Checks if the given object is currently in the success state
25851  */
25852 bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
25853
25854 /**
25855  * Frees any resources used by the CResult_ShutdownScriptNoneZ.
25856  */
25857 void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
25858
25859 /**
25860  * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
25861  * but with all dynamically-allocated buffers duplicated in new buffers.
25862  */
25863 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
25864
25865 /**
25866  * Constructs a new COption_u16Z containing a u16
25867  */
25868 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
25869
25870 /**
25871  * Constructs a new COption_u16Z containing nothing
25872  */
25873 struct LDKCOption_u16Z COption_u16Z_none(void);
25874
25875 /**
25876  * Frees any resources associated with the u16, if we are in the Some state
25877  */
25878 void COption_u16Z_free(struct LDKCOption_u16Z _res);
25879
25880 /**
25881  * Creates a new COption_u16Z which has the same data as `orig`
25882  * but with all dynamically-allocated buffers duplicated in new buffers.
25883  */
25884 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
25885
25886 /**
25887  * Constructs a new COption_boolZ containing a bool
25888  */
25889 struct LDKCOption_boolZ COption_boolZ_some(bool o);
25890
25891 /**
25892  * Constructs a new COption_boolZ containing nothing
25893  */
25894 struct LDKCOption_boolZ COption_boolZ_none(void);
25895
25896 /**
25897  * Frees any resources associated with the bool, if we are in the Some state
25898  */
25899 void COption_boolZ_free(struct LDKCOption_boolZ _res);
25900
25901 /**
25902  * Creates a new COption_boolZ which has the same data as `orig`
25903  * but with all dynamically-allocated buffers duplicated in new buffers.
25904  */
25905 struct LDKCOption_boolZ COption_boolZ_clone(const struct LDKCOption_boolZ *NONNULL_PTR orig);
25906
25907 /**
25908  * Creates a new CResult_WitnessNoneZ in the success state.
25909  */
25910 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_ok(struct LDKWitness o);
25911
25912 /**
25913  * Creates a new CResult_WitnessNoneZ in the error state.
25914  */
25915 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_err(void);
25916
25917 /**
25918  * Checks if the given object is currently in the success state
25919  */
25920 bool CResult_WitnessNoneZ_is_ok(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR o);
25921
25922 /**
25923  * Frees any resources used by the CResult_WitnessNoneZ.
25924  */
25925 void CResult_WitnessNoneZ_free(struct LDKCResult_WitnessNoneZ _res);
25926
25927 /**
25928  * Creates a new CResult_WitnessNoneZ which has the same data as `orig`
25929  * but with all dynamically-allocated buffers duplicated in new buffers.
25930  */
25931 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_clone(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR orig);
25932
25933 /**
25934  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25935  */
25936 void CVec_ECDSASignatureZ_free(struct LDKCVec_ECDSASignatureZ _res);
25937
25938 /**
25939  * Creates a new tuple which has the same data as `orig`
25940  * but with all dynamically-allocated buffers duplicated in new buffers.
25941  */
25942 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(const struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR orig);
25943
25944 /**
25945  * Creates a new C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ from the contained elements.
25946  */
25947 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(struct LDKECDSASignature a, struct LDKCVec_ECDSASignatureZ b);
25948
25949 /**
25950  * Frees any resources used by the C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ.
25951  */
25952 void C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res);
25953
25954 /**
25955  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state.
25956  */
25957 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o);
25958
25959 /**
25960  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the error state.
25961  */
25962 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(void);
25963
25964 /**
25965  * Checks if the given object is currently in the success state
25966  */
25967 bool CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR o);
25968
25969 /**
25970  * Frees any resources used by the CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.
25971  */
25972 void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res);
25973
25974 /**
25975  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ which has the same data as `orig`
25976  * but with all dynamically-allocated buffers duplicated in new buffers.
25977  */
25978 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR orig);
25979
25980 /**
25981  * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
25982  */
25983 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
25984
25985 /**
25986  * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
25987  */
25988 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
25989
25990 /**
25991  * Checks if the given object is currently in the success state
25992  */
25993 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
25994
25995 /**
25996  * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
25997  */
25998 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
25999
26000 /**
26001  * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
26002  * but with all dynamically-allocated buffers duplicated in new buffers.
26003  */
26004 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
26005
26006 /**
26007  * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
26008  */
26009 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
26010
26011 /**
26012  * Constructs a new COption_WriteableScoreZ containing nothing
26013  */
26014 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
26015
26016 /**
26017  * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
26018  */
26019 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
26020
26021 /**
26022  * Creates a new CResult_NoneIOErrorZ in the success state.
26023  */
26024 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_ok(void);
26025
26026 /**
26027  * Creates a new CResult_NoneIOErrorZ in the error state.
26028  */
26029 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_err(enum LDKIOError e);
26030
26031 /**
26032  * Checks if the given object is currently in the success state
26033  */
26034 bool CResult_NoneIOErrorZ_is_ok(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR o);
26035
26036 /**
26037  * Frees any resources used by the CResult_NoneIOErrorZ.
26038  */
26039 void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
26040
26041 /**
26042  * Creates a new CResult_NoneIOErrorZ which has the same data as `orig`
26043  * but with all dynamically-allocated buffers duplicated in new buffers.
26044  */
26045 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
26046
26047 /**
26048  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26049  */
26050 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
26051
26052 /**
26053  * Creates a new CResult_RouteLightningErrorZ in the success state.
26054  */
26055 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
26056
26057 /**
26058  * Creates a new CResult_RouteLightningErrorZ in the error state.
26059  */
26060 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
26061
26062 /**
26063  * Checks if the given object is currently in the success state
26064  */
26065 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
26066
26067 /**
26068  * Frees any resources used by the CResult_RouteLightningErrorZ.
26069  */
26070 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
26071
26072 /**
26073  * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
26074  * but with all dynamically-allocated buffers duplicated in new buffers.
26075  */
26076 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
26077
26078 /**
26079  * Creates a new tuple which has the same data as `orig`
26080  * but with all dynamically-allocated buffers duplicated in new buffers.
26081  */
26082 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
26083
26084 /**
26085  * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
26086  */
26087 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
26088
26089 /**
26090  * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
26091  */
26092 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
26093
26094 /**
26095  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26096  */
26097 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
26098
26099 /**
26100  * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the success state.
26101  */
26102 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o);
26103
26104 /**
26105  * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the error state.
26106  */
26107 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(void);
26108
26109 /**
26110  * Checks if the given object is currently in the success state
26111  */
26112 bool CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR o);
26113
26114 /**
26115  * Frees any resources used by the CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.
26116  */
26117 void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res);
26118
26119 /**
26120  * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ which has the same data as `orig`
26121  * but with all dynamically-allocated buffers duplicated in new buffers.
26122  */
26123 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR orig);
26124
26125 /**
26126  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26127  */
26128 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
26129
26130 /**
26131  * Creates a new CResult_OnionMessagePathNoneZ in the success state.
26132  */
26133 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
26134
26135 /**
26136  * Creates a new CResult_OnionMessagePathNoneZ in the error state.
26137  */
26138 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
26139
26140 /**
26141  * Checks if the given object is currently in the success state
26142  */
26143 bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
26144
26145 /**
26146  * Frees any resources used by the CResult_OnionMessagePathNoneZ.
26147  */
26148 void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
26149
26150 /**
26151  * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
26152  * but with all dynamically-allocated buffers duplicated in new buffers.
26153  */
26154 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
26155
26156 /**
26157  * Creates a new CResult_CVec_BlindedPathZNoneZ in the success state.
26158  */
26159 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_ok(struct LDKCVec_BlindedPathZ o);
26160
26161 /**
26162  * Creates a new CResult_CVec_BlindedPathZNoneZ in the error state.
26163  */
26164 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_err(void);
26165
26166 /**
26167  * Checks if the given object is currently in the success state
26168  */
26169 bool CResult_CVec_BlindedPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR o);
26170
26171 /**
26172  * Frees any resources used by the CResult_CVec_BlindedPathZNoneZ.
26173  */
26174 void CResult_CVec_BlindedPathZNoneZ_free(struct LDKCResult_CVec_BlindedPathZNoneZ _res);
26175
26176 /**
26177  * Creates a new CResult_CVec_BlindedPathZNoneZ which has the same data as `orig`
26178  * but with all dynamically-allocated buffers duplicated in new buffers.
26179  */
26180 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR orig);
26181
26182 /**
26183  * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
26184  */
26185 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
26186
26187 /**
26188  * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
26189  */
26190 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
26191
26192 /**
26193  * Checks if the given object is currently in the success state
26194  */
26195 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
26196
26197 /**
26198  * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
26199  */
26200 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
26201
26202 /**
26203  * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
26204  * but with all dynamically-allocated buffers duplicated in new buffers.
26205  */
26206 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
26207
26208 /**
26209  * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
26210  */
26211 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
26212
26213 /**
26214  * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
26215  */
26216 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
26217
26218 /**
26219  * Checks if the given object is currently in the success state
26220  */
26221 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
26222
26223 /**
26224  * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
26225  */
26226 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
26227
26228 /**
26229  * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
26230  * but with all dynamically-allocated buffers duplicated in new buffers.
26231  */
26232 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
26233
26234 /**
26235  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26236  */
26237 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
26238
26239 /**
26240  * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
26241  */
26242 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
26243
26244 /**
26245  * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
26246  */
26247 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
26248
26249 /**
26250  * Checks if the given object is currently in the success state
26251  */
26252 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
26253
26254 /**
26255  * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
26256  */
26257 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
26258
26259 /**
26260  * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
26261  * but with all dynamically-allocated buffers duplicated in new buffers.
26262  */
26263 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
26264
26265 /**
26266  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26267  */
26268 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
26269
26270 /**
26271  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26272  */
26273 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
26274
26275 /**
26276  * Creates a new CResult_RouteDecodeErrorZ in the success state.
26277  */
26278 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
26279
26280 /**
26281  * Creates a new CResult_RouteDecodeErrorZ in the error state.
26282  */
26283 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
26284
26285 /**
26286  * Checks if the given object is currently in the success state
26287  */
26288 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
26289
26290 /**
26291  * Frees any resources used by the CResult_RouteDecodeErrorZ.
26292  */
26293 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
26294
26295 /**
26296  * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
26297  * but with all dynamically-allocated buffers duplicated in new buffers.
26298  */
26299 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
26300
26301 /**
26302  * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
26303  */
26304 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
26305
26306 /**
26307  * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
26308  */
26309 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
26310
26311 /**
26312  * Checks if the given object is currently in the success state
26313  */
26314 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
26315
26316 /**
26317  * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
26318  */
26319 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
26320
26321 /**
26322  * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
26323  * but with all dynamically-allocated buffers duplicated in new buffers.
26324  */
26325 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
26326
26327 /**
26328  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26329  */
26330 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
26331
26332 /**
26333  * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
26334  */
26335 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
26336
26337 /**
26338  * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
26339  */
26340 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
26341
26342 /**
26343  * Checks if the given object is currently in the success state
26344  */
26345 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
26346
26347 /**
26348  * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
26349  */
26350 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
26351
26352 /**
26353  * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
26354  * but with all dynamically-allocated buffers duplicated in new buffers.
26355  */
26356 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
26357
26358 /**
26359  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26360  */
26361 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
26362
26363 /**
26364  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26365  */
26366 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
26367
26368 /**
26369  * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
26370  */
26371 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
26372
26373 /**
26374  * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
26375  */
26376 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
26377
26378 /**
26379  * Checks if the given object is currently in the success state
26380  */
26381 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
26382
26383 /**
26384  * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
26385  */
26386 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
26387
26388 /**
26389  * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
26390  * but with all dynamically-allocated buffers duplicated in new buffers.
26391  */
26392 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
26393
26394 /**
26395  * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
26396  */
26397 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
26398
26399 /**
26400  * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
26401  */
26402 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
26403
26404 /**
26405  * Checks if the given object is currently in the success state
26406  */
26407 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
26408
26409 /**
26410  * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
26411  */
26412 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
26413
26414 /**
26415  * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
26416  * but with all dynamically-allocated buffers duplicated in new buffers.
26417  */
26418 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
26419
26420 /**
26421  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
26422  */
26423 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
26424
26425 /**
26426  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
26427  */
26428 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
26429
26430 /**
26431  * Checks if the given object is currently in the success state
26432  */
26433 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
26434
26435 /**
26436  * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
26437  */
26438 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
26439
26440 /**
26441  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
26442  * but with all dynamically-allocated buffers duplicated in new buffers.
26443  */
26444 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
26445
26446 /**
26447  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26448  */
26449 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
26450
26451 /**
26452  * Creates a new tuple which has the same data as `orig`
26453  * but with all dynamically-allocated buffers duplicated in new buffers.
26454  */
26455 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
26456
26457 /**
26458  * Creates a new C2Tuple_u64u64Z from the contained elements.
26459  */
26460 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
26461
26462 /**
26463  * Frees any resources used by the C2Tuple_u64u64Z.
26464  */
26465 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
26466
26467 /**
26468  * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
26469  */
26470 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
26471
26472 /**
26473  * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
26474  */
26475 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
26476
26477 /**
26478  * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
26479  */
26480 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
26481
26482 /**
26483  * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
26484  * but with all dynamically-allocated buffers duplicated in new buffers.
26485  */
26486 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
26487
26488 /**
26489  * Creates a new C2Tuple_Z from the contained elements.
26490  */
26491 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
26492
26493 /**
26494  * Frees any resources used by the C2Tuple_Z.
26495  */
26496 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
26497
26498 /**
26499  * Creates a new C2Tuple__u1632_u1632Z from the contained elements.
26500  */
26501 struct LDKC2Tuple__u1632_u1632Z C2Tuple__u1632_u1632Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
26502
26503 /**
26504  * Frees any resources used by the C2Tuple__u1632_u1632Z.
26505  */
26506 void C2Tuple__u1632_u1632Z_free(struct LDKC2Tuple__u1632_u1632Z _res);
26507
26508 /**
26509  * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
26510  */
26511 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(struct LDKC2Tuple__u1632_u1632Z o);
26512
26513 /**
26514  * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
26515  */
26516 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none(void);
26517
26518 /**
26519  * Frees any resources associated with the crate::c_types::derived::C2Tuple__u1632_u1632Z, if we are in the Some state
26520  */
26521 void COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ _res);
26522
26523 /**
26524  * Constructs a new COption_f64Z containing a f64
26525  */
26526 struct LDKCOption_f64Z COption_f64Z_some(double o);
26527
26528 /**
26529  * Constructs a new COption_f64Z containing nothing
26530  */
26531 struct LDKCOption_f64Z COption_f64Z_none(void);
26532
26533 /**
26534  * Frees any resources associated with the f64, if we are in the Some state
26535  */
26536 void COption_f64Z_free(struct LDKCOption_f64Z _res);
26537
26538 /**
26539  * Creates a new COption_f64Z which has the same data as `orig`
26540  * but with all dynamically-allocated buffers duplicated in new buffers.
26541  */
26542 struct LDKCOption_f64Z COption_f64Z_clone(const struct LDKCOption_f64Z *NONNULL_PTR orig);
26543
26544 /**
26545  * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
26546  */
26547 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
26548
26549 /**
26550  * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
26551  */
26552 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
26553
26554 /**
26555  * Checks if the given object is currently in the success state
26556  */
26557 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
26558
26559 /**
26560  * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
26561  */
26562 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
26563
26564 /**
26565  * Creates a new CResult_BestBlockDecodeErrorZ in the success state.
26566  */
26567 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_ok(struct LDKBestBlock o);
26568
26569 /**
26570  * Creates a new CResult_BestBlockDecodeErrorZ in the error state.
26571  */
26572 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_err(struct LDKDecodeError e);
26573
26574 /**
26575  * Checks if the given object is currently in the success state
26576  */
26577 bool CResult_BestBlockDecodeErrorZ_is_ok(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR o);
26578
26579 /**
26580  * Frees any resources used by the CResult_BestBlockDecodeErrorZ.
26581  */
26582 void CResult_BestBlockDecodeErrorZ_free(struct LDKCResult_BestBlockDecodeErrorZ _res);
26583
26584 /**
26585  * Creates a new CResult_BestBlockDecodeErrorZ which has the same data as `orig`
26586  * but with all dynamically-allocated buffers duplicated in new buffers.
26587  */
26588 struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_clone(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR orig);
26589
26590 /**
26591  * Creates a new tuple which has the same data as `orig`
26592  * but with all dynamically-allocated buffers duplicated in new buffers.
26593  */
26594 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
26595
26596 /**
26597  * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
26598  */
26599 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
26600
26601 /**
26602  * Frees any resources used by the C2Tuple_usizeTransactionZ.
26603  */
26604 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
26605
26606 /**
26607  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26608  */
26609 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
26610
26611 /**
26612  * Creates a new tuple which has the same data as `orig`
26613  * but with all dynamically-allocated buffers duplicated in new buffers.
26614  */
26615 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *NONNULL_PTR orig);
26616
26617 /**
26618  * Creates a new C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ from the contained elements.
26619  */
26620 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_new(struct LDKThirtyTwoBytes a, uint32_t b, struct LDKCOption_ThirtyTwoBytesZ c);
26621
26622 /**
26623  * Frees any resources used by the C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.
26624  */
26625 void C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_free(struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ _res);
26626
26627 /**
26628  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26629  */
26630 void CVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ_free(struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ _res);
26631
26632 /**
26633  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the success state.
26634  */
26635 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o);
26636
26637 /**
26638  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the error state.
26639  */
26640 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void);
26641
26642 /**
26643  * Checks if the given object is currently in the success state
26644  */
26645 bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o);
26646
26647 /**
26648  * Frees any resources used by the CResult_ChannelMonitorUpdateStatusNoneZ.
26649  */
26650 void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res);
26651
26652 /**
26653  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ which has the same data as `orig`
26654  * but with all dynamically-allocated buffers duplicated in new buffers.
26655  */
26656 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig);
26657
26658 /**
26659  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26660  */
26661 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
26662
26663 /**
26664  * Creates a new tuple which has the same data as `orig`
26665  * but with all dynamically-allocated buffers duplicated in new buffers.
26666  */
26667 struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
26668
26669 /**
26670  * Creates a new C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ from the contained elements.
26671  */
26672 struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKChannelId b, struct LDKCVec_MonitorEventZ c, struct LDKPublicKey d);
26673
26674 /**
26675  * Frees any resources used by the C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.
26676  */
26677 void C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res);
26678
26679 /**
26680  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26681  */
26682 void CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ _res);
26683
26684 /**
26685  * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
26686  */
26687 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
26688
26689 /**
26690  * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
26691  */
26692 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26693
26694 /**
26695  * Checks if the given object is currently in the success state
26696  */
26697 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
26698
26699 /**
26700  * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
26701  */
26702 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
26703
26704 /**
26705  * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
26706  * but with all dynamically-allocated buffers duplicated in new buffers.
26707  */
26708 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
26709
26710 /**
26711  * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
26712  */
26713 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
26714
26715 /**
26716  * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
26717  */
26718 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26719
26720 /**
26721  * Checks if the given object is currently in the success state
26722  */
26723 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
26724
26725 /**
26726  * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
26727  */
26728 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
26729
26730 /**
26731  * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
26732  * but with all dynamically-allocated buffers duplicated in new buffers.
26733  */
26734 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
26735
26736 /**
26737  * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
26738  */
26739 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
26740
26741 /**
26742  * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
26743  */
26744 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26745
26746 /**
26747  * Checks if the given object is currently in the success state
26748  */
26749 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
26750
26751 /**
26752  * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
26753  */
26754 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
26755
26756 /**
26757  * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
26758  * but with all dynamically-allocated buffers duplicated in new buffers.
26759  */
26760 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
26761
26762 /**
26763  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
26764  */
26765 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
26766
26767 /**
26768  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
26769  */
26770 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26771
26772 /**
26773  * Checks if the given object is currently in the success state
26774  */
26775 bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
26776
26777 /**
26778  * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
26779  */
26780 void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
26781
26782 /**
26783  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
26784  * but with all dynamically-allocated buffers duplicated in new buffers.
26785  */
26786 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
26787
26788 /**
26789  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
26790  */
26791 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
26792
26793 /**
26794  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
26795  */
26796 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26797
26798 /**
26799  * Checks if the given object is currently in the success state
26800  */
26801 bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
26802
26803 /**
26804  * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
26805  */
26806 void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
26807
26808 /**
26809  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
26810  * but with all dynamically-allocated buffers duplicated in new buffers.
26811  */
26812 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
26813
26814 /**
26815  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
26816  */
26817 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
26818
26819 /**
26820  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
26821  */
26822 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26823
26824 /**
26825  * Checks if the given object is currently in the success state
26826  */
26827 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
26828
26829 /**
26830  * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
26831  */
26832 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
26833
26834 /**
26835  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
26836  * but with all dynamically-allocated buffers duplicated in new buffers.
26837  */
26838 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
26839
26840 /**
26841  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
26842  */
26843 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
26844
26845 /**
26846  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
26847  */
26848 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
26849
26850 /**
26851  * Checks if the given object is currently in the success state
26852  */
26853 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
26854
26855 /**
26856  * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
26857  */
26858 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
26859
26860 /**
26861  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
26862  * but with all dynamically-allocated buffers duplicated in new buffers.
26863  */
26864 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
26865
26866 /**
26867  * Creates a new CResult_OfferIdDecodeErrorZ in the success state.
26868  */
26869 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_ok(struct LDKOfferId o);
26870
26871 /**
26872  * Creates a new CResult_OfferIdDecodeErrorZ in the error state.
26873  */
26874 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_err(struct LDKDecodeError e);
26875
26876 /**
26877  * Checks if the given object is currently in the success state
26878  */
26879 bool CResult_OfferIdDecodeErrorZ_is_ok(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR o);
26880
26881 /**
26882  * Frees any resources used by the CResult_OfferIdDecodeErrorZ.
26883  */
26884 void CResult_OfferIdDecodeErrorZ_free(struct LDKCResult_OfferIdDecodeErrorZ _res);
26885
26886 /**
26887  * Creates a new CResult_OfferIdDecodeErrorZ which has the same data as `orig`
26888  * but with all dynamically-allocated buffers duplicated in new buffers.
26889  */
26890 struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_clone(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR orig);
26891
26892 /**
26893  * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the success state.
26894  */
26895 struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithDerivedPayerIdBuilder o);
26896
26897 /**
26898  * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the error state.
26899  */
26900 struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
26901
26902 /**
26903  * Checks if the given object is currently in the success state
26904  */
26905 bool CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
26906
26907 /**
26908  * Frees any resources used by the CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.
26909  */
26910 void CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ _res);
26911
26912 /**
26913  * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the success state.
26914  */
26915 struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithExplicitPayerIdBuilder o);
26916
26917 /**
26918  * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the error state.
26919  */
26920 struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
26921
26922 /**
26923  * Checks if the given object is currently in the success state
26924  */
26925 bool CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
26926
26927 /**
26928  * Frees any resources used by the CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.
26929  */
26930 void CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res);
26931
26932 /**
26933  * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
26934  */
26935 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
26936
26937 /**
26938  * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
26939  */
26940 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
26941
26942 /**
26943  * Checks if the given object is currently in the success state
26944  */
26945 bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
26946
26947 /**
26948  * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
26949  */
26950 void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
26951
26952 /**
26953  * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
26954  * but with all dynamically-allocated buffers duplicated in new buffers.
26955  */
26956 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
26957
26958 /**
26959  * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
26960  */
26961 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
26962
26963 /**
26964  * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
26965  */
26966 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
26967
26968 /**
26969  * Checks if the given object is currently in the success state
26970  */
26971 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
26972
26973 /**
26974  * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
26975  */
26976 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
26977
26978 /**
26979  * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
26980  * but with all dynamically-allocated buffers duplicated in new buffers.
26981  */
26982 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
26983
26984 /**
26985  * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
26986  */
26987 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o);
26988
26989 /**
26990  * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
26991  */
26992 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
26993
26994 /**
26995  * Checks if the given object is currently in the success state
26996  */
26997 bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o);
26998
26999 /**
27000  * Frees any resources used by the CResult_PublicKeySecp256k1ErrorZ.
27001  */
27002 void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res);
27003
27004 /**
27005  * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
27006  * but with all dynamically-allocated buffers duplicated in new buffers.
27007  */
27008 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig);
27009
27010 /**
27011  * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
27012  */
27013 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
27014
27015 /**
27016  * Constructs a new COption_NetworkUpdateZ containing nothing
27017  */
27018 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
27019
27020 /**
27021  * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
27022  */
27023 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
27024
27025 /**
27026  * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
27027  * but with all dynamically-allocated buffers duplicated in new buffers.
27028  */
27029 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
27030
27031 /**
27032  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
27033  */
27034 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
27035
27036 /**
27037  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
27038  */
27039 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
27040
27041 /**
27042  * Checks if the given object is currently in the success state
27043  */
27044 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
27045
27046 /**
27047  * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
27048  */
27049 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
27050
27051 /**
27052  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
27053  * but with all dynamically-allocated buffers duplicated in new buffers.
27054  */
27055 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
27056
27057 /**
27058  * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
27059  */
27060 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
27061
27062 /**
27063  * Constructs a new COption_UtxoLookupZ containing nothing
27064  */
27065 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
27066
27067 /**
27068  * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
27069  */
27070 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
27071
27072 /**
27073  * Creates a new CResult_NoneLightningErrorZ in the success state.
27074  */
27075 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
27076
27077 /**
27078  * Creates a new CResult_NoneLightningErrorZ in the error state.
27079  */
27080 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
27081
27082 /**
27083  * Checks if the given object is currently in the success state
27084  */
27085 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
27086
27087 /**
27088  * Frees any resources used by the CResult_NoneLightningErrorZ.
27089  */
27090 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
27091
27092 /**
27093  * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
27094  * but with all dynamically-allocated buffers duplicated in new buffers.
27095  */
27096 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
27097
27098 /**
27099  * Creates a new CResult_boolLightningErrorZ in the success state.
27100  */
27101 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
27102
27103 /**
27104  * Creates a new CResult_boolLightningErrorZ in the error state.
27105  */
27106 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
27107
27108 /**
27109  * Checks if the given object is currently in the success state
27110  */
27111 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
27112
27113 /**
27114  * Frees any resources used by the CResult_boolLightningErrorZ.
27115  */
27116 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
27117
27118 /**
27119  * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
27120  * but with all dynamically-allocated buffers duplicated in new buffers.
27121  */
27122 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
27123
27124 /**
27125  * Creates a new tuple which has the same data as `orig`
27126  * but with all dynamically-allocated buffers duplicated in new buffers.
27127  */
27128 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
27129
27130 /**
27131  * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
27132  */
27133 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
27134
27135 /**
27136  * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
27137  */
27138 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
27139
27140 /**
27141  * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
27142  */
27143 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
27144
27145 /**
27146  * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
27147  */
27148 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
27149
27150 /**
27151  * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
27152  */
27153 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
27154
27155 /**
27156  * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
27157  * but with all dynamically-allocated buffers duplicated in new buffers.
27158  */
27159 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
27160
27161 /**
27162  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27163  */
27164 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
27165
27166 /**
27167  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
27168  */
27169 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
27170
27171 /**
27172  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
27173  */
27174 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
27175
27176 /**
27177  * Checks if the given object is currently in the success state
27178  */
27179 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
27180
27181 /**
27182  * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
27183  */
27184 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
27185
27186 /**
27187  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
27188  * but with all dynamically-allocated buffers duplicated in new buffers.
27189  */
27190 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
27191
27192 /**
27193  * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
27194  */
27195 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
27196
27197 /**
27198  * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
27199  */
27200 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
27201
27202 /**
27203  * Checks if the given object is currently in the success state
27204  */
27205 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
27206
27207 /**
27208  * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
27209  */
27210 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
27211
27212 /**
27213  * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
27214  * but with all dynamically-allocated buffers duplicated in new buffers.
27215  */
27216 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
27217
27218 /**
27219  * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
27220  */
27221 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
27222
27223 /**
27224  * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
27225  */
27226 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
27227
27228 /**
27229  * Checks if the given object is currently in the success state
27230  */
27231 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
27232
27233 /**
27234  * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
27235  */
27236 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
27237
27238 /**
27239  * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
27240  * but with all dynamically-allocated buffers duplicated in new buffers.
27241  */
27242 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
27243
27244 /**
27245  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27246  */
27247 void CVec_SocketAddressZ_free(struct LDKCVec_SocketAddressZ _res);
27248
27249 /**
27250  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
27251  */
27252 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
27253
27254 /**
27255  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
27256  */
27257 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
27258
27259 /**
27260  * Checks if the given object is currently in the success state
27261  */
27262 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
27263
27264 /**
27265  * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
27266  */
27267 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
27268
27269 /**
27270  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
27271  * but with all dynamically-allocated buffers duplicated in new buffers.
27272  */
27273 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
27274
27275 /**
27276  * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
27277  */
27278 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
27279
27280 /**
27281  * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
27282  */
27283 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
27284
27285 /**
27286  * Checks if the given object is currently in the success state
27287  */
27288 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
27289
27290 /**
27291  * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
27292  */
27293 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
27294
27295 /**
27296  * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
27297  * but with all dynamically-allocated buffers duplicated in new buffers.
27298  */
27299 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
27300
27301 /**
27302  * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
27303  */
27304 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
27305
27306 /**
27307  * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
27308  */
27309 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
27310
27311 /**
27312  * Checks if the given object is currently in the success state
27313  */
27314 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
27315
27316 /**
27317  * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
27318  */
27319 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
27320
27321 /**
27322  * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
27323  * but with all dynamically-allocated buffers duplicated in new buffers.
27324  */
27325 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
27326
27327 /**
27328  * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
27329  */
27330 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
27331
27332 /**
27333  * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
27334  */
27335 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
27336
27337 /**
27338  * Checks if the given object is currently in the success state
27339  */
27340 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
27341
27342 /**
27343  * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
27344  */
27345 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
27346
27347 /**
27348  * Constructs a new COption_CVec_SocketAddressZZ containing a crate::c_types::derived::CVec_SocketAddressZ
27349  */
27350 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_some(struct LDKCVec_SocketAddressZ o);
27351
27352 /**
27353  * Constructs a new COption_CVec_SocketAddressZZ containing nothing
27354  */
27355 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_none(void);
27356
27357 /**
27358  * Frees any resources associated with the crate::c_types::derived::CVec_SocketAddressZ, if we are in the Some state
27359  */
27360 void COption_CVec_SocketAddressZZ_free(struct LDKCOption_CVec_SocketAddressZZ _res);
27361
27362 /**
27363  * Creates a new COption_CVec_SocketAddressZZ which has the same data as `orig`
27364  * but with all dynamically-allocated buffers duplicated in new buffers.
27365  */
27366 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig);
27367
27368 /**
27369  * Creates a new CResult_u64ShortChannelIdErrorZ in the success state.
27370  */
27371 struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_ok(uint64_t o);
27372
27373 /**
27374  * Creates a new CResult_u64ShortChannelIdErrorZ in the error state.
27375  */
27376 struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_err(enum LDKShortChannelIdError e);
27377
27378 /**
27379  * Checks if the given object is currently in the success state
27380  */
27381 bool CResult_u64ShortChannelIdErrorZ_is_ok(const struct LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR o);
27382
27383 /**
27384  * Frees any resources used by the CResult_u64ShortChannelIdErrorZ.
27385  */
27386 void CResult_u64ShortChannelIdErrorZ_free(struct LDKCResult_u64ShortChannelIdErrorZ _res);
27387
27388 /**
27389  * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the success state.
27390  */
27391 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_ok(struct LDKPendingHTLCInfo o);
27392
27393 /**
27394  * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the error state.
27395  */
27396 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_err(struct LDKInboundHTLCErr e);
27397
27398 /**
27399  * Checks if the given object is currently in the success state
27400  */
27401 bool CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR o);
27402
27403 /**
27404  * Frees any resources used by the CResult_PendingHTLCInfoInboundHTLCErrZ.
27405  */
27406 void CResult_PendingHTLCInfoInboundHTLCErrZ_free(struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ _res);
27407
27408 /**
27409  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27410  */
27411 void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
27412
27413 /**
27414  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27415  */
27416 void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
27417
27418 /**
27419  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27420  */
27421 void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
27422
27423 /**
27424  * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
27425  */
27426 struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
27427
27428 /**
27429  * Constructs a new COption_TxOutZ containing nothing
27430  */
27431 struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
27432
27433 /**
27434  * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
27435  */
27436 void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
27437
27438 /**
27439  * Creates a new COption_TxOutZ which has the same data as `orig`
27440  * but with all dynamically-allocated buffers duplicated in new buffers.
27441  */
27442 struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
27443
27444 /**
27445  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27446  */
27447 void CVec_InputZ_free(struct LDKCVec_InputZ _res);
27448
27449 /**
27450  * Creates a new CResult_CoinSelectionNoneZ in the success state.
27451  */
27452 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
27453
27454 /**
27455  * Creates a new CResult_CoinSelectionNoneZ in the error state.
27456  */
27457 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
27458
27459 /**
27460  * Checks if the given object is currently in the success state
27461  */
27462 bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
27463
27464 /**
27465  * Frees any resources used by the CResult_CoinSelectionNoneZ.
27466  */
27467 void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
27468
27469 /**
27470  * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
27471  * but with all dynamically-allocated buffers duplicated in new buffers.
27472  */
27473 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
27474
27475 /**
27476  * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
27477  */
27478 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
27479
27480 /**
27481  * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
27482  */
27483 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
27484
27485 /**
27486  * Checks if the given object is currently in the success state
27487  */
27488 bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
27489
27490 /**
27491  * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
27492  */
27493 void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
27494
27495 /**
27496  * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
27497  * but with all dynamically-allocated buffers duplicated in new buffers.
27498  */
27499 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
27500
27501 /**
27502  * Constructs a new COption_PaymentContextZ containing a crate::lightning::blinded_path::payment::PaymentContext
27503  */
27504 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_some(struct LDKPaymentContext o);
27505
27506 /**
27507  * Constructs a new COption_PaymentContextZ containing nothing
27508  */
27509 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_none(void);
27510
27511 /**
27512  * Frees any resources associated with the crate::lightning::blinded_path::payment::PaymentContext, if we are in the Some state
27513  */
27514 void COption_PaymentContextZ_free(struct LDKCOption_PaymentContextZ _res);
27515
27516 /**
27517  * Creates a new COption_PaymentContextZ which has the same data as `orig`
27518  * but with all dynamically-allocated buffers duplicated in new buffers.
27519  */
27520 struct LDKCOption_PaymentContextZ COption_PaymentContextZ_clone(const struct LDKCOption_PaymentContextZ *NONNULL_PTR orig);
27521
27522 /**
27523  * Creates a new tuple which has the same data as `orig`
27524  * but with all dynamically-allocated buffers duplicated in new buffers.
27525  */
27526 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig);
27527
27528 /**
27529  * Creates a new C2Tuple_u64u16Z from the contained elements.
27530  */
27531 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_new(uint64_t a, uint16_t b);
27532
27533 /**
27534  * Frees any resources used by the C2Tuple_u64u16Z.
27535  */
27536 void C2Tuple_u64u16Z_free(struct LDKC2Tuple_u64u16Z _res);
27537
27538 /**
27539  * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z
27540  */
27541 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_some(struct LDKC2Tuple_u64u16Z o);
27542
27543 /**
27544  * Constructs a new COption_C2Tuple_u64u16ZZ containing nothing
27545  */
27546 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_none(void);
27547
27548 /**
27549  * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u16Z, if we are in the Some state
27550  */
27551 void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
27552
27553 /**
27554  * Creates a new COption_C2Tuple_u64u16ZZ which has the same data as `orig`
27555  * but with all dynamically-allocated buffers duplicated in new buffers.
27556  */
27557 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
27558
27559 /**
27560  * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState
27561  */
27562 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
27563
27564 /**
27565  * Constructs a new COption_ChannelShutdownStateZ containing nothing
27566  */
27567 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
27568
27569 /**
27570  * Frees any resources associated with the crate::lightning::ln::channelmanager::ChannelShutdownState, if we are in the Some state
27571  */
27572 void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
27573
27574 /**
27575  * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
27576  * but with all dynamically-allocated buffers duplicated in new buffers.
27577  */
27578 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
27579
27580 /**
27581  * Creates a new CResult_ChannelIdAPIErrorZ in the success state.
27582  */
27583 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_ok(struct LDKChannelId o);
27584
27585 /**
27586  * Creates a new CResult_ChannelIdAPIErrorZ in the error state.
27587  */
27588 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_err(struct LDKAPIError e);
27589
27590 /**
27591  * Checks if the given object is currently in the success state
27592  */
27593 bool CResult_ChannelIdAPIErrorZ_is_ok(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR o);
27594
27595 /**
27596  * Frees any resources used by the CResult_ChannelIdAPIErrorZ.
27597  */
27598 void CResult_ChannelIdAPIErrorZ_free(struct LDKCResult_ChannelIdAPIErrorZ _res);
27599
27600 /**
27601  * Creates a new CResult_ChannelIdAPIErrorZ which has the same data as `orig`
27602  * but with all dynamically-allocated buffers duplicated in new buffers.
27603  */
27604 struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_clone(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR orig);
27605
27606 /**
27607  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27608  */
27609 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
27610
27611 /**
27612  * Creates a new CResult_NonePaymentSendFailureZ in the success state.
27613  */
27614 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
27615
27616 /**
27617  * Creates a new CResult_NonePaymentSendFailureZ in the error state.
27618  */
27619 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
27620
27621 /**
27622  * Checks if the given object is currently in the success state
27623  */
27624 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
27625
27626 /**
27627  * Frees any resources used by the CResult_NonePaymentSendFailureZ.
27628  */
27629 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
27630
27631 /**
27632  * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
27633  * but with all dynamically-allocated buffers duplicated in new buffers.
27634  */
27635 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
27636
27637 /**
27638  * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
27639  */
27640 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
27641
27642 /**
27643  * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
27644  */
27645 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
27646
27647 /**
27648  * Checks if the given object is currently in the success state
27649  */
27650 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
27651
27652 /**
27653  * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
27654  */
27655 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
27656
27657 /**
27658  * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
27659  * but with all dynamically-allocated buffers duplicated in new buffers.
27660  */
27661 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
27662
27663 /**
27664  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the success state.
27665  */
27666 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
27667
27668 /**
27669  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state.
27670  */
27671 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
27672
27673 /**
27674  * Checks if the given object is currently in the success state
27675  */
27676 bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o);
27677
27678 /**
27679  * Frees any resources used by the CResult_ThirtyTwoBytesPaymentSendFailureZ.
27680  */
27681 void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res);
27682
27683 /**
27684  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig`
27685  * but with all dynamically-allocated buffers duplicated in new buffers.
27686  */
27687 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig);
27688
27689 /**
27690  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the success state.
27691  */
27692 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
27693
27694 /**
27695  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the error state.
27696  */
27697 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
27698
27699 /**
27700  * Checks if the given object is currently in the success state
27701  */
27702 bool CResult_ThirtyTwoBytesRetryableSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR o);
27703
27704 /**
27705  * Frees any resources used by the CResult_ThirtyTwoBytesRetryableSendFailureZ.
27706  */
27707 void CResult_ThirtyTwoBytesRetryableSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ _res);
27708
27709 /**
27710  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ which has the same data as `orig`
27711  * but with all dynamically-allocated buffers duplicated in new buffers.
27712  */
27713 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR orig);
27714
27715 /**
27716  * Creates a new tuple which has the same data as `orig`
27717  * but with all dynamically-allocated buffers duplicated in new buffers.
27718  */
27719 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR orig);
27720
27721 /**
27722  * Creates a new C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ from the contained elements.
27723  */
27724 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
27725
27726 /**
27727  * Frees any resources used by the C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ.
27728  */
27729 void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res);
27730
27731 /**
27732  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state.
27733  */
27734 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
27735
27736 /**
27737  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state.
27738  */
27739 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
27740
27741 /**
27742  * Checks if the given object is currently in the success state
27743  */
27744 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o);
27745
27746 /**
27747  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.
27748  */
27749 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res);
27750
27751 /**
27752  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig`
27753  * but with all dynamically-allocated buffers duplicated in new buffers.
27754  */
27755 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig);
27756
27757 /**
27758  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27759  */
27760 void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res);
27761
27762 /**
27763  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state.
27764  */
27765 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
27766
27767 /**
27768  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the error state.
27769  */
27770 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_err(struct LDKProbeSendFailure e);
27771
27772 /**
27773  * Checks if the given object is currently in the success state
27774  */
27775 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR o);
27776
27777 /**
27778  * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.
27779  */
27780 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ _res);
27781
27782 /**
27783  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ which has the same data as `orig`
27784  * but with all dynamically-allocated buffers duplicated in new buffers.
27785  */
27786 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig);
27787
27788 /**
27789  * Creates a new tuple which has the same data as `orig`
27790  * but with all dynamically-allocated buffers duplicated in new buffers.
27791  */
27792 struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_clone(const struct LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR orig);
27793
27794 /**
27795  * Creates a new C2Tuple_ChannelIdPublicKeyZ from the contained elements.
27796  */
27797 struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_new(struct LDKChannelId a, struct LDKPublicKey b);
27798
27799 /**
27800  * Frees any resources used by the C2Tuple_ChannelIdPublicKeyZ.
27801  */
27802 void C2Tuple_ChannelIdPublicKeyZ_free(struct LDKC2Tuple_ChannelIdPublicKeyZ _res);
27803
27804 /**
27805  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27806  */
27807 void CVec_C2Tuple_ChannelIdPublicKeyZZ_free(struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ _res);
27808
27809 /**
27810  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27811  */
27812 void CVec_ChannelIdZ_free(struct LDKCVec_ChannelIdZ _res);
27813
27814 /**
27815  * Constructs a new COption_StrZ containing a crate::c_types::Str
27816  */
27817 struct LDKCOption_StrZ COption_StrZ_some(struct LDKStr o);
27818
27819 /**
27820  * Constructs a new COption_StrZ containing nothing
27821  */
27822 struct LDKCOption_StrZ COption_StrZ_none(void);
27823
27824 /**
27825  * Frees any resources associated with the crate::c_types::Str, if we are in the Some state
27826  */
27827 void COption_StrZ_free(struct LDKCOption_StrZ _res);
27828
27829 /**
27830  * Creates a new COption_StrZ which has the same data as `orig`
27831  * but with all dynamically-allocated buffers duplicated in new buffers.
27832  */
27833 struct LDKCOption_StrZ COption_StrZ_clone(const struct LDKCOption_StrZ *NONNULL_PTR orig);
27834
27835 /**
27836  * Creates a new CResult_NoneBolt12SemanticErrorZ in the success state.
27837  */
27838 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_ok(void);
27839
27840 /**
27841  * Creates a new CResult_NoneBolt12SemanticErrorZ in the error state.
27842  */
27843 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
27844
27845 /**
27846  * Checks if the given object is currently in the success state
27847  */
27848 bool CResult_NoneBolt12SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR o);
27849
27850 /**
27851  * Frees any resources used by the CResult_NoneBolt12SemanticErrorZ.
27852  */
27853 void CResult_NoneBolt12SemanticErrorZ_free(struct LDKCResult_NoneBolt12SemanticErrorZ _res);
27854
27855 /**
27856  * Creates a new CResult_NoneBolt12SemanticErrorZ which has the same data as `orig`
27857  * but with all dynamically-allocated buffers duplicated in new buffers.
27858  */
27859 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_clone(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR orig);
27860
27861 /**
27862  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state.
27863  */
27864 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
27865
27866 /**
27867  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the error state.
27868  */
27869 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void);
27870
27871 /**
27872  * Checks if the given object is currently in the success state
27873  */
27874 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR o);
27875
27876 /**
27877  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.
27878  */
27879 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ _res);
27880
27881 /**
27882  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ which has the same data as `orig`
27883  * but with all dynamically-allocated buffers duplicated in new buffers.
27884  */
27885 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig);
27886
27887 /**
27888  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the success state.
27889  */
27890 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
27891
27892 /**
27893  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the error state.
27894  */
27895 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e);
27896
27897 /**
27898  * Checks if the given object is currently in the success state
27899  */
27900 bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o);
27901
27902 /**
27903  * Frees any resources used by the CResult_ThirtyTwoBytesAPIErrorZ.
27904  */
27905 void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res);
27906
27907 /**
27908  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ which has the same data as `orig`
27909  * but with all dynamically-allocated buffers duplicated in new buffers.
27910  */
27911 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
27912
27913 /**
27914  * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
27915  */
27916 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
27917
27918 /**
27919  * Constructs a new COption_OffersMessageZ containing nothing
27920  */
27921 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
27922
27923 /**
27924  * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
27925  */
27926 void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
27927
27928 /**
27929  * Creates a new COption_OffersMessageZ which has the same data as `orig`
27930  * but with all dynamically-allocated buffers duplicated in new buffers.
27931  */
27932 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
27933
27934 /**
27935  * Creates a new tuple which has the same data as `orig`
27936  * but with all dynamically-allocated buffers duplicated in new buffers.
27937  */
27938 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR orig);
27939
27940 /**
27941  * Creates a new C3Tuple_OffersMessageDestinationBlindedPathZ from the contained elements.
27942  */
27943 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_new(struct LDKOffersMessage a, struct LDKDestination b, struct LDKBlindedPath c);
27944
27945 /**
27946  * Frees any resources used by the C3Tuple_OffersMessageDestinationBlindedPathZ.
27947  */
27948 void C3Tuple_OffersMessageDestinationBlindedPathZ_free(struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res);
27949
27950 /**
27951  * Frees the buffer pointed to by `data` if `datalen` is non-0.
27952  */
27953 void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res);
27954
27955 /**
27956  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
27957  */
27958 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
27959
27960 /**
27961  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
27962  */
27963 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
27964
27965 /**
27966  * Checks if the given object is currently in the success state
27967  */
27968 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
27969
27970 /**
27971  * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
27972  */
27973 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
27974
27975 /**
27976  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
27977  * but with all dynamically-allocated buffers duplicated in new buffers.
27978  */
27979 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
27980
27981 /**
27982  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
27983  */
27984 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
27985
27986 /**
27987  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
27988  */
27989 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
27990
27991 /**
27992  * Checks if the given object is currently in the success state
27993  */
27994 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
27995
27996 /**
27997  * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
27998  */
27999 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
28000
28001 /**
28002  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
28003  * but with all dynamically-allocated buffers duplicated in new buffers.
28004  */
28005 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
28006
28007 /**
28008  * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
28009  */
28010 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
28011
28012 /**
28013  * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
28014  */
28015 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
28016
28017 /**
28018  * Checks if the given object is currently in the success state
28019  */
28020 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
28021
28022 /**
28023  * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
28024  */
28025 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
28026
28027 /**
28028  * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
28029  * but with all dynamically-allocated buffers duplicated in new buffers.
28030  */
28031 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
28032
28033 /**
28034  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
28035  */
28036 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
28037
28038 /**
28039  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
28040  */
28041 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
28042
28043 /**
28044  * Checks if the given object is currently in the success state
28045  */
28046 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
28047
28048 /**
28049  * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
28050  */
28051 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
28052
28053 /**
28054  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
28055  * but with all dynamically-allocated buffers duplicated in new buffers.
28056  */
28057 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
28058
28059 /**
28060  * Creates a new CResult_BlindedForwardDecodeErrorZ in the success state.
28061  */
28062 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_ok(struct LDKBlindedForward o);
28063
28064 /**
28065  * Creates a new CResult_BlindedForwardDecodeErrorZ in the error state.
28066  */
28067 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_err(struct LDKDecodeError e);
28068
28069 /**
28070  * Checks if the given object is currently in the success state
28071  */
28072 bool CResult_BlindedForwardDecodeErrorZ_is_ok(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR o);
28073
28074 /**
28075  * Frees any resources used by the CResult_BlindedForwardDecodeErrorZ.
28076  */
28077 void CResult_BlindedForwardDecodeErrorZ_free(struct LDKCResult_BlindedForwardDecodeErrorZ _res);
28078
28079 /**
28080  * Creates a new CResult_BlindedForwardDecodeErrorZ which has the same data as `orig`
28081  * but with all dynamically-allocated buffers duplicated in new buffers.
28082  */
28083 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_clone(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR orig);
28084
28085 /**
28086  * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the success state.
28087  */
28088 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_ok(struct LDKPendingHTLCRouting o);
28089
28090 /**
28091  * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the error state.
28092  */
28093 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_err(struct LDKDecodeError e);
28094
28095 /**
28096  * Checks if the given object is currently in the success state
28097  */
28098 bool CResult_PendingHTLCRoutingDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR o);
28099
28100 /**
28101  * Frees any resources used by the CResult_PendingHTLCRoutingDecodeErrorZ.
28102  */
28103 void CResult_PendingHTLCRoutingDecodeErrorZ_free(struct LDKCResult_PendingHTLCRoutingDecodeErrorZ _res);
28104
28105 /**
28106  * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ which has the same data as `orig`
28107  * but with all dynamically-allocated buffers duplicated in new buffers.
28108  */
28109 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR orig);
28110
28111 /**
28112  * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the success state.
28113  */
28114 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_ok(struct LDKPendingHTLCInfo o);
28115
28116 /**
28117  * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the error state.
28118  */
28119 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_err(struct LDKDecodeError e);
28120
28121 /**
28122  * Checks if the given object is currently in the success state
28123  */
28124 bool CResult_PendingHTLCInfoDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR o);
28125
28126 /**
28127  * Frees any resources used by the CResult_PendingHTLCInfoDecodeErrorZ.
28128  */
28129 void CResult_PendingHTLCInfoDecodeErrorZ_free(struct LDKCResult_PendingHTLCInfoDecodeErrorZ _res);
28130
28131 /**
28132  * Creates a new CResult_PendingHTLCInfoDecodeErrorZ which has the same data as `orig`
28133  * but with all dynamically-allocated buffers duplicated in new buffers.
28134  */
28135 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR orig);
28136
28137 /**
28138  * Creates a new CResult_BlindedFailureDecodeErrorZ in the success state.
28139  */
28140 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_ok(enum LDKBlindedFailure o);
28141
28142 /**
28143  * Creates a new CResult_BlindedFailureDecodeErrorZ in the error state.
28144  */
28145 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_err(struct LDKDecodeError e);
28146
28147 /**
28148  * Checks if the given object is currently in the success state
28149  */
28150 bool CResult_BlindedFailureDecodeErrorZ_is_ok(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR o);
28151
28152 /**
28153  * Frees any resources used by the CResult_BlindedFailureDecodeErrorZ.
28154  */
28155 void CResult_BlindedFailureDecodeErrorZ_free(struct LDKCResult_BlindedFailureDecodeErrorZ _res);
28156
28157 /**
28158  * Creates a new CResult_BlindedFailureDecodeErrorZ which has the same data as `orig`
28159  * but with all dynamically-allocated buffers duplicated in new buffers.
28160  */
28161 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_clone(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR orig);
28162
28163 /**
28164  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
28165  */
28166 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
28167
28168 /**
28169  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
28170  */
28171 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
28172
28173 /**
28174  * Checks if the given object is currently in the success state
28175  */
28176 bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
28177
28178 /**
28179  * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
28180  */
28181 void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
28182
28183 /**
28184  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
28185  * but with all dynamically-allocated buffers duplicated in new buffers.
28186  */
28187 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
28188
28189 /**
28190  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28191  */
28192 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
28193
28194 /**
28195  * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements.
28196  */
28197 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
28198
28199 /**
28200  * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelManagerZ.
28201  */
28202 void C2Tuple_ThirtyTwoBytesChannelManagerZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ _res);
28203
28204 /**
28205  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
28206  */
28207 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ o);
28208
28209 /**
28210  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
28211  */
28212 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
28213
28214 /**
28215  * Checks if the given object is currently in the success state
28216  */
28217 bool CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ *NONNULL_PTR o);
28218
28219 /**
28220  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.
28221  */
28222 void CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ _res);
28223
28224 /**
28225  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
28226  */
28227 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
28228
28229 /**
28230  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
28231  */
28232 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
28233
28234 /**
28235  * Checks if the given object is currently in the success state
28236  */
28237 bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
28238
28239 /**
28240  * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
28241  */
28242 void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
28243
28244 /**
28245  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
28246  * but with all dynamically-allocated buffers duplicated in new buffers.
28247  */
28248 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
28249
28250 /**
28251  * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
28252  */
28253 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
28254
28255 /**
28256  * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
28257  */
28258 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
28259
28260 /**
28261  * Checks if the given object is currently in the success state
28262  */
28263 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
28264
28265 /**
28266  * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
28267  */
28268 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
28269
28270 /**
28271  * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
28272  * but with all dynamically-allocated buffers duplicated in new buffers.
28273  */
28274 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
28275
28276 /**
28277  * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
28278  */
28279 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
28280
28281 /**
28282  * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
28283  */
28284 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
28285
28286 /**
28287  * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
28288  */
28289 void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
28290
28291 /**
28292  * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
28293  * but with all dynamically-allocated buffers duplicated in new buffers.
28294  */
28295 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
28296
28297 /**
28298  * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
28299  */
28300 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
28301
28302 /**
28303  * Constructs a new COption_APIErrorZ containing nothing
28304  */
28305 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
28306
28307 /**
28308  * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
28309  */
28310 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
28311
28312 /**
28313  * Creates a new COption_APIErrorZ which has the same data as `orig`
28314  * but with all dynamically-allocated buffers duplicated in new buffers.
28315  */
28316 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
28317
28318 /**
28319  * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
28320  */
28321 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
28322
28323 /**
28324  * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
28325  */
28326 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
28327
28328 /**
28329  * Checks if the given object is currently in the success state
28330  */
28331 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
28332
28333 /**
28334  * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
28335  */
28336 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
28337
28338 /**
28339  * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
28340  * but with all dynamically-allocated buffers duplicated in new buffers.
28341  */
28342 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
28343
28344 /**
28345  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
28346  */
28347 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
28348
28349 /**
28350  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
28351  */
28352 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
28353
28354 /**
28355  * Checks if the given object is currently in the success state
28356  */
28357 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
28358
28359 /**
28360  * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
28361  */
28362 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
28363
28364 /**
28365  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
28366  * but with all dynamically-allocated buffers duplicated in new buffers.
28367  */
28368 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
28369
28370 /**
28371  * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
28372  */
28373 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
28374
28375 /**
28376  * Constructs a new COption_MonitorEventZ containing nothing
28377  */
28378 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
28379
28380 /**
28381  * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
28382  */
28383 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
28384
28385 /**
28386  * Creates a new COption_MonitorEventZ which has the same data as `orig`
28387  * but with all dynamically-allocated buffers duplicated in new buffers.
28388  */
28389 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
28390
28391 /**
28392  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
28393  */
28394 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
28395
28396 /**
28397  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
28398  */
28399 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
28400
28401 /**
28402  * Checks if the given object is currently in the success state
28403  */
28404 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
28405
28406 /**
28407  * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
28408  */
28409 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
28410
28411 /**
28412  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
28413  * but with all dynamically-allocated buffers duplicated in new buffers.
28414  */
28415 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
28416
28417 /**
28418  * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
28419  */
28420 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
28421
28422 /**
28423  * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
28424  */
28425 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
28426
28427 /**
28428  * Checks if the given object is currently in the success state
28429  */
28430 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
28431
28432 /**
28433  * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
28434  */
28435 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
28436
28437 /**
28438  * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
28439  * but with all dynamically-allocated buffers duplicated in new buffers.
28440  */
28441 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
28442
28443 /**
28444  * Creates a new tuple which has the same data as `orig`
28445  * but with all dynamically-allocated buffers duplicated in new buffers.
28446  */
28447 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u8ZZ *NONNULL_PTR orig);
28448
28449 /**
28450  * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements.
28451  */
28452 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
28453
28454 /**
28455  * Frees any resources used by the C2Tuple_OutPointCVec_u8ZZ.
28456  */
28457 void C2Tuple_OutPointCVec_u8ZZ_free(struct LDKC2Tuple_OutPointCVec_u8ZZ _res);
28458
28459 /**
28460  * Creates a new tuple which has the same data as `orig`
28461  * but with all dynamically-allocated buffers duplicated in new buffers.
28462  */
28463 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_clone(const struct LDKC2Tuple_u32CVec_u8ZZ *NONNULL_PTR orig);
28464
28465 /**
28466  * Creates a new C2Tuple_u32CVec_u8ZZ from the contained elements.
28467  */
28468 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_new(uint32_t a, struct LDKCVec_u8Z b);
28469
28470 /**
28471  * Frees any resources used by the C2Tuple_u32CVec_u8ZZ.
28472  */
28473 void C2Tuple_u32CVec_u8ZZ_free(struct LDKC2Tuple_u32CVec_u8ZZ _res);
28474
28475 /**
28476  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28477  */
28478 void CVec_C2Tuple_u32CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u32CVec_u8ZZZ _res);
28479
28480 /**
28481  * Creates a new tuple which has the same data as `orig`
28482  * but with all dynamically-allocated buffers duplicated in new buffers.
28483  */
28484 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR orig);
28485
28486 /**
28487  * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements.
28488  */
28489 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b);
28490
28491 /**
28492  * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.
28493  */
28494 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ _res);
28495
28496 /**
28497  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28498  */
28499 void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
28500
28501 /**
28502  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28503  */
28504 void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res);
28505
28506 /**
28507  * Creates a new tuple which has the same data as `orig`
28508  * but with all dynamically-allocated buffers duplicated in new buffers.
28509  */
28510 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
28511
28512 /**
28513  * Creates a new C2Tuple_u32TxOutZ from the contained elements.
28514  */
28515 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
28516
28517 /**
28518  * Frees any resources used by the C2Tuple_u32TxOutZ.
28519  */
28520 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
28521
28522 /**
28523  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28524  */
28525 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
28526
28527 /**
28528  * Creates a new tuple which has the same data as `orig`
28529  * but with all dynamically-allocated buffers duplicated in new buffers.
28530  */
28531 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
28532
28533 /**
28534  * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements.
28535  */
28536 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
28537
28538 /**
28539  * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.
28540  */
28541 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ _res);
28542
28543 /**
28544  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28545  */
28546 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
28547
28548 /**
28549  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28550  */
28551 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
28552
28553 /**
28554  * Creates a new tuple which has the same data as `orig`
28555  * but with all dynamically-allocated buffers duplicated in new buffers.
28556  */
28557 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR orig);
28558
28559 /**
28560  * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements.
28561  */
28562 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
28563
28564 /**
28565  * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelMonitorZ.
28566  */
28567 void C2Tuple_ThirtyTwoBytesChannelMonitorZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ _res);
28568
28569 /**
28570  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state.
28571  */
28572 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
28573
28574 /**
28575  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the error state.
28576  */
28577 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
28578
28579 /**
28580  * Checks if the given object is currently in the success state
28581  */
28582 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
28583
28584 /**
28585  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.
28586  */
28587 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ _res);
28588
28589 /**
28590  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ which has the same data as `orig`
28591  * but with all dynamically-allocated buffers duplicated in new buffers.
28592  */
28593 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR orig);
28594
28595 /**
28596  * Creates a new tuple which has the same data as `orig`
28597  * but with all dynamically-allocated buffers duplicated in new buffers.
28598  */
28599 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig);
28600
28601 /**
28602  * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
28603  */
28604 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
28605
28606 /**
28607  * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
28608  */
28609 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
28610
28611 /**
28612  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28613  */
28614 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
28615
28616 /**
28617  * Creates a new tuple which has the same data as `orig`
28618  * but with all dynamically-allocated buffers duplicated in new buffers.
28619  */
28620 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR orig);
28621
28622 /**
28623  * Creates a new C2Tuple_PublicKeyCVec_SocketAddressZZ from the contained elements.
28624  */
28625 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCVec_SocketAddressZ b);
28626
28627 /**
28628  * Frees any resources used by the C2Tuple_PublicKeyCVec_SocketAddressZZ.
28629  */
28630 void C2Tuple_PublicKeyCVec_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res);
28631
28632 /**
28633  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28634  */
28635 void CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res);
28636
28637 /**
28638  * Constructs a new COption_OnionMessageContentsZ containing a crate::lightning::onion_message::packet::OnionMessageContents
28639  */
28640 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_some(struct LDKOnionMessageContents o);
28641
28642 /**
28643  * Constructs a new COption_OnionMessageContentsZ containing nothing
28644  */
28645 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_none(void);
28646
28647 /**
28648  * Frees any resources associated with the crate::lightning::onion_message::packet::OnionMessageContents, if we are in the Some state
28649  */
28650 void COption_OnionMessageContentsZ_free(struct LDKCOption_OnionMessageContentsZ _res);
28651
28652 /**
28653  * Creates a new COption_OnionMessageContentsZ which has the same data as `orig`
28654  * but with all dynamically-allocated buffers duplicated in new buffers.
28655  */
28656 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_clone(const struct LDKCOption_OnionMessageContentsZ *NONNULL_PTR orig);
28657
28658 /**
28659  * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the success state.
28660  */
28661 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_OnionMessageContentsZ o);
28662
28663 /**
28664  * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the error state.
28665  */
28666 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
28667
28668 /**
28669  * Checks if the given object is currently in the success state
28670  */
28671 bool CResult_COption_OnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
28672
28673 /**
28674  * Frees any resources used by the CResult_COption_OnionMessageContentsZDecodeErrorZ.
28675  */
28676 void CResult_COption_OnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ _res);
28677
28678 /**
28679  * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ which has the same data as `orig`
28680  * but with all dynamically-allocated buffers duplicated in new buffers.
28681  */
28682 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
28683
28684 /**
28685  * Creates a new tuple which has the same data as `orig`
28686  * but with all dynamically-allocated buffers duplicated in new buffers.
28687  */
28688 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR orig);
28689
28690 /**
28691  * Creates a new C3Tuple_OnionMessageContentsDestinationBlindedPathZ from the contained elements.
28692  */
28693 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(struct LDKOnionMessageContents a, struct LDKDestination b, struct LDKBlindedPath c);
28694
28695 /**
28696  * Frees any resources used by the C3Tuple_OnionMessageContentsDestinationBlindedPathZ.
28697  */
28698 void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res);
28699
28700 /**
28701  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28702  */
28703 void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res);
28704
28705 /**
28706  * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
28707  */
28708 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
28709
28710 /**
28711  * Constructs a new COption_TypeZ containing nothing
28712  */
28713 struct LDKCOption_TypeZ COption_TypeZ_none(void);
28714
28715 /**
28716  * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
28717  */
28718 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
28719
28720 /**
28721  * Creates a new COption_TypeZ which has the same data as `orig`
28722  * but with all dynamically-allocated buffers duplicated in new buffers.
28723  */
28724 struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig);
28725
28726 /**
28727  * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
28728  */
28729 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
28730
28731 /**
28732  * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
28733  */
28734 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
28735
28736 /**
28737  * Checks if the given object is currently in the success state
28738  */
28739 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
28740
28741 /**
28742  * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
28743  */
28744 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
28745
28746 /**
28747  * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig`
28748  * but with all dynamically-allocated buffers duplicated in new buffers.
28749  */
28750 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
28751
28752 /**
28753  * Constructs a new COption_SocketAddressZ containing a crate::lightning::ln::msgs::SocketAddress
28754  */
28755 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_some(struct LDKSocketAddress o);
28756
28757 /**
28758  * Constructs a new COption_SocketAddressZ containing nothing
28759  */
28760 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_none(void);
28761
28762 /**
28763  * Frees any resources associated with the crate::lightning::ln::msgs::SocketAddress, if we are in the Some state
28764  */
28765 void COption_SocketAddressZ_free(struct LDKCOption_SocketAddressZ _res);
28766
28767 /**
28768  * Creates a new COption_SocketAddressZ which has the same data as `orig`
28769  * but with all dynamically-allocated buffers duplicated in new buffers.
28770  */
28771 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig);
28772
28773 /**
28774  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28775  */
28776 void CVec_PeerDetailsZ_free(struct LDKCVec_PeerDetailsZ _res);
28777
28778 /**
28779  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
28780  */
28781 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
28782
28783 /**
28784  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
28785  */
28786 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
28787
28788 /**
28789  * Checks if the given object is currently in the success state
28790  */
28791 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
28792
28793 /**
28794  * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
28795  */
28796 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
28797
28798 /**
28799  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
28800  * but with all dynamically-allocated buffers duplicated in new buffers.
28801  */
28802 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
28803
28804 /**
28805  * Creates a new CResult_NonePeerHandleErrorZ in the success state.
28806  */
28807 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
28808
28809 /**
28810  * Creates a new CResult_NonePeerHandleErrorZ in the error state.
28811  */
28812 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
28813
28814 /**
28815  * Checks if the given object is currently in the success state
28816  */
28817 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
28818
28819 /**
28820  * Frees any resources used by the CResult_NonePeerHandleErrorZ.
28821  */
28822 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
28823
28824 /**
28825  * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
28826  * but with all dynamically-allocated buffers duplicated in new buffers.
28827  */
28828 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
28829
28830 /**
28831  * Creates a new CResult_boolPeerHandleErrorZ in the success state.
28832  */
28833 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
28834
28835 /**
28836  * Creates a new CResult_boolPeerHandleErrorZ in the error state.
28837  */
28838 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
28839
28840 /**
28841  * Checks if the given object is currently in the success state
28842  */
28843 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
28844
28845 /**
28846  * Frees any resources used by the CResult_boolPeerHandleErrorZ.
28847  */
28848 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
28849
28850 /**
28851  * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
28852  * but with all dynamically-allocated buffers duplicated in new buffers.
28853  */
28854 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
28855
28856 /**
28857  * Creates a new CResult_u32GraphSyncErrorZ in the success state.
28858  */
28859 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
28860
28861 /**
28862  * Creates a new CResult_u32GraphSyncErrorZ in the error state.
28863  */
28864 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
28865
28866 /**
28867  * Checks if the given object is currently in the success state
28868  */
28869 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
28870
28871 /**
28872  * Frees any resources used by the CResult_u32GraphSyncErrorZ.
28873  */
28874 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
28875
28876 /**
28877  * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
28878  */
28879 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_ok(struct LDKCVec_u8Z o);
28880
28881 /**
28882  * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
28883  */
28884 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_err(enum LDKIOError e);
28885
28886 /**
28887  * Checks if the given object is currently in the success state
28888  */
28889 bool CResult_CVec_u8ZIOErrorZ_is_ok(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR o);
28890
28891 /**
28892  * Frees any resources used by the CResult_CVec_u8ZIOErrorZ.
28893  */
28894 void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
28895
28896 /**
28897  * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
28898  * but with all dynamically-allocated buffers duplicated in new buffers.
28899  */
28900 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
28901
28902 /**
28903  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28904  */
28905 void CVec_StrZ_free(struct LDKCVec_StrZ _res);
28906
28907 /**
28908  * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
28909  */
28910 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o);
28911
28912 /**
28913  * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
28914  */
28915 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e);
28916
28917 /**
28918  * Checks if the given object is currently in the success state
28919  */
28920 bool CResult_CVec_StrZIOErrorZ_is_ok(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR o);
28921
28922 /**
28923  * Frees any resources used by the CResult_CVec_StrZIOErrorZ.
28924  */
28925 void CResult_CVec_StrZIOErrorZ_free(struct LDKCResult_CVec_StrZIOErrorZ _res);
28926
28927 /**
28928  * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
28929  * but with all dynamically-allocated buffers duplicated in new buffers.
28930  */
28931 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig);
28932
28933 /**
28934  * Frees the buffer pointed to by `data` if `datalen` is non-0.
28935  */
28936 void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res);
28937
28938 /**
28939  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state.
28940  */
28941 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o);
28942
28943 /**
28944  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the error state.
28945  */
28946 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_err(enum LDKIOError e);
28947
28948 /**
28949  * Checks if the given object is currently in the success state
28950  */
28951 bool CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR o);
28952
28953 /**
28954  * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.
28955  */
28956 void CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ _res);
28957
28958 /**
28959  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ which has the same data as `orig`
28960  * but with all dynamically-allocated buffers duplicated in new buffers.
28961  */
28962 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR orig);
28963
28964 /**
28965  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state.
28966  */
28967 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
28968
28969 /**
28970  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the error state.
28971  */
28972 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_err(enum LDKIOError e);
28973
28974 /**
28975  * Checks if the given object is currently in the success state
28976  */
28977 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR o);
28978
28979 /**
28980  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.
28981  */
28982 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ _res);
28983
28984 /**
28985  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ which has the same data as `orig`
28986  * but with all dynamically-allocated buffers duplicated in new buffers.
28987  */
28988 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig);
28989
28990 /**
28991  * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the success state.
28992  */
28993 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(struct LDKUnsignedInvoiceRequest o);
28994
28995 /**
28996  * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the error state.
28997  */
28998 struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
28999
29000 /**
29001  * Checks if the given object is currently in the success state
29002  */
29003 bool CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o);
29004
29005 /**
29006  * Frees any resources used by the CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ.
29007  */
29008 void CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ _res);
29009
29010 /**
29011  * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the success state.
29012  */
29013 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_ok(struct LDKInvoiceRequest o);
29014
29015 /**
29016  * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the error state.
29017  */
29018 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29019
29020 /**
29021  * Checks if the given object is currently in the success state
29022  */
29023 bool CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o);
29024
29025 /**
29026  * Frees any resources used by the CResult_InvoiceRequestBolt12SemanticErrorZ.
29027  */
29028 void CResult_InvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ _res);
29029
29030 /**
29031  * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ which has the same data as `orig`
29032  * but with all dynamically-allocated buffers duplicated in new buffers.
29033  */
29034 struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig);
29035
29036 /**
29037  * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey
29038  */
29039 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o);
29040
29041 /**
29042  * Constructs a new COption_SecretKeyZ containing nothing
29043  */
29044 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void);
29045
29046 /**
29047  * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
29048  */
29049 void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res);
29050
29051 /**
29052  * Creates a new COption_SecretKeyZ which has the same data as `orig`
29053  * but with all dynamically-allocated buffers duplicated in new buffers.
29054  */
29055 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig);
29056
29057 /**
29058  * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
29059  */
29060 struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithExplicitSigningPubkeyBuilder o);
29061
29062 /**
29063  * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the error state.
29064  */
29065 struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29066
29067 /**
29068  * Checks if the given object is currently in the success state
29069  */
29070 bool CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
29071
29072 /**
29073  * Frees any resources used by the CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.
29074  */
29075 void CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ _res);
29076
29077 /**
29078  * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state.
29079  */
29080 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o);
29081
29082 /**
29083  * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the error state.
29084  */
29085 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void);
29086
29087 /**
29088  * Checks if the given object is currently in the success state
29089  */
29090 bool CResult_VerifiedInvoiceRequestNoneZ_is_ok(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR o);
29091
29092 /**
29093  * Frees any resources used by the CResult_VerifiedInvoiceRequestNoneZ.
29094  */
29095 void CResult_VerifiedInvoiceRequestNoneZ_free(struct LDKCResult_VerifiedInvoiceRequestNoneZ _res);
29096
29097 /**
29098  * Creates a new CResult_VerifiedInvoiceRequestNoneZ which has the same data as `orig`
29099  * but with all dynamically-allocated buffers duplicated in new buffers.
29100  */
29101 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig);
29102
29103 /**
29104  * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
29105  */
29106 struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithDerivedSigningPubkeyBuilder o);
29107
29108 /**
29109  * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the error state.
29110  */
29111 struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
29112
29113 /**
29114  * Checks if the given object is currently in the success state
29115  */
29116 bool CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
29117
29118 /**
29119  * Frees any resources used by the CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.
29120  */
29121 void CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ _res);
29122
29123 /**
29124  * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the success state.
29125  */
29126 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_ok(struct LDKInvoiceRequestFields o);
29127
29128 /**
29129  * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the error state.
29130  */
29131 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_err(struct LDKDecodeError e);
29132
29133 /**
29134  * Checks if the given object is currently in the success state
29135  */
29136 bool CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR o);
29137
29138 /**
29139  * Frees any resources used by the CResult_InvoiceRequestFieldsDecodeErrorZ.
29140  */
29141 void CResult_InvoiceRequestFieldsDecodeErrorZ_free(struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ _res);
29142
29143 /**
29144  * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ which has the same data as `orig`
29145  * but with all dynamically-allocated buffers duplicated in new buffers.
29146  */
29147 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_clone(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR orig);
29148
29149 /**
29150  * Constructs a new COption_NoneZ containing a
29151  */
29152 enum LDKCOption_NoneZ COption_NoneZ_some(void);
29153
29154 /**
29155  * Constructs a new COption_NoneZ containing nothing
29156  */
29157 enum LDKCOption_NoneZ COption_NoneZ_none(void);
29158
29159 /**
29160  * Frees any resources associated with the , if we are in the Some state
29161  */
29162 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
29163
29164 /**
29165  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29166  */
29167 void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
29168
29169 /**
29170  * Constructs a new COption_ECDSASignatureZ containing a crate::c_types::ECDSASignature
29171  */
29172 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_some(struct LDKECDSASignature o);
29173
29174 /**
29175  * Constructs a new COption_ECDSASignatureZ containing nothing
29176  */
29177 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_none(void);
29178
29179 /**
29180  * Frees any resources associated with the crate::c_types::ECDSASignature, if we are in the Some state
29181  */
29182 void COption_ECDSASignatureZ_free(struct LDKCOption_ECDSASignatureZ _res);
29183
29184 /**
29185  * Creates a new COption_ECDSASignatureZ which has the same data as `orig`
29186  * but with all dynamically-allocated buffers duplicated in new buffers.
29187  */
29188 struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_clone(const struct LDKCOption_ECDSASignatureZ *NONNULL_PTR orig);
29189
29190 /**
29191  * Constructs a new COption_i64Z containing a i64
29192  */
29193 struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
29194
29195 /**
29196  * Constructs a new COption_i64Z containing nothing
29197  */
29198 struct LDKCOption_i64Z COption_i64Z_none(void);
29199
29200 /**
29201  * Frees any resources associated with the i64, if we are in the Some state
29202  */
29203 void COption_i64Z_free(struct LDKCOption_i64Z _res);
29204
29205 /**
29206  * Creates a new COption_i64Z which has the same data as `orig`
29207  * but with all dynamically-allocated buffers duplicated in new buffers.
29208  */
29209 struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
29210
29211 /**
29212  * Creates a new CResult_SocketAddressDecodeErrorZ in the success state.
29213  */
29214 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_ok(struct LDKSocketAddress o);
29215
29216 /**
29217  * Creates a new CResult_SocketAddressDecodeErrorZ in the error state.
29218  */
29219 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_err(struct LDKDecodeError e);
29220
29221 /**
29222  * Checks if the given object is currently in the success state
29223  */
29224 bool CResult_SocketAddressDecodeErrorZ_is_ok(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR o);
29225
29226 /**
29227  * Frees any resources used by the CResult_SocketAddressDecodeErrorZ.
29228  */
29229 void CResult_SocketAddressDecodeErrorZ_free(struct LDKCResult_SocketAddressDecodeErrorZ _res);
29230
29231 /**
29232  * Creates a new CResult_SocketAddressDecodeErrorZ which has the same data as `orig`
29233  * but with all dynamically-allocated buffers duplicated in new buffers.
29234  */
29235 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_clone(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR orig);
29236
29237 /**
29238  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the success state.
29239  */
29240 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_ok(struct LDKSocketAddress o);
29241
29242 /**
29243  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the error state.
29244  */
29245 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_err(enum LDKSocketAddressParseError e);
29246
29247 /**
29248  * Checks if the given object is currently in the success state
29249  */
29250 bool CResult_SocketAddressSocketAddressParseErrorZ_is_ok(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR o);
29251
29252 /**
29253  * Frees any resources used by the CResult_SocketAddressSocketAddressParseErrorZ.
29254  */
29255 void CResult_SocketAddressSocketAddressParseErrorZ_free(struct LDKCResult_SocketAddressSocketAddressParseErrorZ _res);
29256
29257 /**
29258  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ which has the same data as `orig`
29259  * but with all dynamically-allocated buffers duplicated in new buffers.
29260  */
29261 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_clone(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR orig);
29262
29263 /**
29264  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29265  */
29266 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
29267
29268 /**
29269  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29270  */
29271 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
29272
29273 /**
29274  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29275  */
29276 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
29277
29278 /**
29279  * Frees the buffer pointed to by `data` if `datalen` is non-0.
29280  */
29281 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
29282
29283 /**
29284  * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
29285  */
29286 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
29287
29288 /**
29289  * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
29290  */
29291 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
29292
29293 /**
29294  * Checks if the given object is currently in the success state
29295  */
29296 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
29297
29298 /**
29299  * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
29300  */
29301 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
29302
29303 /**
29304  * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
29305  * but with all dynamically-allocated buffers duplicated in new buffers.
29306  */
29307 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
29308
29309 /**
29310  * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
29311  */
29312 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
29313
29314 /**
29315  * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
29316  */
29317 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
29318
29319 /**
29320  * Checks if the given object is currently in the success state
29321  */
29322 bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
29323
29324 /**
29325  * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
29326  */
29327 void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
29328
29329 /**
29330  * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
29331  * but with all dynamically-allocated buffers duplicated in new buffers.
29332  */
29333 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
29334
29335 /**
29336  * Creates a new CResult_StfuDecodeErrorZ in the success state.
29337  */
29338 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_ok(struct LDKStfu o);
29339
29340 /**
29341  * Creates a new CResult_StfuDecodeErrorZ in the error state.
29342  */
29343 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_err(struct LDKDecodeError e);
29344
29345 /**
29346  * Checks if the given object is currently in the success state
29347  */
29348 bool CResult_StfuDecodeErrorZ_is_ok(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR o);
29349
29350 /**
29351  * Frees any resources used by the CResult_StfuDecodeErrorZ.
29352  */
29353 void CResult_StfuDecodeErrorZ_free(struct LDKCResult_StfuDecodeErrorZ _res);
29354
29355 /**
29356  * Creates a new CResult_StfuDecodeErrorZ which has the same data as `orig`
29357  * but with all dynamically-allocated buffers duplicated in new buffers.
29358  */
29359 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_clone(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR orig);
29360
29361 /**
29362  * Creates a new CResult_SpliceDecodeErrorZ in the success state.
29363  */
29364 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_ok(struct LDKSplice o);
29365
29366 /**
29367  * Creates a new CResult_SpliceDecodeErrorZ in the error state.
29368  */
29369 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_err(struct LDKDecodeError e);
29370
29371 /**
29372  * Checks if the given object is currently in the success state
29373  */
29374 bool CResult_SpliceDecodeErrorZ_is_ok(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR o);
29375
29376 /**
29377  * Frees any resources used by the CResult_SpliceDecodeErrorZ.
29378  */
29379 void CResult_SpliceDecodeErrorZ_free(struct LDKCResult_SpliceDecodeErrorZ _res);
29380
29381 /**
29382  * Creates a new CResult_SpliceDecodeErrorZ which has the same data as `orig`
29383  * but with all dynamically-allocated buffers duplicated in new buffers.
29384  */
29385 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_clone(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR orig);
29386
29387 /**
29388  * Creates a new CResult_SpliceAckDecodeErrorZ in the success state.
29389  */
29390 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_ok(struct LDKSpliceAck o);
29391
29392 /**
29393  * Creates a new CResult_SpliceAckDecodeErrorZ in the error state.
29394  */
29395 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_err(struct LDKDecodeError e);
29396
29397 /**
29398  * Checks if the given object is currently in the success state
29399  */
29400 bool CResult_SpliceAckDecodeErrorZ_is_ok(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR o);
29401
29402 /**
29403  * Frees any resources used by the CResult_SpliceAckDecodeErrorZ.
29404  */
29405 void CResult_SpliceAckDecodeErrorZ_free(struct LDKCResult_SpliceAckDecodeErrorZ _res);
29406
29407 /**
29408  * Creates a new CResult_SpliceAckDecodeErrorZ which has the same data as `orig`
29409  * but with all dynamically-allocated buffers duplicated in new buffers.
29410  */
29411 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_clone(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR orig);
29412
29413 /**
29414  * Creates a new CResult_SpliceLockedDecodeErrorZ in the success state.
29415  */
29416 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_ok(struct LDKSpliceLocked o);
29417
29418 /**
29419  * Creates a new CResult_SpliceLockedDecodeErrorZ in the error state.
29420  */
29421 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_err(struct LDKDecodeError e);
29422
29423 /**
29424  * Checks if the given object is currently in the success state
29425  */
29426 bool CResult_SpliceLockedDecodeErrorZ_is_ok(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR o);
29427
29428 /**
29429  * Frees any resources used by the CResult_SpliceLockedDecodeErrorZ.
29430  */
29431 void CResult_SpliceLockedDecodeErrorZ_free(struct LDKCResult_SpliceLockedDecodeErrorZ _res);
29432
29433 /**
29434  * Creates a new CResult_SpliceLockedDecodeErrorZ which has the same data as `orig`
29435  * but with all dynamically-allocated buffers duplicated in new buffers.
29436  */
29437 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_clone(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR orig);
29438
29439 /**
29440  * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
29441  */
29442 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
29443
29444 /**
29445  * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
29446  */
29447 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
29448
29449 /**
29450  * Checks if the given object is currently in the success state
29451  */
29452 bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
29453
29454 /**
29455  * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
29456  */
29457 void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
29458
29459 /**
29460  * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
29461  * but with all dynamically-allocated buffers duplicated in new buffers.
29462  */
29463 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
29464
29465 /**
29466  * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
29467  */
29468 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
29469
29470 /**
29471  * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
29472  */
29473 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
29474
29475 /**
29476  * Checks if the given object is currently in the success state
29477  */
29478 bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
29479
29480 /**
29481  * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
29482  */
29483 void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
29484
29485 /**
29486  * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
29487  * but with all dynamically-allocated buffers duplicated in new buffers.
29488  */
29489 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
29490
29491 /**
29492  * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
29493  */
29494 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
29495
29496 /**
29497  * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
29498  */
29499 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
29500
29501 /**
29502  * Checks if the given object is currently in the success state
29503  */
29504 bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
29505
29506 /**
29507  * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
29508  */
29509 void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
29510
29511 /**
29512  * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
29513  * but with all dynamically-allocated buffers duplicated in new buffers.
29514  */
29515 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
29516
29517 /**
29518  * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
29519  */
29520 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
29521
29522 /**
29523  * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
29524  */
29525 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
29526
29527 /**
29528  * Checks if the given object is currently in the success state
29529  */
29530 bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
29531
29532 /**
29533  * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
29534  */
29535 void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
29536
29537 /**
29538  * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
29539  * but with all dynamically-allocated buffers duplicated in new buffers.
29540  */
29541 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
29542
29543 /**
29544  * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
29545  */
29546 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
29547
29548 /**
29549  * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
29550  */
29551 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
29552
29553 /**
29554  * Checks if the given object is currently in the success state
29555  */
29556 bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
29557
29558 /**
29559  * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
29560  */
29561 void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
29562
29563 /**
29564  * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
29565  * but with all dynamically-allocated buffers duplicated in new buffers.
29566  */
29567 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
29568
29569 /**
29570  * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
29571  */
29572 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
29573
29574 /**
29575  * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
29576  */
29577 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
29578
29579 /**
29580  * Checks if the given object is currently in the success state
29581  */
29582 bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
29583
29584 /**
29585  * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
29586  */
29587 void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
29588
29589 /**
29590  * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
29591  * but with all dynamically-allocated buffers duplicated in new buffers.
29592  */
29593 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
29594
29595 /**
29596  * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
29597  */
29598 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
29599
29600 /**
29601  * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
29602  */
29603 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
29604
29605 /**
29606  * Checks if the given object is currently in the success state
29607  */
29608 bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
29609
29610 /**
29611  * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
29612  */
29613 void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
29614
29615 /**
29616  * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
29617  * but with all dynamically-allocated buffers duplicated in new buffers.
29618  */
29619 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
29620
29621 /**
29622  * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
29623  */
29624 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
29625
29626 /**
29627  * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
29628  */
29629 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
29630
29631 /**
29632  * Checks if the given object is currently in the success state
29633  */
29634 bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
29635
29636 /**
29637  * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
29638  */
29639 void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
29640
29641 /**
29642  * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
29643  * but with all dynamically-allocated buffers duplicated in new buffers.
29644  */
29645 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
29646
29647 /**
29648  * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
29649  */
29650 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
29651
29652 /**
29653  * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
29654  */
29655 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
29656
29657 /**
29658  * Checks if the given object is currently in the success state
29659  */
29660 bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
29661
29662 /**
29663  * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
29664  */
29665 void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
29666
29667 /**
29668  * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
29669  * but with all dynamically-allocated buffers duplicated in new buffers.
29670  */
29671 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
29672
29673 /**
29674  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
29675  */
29676 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
29677
29678 /**
29679  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
29680  */
29681 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
29682
29683 /**
29684  * Checks if the given object is currently in the success state
29685  */
29686 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
29687
29688 /**
29689  * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
29690  */
29691 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
29692
29693 /**
29694  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
29695  * but with all dynamically-allocated buffers duplicated in new buffers.
29696  */
29697 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
29698
29699 /**
29700  * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
29701  */
29702 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
29703
29704 /**
29705  * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
29706  */
29707 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
29708
29709 /**
29710  * Checks if the given object is currently in the success state
29711  */
29712 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
29713
29714 /**
29715  * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
29716  */
29717 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
29718
29719 /**
29720  * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
29721  * but with all dynamically-allocated buffers duplicated in new buffers.
29722  */
29723 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
29724
29725 /**
29726  * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
29727  */
29728 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
29729
29730 /**
29731  * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
29732  */
29733 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
29734
29735 /**
29736  * Checks if the given object is currently in the success state
29737  */
29738 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
29739
29740 /**
29741  * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
29742  */
29743 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
29744
29745 /**
29746  * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
29747  * but with all dynamically-allocated buffers duplicated in new buffers.
29748  */
29749 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
29750
29751 /**
29752  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
29753  */
29754 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
29755
29756 /**
29757  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
29758  */
29759 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
29760
29761 /**
29762  * Checks if the given object is currently in the success state
29763  */
29764 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
29765
29766 /**
29767  * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
29768  */
29769 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
29770
29771 /**
29772  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
29773  * but with all dynamically-allocated buffers duplicated in new buffers.
29774  */
29775 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
29776
29777 /**
29778  * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
29779  */
29780 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
29781
29782 /**
29783  * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
29784  */
29785 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
29786
29787 /**
29788  * Checks if the given object is currently in the success state
29789  */
29790 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
29791
29792 /**
29793  * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
29794  */
29795 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
29796
29797 /**
29798  * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
29799  * but with all dynamically-allocated buffers duplicated in new buffers.
29800  */
29801 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
29802
29803 /**
29804  * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
29805  */
29806 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
29807
29808 /**
29809  * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
29810  */
29811 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
29812
29813 /**
29814  * Checks if the given object is currently in the success state
29815  */
29816 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
29817
29818 /**
29819  * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
29820  */
29821 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
29822
29823 /**
29824  * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
29825  * but with all dynamically-allocated buffers duplicated in new buffers.
29826  */
29827 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
29828
29829 /**
29830  * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
29831  */
29832 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
29833
29834 /**
29835  * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
29836  */
29837 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
29838
29839 /**
29840  * Checks if the given object is currently in the success state
29841  */
29842 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
29843
29844 /**
29845  * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
29846  */
29847 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
29848
29849 /**
29850  * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
29851  * but with all dynamically-allocated buffers duplicated in new buffers.
29852  */
29853 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
29854
29855 /**
29856  * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
29857  */
29858 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
29859
29860 /**
29861  * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
29862  */
29863 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
29864
29865 /**
29866  * Checks if the given object is currently in the success state
29867  */
29868 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
29869
29870 /**
29871  * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
29872  */
29873 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
29874
29875 /**
29876  * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
29877  * but with all dynamically-allocated buffers duplicated in new buffers.
29878  */
29879 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
29880
29881 /**
29882  * Creates a new CResult_InitDecodeErrorZ in the success state.
29883  */
29884 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
29885
29886 /**
29887  * Creates a new CResult_InitDecodeErrorZ in the error state.
29888  */
29889 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
29890
29891 /**
29892  * Checks if the given object is currently in the success state
29893  */
29894 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
29895
29896 /**
29897  * Frees any resources used by the CResult_InitDecodeErrorZ.
29898  */
29899 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
29900
29901 /**
29902  * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
29903  * but with all dynamically-allocated buffers duplicated in new buffers.
29904  */
29905 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
29906
29907 /**
29908  * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
29909  */
29910 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
29911
29912 /**
29913  * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
29914  */
29915 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
29916
29917 /**
29918  * Checks if the given object is currently in the success state
29919  */
29920 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
29921
29922 /**
29923  * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
29924  */
29925 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
29926
29927 /**
29928  * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
29929  * but with all dynamically-allocated buffers duplicated in new buffers.
29930  */
29931 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
29932
29933 /**
29934  * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
29935  */
29936 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
29937
29938 /**
29939  * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
29940  */
29941 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
29942
29943 /**
29944  * Checks if the given object is currently in the success state
29945  */
29946 bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
29947
29948 /**
29949  * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
29950  */
29951 void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
29952
29953 /**
29954  * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
29955  * but with all dynamically-allocated buffers duplicated in new buffers.
29956  */
29957 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
29958
29959 /**
29960  * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
29961  */
29962 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
29963
29964 /**
29965  * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
29966  */
29967 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
29968
29969 /**
29970  * Checks if the given object is currently in the success state
29971  */
29972 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
29973
29974 /**
29975  * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
29976  */
29977 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
29978
29979 /**
29980  * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
29981  * but with all dynamically-allocated buffers duplicated in new buffers.
29982  */
29983 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
29984
29985 /**
29986  * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
29987  */
29988 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
29989
29990 /**
29991  * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
29992  */
29993 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
29994
29995 /**
29996  * Checks if the given object is currently in the success state
29997  */
29998 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
29999
30000 /**
30001  * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
30002  */
30003 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
30004
30005 /**
30006  * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
30007  * but with all dynamically-allocated buffers duplicated in new buffers.
30008  */
30009 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
30010
30011 /**
30012  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
30013  */
30014 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
30015
30016 /**
30017  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
30018  */
30019 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30020
30021 /**
30022  * Checks if the given object is currently in the success state
30023  */
30024 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
30025
30026 /**
30027  * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
30028  */
30029 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
30030
30031 /**
30032  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
30033  * but with all dynamically-allocated buffers duplicated in new buffers.
30034  */
30035 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
30036
30037 /**
30038  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
30039  */
30040 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
30041
30042 /**
30043  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
30044  */
30045 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30046
30047 /**
30048  * Checks if the given object is currently in the success state
30049  */
30050 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
30051
30052 /**
30053  * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
30054  */
30055 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
30056
30057 /**
30058  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
30059  * but with all dynamically-allocated buffers duplicated in new buffers.
30060  */
30061 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
30062
30063 /**
30064  * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
30065  */
30066 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
30067
30068 /**
30069  * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
30070  */
30071 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
30072
30073 /**
30074  * Checks if the given object is currently in the success state
30075  */
30076 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
30077
30078 /**
30079  * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
30080  */
30081 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
30082
30083 /**
30084  * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
30085  * but with all dynamically-allocated buffers duplicated in new buffers.
30086  */
30087 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
30088
30089 /**
30090  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
30091  */
30092 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
30093
30094 /**
30095  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
30096  */
30097 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30098
30099 /**
30100  * Checks if the given object is currently in the success state
30101  */
30102 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
30103
30104 /**
30105  * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
30106  */
30107 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
30108
30109 /**
30110  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
30111  * but with all dynamically-allocated buffers duplicated in new buffers.
30112  */
30113 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
30114
30115 /**
30116  * Creates a new CResult_OnionPacketDecodeErrorZ in the success state.
30117  */
30118 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_ok(struct LDKOnionPacket o);
30119
30120 /**
30121  * Creates a new CResult_OnionPacketDecodeErrorZ in the error state.
30122  */
30123 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_err(struct LDKDecodeError e);
30124
30125 /**
30126  * Checks if the given object is currently in the success state
30127  */
30128 bool CResult_OnionPacketDecodeErrorZ_is_ok(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR o);
30129
30130 /**
30131  * Frees any resources used by the CResult_OnionPacketDecodeErrorZ.
30132  */
30133 void CResult_OnionPacketDecodeErrorZ_free(struct LDKCResult_OnionPacketDecodeErrorZ _res);
30134
30135 /**
30136  * Creates a new CResult_OnionPacketDecodeErrorZ which has the same data as `orig`
30137  * but with all dynamically-allocated buffers duplicated in new buffers.
30138  */
30139 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_clone(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR orig);
30140
30141 /**
30142  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
30143  */
30144 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
30145
30146 /**
30147  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
30148  */
30149 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
30150
30151 /**
30152  * Checks if the given object is currently in the success state
30153  */
30154 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
30155
30156 /**
30157  * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
30158  */
30159 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
30160
30161 /**
30162  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
30163  * but with all dynamically-allocated buffers duplicated in new buffers.
30164  */
30165 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
30166
30167 /**
30168  * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
30169  */
30170 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
30171
30172 /**
30173  * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
30174  */
30175 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
30176
30177 /**
30178  * Checks if the given object is currently in the success state
30179  */
30180 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
30181
30182 /**
30183  * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
30184  */
30185 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
30186
30187 /**
30188  * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
30189  * but with all dynamically-allocated buffers duplicated in new buffers.
30190  */
30191 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
30192
30193 /**
30194  * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the success state.
30195  */
30196 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_ok(struct LDKFinalOnionHopData o);
30197
30198 /**
30199  * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the error state.
30200  */
30201 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_err(struct LDKDecodeError e);
30202
30203 /**
30204  * Checks if the given object is currently in the success state
30205  */
30206 bool CResult_FinalOnionHopDataDecodeErrorZ_is_ok(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR o);
30207
30208 /**
30209  * Frees any resources used by the CResult_FinalOnionHopDataDecodeErrorZ.
30210  */
30211 void CResult_FinalOnionHopDataDecodeErrorZ_free(struct LDKCResult_FinalOnionHopDataDecodeErrorZ _res);
30212
30213 /**
30214  * Creates a new CResult_FinalOnionHopDataDecodeErrorZ which has the same data as `orig`
30215  * but with all dynamically-allocated buffers duplicated in new buffers.
30216  */
30217 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_clone(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR orig);
30218
30219 /**
30220  * Creates a new CResult_PingDecodeErrorZ in the success state.
30221  */
30222 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
30223
30224 /**
30225  * Creates a new CResult_PingDecodeErrorZ in the error state.
30226  */
30227 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
30228
30229 /**
30230  * Checks if the given object is currently in the success state
30231  */
30232 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
30233
30234 /**
30235  * Frees any resources used by the CResult_PingDecodeErrorZ.
30236  */
30237 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
30238
30239 /**
30240  * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
30241  * but with all dynamically-allocated buffers duplicated in new buffers.
30242  */
30243 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
30244
30245 /**
30246  * Creates a new CResult_PongDecodeErrorZ in the success state.
30247  */
30248 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
30249
30250 /**
30251  * Creates a new CResult_PongDecodeErrorZ in the error state.
30252  */
30253 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
30254
30255 /**
30256  * Checks if the given object is currently in the success state
30257  */
30258 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
30259
30260 /**
30261  * Frees any resources used by the CResult_PongDecodeErrorZ.
30262  */
30263 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
30264
30265 /**
30266  * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
30267  * but with all dynamically-allocated buffers duplicated in new buffers.
30268  */
30269 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
30270
30271 /**
30272  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
30273  */
30274 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
30275
30276 /**
30277  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
30278  */
30279 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30280
30281 /**
30282  * Checks if the given object is currently in the success state
30283  */
30284 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
30285
30286 /**
30287  * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
30288  */
30289 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
30290
30291 /**
30292  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
30293  * but with all dynamically-allocated buffers duplicated in new buffers.
30294  */
30295 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30296
30297 /**
30298  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
30299  */
30300 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
30301
30302 /**
30303  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
30304  */
30305 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30306
30307 /**
30308  * Checks if the given object is currently in the success state
30309  */
30310 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
30311
30312 /**
30313  * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
30314  */
30315 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
30316
30317 /**
30318  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
30319  * but with all dynamically-allocated buffers duplicated in new buffers.
30320  */
30321 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30322
30323 /**
30324  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
30325  */
30326 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
30327
30328 /**
30329  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
30330  */
30331 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
30332
30333 /**
30334  * Checks if the given object is currently in the success state
30335  */
30336 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
30337
30338 /**
30339  * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
30340  */
30341 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
30342
30343 /**
30344  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
30345  * but with all dynamically-allocated buffers duplicated in new buffers.
30346  */
30347 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
30348
30349 /**
30350  * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
30351  */
30352 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
30353
30354 /**
30355  * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
30356  */
30357 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
30358
30359 /**
30360  * Checks if the given object is currently in the success state
30361  */
30362 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
30363
30364 /**
30365  * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
30366  */
30367 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
30368
30369 /**
30370  * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
30371  * but with all dynamically-allocated buffers duplicated in new buffers.
30372  */
30373 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
30374
30375 /**
30376  * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
30377  */
30378 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
30379
30380 /**
30381  * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
30382  */
30383 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
30384
30385 /**
30386  * Checks if the given object is currently in the success state
30387  */
30388 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
30389
30390 /**
30391  * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
30392  */
30393 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
30394
30395 /**
30396  * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
30397  * but with all dynamically-allocated buffers duplicated in new buffers.
30398  */
30399 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
30400
30401 /**
30402  * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
30403  */
30404 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
30405
30406 /**
30407  * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
30408  */
30409 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
30410
30411 /**
30412  * Checks if the given object is currently in the success state
30413  */
30414 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
30415
30416 /**
30417  * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
30418  */
30419 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
30420
30421 /**
30422  * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
30423  * but with all dynamically-allocated buffers duplicated in new buffers.
30424  */
30425 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
30426
30427 /**
30428  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
30429  */
30430 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
30431
30432 /**
30433  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
30434  */
30435 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30436
30437 /**
30438  * Checks if the given object is currently in the success state
30439  */
30440 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
30441
30442 /**
30443  * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
30444  */
30445 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
30446
30447 /**
30448  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
30449  * but with all dynamically-allocated buffers duplicated in new buffers.
30450  */
30451 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30452
30453 /**
30454  * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
30455  */
30456 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
30457
30458 /**
30459  * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
30460  */
30461 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
30462
30463 /**
30464  * Checks if the given object is currently in the success state
30465  */
30466 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
30467
30468 /**
30469  * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
30470  */
30471 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
30472
30473 /**
30474  * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
30475  * but with all dynamically-allocated buffers duplicated in new buffers.
30476  */
30477 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
30478
30479 /**
30480  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
30481  */
30482 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
30483
30484 /**
30485  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
30486  */
30487 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
30488
30489 /**
30490  * Checks if the given object is currently in the success state
30491  */
30492 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
30493
30494 /**
30495  * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
30496  */
30497 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
30498
30499 /**
30500  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
30501  * but with all dynamically-allocated buffers duplicated in new buffers.
30502  */
30503 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
30504
30505 /**
30506  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
30507  */
30508 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
30509
30510 /**
30511  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
30512  */
30513 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
30514
30515 /**
30516  * Checks if the given object is currently in the success state
30517  */
30518 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
30519
30520 /**
30521  * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
30522  */
30523 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
30524
30525 /**
30526  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
30527  * but with all dynamically-allocated buffers duplicated in new buffers.
30528  */
30529 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
30530
30531 /**
30532  * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
30533  */
30534 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
30535
30536 /**
30537  * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
30538  */
30539 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
30540
30541 /**
30542  * Checks if the given object is currently in the success state
30543  */
30544 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
30545
30546 /**
30547  * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
30548  */
30549 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
30550
30551 /**
30552  * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
30553  * but with all dynamically-allocated buffers duplicated in new buffers.
30554  */
30555 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
30556
30557 /**
30558  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
30559  */
30560 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
30561
30562 /**
30563  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
30564  */
30565 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
30566
30567 /**
30568  * Checks if the given object is currently in the success state
30569  */
30570 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
30571
30572 /**
30573  * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
30574  */
30575 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
30576
30577 /**
30578  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
30579  * but with all dynamically-allocated buffers duplicated in new buffers.
30580  */
30581 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
30582
30583 /**
30584  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
30585  */
30586 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
30587
30588 /**
30589  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
30590  */
30591 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
30592
30593 /**
30594  * Checks if the given object is currently in the success state
30595  */
30596 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
30597
30598 /**
30599  * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
30600  */
30601 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
30602
30603 /**
30604  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
30605  * but with all dynamically-allocated buffers duplicated in new buffers.
30606  */
30607 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
30608
30609 /**
30610  * Frees the buffer pointed to by `data` if `datalen` is non-0.
30611  */
30612 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
30613
30614 /**
30615  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
30616  */
30617 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
30618
30619 /**
30620  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
30621  */
30622 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
30623
30624 /**
30625  * Checks if the given object is currently in the success state
30626  */
30627 bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
30628
30629 /**
30630  * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
30631  */
30632 void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
30633
30634 /**
30635  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
30636  * but with all dynamically-allocated buffers duplicated in new buffers.
30637  */
30638 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
30639
30640 /**
30641  * Frees the buffer pointed to by `data` if `datalen` is non-0.
30642  */
30643 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
30644
30645 /**
30646  * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
30647  */
30648 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
30649
30650 /**
30651  * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
30652  */
30653 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
30654
30655 /**
30656  * Checks if the given object is currently in the success state
30657  */
30658 bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
30659
30660 /**
30661  * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
30662  */
30663 void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
30664
30665 /**
30666  * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
30667  * but with all dynamically-allocated buffers duplicated in new buffers.
30668  */
30669 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
30670
30671 /**
30672  * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
30673  */
30674 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
30675
30676 /**
30677  * Constructs a new COption_HTLCClaimZ containing nothing
30678  */
30679 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
30680
30681 /**
30682  * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
30683  */
30684 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
30685
30686 /**
30687  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
30688  */
30689 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
30690
30691 /**
30692  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
30693  */
30694 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
30695
30696 /**
30697  * Checks if the given object is currently in the success state
30698  */
30699 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
30700
30701 /**
30702  * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
30703  */
30704 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
30705
30706 /**
30707  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
30708  * but with all dynamically-allocated buffers duplicated in new buffers.
30709  */
30710 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
30711
30712 /**
30713  * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
30714  */
30715 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
30716
30717 /**
30718  * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
30719  */
30720 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
30721
30722 /**
30723  * Checks if the given object is currently in the success state
30724  */
30725 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
30726
30727 /**
30728  * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
30729  */
30730 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
30731
30732 /**
30733  * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
30734  * but with all dynamically-allocated buffers duplicated in new buffers.
30735  */
30736 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
30737
30738 /**
30739  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
30740  */
30741 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
30742
30743 /**
30744  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
30745  */
30746 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
30747
30748 /**
30749  * Checks if the given object is currently in the success state
30750  */
30751 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
30752
30753 /**
30754  * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
30755  */
30756 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
30757
30758 /**
30759  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
30760  * but with all dynamically-allocated buffers duplicated in new buffers.
30761  */
30762 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
30763
30764 /**
30765  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
30766  */
30767 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
30768
30769 /**
30770  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
30771  */
30772 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
30773
30774 /**
30775  * Checks if the given object is currently in the success state
30776  */
30777 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
30778
30779 /**
30780  * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
30781  */
30782 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
30783
30784 /**
30785  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
30786  * but with all dynamically-allocated buffers duplicated in new buffers.
30787  */
30788 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
30789
30790 /**
30791  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
30792  */
30793 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
30794
30795 /**
30796  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
30797  */
30798 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
30799
30800 /**
30801  * Checks if the given object is currently in the success state
30802  */
30803 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
30804
30805 /**
30806  * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
30807  */
30808 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
30809
30810 /**
30811  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
30812  * but with all dynamically-allocated buffers duplicated in new buffers.
30813  */
30814 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
30815
30816 /**
30817  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
30818  */
30819 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
30820
30821 /**
30822  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
30823  */
30824 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
30825
30826 /**
30827  * Checks if the given object is currently in the success state
30828  */
30829 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
30830
30831 /**
30832  * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
30833  */
30834 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
30835
30836 /**
30837  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
30838  * but with all dynamically-allocated buffers duplicated in new buffers.
30839  */
30840 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
30841
30842 /**
30843  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
30844  */
30845 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
30846
30847 /**
30848  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
30849  */
30850 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
30851
30852 /**
30853  * Checks if the given object is currently in the success state
30854  */
30855 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
30856
30857 /**
30858  * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
30859  */
30860 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
30861
30862 /**
30863  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
30864  * but with all dynamically-allocated buffers duplicated in new buffers.
30865  */
30866 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
30867
30868 /**
30869  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
30870  */
30871 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
30872
30873 /**
30874  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
30875  */
30876 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
30877
30878 /**
30879  * Checks if the given object is currently in the success state
30880  */
30881 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
30882
30883 /**
30884  * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
30885  */
30886 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
30887
30888 /**
30889  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
30890  * but with all dynamically-allocated buffers duplicated in new buffers.
30891  */
30892 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
30893
30894 /**
30895  * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
30896  */
30897 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
30898
30899 /**
30900  * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
30901  */
30902 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
30903
30904 /**
30905  * Checks if the given object is currently in the success state
30906  */
30907 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
30908
30909 /**
30910  * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
30911  */
30912 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
30913
30914 /**
30915  * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
30916  */
30917 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
30918
30919 /**
30920  * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
30921  */
30922 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
30923
30924 /**
30925  * Checks if the given object is currently in the success state
30926  */
30927 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
30928
30929 /**
30930  * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
30931  */
30932 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
30933
30934 /**
30935  * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
30936  * but with all dynamically-allocated buffers duplicated in new buffers.
30937  */
30938 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
30939
30940 /**
30941  * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
30942  */
30943 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
30944
30945 /**
30946  * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
30947  */
30948 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
30949
30950 /**
30951  * Checks if the given object is currently in the success state
30952  */
30953 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
30954
30955 /**
30956  * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
30957  */
30958 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
30959
30960 /**
30961  * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
30962  */
30963 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
30964
30965 /**
30966  * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
30967  */
30968 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
30969
30970 /**
30971  * Checks if the given object is currently in the success state
30972  */
30973 bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
30974
30975 /**
30976  * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
30977  */
30978 void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
30979
30980 /**
30981  * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
30982  * but with all dynamically-allocated buffers duplicated in new buffers.
30983  */
30984 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
30985
30986 /**
30987  * Constructs a new COption_usizeZ containing a usize
30988  */
30989 struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
30990
30991 /**
30992  * Constructs a new COption_usizeZ containing nothing
30993  */
30994 struct LDKCOption_usizeZ COption_usizeZ_none(void);
30995
30996 /**
30997  * Frees any resources associated with the usize, if we are in the Some state
30998  */
30999 void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
31000
31001 /**
31002  * Creates a new COption_usizeZ which has the same data as `orig`
31003  * but with all dynamically-allocated buffers duplicated in new buffers.
31004  */
31005 struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
31006
31007 /**
31008  * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
31009  */
31010 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
31011
31012 /**
31013  * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
31014  */
31015 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
31016
31017 /**
31018  * Checks if the given object is currently in the success state
31019  */
31020 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
31021
31022 /**
31023  * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
31024  */
31025 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
31026
31027 /**
31028  * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
31029  * but with all dynamically-allocated buffers duplicated in new buffers.
31030  */
31031 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
31032
31033 /**
31034  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
31035  */
31036 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
31037
31038 /**
31039  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
31040  */
31041 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
31042
31043 /**
31044  * Checks if the given object is currently in the success state
31045  */
31046 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
31047
31048 /**
31049  * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
31050  */
31051 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
31052
31053 /**
31054  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
31055  * but with all dynamically-allocated buffers duplicated in new buffers.
31056  */
31057 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
31058
31059 /**
31060  * Frees the buffer pointed to by `data` if `datalen` is non-0.
31061  */
31062 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
31063
31064 /**
31065  * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
31066  */
31067 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
31068
31069 /**
31070  * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
31071  */
31072 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
31073
31074 /**
31075  * Checks if the given object is currently in the success state
31076  */
31077 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
31078
31079 /**
31080  * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
31081  */
31082 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
31083
31084 /**
31085  * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
31086  * but with all dynamically-allocated buffers duplicated in new buffers.
31087  */
31088 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
31089
31090 /**
31091  * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state.
31092  */
31093 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_ok(struct LDKClaimedHTLC o);
31094
31095 /**
31096  * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the error state.
31097  */
31098 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
31099
31100 /**
31101  * Checks if the given object is currently in the success state
31102  */
31103 bool CResult_ClaimedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR o);
31104
31105 /**
31106  * Frees any resources used by the CResult_ClaimedHTLCDecodeErrorZ.
31107  */
31108 void CResult_ClaimedHTLCDecodeErrorZ_free(struct LDKCResult_ClaimedHTLCDecodeErrorZ _res);
31109
31110 /**
31111  * Creates a new CResult_ClaimedHTLCDecodeErrorZ which has the same data as `orig`
31112  * but with all dynamically-allocated buffers duplicated in new buffers.
31113  */
31114 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_clone(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR orig);
31115
31116 /**
31117  * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
31118  */
31119 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
31120
31121 /**
31122  * Constructs a new COption_PathFailureZ containing nothing
31123  */
31124 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
31125
31126 /**
31127  * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
31128  */
31129 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
31130
31131 /**
31132  * Creates a new COption_PathFailureZ which has the same data as `orig`
31133  * but with all dynamically-allocated buffers duplicated in new buffers.
31134  */
31135 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
31136
31137 /**
31138  * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
31139  */
31140 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
31141
31142 /**
31143  * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
31144  */
31145 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
31146
31147 /**
31148  * Checks if the given object is currently in the success state
31149  */
31150 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
31151
31152 /**
31153  * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
31154  */
31155 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
31156
31157 /**
31158  * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
31159  * but with all dynamically-allocated buffers duplicated in new buffers.
31160  */
31161 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
31162
31163 /**
31164  * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
31165  */
31166 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
31167
31168 /**
31169  * Constructs a new COption_ClosureReasonZ containing nothing
31170  */
31171 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
31172
31173 /**
31174  * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
31175  */
31176 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
31177
31178 /**
31179  * Creates a new COption_ClosureReasonZ which has the same data as `orig`
31180  * but with all dynamically-allocated buffers duplicated in new buffers.
31181  */
31182 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
31183
31184 /**
31185  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
31186  */
31187 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
31188
31189 /**
31190  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
31191  */
31192 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
31193
31194 /**
31195  * Checks if the given object is currently in the success state
31196  */
31197 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
31198
31199 /**
31200  * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
31201  */
31202 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
31203
31204 /**
31205  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
31206  * but with all dynamically-allocated buffers duplicated in new buffers.
31207  */
31208 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
31209
31210 /**
31211  * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
31212  */
31213 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
31214
31215 /**
31216  * Constructs a new COption_HTLCDestinationZ containing nothing
31217  */
31218 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
31219
31220 /**
31221  * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
31222  */
31223 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
31224
31225 /**
31226  * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
31227  * but with all dynamically-allocated buffers duplicated in new buffers.
31228  */
31229 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
31230
31231 /**
31232  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
31233  */
31234 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
31235
31236 /**
31237  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
31238  */
31239 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
31240
31241 /**
31242  * Checks if the given object is currently in the success state
31243  */
31244 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
31245
31246 /**
31247  * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
31248  */
31249 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
31250
31251 /**
31252  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
31253  * but with all dynamically-allocated buffers duplicated in new buffers.
31254  */
31255 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
31256
31257 /**
31258  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
31259  */
31260 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
31261
31262 /**
31263  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
31264  */
31265 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
31266
31267 /**
31268  * Checks if the given object is currently in the success state
31269  */
31270 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
31271
31272 /**
31273  * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
31274  */
31275 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
31276
31277 /**
31278  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
31279  * but with all dynamically-allocated buffers duplicated in new buffers.
31280  */
31281 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
31282
31283 /**
31284  * Constructs a new COption_U128Z containing a crate::c_types::U128
31285  */
31286 struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
31287
31288 /**
31289  * Constructs a new COption_U128Z containing nothing
31290  */
31291 struct LDKCOption_U128Z COption_U128Z_none(void);
31292
31293 /**
31294  * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
31295  */
31296 void COption_U128Z_free(struct LDKCOption_U128Z _res);
31297
31298 /**
31299  * Creates a new COption_U128Z which has the same data as `orig`
31300  * but with all dynamically-allocated buffers duplicated in new buffers.
31301  */
31302 struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
31303
31304 /**
31305  * Frees the buffer pointed to by `data` if `datalen` is non-0.
31306  */
31307 void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
31308
31309 /**
31310  * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
31311  */
31312 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
31313
31314 /**
31315  * Constructs a new COption_PaymentFailureReasonZ containing nothing
31316  */
31317 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
31318
31319 /**
31320  * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
31321  */
31322 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
31323
31324 /**
31325  * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
31326  * but with all dynamically-allocated buffers duplicated in new buffers.
31327  */
31328 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
31329
31330 /**
31331  * Constructs a new COption_EventZ containing a crate::lightning::events::Event
31332  */
31333 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
31334
31335 /**
31336  * Constructs a new COption_EventZ containing nothing
31337  */
31338 struct LDKCOption_EventZ COption_EventZ_none(void);
31339
31340 /**
31341  * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
31342  */
31343 void COption_EventZ_free(struct LDKCOption_EventZ _res);
31344
31345 /**
31346  * Creates a new COption_EventZ which has the same data as `orig`
31347  * but with all dynamically-allocated buffers duplicated in new buffers.
31348  */
31349 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
31350
31351 /**
31352  * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
31353  */
31354 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
31355
31356 /**
31357  * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
31358  */
31359 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
31360
31361 /**
31362  * Checks if the given object is currently in the success state
31363  */
31364 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
31365
31366 /**
31367  * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
31368  */
31369 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
31370
31371 /**
31372  * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
31373  * but with all dynamically-allocated buffers duplicated in new buffers.
31374  */
31375 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
31376
31377 /**
31378  * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
31379  */
31380 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
31381
31382 /**
31383  * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
31384  */
31385 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
31386
31387 /**
31388  * Checks if the given object is currently in the success state
31389  */
31390 bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
31391
31392 /**
31393  * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
31394  */
31395 void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
31396
31397 /**
31398  * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
31399  * but with all dynamically-allocated buffers duplicated in new buffers.
31400  */
31401 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
31402
31403 /**
31404  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
31405  */
31406 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
31407
31408 /**
31409  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
31410  */
31411 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
31412
31413 /**
31414  * Checks if the given object is currently in the success state
31415  */
31416 bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
31417
31418 /**
31419  * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
31420  */
31421 void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
31422
31423 /**
31424  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
31425  * but with all dynamically-allocated buffers duplicated in new buffers.
31426  */
31427 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
31428
31429 /**
31430  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
31431  */
31432 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
31433
31434 /**
31435  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
31436  */
31437 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
31438
31439 /**
31440  * Checks if the given object is currently in the success state
31441  */
31442 bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
31443
31444 /**
31445  * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
31446  */
31447 void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
31448
31449 /**
31450  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
31451  * but with all dynamically-allocated buffers duplicated in new buffers.
31452  */
31453 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
31454
31455 /**
31456  * Creates a new tuple which has the same data as `orig`
31457  * but with all dynamically-allocated buffers duplicated in new buffers.
31458  */
31459 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
31460
31461 /**
31462  * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
31463  */
31464 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
31465
31466 /**
31467  * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
31468  */
31469 void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
31470
31471 /**
31472  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
31473  */
31474 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_ok(struct LDKPayeePubKey o);
31475
31476 /**
31477  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
31478  */
31479 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
31480
31481 /**
31482  * Checks if the given object is currently in the success state
31483  */
31484 bool CResult_PayeePubKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR o);
31485
31486 /**
31487  * Frees any resources used by the CResult_PayeePubKeySecp256k1ErrorZ.
31488  */
31489 void CResult_PayeePubKeySecp256k1ErrorZ_free(struct LDKCResult_PayeePubKeySecp256k1ErrorZ _res);
31490
31491 /**
31492  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
31493  * but with all dynamically-allocated buffers duplicated in new buffers.
31494  */
31495 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_clone(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR orig);
31496
31497 /**
31498  * Frees the buffer pointed to by `data` if `datalen` is non-0.
31499  */
31500 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
31501
31502 /**
31503  * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
31504  */
31505 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
31506
31507 /**
31508  * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
31509  */
31510 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
31511
31512 /**
31513  * Checks if the given object is currently in the success state
31514  */
31515 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
31516
31517 /**
31518  * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
31519  */
31520 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
31521
31522 /**
31523  * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
31524  * but with all dynamically-allocated buffers duplicated in new buffers.
31525  */
31526 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
31527
31528 /**
31529  * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
31530  */
31531 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
31532
31533 /**
31534  * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
31535  */
31536 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
31537
31538 /**
31539  * Checks if the given object is currently in the success state
31540  */
31541 bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
31542
31543 /**
31544  * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
31545  */
31546 void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
31547
31548 /**
31549  * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
31550  * but with all dynamically-allocated buffers duplicated in new buffers.
31551  */
31552 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
31553
31554 /**
31555  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
31556  */
31557 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
31558
31559 /**
31560  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
31561  */
31562 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
31563
31564 /**
31565  * Checks if the given object is currently in the success state
31566  */
31567 bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
31568
31569 /**
31570  * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
31571  */
31572 void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
31573
31574 /**
31575  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
31576  * but with all dynamically-allocated buffers duplicated in new buffers.
31577  */
31578 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
31579
31580 /**
31581  * Creates a new CResult_DescriptionCreationErrorZ in the success state.
31582  */
31583 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
31584
31585 /**
31586  * Creates a new CResult_DescriptionCreationErrorZ in the error state.
31587  */
31588 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
31589
31590 /**
31591  * Checks if the given object is currently in the success state
31592  */
31593 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
31594
31595 /**
31596  * Frees any resources used by the CResult_DescriptionCreationErrorZ.
31597  */
31598 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
31599
31600 /**
31601  * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
31602  * but with all dynamically-allocated buffers duplicated in new buffers.
31603  */
31604 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
31605
31606 /**
31607  * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
31608  */
31609 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
31610
31611 /**
31612  * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
31613  */
31614 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
31615
31616 /**
31617  * Checks if the given object is currently in the success state
31618  */
31619 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
31620
31621 /**
31622  * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
31623  */
31624 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
31625
31626 /**
31627  * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
31628  * but with all dynamically-allocated buffers duplicated in new buffers.
31629  */
31630 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
31631
31632 /**
31633  * Creates a new CResult_OutPointDecodeErrorZ in the success state.
31634  */
31635 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
31636
31637 /**
31638  * Creates a new CResult_OutPointDecodeErrorZ in the error state.
31639  */
31640 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
31641
31642 /**
31643  * Checks if the given object is currently in the success state
31644  */
31645 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
31646
31647 /**
31648  * Frees any resources used by the CResult_OutPointDecodeErrorZ.
31649  */
31650 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
31651
31652 /**
31653  * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
31654  * but with all dynamically-allocated buffers duplicated in new buffers.
31655  */
31656 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
31657
31658 /**
31659  * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
31660  */
31661 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
31662
31663 /**
31664  * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
31665  */
31666 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
31667
31668 /**
31669  * Checks if the given object is currently in the success state
31670  */
31671 bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
31672
31673 /**
31674  * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
31675  */
31676 void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
31677
31678 /**
31679  * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
31680  * but with all dynamically-allocated buffers duplicated in new buffers.
31681  */
31682 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
31683
31684 /**
31685  * Creates a new CResult_HostnameDecodeErrorZ in the success state.
31686  */
31687 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
31688
31689 /**
31690  * Creates a new CResult_HostnameDecodeErrorZ in the error state.
31691  */
31692 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
31693
31694 /**
31695  * Checks if the given object is currently in the success state
31696  */
31697 bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
31698
31699 /**
31700  * Frees any resources used by the CResult_HostnameDecodeErrorZ.
31701  */
31702 void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
31703
31704 /**
31705  * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
31706  * but with all dynamically-allocated buffers duplicated in new buffers.
31707  */
31708 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
31709
31710 /**
31711  * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
31712  */
31713 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
31714
31715 /**
31716  * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
31717  */
31718 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
31719
31720 /**
31721  * Checks if the given object is currently in the success state
31722  */
31723 bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
31724
31725 /**
31726  * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
31727  */
31728 void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
31729
31730 /**
31731  * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
31732  * but with all dynamically-allocated buffers duplicated in new buffers.
31733  */
31734 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
31735
31736 /**
31737  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
31738  */
31739 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
31740
31741 /**
31742  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
31743  */
31744 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
31745
31746 /**
31747  * Checks if the given object is currently in the success state
31748  */
31749 bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
31750
31751 /**
31752  * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
31753  */
31754 void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
31755
31756 /**
31757  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
31758  * but with all dynamically-allocated buffers duplicated in new buffers.
31759  */
31760 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
31761
31762 /**
31763  * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
31764  */
31765 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
31766
31767 /**
31768  * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
31769  */
31770 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
31771
31772 /**
31773  * Checks if the given object is currently in the success state
31774  */
31775 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
31776
31777 /**
31778  * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
31779  */
31780 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
31781
31782 /**
31783  * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
31784  * but with all dynamically-allocated buffers duplicated in new buffers.
31785  */
31786 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
31787
31788 /**
31789  * Creates a new CResult_ChannelIdDecodeErrorZ in the success state.
31790  */
31791 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_ok(struct LDKChannelId o);
31792
31793 /**
31794  * Creates a new CResult_ChannelIdDecodeErrorZ in the error state.
31795  */
31796 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_err(struct LDKDecodeError e);
31797
31798 /**
31799  * Checks if the given object is currently in the success state
31800  */
31801 bool CResult_ChannelIdDecodeErrorZ_is_ok(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR o);
31802
31803 /**
31804  * Frees any resources used by the CResult_ChannelIdDecodeErrorZ.
31805  */
31806 void CResult_ChannelIdDecodeErrorZ_free(struct LDKCResult_ChannelIdDecodeErrorZ _res);
31807
31808 /**
31809  * Creates a new CResult_ChannelIdDecodeErrorZ which has the same data as `orig`
31810  * but with all dynamically-allocated buffers duplicated in new buffers.
31811  */
31812 struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_clone(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR orig);
31813
31814 /**
31815  * Creates a new tuple which has the same data as `orig`
31816  * but with all dynamically-allocated buffers duplicated in new buffers.
31817  */
31818 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_clone(const struct LDKC2Tuple__u832u16Z *NONNULL_PTR orig);
31819
31820 /**
31821  * Creates a new C2Tuple__u832u16Z from the contained elements.
31822  */
31823 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_new(struct LDKThirtyTwoBytes a, uint16_t b);
31824
31825 /**
31826  * Frees any resources used by the C2Tuple__u832u16Z.
31827  */
31828 void C2Tuple__u832u16Z_free(struct LDKC2Tuple__u832u16Z _res);
31829
31830 /**
31831  * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
31832  */
31833 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o);
31834
31835 /**
31836  * Creates a new CResult_PaymentRelayDecodeErrorZ in the error state.
31837  */
31838 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e);
31839
31840 /**
31841  * Checks if the given object is currently in the success state
31842  */
31843 bool CResult_PaymentRelayDecodeErrorZ_is_ok(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR o);
31844
31845 /**
31846  * Frees any resources used by the CResult_PaymentRelayDecodeErrorZ.
31847  */
31848 void CResult_PaymentRelayDecodeErrorZ_free(struct LDKCResult_PaymentRelayDecodeErrorZ _res);
31849
31850 /**
31851  * Creates a new CResult_PaymentRelayDecodeErrorZ which has the same data as `orig`
31852  * but with all dynamically-allocated buffers duplicated in new buffers.
31853  */
31854 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_clone(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR orig);
31855
31856 /**
31857  * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state.
31858  */
31859 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_ok(struct LDKPaymentConstraints o);
31860
31861 /**
31862  * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the error state.
31863  */
31864 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_err(struct LDKDecodeError e);
31865
31866 /**
31867  * Checks if the given object is currently in the success state
31868  */
31869 bool CResult_PaymentConstraintsDecodeErrorZ_is_ok(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR o);
31870
31871 /**
31872  * Frees any resources used by the CResult_PaymentConstraintsDecodeErrorZ.
31873  */
31874 void CResult_PaymentConstraintsDecodeErrorZ_free(struct LDKCResult_PaymentConstraintsDecodeErrorZ _res);
31875
31876 /**
31877  * Creates a new CResult_PaymentConstraintsDecodeErrorZ which has the same data as `orig`
31878  * but with all dynamically-allocated buffers duplicated in new buffers.
31879  */
31880 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig);
31881
31882 /**
31883  * Creates a new CResult_PaymentContextDecodeErrorZ in the success state.
31884  */
31885 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_ok(struct LDKPaymentContext o);
31886
31887 /**
31888  * Creates a new CResult_PaymentContextDecodeErrorZ in the error state.
31889  */
31890 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_err(struct LDKDecodeError e);
31891
31892 /**
31893  * Checks if the given object is currently in the success state
31894  */
31895 bool CResult_PaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR o);
31896
31897 /**
31898  * Frees any resources used by the CResult_PaymentContextDecodeErrorZ.
31899  */
31900 void CResult_PaymentContextDecodeErrorZ_free(struct LDKCResult_PaymentContextDecodeErrorZ _res);
31901
31902 /**
31903  * Creates a new CResult_PaymentContextDecodeErrorZ which has the same data as `orig`
31904  * but with all dynamically-allocated buffers duplicated in new buffers.
31905  */
31906 struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_clone(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR orig);
31907
31908 /**
31909  * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the success state.
31910  */
31911 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_ok(struct LDKUnknownPaymentContext o);
31912
31913 /**
31914  * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the error state.
31915  */
31916 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_err(struct LDKDecodeError e);
31917
31918 /**
31919  * Checks if the given object is currently in the success state
31920  */
31921 bool CResult_UnknownPaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR o);
31922
31923 /**
31924  * Frees any resources used by the CResult_UnknownPaymentContextDecodeErrorZ.
31925  */
31926 void CResult_UnknownPaymentContextDecodeErrorZ_free(struct LDKCResult_UnknownPaymentContextDecodeErrorZ _res);
31927
31928 /**
31929  * Creates a new CResult_UnknownPaymentContextDecodeErrorZ which has the same data as `orig`
31930  * but with all dynamically-allocated buffers duplicated in new buffers.
31931  */
31932 struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_clone(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR orig);
31933
31934 /**
31935  * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the success state.
31936  */
31937 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_ok(struct LDKBolt12OfferContext o);
31938
31939 /**
31940  * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the error state.
31941  */
31942 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_err(struct LDKDecodeError e);
31943
31944 /**
31945  * Checks if the given object is currently in the success state
31946  */
31947 bool CResult_Bolt12OfferContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR o);
31948
31949 /**
31950  * Frees any resources used by the CResult_Bolt12OfferContextDecodeErrorZ.
31951  */
31952 void CResult_Bolt12OfferContextDecodeErrorZ_free(struct LDKCResult_Bolt12OfferContextDecodeErrorZ _res);
31953
31954 /**
31955  * Creates a new CResult_Bolt12OfferContextDecodeErrorZ which has the same data as `orig`
31956  * but with all dynamically-allocated buffers duplicated in new buffers.
31957  */
31958 struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR orig);
31959
31960 /**
31961  * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the success state.
31962  */
31963 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_ok(struct LDKBolt12RefundContext o);
31964
31965 /**
31966  * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the error state.
31967  */
31968 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_err(struct LDKDecodeError e);
31969
31970 /**
31971  * Checks if the given object is currently in the success state
31972  */
31973 bool CResult_Bolt12RefundContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR o);
31974
31975 /**
31976  * Frees any resources used by the CResult_Bolt12RefundContextDecodeErrorZ.
31977  */
31978 void CResult_Bolt12RefundContextDecodeErrorZ_free(struct LDKCResult_Bolt12RefundContextDecodeErrorZ _res);
31979
31980 /**
31981  * Creates a new CResult_Bolt12RefundContextDecodeErrorZ which has the same data as `orig`
31982  * but with all dynamically-allocated buffers duplicated in new buffers.
31983  */
31984 struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR orig);
31985
31986 /**
31987  * Creates a new CResult_StrSecp256k1ErrorZ in the success state.
31988  */
31989 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o);
31990
31991 /**
31992  * Creates a new CResult_StrSecp256k1ErrorZ in the error state.
31993  */
31994 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
31995
31996 /**
31997  * Checks if the given object is currently in the success state
31998  */
31999 bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o);
32000
32001 /**
32002  * Frees any resources used by the CResult_StrSecp256k1ErrorZ.
32003  */
32004 void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res);
32005
32006 /**
32007  * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig`
32008  * but with all dynamically-allocated buffers duplicated in new buffers.
32009  */
32010 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig);
32011
32012 /**
32013  * Creates a new tuple which has the same data as `orig`
32014  * but with all dynamically-allocated buffers duplicated in new buffers.
32015  */
32016 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig);
32017
32018 /**
32019  * Creates a new C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ from the contained elements.
32020  */
32021 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c);
32022
32023 /**
32024  * Frees any resources used by the C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.
32025  */
32026 void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res);
32027
32028 /**
32029  * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the success state.
32030  */
32031 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o);
32032
32033 /**
32034  * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the error state.
32035  */
32036 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void);
32037
32038 /**
32039  * Checks if the given object is currently in the success state
32040  */
32041 bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o);
32042
32043 /**
32044  * Frees any resources used by the CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.
32045  */
32046 void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res);
32047
32048 /**
32049  * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ which has the same data as `orig`
32050  * but with all dynamically-allocated buffers duplicated in new buffers.
32051  */
32052 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig);
32053
32054 /**
32055  * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
32056  */
32057 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
32058
32059 /**
32060  * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
32061  */
32062 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
32063
32064 /**
32065  * Checks if the given object is currently in the success state
32066  */
32067 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
32068
32069 /**
32070  * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
32071  */
32072 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
32073
32074 /**
32075  * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
32076  * but with all dynamically-allocated buffers duplicated in new buffers.
32077  */
32078 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
32079
32080 /**
32081  * Creates a new tuple which has the same data as `orig`
32082  * but with all dynamically-allocated buffers duplicated in new buffers.
32083  */
32084 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(const struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR orig);
32085
32086 /**
32087  * Creates a new C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ from the contained elements.
32088  */
32089 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(struct LDKPublicKey a, struct LDKOnionMessage b, struct LDKCOption_CVec_SocketAddressZZ c);
32090
32091 /**
32092  * Frees any resources used by the C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.
32093  */
32094 void C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res);
32095
32096 /**
32097  * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the success state.
32098  */
32099 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o);
32100
32101 /**
32102  * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the error state.
32103  */
32104 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(struct LDKSendError e);
32105
32106 /**
32107  * Checks if the given object is currently in the success state
32108  */
32109 bool CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR o);
32110
32111 /**
32112  * Frees any resources used by the CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.
32113  */
32114 void CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res);
32115
32116 /**
32117  * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ which has the same data as `orig`
32118  * but with all dynamically-allocated buffers duplicated in new buffers.
32119  */
32120 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR orig);
32121
32122 /**
32123  * Creates a new CResult_PeeledOnionNoneZ in the success state.
32124  */
32125 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_ok(struct LDKPeeledOnion o);
32126
32127 /**
32128  * Creates a new CResult_PeeledOnionNoneZ in the error state.
32129  */
32130 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_err(void);
32131
32132 /**
32133  * Checks if the given object is currently in the success state
32134  */
32135 bool CResult_PeeledOnionNoneZ_is_ok(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR o);
32136
32137 /**
32138  * Frees any resources used by the CResult_PeeledOnionNoneZ.
32139  */
32140 void CResult_PeeledOnionNoneZ_free(struct LDKCResult_PeeledOnionNoneZ _res);
32141
32142 /**
32143  * Creates a new CResult_PeeledOnionNoneZ which has the same data as `orig`
32144  * but with all dynamically-allocated buffers duplicated in new buffers.
32145  */
32146 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_clone(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR orig);
32147
32148 /**
32149  * Creates a new CResult_SendSuccessSendErrorZ in the success state.
32150  */
32151 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_ok(struct LDKSendSuccess o);
32152
32153 /**
32154  * Creates a new CResult_SendSuccessSendErrorZ in the error state.
32155  */
32156 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_err(struct LDKSendError e);
32157
32158 /**
32159  * Checks if the given object is currently in the success state
32160  */
32161 bool CResult_SendSuccessSendErrorZ_is_ok(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR o);
32162
32163 /**
32164  * Frees any resources used by the CResult_SendSuccessSendErrorZ.
32165  */
32166 void CResult_SendSuccessSendErrorZ_free(struct LDKCResult_SendSuccessSendErrorZ _res);
32167
32168 /**
32169  * Creates a new CResult_SendSuccessSendErrorZ which has the same data as `orig`
32170  * but with all dynamically-allocated buffers duplicated in new buffers.
32171  */
32172 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_clone(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR orig);
32173
32174 /**
32175  * Creates a new CResult_BlindedPathNoneZ in the success state.
32176  */
32177 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
32178
32179 /**
32180  * Creates a new CResult_BlindedPathNoneZ in the error state.
32181  */
32182 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
32183
32184 /**
32185  * Checks if the given object is currently in the success state
32186  */
32187 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
32188
32189 /**
32190  * Frees any resources used by the CResult_BlindedPathNoneZ.
32191  */
32192 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
32193
32194 /**
32195  * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
32196  * but with all dynamically-allocated buffers duplicated in new buffers.
32197  */
32198 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
32199
32200 /**
32201  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
32202  */
32203 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o);
32204
32205 /**
32206  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
32207  */
32208 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void);
32209
32210 /**
32211  * Checks if the given object is currently in the success state
32212  */
32213 bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o);
32214
32215 /**
32216  * Frees any resources used by the CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.
32217  */
32218 void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res);
32219
32220 /**
32221  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
32222  * but with all dynamically-allocated buffers duplicated in new buffers.
32223  */
32224 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig);
32225
32226 /**
32227  * Frees the buffer pointed to by `data` if `datalen` is non-0.
32228  */
32229 void CVec_ForwardNodeZ_free(struct LDKCVec_ForwardNodeZ _res);
32230
32231 /**
32232  * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
32233  */
32234 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
32235
32236 /**
32237  * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
32238  */
32239 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
32240
32241 /**
32242  * Checks if the given object is currently in the success state
32243  */
32244 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
32245
32246 /**
32247  * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
32248  */
32249 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
32250
32251 /**
32252  * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
32253  * but with all dynamically-allocated buffers duplicated in new buffers.
32254  */
32255 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
32256
32257 /**
32258  * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
32259  */
32260 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
32261
32262 /**
32263  * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
32264  */
32265 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
32266
32267 /**
32268  * Checks if the given object is currently in the success state
32269  */
32270 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
32271
32272 /**
32273  * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
32274  */
32275 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
32276
32277 /**
32278  * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
32279  * but with all dynamically-allocated buffers duplicated in new buffers.
32280  */
32281 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
32282
32283 /**
32284  * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
32285  */
32286 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
32287
32288 /**
32289  * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
32290  */
32291 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
32292
32293 /**
32294  * Checks if the given object is currently in the success state
32295  */
32296 bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
32297
32298 /**
32299  * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
32300  */
32301 void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
32302
32303 /**
32304  * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
32305  * but with all dynamically-allocated buffers duplicated in new buffers.
32306  */
32307 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
32308
32309 /**
32310  * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the success state.
32311  */
32312 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_ok(struct LDKTrackedSpendableOutput o);
32313
32314 /**
32315  * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the error state.
32316  */
32317 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_err(struct LDKDecodeError e);
32318
32319 /**
32320  * Checks if the given object is currently in the success state
32321  */
32322 bool CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR o);
32323
32324 /**
32325  * Frees any resources used by the CResult_TrackedSpendableOutputDecodeErrorZ.
32326  */
32327 void CResult_TrackedSpendableOutputDecodeErrorZ_free(struct LDKCResult_TrackedSpendableOutputDecodeErrorZ _res);
32328
32329 /**
32330  * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ which has the same data as `orig`
32331  * but with all dynamically-allocated buffers duplicated in new buffers.
32332  */
32333 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_clone(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR orig);
32334
32335 /**
32336  * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the success state.
32337  */
32338 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_ok(struct LDKOutputSpendStatus o);
32339
32340 /**
32341  * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the error state.
32342  */
32343 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_err(struct LDKDecodeError e);
32344
32345 /**
32346  * Checks if the given object is currently in the success state
32347  */
32348 bool CResult_OutputSpendStatusDecodeErrorZ_is_ok(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR o);
32349
32350 /**
32351  * Frees any resources used by the CResult_OutputSpendStatusDecodeErrorZ.
32352  */
32353 void CResult_OutputSpendStatusDecodeErrorZ_free(struct LDKCResult_OutputSpendStatusDecodeErrorZ _res);
32354
32355 /**
32356  * Creates a new CResult_OutputSpendStatusDecodeErrorZ which has the same data as `orig`
32357  * but with all dynamically-allocated buffers duplicated in new buffers.
32358  */
32359 struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_clone(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR orig);
32360
32361 /**
32362  * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
32363  */
32364 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
32365
32366 /**
32367  * Constructs a new COption_FilterZ containing nothing
32368  */
32369 struct LDKCOption_FilterZ COption_FilterZ_none(void);
32370
32371 /**
32372  * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
32373  */
32374 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
32375
32376 /**
32377  * Frees the buffer pointed to by `data` if `datalen` is non-0.
32378  */
32379 void CVec_TrackedSpendableOutputZ_free(struct LDKCVec_TrackedSpendableOutputZ _res);
32380
32381 /**
32382  * Creates a new CResult_OutputSweeperDecodeErrorZ in the success state.
32383  */
32384 struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_ok(struct LDKOutputSweeper o);
32385
32386 /**
32387  * Creates a new CResult_OutputSweeperDecodeErrorZ in the error state.
32388  */
32389 struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_err(struct LDKDecodeError e);
32390
32391 /**
32392  * Checks if the given object is currently in the success state
32393  */
32394 bool CResult_OutputSweeperDecodeErrorZ_is_ok(const struct LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR o);
32395
32396 /**
32397  * Frees any resources used by the CResult_OutputSweeperDecodeErrorZ.
32398  */
32399 void CResult_OutputSweeperDecodeErrorZ_free(struct LDKCResult_OutputSweeperDecodeErrorZ _res);
32400
32401 /**
32402  * Creates a new C2Tuple_BestBlockOutputSweeperZ from the contained elements.
32403  */
32404 struct LDKC2Tuple_BestBlockOutputSweeperZ C2Tuple_BestBlockOutputSweeperZ_new(struct LDKBestBlock a, struct LDKOutputSweeper b);
32405
32406 /**
32407  * Frees any resources used by the C2Tuple_BestBlockOutputSweeperZ.
32408  */
32409 void C2Tuple_BestBlockOutputSweeperZ_free(struct LDKC2Tuple_BestBlockOutputSweeperZ _res);
32410
32411 /**
32412  * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the success state.
32413  */
32414 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(struct LDKC2Tuple_BestBlockOutputSweeperZ o);
32415
32416 /**
32417  * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the error state.
32418  */
32419 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(struct LDKDecodeError e);
32420
32421 /**
32422  * Checks if the given object is currently in the success state
32423  */
32424 bool CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR o);
32425
32426 /**
32427  * Frees any resources used by the CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.
32428  */
32429 void CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res);
32430
32431 /**
32432  * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the success state.
32433  */
32434 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_ok(struct LDKDelayedPaymentBasepoint o);
32435
32436 /**
32437  * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the error state.
32438  */
32439 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_err(struct LDKDecodeError e);
32440
32441 /**
32442  * Checks if the given object is currently in the success state
32443  */
32444 bool CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR o);
32445
32446 /**
32447  * Frees any resources used by the CResult_DelayedPaymentBasepointDecodeErrorZ.
32448  */
32449 void CResult_DelayedPaymentBasepointDecodeErrorZ_free(struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ _res);
32450
32451 /**
32452  * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ which has the same data as `orig`
32453  * but with all dynamically-allocated buffers duplicated in new buffers.
32454  */
32455 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR orig);
32456
32457 /**
32458  * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the success state.
32459  */
32460 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_ok(struct LDKDelayedPaymentKey o);
32461
32462 /**
32463  * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the error state.
32464  */
32465 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_err(struct LDKDecodeError e);
32466
32467 /**
32468  * Checks if the given object is currently in the success state
32469  */
32470 bool CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR o);
32471
32472 /**
32473  * Frees any resources used by the CResult_DelayedPaymentKeyDecodeErrorZ.
32474  */
32475 void CResult_DelayedPaymentKeyDecodeErrorZ_free(struct LDKCResult_DelayedPaymentKeyDecodeErrorZ _res);
32476
32477 /**
32478  * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ which has the same data as `orig`
32479  * but with all dynamically-allocated buffers duplicated in new buffers.
32480  */
32481 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR orig);
32482
32483 /**
32484  * Creates a new CResult_HtlcBasepointDecodeErrorZ in the success state.
32485  */
32486 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_ok(struct LDKHtlcBasepoint o);
32487
32488 /**
32489  * Creates a new CResult_HtlcBasepointDecodeErrorZ in the error state.
32490  */
32491 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_err(struct LDKDecodeError e);
32492
32493 /**
32494  * Checks if the given object is currently in the success state
32495  */
32496 bool CResult_HtlcBasepointDecodeErrorZ_is_ok(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR o);
32497
32498 /**
32499  * Frees any resources used by the CResult_HtlcBasepointDecodeErrorZ.
32500  */
32501 void CResult_HtlcBasepointDecodeErrorZ_free(struct LDKCResult_HtlcBasepointDecodeErrorZ _res);
32502
32503 /**
32504  * Creates a new CResult_HtlcBasepointDecodeErrorZ which has the same data as `orig`
32505  * but with all dynamically-allocated buffers duplicated in new buffers.
32506  */
32507 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_clone(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR orig);
32508
32509 /**
32510  * Creates a new CResult_HtlcKeyDecodeErrorZ in the success state.
32511  */
32512 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_ok(struct LDKHtlcKey o);
32513
32514 /**
32515  * Creates a new CResult_HtlcKeyDecodeErrorZ in the error state.
32516  */
32517 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_err(struct LDKDecodeError e);
32518
32519 /**
32520  * Checks if the given object is currently in the success state
32521  */
32522 bool CResult_HtlcKeyDecodeErrorZ_is_ok(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR o);
32523
32524 /**
32525  * Frees any resources used by the CResult_HtlcKeyDecodeErrorZ.
32526  */
32527 void CResult_HtlcKeyDecodeErrorZ_free(struct LDKCResult_HtlcKeyDecodeErrorZ _res);
32528
32529 /**
32530  * Creates a new CResult_HtlcKeyDecodeErrorZ which has the same data as `orig`
32531  * but with all dynamically-allocated buffers duplicated in new buffers.
32532  */
32533 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_clone(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR orig);
32534
32535 /**
32536  * Creates a new CResult_RevocationBasepointDecodeErrorZ in the success state.
32537  */
32538 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_ok(struct LDKRevocationBasepoint o);
32539
32540 /**
32541  * Creates a new CResult_RevocationBasepointDecodeErrorZ in the error state.
32542  */
32543 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_err(struct LDKDecodeError e);
32544
32545 /**
32546  * Checks if the given object is currently in the success state
32547  */
32548 bool CResult_RevocationBasepointDecodeErrorZ_is_ok(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR o);
32549
32550 /**
32551  * Frees any resources used by the CResult_RevocationBasepointDecodeErrorZ.
32552  */
32553 void CResult_RevocationBasepointDecodeErrorZ_free(struct LDKCResult_RevocationBasepointDecodeErrorZ _res);
32554
32555 /**
32556  * Creates a new CResult_RevocationBasepointDecodeErrorZ which has the same data as `orig`
32557  * but with all dynamically-allocated buffers duplicated in new buffers.
32558  */
32559 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_clone(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR orig);
32560
32561 /**
32562  * Creates a new CResult_RevocationKeyDecodeErrorZ in the success state.
32563  */
32564 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_ok(struct LDKRevocationKey o);
32565
32566 /**
32567  * Creates a new CResult_RevocationKeyDecodeErrorZ in the error state.
32568  */
32569 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_err(struct LDKDecodeError e);
32570
32571 /**
32572  * Checks if the given object is currently in the success state
32573  */
32574 bool CResult_RevocationKeyDecodeErrorZ_is_ok(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR o);
32575
32576 /**
32577  * Frees any resources used by the CResult_RevocationKeyDecodeErrorZ.
32578  */
32579 void CResult_RevocationKeyDecodeErrorZ_free(struct LDKCResult_RevocationKeyDecodeErrorZ _res);
32580
32581 /**
32582  * Creates a new CResult_RevocationKeyDecodeErrorZ which has the same data as `orig`
32583  * but with all dynamically-allocated buffers duplicated in new buffers.
32584  */
32585 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_clone(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR orig);
32586
32587 /**
32588  * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
32589  */
32590 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
32591
32592 /**
32593  * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
32594  */
32595 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
32596
32597 /**
32598  * Checks if the given object is currently in the success state
32599  */
32600 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
32601
32602 /**
32603  * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
32604  */
32605 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
32606
32607 /**
32608  * Creates a new tuple which has the same data as `orig`
32609  * but with all dynamically-allocated buffers duplicated in new buffers.
32610  */
32611 struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_clone(const struct LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR orig);
32612
32613 /**
32614  * Creates a new C2Tuple_OutPointChannelIdZ from the contained elements.
32615  */
32616 struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_new(struct LDKOutPoint a, struct LDKChannelId b);
32617
32618 /**
32619  * Frees any resources used by the C2Tuple_OutPointChannelIdZ.
32620  */
32621 void C2Tuple_OutPointChannelIdZ_free(struct LDKC2Tuple_OutPointChannelIdZ _res);
32622
32623 /**
32624  * Frees the buffer pointed to by `data` if `datalen` is non-0.
32625  */
32626 void CVec_C2Tuple_OutPointChannelIdZZ_free(struct LDKCVec_C2Tuple_OutPointChannelIdZZ _res);
32627
32628 /**
32629  * Frees the buffer pointed to by `data` if `datalen` is non-0.
32630  */
32631 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
32632
32633 /**
32634  * Creates a new tuple which has the same data as `orig`
32635  * but with all dynamically-allocated buffers duplicated in new buffers.
32636  */
32637 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
32638
32639 /**
32640  * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
32641  */
32642 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
32643
32644 /**
32645  * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
32646  */
32647 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
32648
32649 /**
32650  * Frees the buffer pointed to by `data` if `datalen` is non-0.
32651  */
32652 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
32653
32654 /**
32655  * Frees any resources used by the APIError
32656  */
32657 void APIError_free(struct LDKAPIError this_ptr);
32658
32659 /**
32660  * Creates a copy of the APIError
32661  */
32662 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
32663
32664 /**
32665  * Utility method to constructs a new APIMisuseError-variant APIError
32666  */
32667 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
32668
32669 /**
32670  * Utility method to constructs a new FeeRateTooHigh-variant APIError
32671  */
32672 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
32673
32674 /**
32675  * Utility method to constructs a new InvalidRoute-variant APIError
32676  */
32677 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
32678
32679 /**
32680  * Utility method to constructs a new ChannelUnavailable-variant APIError
32681  */
32682 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
32683
32684 /**
32685  * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
32686  */
32687 struct LDKAPIError APIError_monitor_update_in_progress(void);
32688
32689 /**
32690  * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
32691  */
32692 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
32693
32694 /**
32695  * Checks if two APIErrors contain equal inner contents.
32696  * This ignores pointers and is_owned flags and looks at the values in fields.
32697  */
32698 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
32699
32700 /**
32701  * Serialize the APIError object into a byte array which can be read by APIError_read
32702  */
32703 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
32704
32705 /**
32706  * Read a APIError from a byte array, created by APIError_write
32707  */
32708 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
32709
32710 /**
32711  * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
32712  */
32713 void BigSize_free(struct LDKBigSize this_obj);
32714
32715 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
32716
32717 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
32718
32719 /**
32720  * Constructs a new BigSize given each field
32721  */
32722 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
32723
32724 /**
32725  * Creates a copy of the BigSize
32726  */
32727 struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
32728
32729 /**
32730  * Generates a non-cryptographic 64-bit hash of the BigSize.
32731  */
32732 uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
32733
32734 /**
32735  * Checks if two BigSizes contain equal inner contents.
32736  * This ignores pointers and is_owned flags and looks at the values in fields.
32737  * Two objects with NULL inner values will be considered "equal" here.
32738  */
32739 bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
32740
32741 /**
32742  * Serialize the BigSize object into a byte array which can be read by BigSize_read
32743  */
32744 struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
32745
32746 /**
32747  * Read a BigSize from a byte array, created by BigSize_write
32748  */
32749 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
32750
32751 /**
32752  * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
32753  */
32754 void Hostname_free(struct LDKHostname this_obj);
32755
32756 /**
32757  * Creates a copy of the Hostname
32758  */
32759 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
32760
32761 /**
32762  * Generates a non-cryptographic 64-bit hash of the Hostname.
32763  */
32764 uint64_t Hostname_hash(const struct LDKHostname *NONNULL_PTR o);
32765
32766 /**
32767  * Checks if two Hostnames contain equal inner contents.
32768  * This ignores pointers and is_owned flags and looks at the values in fields.
32769  * Two objects with NULL inner values will be considered "equal" here.
32770  */
32771 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
32772
32773 /**
32774  * Returns the length of the hostname.
32775  */
32776 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
32777
32778 /**
32779  * Serialize the Hostname object into a byte array which can be read by Hostname_read
32780  */
32781 struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
32782
32783 /**
32784  * Read a Hostname from a byte array, created by Hostname_write
32785  */
32786 struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
32787
32788 /**
32789  * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
32790  */
32791 void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
32792
32793 /**
32794  * Creates a copy of the TransactionU16LenLimited
32795  */
32796 struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
32797
32798 /**
32799  * Generates a non-cryptographic 64-bit hash of the TransactionU16LenLimited.
32800  */
32801 uint64_t TransactionU16LenLimited_hash(const struct LDKTransactionU16LenLimited *NONNULL_PTR o);
32802
32803 /**
32804  * Checks if two TransactionU16LenLimiteds contain equal inner contents.
32805  * This ignores pointers and is_owned flags and looks at the values in fields.
32806  * Two objects with NULL inner values will be considered "equal" here.
32807  */
32808 bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
32809
32810 /**
32811  * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
32812  * serialized length is <= u16::MAX.
32813  */
32814 MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
32815
32816 /**
32817  * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
32818  */
32819 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
32820
32821 /**
32822  * Returns a reference to the contained `Transaction`
32823  */
32824 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_as_transaction(const struct LDKTransactionU16LenLimited *NONNULL_PTR this_arg);
32825
32826 /**
32827  * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
32828  */
32829 struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
32830
32831 /**
32832  * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
32833  */
32834 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
32835
32836 /**
32837  * Creates a digital signature of a message given a SecretKey, like the node's secret.
32838  * 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.
32839  * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
32840  */
32841 struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
32842
32843 /**
32844  * Recovers the PublicKey of the signer of the message given the message and the signature.
32845  */
32846 struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
32847
32848 /**
32849  * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
32850  * and the PublicKey.
32851  */
32852 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
32853
32854 /**
32855  * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
32856  */
32857 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
32858
32859 /**
32860  * Calls the free function if one is set
32861  */
32862 void KVStore_free(struct LDKKVStore this_ptr);
32863
32864 /**
32865  * Calls the free function if one is set
32866  */
32867 void Persister_free(struct LDKPersister this_ptr);
32868
32869 /**
32870  * Read previously persisted [`ChannelMonitor`]s from the store.
32871  */
32872 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
32873
32874 /**
32875  * Frees any resources used by the MonitorUpdatingPersister, if is_owned is set and inner is non-NULL.
32876  */
32877 void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
32878
32879 /**
32880  * Constructs a new [`MonitorUpdatingPersister`].
32881  *
32882  * The `maximum_pending_updates` parameter controls how many updates may be stored before a
32883  * [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
32884  * consolidation will frequently occur with fewer updates than what you set here; this number
32885  * is merely the maximum that may be stored. When setting this value, consider that for higher
32886  * values of `maximum_pending_updates`:
32887  *
32888  *   - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
32889  * [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
32890  * `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
32891  *   - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
32892  * \"waves\" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
32893  * less frequent \"waves.\"
32894  *   - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
32895  * [`MonitorUpdatingPersister::cleanup_stale_updates`].
32896  */
32897 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);
32898
32899 /**
32900  * Reads all stored channel monitors, along with any stored updates for them.
32901  *
32902  * It is extremely important that your [`KVStore::read`] implementation uses the
32903  * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
32904  * documentation for [`MonitorUpdatingPersister`].
32905  */
32906 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);
32907
32908 /**
32909  * Read a single channel monitor, along with any stored updates for it.
32910  *
32911  * It is extremely important that your [`KVStore::read`] implementation uses the
32912  * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
32913  * documentation for [`MonitorUpdatingPersister`].
32914  *
32915  * For `monitor_key`, channel storage keys be the channel's transaction ID and index, or
32916  * [`OutPoint`], with an underscore `_` between them. For example, given:
32917  *
32918  *   - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
32919  *   - Index: `1`
32920  *
32921  * The correct `monitor_key` would be:
32922  * `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
32923  *
32924  * Loading a large number of monitors will be faster if done in parallel. You can use this
32925  * function to accomplish this. Take care to limit the number of parallel readers.
32926  */
32927 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);
32928
32929 /**
32930  * Cleans up stale updates for all monitors.
32931  *
32932  * This function works by first listing all monitors, and then for each of them, listing all
32933  * updates. The updates that have an `update_id` less than or equal to than the stored monitor
32934  * are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
32935  * be passed to [`KVStore::remove`].
32936  */
32937 MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy);
32938
32939 /**
32940  * Constructs a new Persist which calls the relevant methods on this_arg.
32941  * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
32942  */
32943 struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
32944
32945 /**
32946  * Creates a copy of the ShortChannelIdError
32947  */
32948 enum LDKShortChannelIdError ShortChannelIdError_clone(const enum LDKShortChannelIdError *NONNULL_PTR orig);
32949
32950 /**
32951  * Utility method to constructs a new BlockOverflow-variant ShortChannelIdError
32952  */
32953 enum LDKShortChannelIdError ShortChannelIdError_block_overflow(void);
32954
32955 /**
32956  * Utility method to constructs a new TxIndexOverflow-variant ShortChannelIdError
32957  */
32958 enum LDKShortChannelIdError ShortChannelIdError_tx_index_overflow(void);
32959
32960 /**
32961  * Utility method to constructs a new VoutIndexOverflow-variant ShortChannelIdError
32962  */
32963 enum LDKShortChannelIdError ShortChannelIdError_vout_index_overflow(void);
32964
32965 /**
32966  * Checks if two ShortChannelIdErrors contain equal inner contents.
32967  * This ignores pointers and is_owned flags and looks at the values in fields.
32968  */
32969 bool ShortChannelIdError_eq(const enum LDKShortChannelIdError *NONNULL_PTR a, const enum LDKShortChannelIdError *NONNULL_PTR b);
32970
32971 /**
32972  * Extracts the block height (most significant 3-bytes) from the `short_channel_id`
32973  */
32974 uint32_t block_from_scid(uint64_t short_channel_id);
32975
32976 /**
32977  * Extracts the tx index (bytes [2..4]) from the `short_channel_id`
32978  */
32979 uint32_t tx_index_from_scid(uint64_t short_channel_id);
32980
32981 /**
32982  * Extracts the vout (bytes [0..2]) from the `short_channel_id`
32983  */
32984 uint16_t vout_from_scid(uint64_t short_channel_id);
32985
32986 /**
32987  * Constructs a `short_channel_id` using the components pieces. Results in an error
32988  * if the block height, tx index, or vout index overflow the maximum sizes.
32989  */
32990 struct LDKCResult_u64ShortChannelIdErrorZ scid_from_parts(uint64_t block, uint64_t tx_index, uint64_t vout_index);
32991
32992 /**
32993  * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
32994  */
32995 void UntrustedString_free(struct LDKUntrustedString this_obj);
32996
32997 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
32998
32999 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
33000
33001 /**
33002  * Constructs a new UntrustedString given each field
33003  */
33004 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
33005
33006 /**
33007  * Creates a copy of the UntrustedString
33008  */
33009 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
33010
33011 /**
33012  * Checks if two UntrustedStrings contain equal inner contents.
33013  * This ignores pointers and is_owned flags and looks at the values in fields.
33014  * Two objects with NULL inner values will be considered "equal" here.
33015  */
33016 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
33017
33018 /**
33019  * Generates a non-cryptographic 64-bit hash of the UntrustedString.
33020  */
33021 uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o);
33022
33023 /**
33024  * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
33025  */
33026 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
33027
33028 /**
33029  * Read a UntrustedString from a byte array, created by UntrustedString_write
33030  */
33031 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
33032
33033 /**
33034  * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
33035  */
33036 void PrintableString_free(struct LDKPrintableString this_obj);
33037
33038 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
33039
33040 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
33041
33042 /**
33043  * Constructs a new PrintableString given each field
33044  */
33045 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
33046
33047 /**
33048  * Frees any resources used by the TrackedSpendableOutput, if is_owned is set and inner is non-NULL.
33049  */
33050 void TrackedSpendableOutput_free(struct LDKTrackedSpendableOutput this_obj);
33051
33052 /**
33053  * The tracked output descriptor.
33054  */
33055 struct LDKSpendableOutputDescriptor TrackedSpendableOutput_get_descriptor(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33056
33057 /**
33058  * The tracked output descriptor.
33059  */
33060 void TrackedSpendableOutput_set_descriptor(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKSpendableOutputDescriptor val);
33061
33062 /**
33063  * The channel this output belongs to.
33064  *
33065  * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`]
33066  *
33067  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33068  */
33069 struct LDKChannelId TrackedSpendableOutput_get_channel_id(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33070
33071 /**
33072  * The channel this output belongs to.
33073  *
33074  * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`]
33075  *
33076  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33077  */
33078 void TrackedSpendableOutput_set_channel_id(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
33079
33080 /**
33081  * The current status of the output spend.
33082  */
33083 struct LDKOutputSpendStatus TrackedSpendableOutput_get_status(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
33084
33085 /**
33086  * The current status of the output spend.
33087  */
33088 void TrackedSpendableOutput_set_status(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKOutputSpendStatus val);
33089
33090 /**
33091  * Constructs a new TrackedSpendableOutput given each field
33092  *
33093  * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33094  */
33095 MUST_USE_RES struct LDKTrackedSpendableOutput TrackedSpendableOutput_new(struct LDKSpendableOutputDescriptor descriptor_arg, struct LDKChannelId channel_id_arg, struct LDKOutputSpendStatus status_arg);
33096
33097 /**
33098  * Creates a copy of the TrackedSpendableOutput
33099  */
33100 struct LDKTrackedSpendableOutput TrackedSpendableOutput_clone(const struct LDKTrackedSpendableOutput *NONNULL_PTR orig);
33101
33102 /**
33103  * Checks if two TrackedSpendableOutputs contain equal inner contents.
33104  * This ignores pointers and is_owned flags and looks at the values in fields.
33105  * Two objects with NULL inner values will be considered "equal" here.
33106  */
33107 bool TrackedSpendableOutput_eq(const struct LDKTrackedSpendableOutput *NONNULL_PTR a, const struct LDKTrackedSpendableOutput *NONNULL_PTR b);
33108
33109 /**
33110  * Returns whether the output is spent in the given transaction.
33111  */
33112 MUST_USE_RES bool TrackedSpendableOutput_is_spent_in(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_arg, struct LDKTransaction tx);
33113
33114 /**
33115  * Serialize the TrackedSpendableOutput object into a byte array which can be read by TrackedSpendableOutput_read
33116  */
33117 struct LDKCVec_u8Z TrackedSpendableOutput_write(const struct LDKTrackedSpendableOutput *NONNULL_PTR obj);
33118
33119 /**
33120  * Read a TrackedSpendableOutput from a byte array, created by TrackedSpendableOutput_write
33121  */
33122 struct LDKCResult_TrackedSpendableOutputDecodeErrorZ TrackedSpendableOutput_read(struct LDKu8slice ser);
33123
33124 /**
33125  * Frees any resources used by the OutputSpendStatus
33126  */
33127 void OutputSpendStatus_free(struct LDKOutputSpendStatus this_ptr);
33128
33129 /**
33130  * Creates a copy of the OutputSpendStatus
33131  */
33132 struct LDKOutputSpendStatus OutputSpendStatus_clone(const struct LDKOutputSpendStatus *NONNULL_PTR orig);
33133
33134 /**
33135  * Utility method to constructs a new PendingInitialBroadcast-variant OutputSpendStatus
33136  */
33137 struct LDKOutputSpendStatus OutputSpendStatus_pending_initial_broadcast(struct LDKCOption_u32Z delayed_until_height);
33138
33139 /**
33140  * Utility method to constructs a new PendingFirstConfirmation-variant OutputSpendStatus
33141  */
33142 struct LDKOutputSpendStatus OutputSpendStatus_pending_first_confirmation(struct LDKThirtyTwoBytes first_broadcast_hash, uint32_t latest_broadcast_height, struct LDKTransaction latest_spending_tx);
33143
33144 /**
33145  * Utility method to constructs a new PendingThresholdConfirmations-variant OutputSpendStatus
33146  */
33147 struct LDKOutputSpendStatus OutputSpendStatus_pending_threshold_confirmations(struct LDKThirtyTwoBytes first_broadcast_hash, uint32_t latest_broadcast_height, struct LDKTransaction latest_spending_tx, uint32_t confirmation_height, struct LDKThirtyTwoBytes confirmation_hash);
33148
33149 /**
33150  * Checks if two OutputSpendStatuss contain equal inner contents.
33151  * This ignores pointers and is_owned flags and looks at the values in fields.
33152  */
33153 bool OutputSpendStatus_eq(const struct LDKOutputSpendStatus *NONNULL_PTR a, const struct LDKOutputSpendStatus *NONNULL_PTR b);
33154
33155 /**
33156  * Serialize the OutputSpendStatus object into a byte array which can be read by OutputSpendStatus_read
33157  */
33158 struct LDKCVec_u8Z OutputSpendStatus_write(const struct LDKOutputSpendStatus *NONNULL_PTR obj);
33159
33160 /**
33161  * Read a OutputSpendStatus from a byte array, created by OutputSpendStatus_write
33162  */
33163 struct LDKCResult_OutputSpendStatusDecodeErrorZ OutputSpendStatus_read(struct LDKu8slice ser);
33164
33165 /**
33166  * Frees any resources used by the OutputSweeper, if is_owned is set and inner is non-NULL.
33167  */
33168 void OutputSweeper_free(struct LDKOutputSweeper this_obj);
33169
33170 /**
33171  * Constructs a new [`OutputSweeper`].
33172  *
33173  * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users also
33174  * need to register their [`Filter`] implementation via the given `chain_data_source`.
33175  */
33176 MUST_USE_RES struct LDKOutputSweeper OutputSweeper_new(struct LDKBestBlock best_block, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKCOption_FilterZ chain_data_source, struct LDKOutputSpender output_spender, struct LDKChangeDestinationSource change_destination_source, struct LDKKVStore kv_store, struct LDKLogger logger);
33177
33178 /**
33179  * Tells the sweeper to track the given outputs descriptors.
33180  *
33181  * Usually, this should be called based on the values emitted by the
33182  * [`Event::SpendableOutputs`].
33183  *
33184  * The given `exclude_static_outputs` flag controls whether the sweeper will filter out
33185  * [`SpendableOutputDescriptor::StaticOutput`]s, which may be handled directly by the on-chain
33186  * wallet implementation.
33187  *
33188  * If `delay_until_height` is set, we will delay the spending until the respective block
33189  * height is reached. This can be used to batch spends, e.g., to reduce on-chain fees.
33190  *
33191  * Returns `Err` on persistence failure, in which case the call may be safely retried.
33192  *
33193  * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
33194  *
33195  * Note that channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
33196  */
33197 MUST_USE_RES struct LDKCResult_NoneNoneZ OutputSweeper_track_spendable_outputs(const struct LDKOutputSweeper *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ output_descriptors, struct LDKChannelId channel_id, bool exclude_static_outputs, struct LDKCOption_u32Z delay_until_height);
33198
33199 /**
33200  * Returns a list of the currently tracked spendable outputs.
33201  */
33202 MUST_USE_RES struct LDKCVec_TrackedSpendableOutputZ OutputSweeper_tracked_spendable_outputs(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33203
33204 /**
33205  * Gets the latest best block which was connected either via the [`Listen`] or
33206  * [`Confirm`] interfaces.
33207  */
33208 MUST_USE_RES struct LDKBestBlock OutputSweeper_current_best_block(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33209
33210 /**
33211  * Constructs a new Listen which calls the relevant methods on this_arg.
33212  * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
33213  */
33214 struct LDKListen OutputSweeper_as_Listen(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33215
33216 /**
33217  * Constructs a new Confirm which calls the relevant methods on this_arg.
33218  * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
33219  */
33220 struct LDKConfirm OutputSweeper_as_Confirm(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
33221
33222 /**
33223  * Frees any resources used by the SpendingDelay
33224  */
33225 void SpendingDelay_free(struct LDKSpendingDelay this_ptr);
33226
33227 /**
33228  * Creates a copy of the SpendingDelay
33229  */
33230 struct LDKSpendingDelay SpendingDelay_clone(const struct LDKSpendingDelay *NONNULL_PTR orig);
33231
33232 /**
33233  * Utility method to constructs a new Relative-variant SpendingDelay
33234  */
33235 struct LDKSpendingDelay SpendingDelay_relative(uint32_t num_blocks);
33236
33237 /**
33238  * Utility method to constructs a new Absolute-variant SpendingDelay
33239  */
33240 struct LDKSpendingDelay SpendingDelay_absolute(uint32_t height);
33241
33242 /**
33243  * Read a OutputSweeper from a byte array, created by OutputSweeper_write
33244  */
33245 struct LDKCResult_OutputSweeperDecodeErrorZ OutputSweeper_read(struct LDKu8slice ser, struct LDKBroadcasterInterface arg_a, struct LDKFeeEstimator arg_b, struct LDKCOption_FilterZ arg_c, struct LDKOutputSpender arg_d, struct LDKChangeDestinationSource arg_e, struct LDKKVStore arg_f, struct LDKLogger arg_g);
33246
33247 /**
33248  * Read a C2Tuple_BestBlockOutputSweeperZ from a byte array, created by C2Tuple_BestBlockOutputSweeperZ_write
33249  */
33250 struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ C2Tuple_BestBlockOutputSweeperZ_read(struct LDKu8slice ser, struct LDKBroadcasterInterface arg_a, struct LDKFeeEstimator arg_b, struct LDKCOption_FilterZ arg_c, struct LDKOutputSpender arg_d, struct LDKChangeDestinationSource arg_e, struct LDKKVStore arg_f, struct LDKLogger arg_g);
33251
33252 /**
33253  * Calls the free function if one is set
33254  */
33255 void FutureCallback_free(struct LDKFutureCallback this_ptr);
33256
33257 /**
33258  * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
33259  */
33260 void Future_free(struct LDKFuture this_obj);
33261
33262 /**
33263  * Registers a callback to be called upon completion of this future. If the future has already
33264  * completed, the callback will be called immediately.
33265  */
33266 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
33267
33268 /**
33269  * Waits until this [`Future`] completes.
33270  */
33271 void Future_wait(const struct LDKFuture *NONNULL_PTR this_arg);
33272
33273 /**
33274  * Waits until this [`Future`] completes or the given amount of time has elapsed.
33275  *
33276  * Returns true if the [`Future`] completed, false if the time elapsed.
33277  */
33278 MUST_USE_RES bool Future_wait_timeout(const struct LDKFuture *NONNULL_PTR this_arg, uint64_t max_wait);
33279
33280 /**
33281  * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
33282  */
33283 void Sleeper_free(struct LDKSleeper this_obj);
33284
33285 /**
33286  * Constructs a new sleeper from one future, allowing blocking on it.
33287  */
33288 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(const struct LDKFuture *NONNULL_PTR future);
33289
33290 /**
33291  * Constructs a new sleeper from two futures, allowing blocking on both at once.
33292  */
33293 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b);
33294
33295 /**
33296  * Constructs a new sleeper on many futures, allowing blocking on all at once.
33297  */
33298 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
33299
33300 /**
33301  * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
33302  */
33303 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
33304
33305 /**
33306  * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
33307  * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
33308  * elapsed.
33309  */
33310 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
33311
33312 /**
33313  * Creates a copy of the Level
33314  */
33315 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
33316
33317 /**
33318  * Utility method to constructs a new Gossip-variant Level
33319  */
33320 enum LDKLevel Level_gossip(void);
33321
33322 /**
33323  * Utility method to constructs a new Trace-variant Level
33324  */
33325 enum LDKLevel Level_trace(void);
33326
33327 /**
33328  * Utility method to constructs a new Debug-variant Level
33329  */
33330 enum LDKLevel Level_debug(void);
33331
33332 /**
33333  * Utility method to constructs a new Info-variant Level
33334  */
33335 enum LDKLevel Level_info(void);
33336
33337 /**
33338  * Utility method to constructs a new Warn-variant Level
33339  */
33340 enum LDKLevel Level_warn(void);
33341
33342 /**
33343  * Utility method to constructs a new Error-variant Level
33344  */
33345 enum LDKLevel Level_error(void);
33346
33347 /**
33348  * Checks if two Levels contain equal inner contents.
33349  * This ignores pointers and is_owned flags and looks at the values in fields.
33350  */
33351 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
33352
33353 /**
33354  * Generates a non-cryptographic 64-bit hash of the Level.
33355  */
33356 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
33357
33358 /**
33359  * Returns the most verbose logging level.
33360  */
33361 MUST_USE_RES enum LDKLevel Level_max(void);
33362
33363 /**
33364  * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
33365  */
33366 void Record_free(struct LDKRecord this_obj);
33367
33368 /**
33369  * The verbosity level of the message.
33370  */
33371 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
33372
33373 /**
33374  * The verbosity level of the message.
33375  */
33376 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
33377
33378 /**
33379  * The node id of the peer pertaining to the logged record.
33380  *
33381  * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
33382  * `None`, depending on if the peer information is readily available in LDK when the log is
33383  * generated.
33384  *
33385  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33386  */
33387 struct LDKPublicKey Record_get_peer_id(const struct LDKRecord *NONNULL_PTR this_ptr);
33388
33389 /**
33390  * The node id of the peer pertaining to the logged record.
33391  *
33392  * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
33393  * `None`, depending on if the peer information is readily available in LDK when the log is
33394  * generated.
33395  *
33396  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33397  */
33398 void Record_set_peer_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33399
33400 /**
33401  * The channel id of the channel pertaining to the logged record. May be a temporary id before
33402  * the channel has been funded.
33403  *
33404  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33405  */
33406 struct LDKChannelId Record_get_channel_id(const struct LDKRecord *NONNULL_PTR this_ptr);
33407
33408 /**
33409  * The channel id of the channel pertaining to the logged record. May be a temporary id before
33410  * the channel has been funded.
33411  *
33412  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33413  */
33414 void Record_set_channel_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKChannelId val);
33415
33416 /**
33417  * The message body.
33418  */
33419 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
33420
33421 /**
33422  * The message body.
33423  */
33424 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
33425
33426 /**
33427  * The module path of the message.
33428  */
33429 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
33430
33431 /**
33432  * The module path of the message.
33433  */
33434 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
33435
33436 /**
33437  * The source file containing the message.
33438  */
33439 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
33440
33441 /**
33442  * The source file containing the message.
33443  */
33444 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
33445
33446 /**
33447  * The line containing the message.
33448  */
33449 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
33450
33451 /**
33452  * The line containing the message.
33453  */
33454 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
33455
33456 /**
33457  * Constructs a new Record given each field
33458  *
33459  * Note that peer_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33460  * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33461  */
33462 MUST_USE_RES struct LDKRecord Record_new(enum LDKLevel level_arg, struct LDKPublicKey peer_id_arg, struct LDKChannelId channel_id_arg, struct LDKStr args_arg, struct LDKStr module_path_arg, struct LDKStr file_arg, uint32_t line_arg);
33463
33464 /**
33465  * Creates a copy of the Record
33466  */
33467 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
33468
33469 /**
33470  * Calls the free function if one is set
33471  */
33472 void Logger_free(struct LDKLogger this_ptr);
33473
33474 /**
33475  * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
33476  */
33477 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
33478
33479 /**
33480  * Confirmations we will wait for before considering the channel locked in.
33481  * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
33482  * equivalent limit applied to outbound channels).
33483  *
33484  * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
33485  * transaction before operation. If you wish to accept channels with zero confirmations, see
33486  * [`UserConfig::manually_accept_inbound_channels`] and
33487  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
33488  *
33489  * Default value: 6.
33490  *
33491  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
33492  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
33493  */
33494 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33495
33496 /**
33497  * Confirmations we will wait for before considering the channel locked in.
33498  * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
33499  * equivalent limit applied to outbound channels).
33500  *
33501  * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
33502  * transaction before operation. If you wish to accept channels with zero confirmations, see
33503  * [`UserConfig::manually_accept_inbound_channels`] and
33504  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
33505  *
33506  * Default value: 6.
33507  *
33508  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
33509  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
33510  */
33511 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
33512
33513 /**
33514  * Set to the number of blocks we require our counterparty to wait to claim their money (ie
33515  * the number of blocks we have to punish our counterparty if they broadcast a revoked
33516  * transaction).
33517  *
33518  * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
33519  * be online to check for revoked transactions on-chain at least once every our_to_self_delay
33520  * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
33521  * possibly with time in between to RBF the spending transaction).
33522  *
33523  * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
33524  * case of an honest unilateral channel close, which implicitly decrease the economic value of
33525  * our channel.
33526  *
33527  * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
33528  * can tweak config to ask for more security, not less.
33529  */
33530 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33531
33532 /**
33533  * Set to the number of blocks we require our counterparty to wait to claim their money (ie
33534  * the number of blocks we have to punish our counterparty if they broadcast a revoked
33535  * transaction).
33536  *
33537  * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
33538  * be online to check for revoked transactions on-chain at least once every our_to_self_delay
33539  * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
33540  * possibly with time in between to RBF the spending transaction).
33541  *
33542  * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
33543  * case of an honest unilateral channel close, which implicitly decrease the economic value of
33544  * our channel.
33545  *
33546  * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
33547  * can tweak config to ask for more security, not less.
33548  */
33549 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
33550
33551 /**
33552  * Set to the smallest value HTLC we will accept to process.
33553  *
33554  * This value is sent to our counterparty on channel-open and we close the channel any time
33555  * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
33556  *
33557  * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
33558  * by the protocol.
33559  */
33560 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33561
33562 /**
33563  * Set to the smallest value HTLC we will accept to process.
33564  *
33565  * This value is sent to our counterparty on channel-open and we close the channel any time
33566  * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
33567  *
33568  * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
33569  * by the protocol.
33570  */
33571 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
33572
33573 /**
33574  * Sets the percentage of the channel value we will cap the total value of outstanding inbound
33575  * HTLCs to.
33576  *
33577  * This can be set to a value between 1-100, where the value corresponds to the percent of the
33578  * channel value in whole percentages.
33579  *
33580  * Note that:
33581  * * If configured to another value than the default value 10, any new channels created with
33582  * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
33583  * `ChannelManager`.
33584  *
33585  * * This caps the total value for inbound HTLCs in-flight only, and there's currently
33586  * no way to configure the cap for the total value of outbound HTLCs in-flight.
33587  *
33588  * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
33589  * are different from the non-HTLC-encumbered funds. This makes this an important knob to
33590  * restrict exposure to loss due to being offline for too long.
33591  * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
33592  * for more information.
33593  *
33594  * Default value: 10.
33595  * Minimum value: 1, any values less than 1 will be treated as 1 instead.
33596  * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
33597  */
33598 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33599
33600 /**
33601  * Sets the percentage of the channel value we will cap the total value of outstanding inbound
33602  * HTLCs to.
33603  *
33604  * This can be set to a value between 1-100, where the value corresponds to the percent of the
33605  * channel value in whole percentages.
33606  *
33607  * Note that:
33608  * * If configured to another value than the default value 10, any new channels created with
33609  * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
33610  * `ChannelManager`.
33611  *
33612  * * This caps the total value for inbound HTLCs in-flight only, and there's currently
33613  * no way to configure the cap for the total value of outbound HTLCs in-flight.
33614  *
33615  * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
33616  * are different from the non-HTLC-encumbered funds. This makes this an important knob to
33617  * restrict exposure to loss due to being offline for too long.
33618  * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
33619  * for more information.
33620  *
33621  * Default value: 10.
33622  * Minimum value: 1, any values less than 1 will be treated as 1 instead.
33623  * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
33624  */
33625 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
33626
33627 /**
33628  * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
33629  * BOLTs) option for outbound private channels. This provides better privacy by not including
33630  * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
33631  * relay HTLCs to us using the channel's SCID alias.
33632  *
33633  * If this option is set, channels may be created that will not be readable by LDK versions
33634  * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
33635  * [`DecodeError::InvalidValue`].
33636  *
33637  * Note that setting this to true does *not* prevent us from opening channels with
33638  * counterparties that do not support the `scid_alias` option; we will simply fall back to a
33639  * private channel without that option.
33640  *
33641  * Ignored if the channel is negotiated to be announced, see
33642  * [`ChannelHandshakeConfig::announced_channel`] and
33643  * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
33644  *
33645  * Default value: false. This value is likely to change to true in the future.
33646  *
33647  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
33648  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
33649  */
33650 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33651
33652 /**
33653  * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
33654  * BOLTs) option for outbound private channels. This provides better privacy by not including
33655  * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
33656  * relay HTLCs to us using the channel's SCID alias.
33657  *
33658  * If this option is set, channels may be created that will not be readable by LDK versions
33659  * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
33660  * [`DecodeError::InvalidValue`].
33661  *
33662  * Note that setting this to true does *not* prevent us from opening channels with
33663  * counterparties that do not support the `scid_alias` option; we will simply fall back to a
33664  * private channel without that option.
33665  *
33666  * Ignored if the channel is negotiated to be announced, see
33667  * [`ChannelHandshakeConfig::announced_channel`] and
33668  * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
33669  *
33670  * Default value: false. This value is likely to change to true in the future.
33671  *
33672  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
33673  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
33674  */
33675 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
33676
33677 /**
33678  * Set to announce the channel publicly and notify all nodes that they can route via this
33679  * channel.
33680  *
33681  * This should only be set to true for nodes which expect to be online reliably.
33682  *
33683  * As the node which funds a channel picks this value this will only apply for new outbound
33684  * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
33685  *
33686  * Default value: false.
33687  */
33688 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33689
33690 /**
33691  * Set to announce the channel publicly and notify all nodes that they can route via this
33692  * channel.
33693  *
33694  * This should only be set to true for nodes which expect to be online reliably.
33695  *
33696  * As the node which funds a channel picks this value this will only apply for new outbound
33697  * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
33698  *
33699  * Default value: false.
33700  */
33701 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
33702
33703 /**
33704  * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
33705  * supports it, they will then enforce the mutual-close output to us matches what we provided
33706  * at intialization, preventing us from closing to an alternate pubkey.
33707  *
33708  * This is set to true by default to provide a slight increase in security, though ultimately
33709  * any attacker who is able to take control of a channel can just as easily send the funds via
33710  * lightning payments, so we never require that our counterparties support this option.
33711  *
33712  * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
33713  *
33714  * Default value: true.
33715  *
33716  * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
33717  */
33718 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33719
33720 /**
33721  * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
33722  * supports it, they will then enforce the mutual-close output to us matches what we provided
33723  * at intialization, preventing us from closing to an alternate pubkey.
33724  *
33725  * This is set to true by default to provide a slight increase in security, though ultimately
33726  * any attacker who is able to take control of a channel can just as easily send the funds via
33727  * lightning payments, so we never require that our counterparties support this option.
33728  *
33729  * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
33730  *
33731  * Default value: true.
33732  *
33733  * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
33734  */
33735 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
33736
33737 /**
33738  * The Proportion of the channel value to configure as counterparty's channel reserve,
33739  * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
33740  *
33741  * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
33742  * on their side, at all times.
33743  * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
33744  * claiming at least this value on chain.
33745  *
33746  * Channel reserve values greater than 30% could be considered highly unreasonable, since that
33747  * amount can never be used for payments.
33748  * Also, if our selected channel reserve for counterparty and counterparty's selected
33749  * channel reserve for us sum up to equal or greater than channel value, channel negotiations
33750  * will fail.
33751  *
33752  * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
33753  * other than the default value.
33754  *
33755  * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
33756  * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
33757  *                as 1000 sats instead, which is a safe implementation-specific lower bound.
33758  * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
33759  *                instead, although channel negotiations will fail in that case.
33760  */
33761 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33762
33763 /**
33764  * The Proportion of the channel value to configure as counterparty's channel reserve,
33765  * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
33766  *
33767  * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
33768  * on their side, at all times.
33769  * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
33770  * claiming at least this value on chain.
33771  *
33772  * Channel reserve values greater than 30% could be considered highly unreasonable, since that
33773  * amount can never be used for payments.
33774  * Also, if our selected channel reserve for counterparty and counterparty's selected
33775  * channel reserve for us sum up to equal or greater than channel value, channel negotiations
33776  * will fail.
33777  *
33778  * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
33779  * other than the default value.
33780  *
33781  * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
33782  * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
33783  *                as 1000 sats instead, which is a safe implementation-specific lower bound.
33784  * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
33785  *                instead, although channel negotiations will fail in that case.
33786  */
33787 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
33788
33789 /**
33790  * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
33791  * channels. This feature requires having a reserve of onchain funds readily available to bump
33792  * transactions in the event of a channel force close to avoid the possibility of losing funds.
33793  *
33794  * Note that if you wish accept inbound channels with anchor outputs, you must enable
33795  * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
33796  * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
33797  * whether your reserve of onchain funds is enough to cover the fees for all existing and new
33798  * channels featuring anchor outputs in the event of a force close.
33799  *
33800  * If this option is set, channels may be created that will not be readable by LDK versions
33801  * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
33802  * [`DecodeError::InvalidValue`].
33803  *
33804  * Note that setting this to true does *not* prevent us from opening channels with
33805  * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
33806  * fall back to a `static_remote_key` channel.
33807  *
33808  * LDK will not support the legacy `option_anchors` commitment version due to a discovered
33809  * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
33810  * Considered Harmful`] mailing list post.
33811  *
33812  * Default value: false. This value is likely to change to true in the future.
33813  *
33814  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
33815  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
33816  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
33817  * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
33818  */
33819 bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33820
33821 /**
33822  * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
33823  * channels. This feature requires having a reserve of onchain funds readily available to bump
33824  * transactions in the event of a channel force close to avoid the possibility of losing funds.
33825  *
33826  * Note that if you wish accept inbound channels with anchor outputs, you must enable
33827  * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
33828  * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
33829  * whether your reserve of onchain funds is enough to cover the fees for all existing and new
33830  * channels featuring anchor outputs in the event of a force close.
33831  *
33832  * If this option is set, channels may be created that will not be readable by LDK versions
33833  * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
33834  * [`DecodeError::InvalidValue`].
33835  *
33836  * Note that setting this to true does *not* prevent us from opening channels with
33837  * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
33838  * fall back to a `static_remote_key` channel.
33839  *
33840  * LDK will not support the legacy `option_anchors` commitment version due to a discovered
33841  * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
33842  * Considered Harmful`] mailing list post.
33843  *
33844  * Default value: false. This value is likely to change to true in the future.
33845  *
33846  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
33847  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
33848  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
33849  * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
33850  */
33851 void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
33852
33853 /**
33854  * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
33855  *
33856  * Increasing the value can help improve liquidity and stability in
33857  * routing at the cost of higher long term disk / DB usage.
33858  *
33859  * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
33860  * other than the default value.
33861  *
33862  * Default value: 50
33863  * Maximum value: 483, any values larger will be treated as 483.
33864  *                     This is the BOLT #2 spec limit on `max_accepted_htlcs`.
33865  */
33866 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
33867
33868 /**
33869  * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
33870  *
33871  * Increasing the value can help improve liquidity and stability in
33872  * routing at the cost of higher long term disk / DB usage.
33873  *
33874  * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
33875  * other than the default value.
33876  *
33877  * Default value: 50
33878  * Maximum value: 483, any values larger will be treated as 483.
33879  *                     This is the BOLT #2 spec limit on `max_accepted_htlcs`.
33880  */
33881 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
33882
33883 /**
33884  * Constructs a new ChannelHandshakeConfig given each field
33885  */
33886 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);
33887
33888 /**
33889  * Creates a copy of the ChannelHandshakeConfig
33890  */
33891 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
33892
33893 /**
33894  * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
33895  */
33896 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
33897
33898 /**
33899  * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
33900  */
33901 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
33902
33903 /**
33904  * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
33905  * only applies to inbound channels.
33906  *
33907  * Default value: 0.
33908  */
33909 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
33910
33911 /**
33912  * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
33913  * only applies to inbound channels.
33914  *
33915  * Default value: 0.
33916  */
33917 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
33918
33919 /**
33920  * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
33921  * only applies to inbound channels.
33922  *
33923  * Default value: 2^24 - 1.
33924  */
33925 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
33926
33927 /**
33928  * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
33929  * only applies to inbound channels.
33930  *
33931  * Default value: 2^24 - 1.
33932  */
33933 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
33934
33935 /**
33936  * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
33937  * you to limit the maximum minimum-size they can require.
33938  *
33939  * Default value: u64::max_value.
33940  */
33941 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
33942
33943 /**
33944  * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
33945  * you to limit the maximum minimum-size they can require.
33946  *
33947  * Default value: u64::max_value.
33948  */
33949 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
33950
33951 /**
33952  * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
33953  * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
33954  *
33955  * Default value: 0.
33956  */
33957 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
33958
33959 /**
33960  * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
33961  * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
33962  *
33963  * Default value: 0.
33964  */
33965 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
33966
33967 /**
33968  * The remote node will require we keep a certain amount in direct payment to ourselves at all
33969  * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
33970  * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
33971  *
33972  * Default value: u64::max_value.
33973  */
33974 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
33975
33976 /**
33977  * The remote node will require we keep a certain amount in direct payment to ourselves at all
33978  * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
33979  * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
33980  *
33981  * Default value: u64::max_value.
33982  */
33983 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
33984
33985 /**
33986  * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
33987  * time. This allows you to set a minimum such value.
33988  *
33989  * Default value: 0.
33990  */
33991 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
33992
33993 /**
33994  * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
33995  * time. This allows you to set a minimum such value.
33996  *
33997  * Default value: 0.
33998  */
33999 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
34000
34001 /**
34002  * Before a channel is usable the funding transaction will need to be confirmed by at least a
34003  * certain number of blocks, specified by the node which is not the funder (as the funder can
34004  * assume they aren't going to double-spend themselves).
34005  * This config allows you to set a limit on the maximum amount of time to wait.
34006  *
34007  * Default value: 144, or roughly one day and only applies to outbound channels.
34008  */
34009 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34010
34011 /**
34012  * Before a channel is usable the funding transaction will need to be confirmed by at least a
34013  * certain number of blocks, specified by the node which is not the funder (as the funder can
34014  * assume they aren't going to double-spend themselves).
34015  * This config allows you to set a limit on the maximum amount of time to wait.
34016  *
34017  * Default value: 144, or roughly one day and only applies to outbound channels.
34018  */
34019 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
34020
34021 /**
34022  * Whether we implicitly trust funding transactions generated by us for our own outbound
34023  * channels to not be double-spent.
34024  *
34025  * If this is set, we assume that our own funding transactions are *never* double-spent, and
34026  * thus we can trust them without any confirmations. This is generally a reasonable
34027  * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
34028  * control of the signing keys).
34029  *
34030  * You may wish to un-set this if you allow the user to (or do in an automated fashion)
34031  * double-spend the funding transaction to RBF with an alternative channel open.
34032  *
34033  * This only applies if our counterparty set their confirmations-required value to 0, and we
34034  * always trust our own funding transaction at 1 confirmation irrespective of this value.
34035  * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
34036  * `true` (0) and `false` (1).
34037  *
34038  * Default value: true
34039  */
34040 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34041
34042 /**
34043  * Whether we implicitly trust funding transactions generated by us for our own outbound
34044  * channels to not be double-spent.
34045  *
34046  * If this is set, we assume that our own funding transactions are *never* double-spent, and
34047  * thus we can trust them without any confirmations. This is generally a reasonable
34048  * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
34049  * control of the signing keys).
34050  *
34051  * You may wish to un-set this if you allow the user to (or do in an automated fashion)
34052  * double-spend the funding transaction to RBF with an alternative channel open.
34053  *
34054  * This only applies if our counterparty set their confirmations-required value to 0, and we
34055  * always trust our own funding transaction at 1 confirmation irrespective of this value.
34056  * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
34057  * `true` (0) and `false` (1).
34058  *
34059  * Default value: true
34060  */
34061 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
34062
34063 /**
34064  * Set to force an incoming channel to match our announced channel preference in
34065  * [`ChannelHandshakeConfig::announced_channel`].
34066  *
34067  * For a node which is not online reliably, this should be set to true and
34068  * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
34069  * channels will ever be opened.
34070  *
34071  * Default value: true.
34072  */
34073 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34074
34075 /**
34076  * Set to force an incoming channel to match our announced channel preference in
34077  * [`ChannelHandshakeConfig::announced_channel`].
34078  *
34079  * For a node which is not online reliably, this should be set to true and
34080  * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
34081  * channels will ever be opened.
34082  *
34083  * Default value: true.
34084  */
34085 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
34086
34087 /**
34088  * Set to the amount of time we're willing to wait to claim money back to us.
34089  *
34090  * Not checking this value would be a security issue, as our peer would be able to set it to
34091  * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
34092  *
34093  * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
34094  * reduce the loss of having useless locked funds (if your peer accepts)
34095  */
34096 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
34097
34098 /**
34099  * Set to the amount of time we're willing to wait to claim money back to us.
34100  *
34101  * Not checking this value would be a security issue, as our peer would be able to set it to
34102  * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
34103  *
34104  * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
34105  * reduce the loss of having useless locked funds (if your peer accepts)
34106  */
34107 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
34108
34109 /**
34110  * Constructs a new ChannelHandshakeLimits given each field
34111  */
34112 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);
34113
34114 /**
34115  * Creates a copy of the ChannelHandshakeLimits
34116  */
34117 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
34118
34119 /**
34120  * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
34121  */
34122 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
34123
34124 /**
34125  * Frees any resources used by the MaxDustHTLCExposure
34126  */
34127 void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
34128
34129 /**
34130  * Creates a copy of the MaxDustHTLCExposure
34131  */
34132 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
34133
34134 /**
34135  * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
34136  */
34137 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
34138
34139 /**
34140  * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
34141  */
34142 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
34143
34144 /**
34145  * Checks if two MaxDustHTLCExposures contain equal inner contents.
34146  * This ignores pointers and is_owned flags and looks at the values in fields.
34147  */
34148 bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
34149
34150 /**
34151  * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
34152  */
34153 struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
34154
34155 /**
34156  * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
34157  */
34158 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
34159
34160 /**
34161  * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
34162  */
34163 void ChannelConfig_free(struct LDKChannelConfig this_obj);
34164
34165 /**
34166  * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
34167  * over the channel.
34168  * This may be allowed to change at runtime in a later update, however doing so must result in
34169  * update messages sent to notify all nodes of our updated relay fee.
34170  *
34171  * Default value: 0.
34172  */
34173 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34174
34175 /**
34176  * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
34177  * over the channel.
34178  * This may be allowed to change at runtime in a later update, however doing so must result in
34179  * update messages sent to notify all nodes of our updated relay fee.
34180  *
34181  * Default value: 0.
34182  */
34183 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
34184
34185 /**
34186  * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
34187  * excess of [`forwarding_fee_proportional_millionths`].
34188  * This may be allowed to change at runtime in a later update, however doing so must result in
34189  * update messages sent to notify all nodes of our updated relay fee.
34190  *
34191  * The default value of a single satoshi roughly matches the market rate on many routing nodes
34192  * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
34193  * this node.
34194  *
34195  * Default value: 1000.
34196  *
34197  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
34198  */
34199 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34200
34201 /**
34202  * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
34203  * excess of [`forwarding_fee_proportional_millionths`].
34204  * This may be allowed to change at runtime in a later update, however doing so must result in
34205  * update messages sent to notify all nodes of our updated relay fee.
34206  *
34207  * The default value of a single satoshi roughly matches the market rate on many routing nodes
34208  * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
34209  * this node.
34210  *
34211  * Default value: 1000.
34212  *
34213  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
34214  */
34215 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
34216
34217 /**
34218  * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
34219  * the channel this config applies to.
34220  *
34221  * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
34222  * HTLC balance when a channel appears on-chain whereas
34223  * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
34224  * (non-HTLC-encumbered) balance.
34225  *
34226  * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
34227  * we (or one of our watchtowers) MUST be online to check for broadcast of the current
34228  * commitment transaction at least once per this many blocks (minus some margin to allow us
34229  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
34230  * the spending transaction).
34231  *
34232  * Default value: 72 (12 hours at an average of 6 blocks/hour).
34233  * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
34234  *                [`MIN_CLTV_EXPIRY_DELTA`] instead.
34235  *
34236  * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
34237  */
34238 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34239
34240 /**
34241  * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
34242  * the channel this config applies to.
34243  *
34244  * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
34245  * HTLC balance when a channel appears on-chain whereas
34246  * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
34247  * (non-HTLC-encumbered) balance.
34248  *
34249  * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
34250  * we (or one of our watchtowers) MUST be online to check for broadcast of the current
34251  * commitment transaction at least once per this many blocks (minus some margin to allow us
34252  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
34253  * the spending transaction).
34254  *
34255  * Default value: 72 (12 hours at an average of 6 blocks/hour).
34256  * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
34257  *                [`MIN_CLTV_EXPIRY_DELTA`] instead.
34258  *
34259  * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
34260  */
34261 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
34262
34263 /**
34264  * Limit our total exposure to potential loss to on-chain fees on close, including in-flight
34265  * HTLCs which are burned to fees as they are too small to claim on-chain and fees on
34266  * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate.
34267  *
34268  * # HTLC-based Dust Exposure
34269  *
34270  * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
34271  * not be claimable on-chain, instead being turned into additional miner fees if either
34272  * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
34273  * to such payments may be substantial if there are many dust HTLCs present when the
34274  * channel is force-closed.
34275  *
34276  * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
34277  * channel negotiated throughout the channel open process, along with the fees required to have
34278  * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
34279  * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
34280  * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
34281  * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
34282  * variant is primarily intended for use with pre-anchor channels.
34283  *
34284  * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
34285  * exposure across all three types per-channel.
34286  *
34287  * # Transaction Fee Dust Exposure
34288  *
34289  * Further, counterparties broadcasting a commitment transaction in a force-close may result
34290  * in other balance being burned to fees, and thus all fees on commitment and HTLC
34291  * transactions in excess of our local fee estimates are included in the dust calculation.
34292  *
34293  * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750
34294  * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per
34295  * non-dust HTLC we're allowed to have with our peers before risking a force-closure for
34296  * inbound channels.
34297  *
34298  * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500
34299  * sat/KW), we risk force-closure if we disagree with our peer by:
34300  * * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in
34301  *   both directions (the maximum),
34302  * * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both
34303  *   directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
34304  * * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs
34305  *   in both directions (the maximum),
34306  * * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs
34307  *   in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
34308  *
34309  * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
34310  * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
34311  * for anchor channels we expect our counterparty to use a relatively low feerate estimate
34312  * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and
34313  * feerate disagreement force-closures should only occur when theirs is higher than ours.
34314  *
34315  * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000.
34316  *
34317  * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
34318  */
34319 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34320
34321 /**
34322  * Limit our total exposure to potential loss to on-chain fees on close, including in-flight
34323  * HTLCs which are burned to fees as they are too small to claim on-chain and fees on
34324  * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate.
34325  *
34326  * # HTLC-based Dust Exposure
34327  *
34328  * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
34329  * not be claimable on-chain, instead being turned into additional miner fees if either
34330  * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
34331  * to such payments may be substantial if there are many dust HTLCs present when the
34332  * channel is force-closed.
34333  *
34334  * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
34335  * channel negotiated throughout the channel open process, along with the fees required to have
34336  * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
34337  * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
34338  * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
34339  * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
34340  * variant is primarily intended for use with pre-anchor channels.
34341  *
34342  * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
34343  * exposure across all three types per-channel.
34344  *
34345  * # Transaction Fee Dust Exposure
34346  *
34347  * Further, counterparties broadcasting a commitment transaction in a force-close may result
34348  * in other balance being burned to fees, and thus all fees on commitment and HTLC
34349  * transactions in excess of our local fee estimates are included in the dust calculation.
34350  *
34351  * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750
34352  * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per
34353  * non-dust HTLC we're allowed to have with our peers before risking a force-closure for
34354  * inbound channels.
34355  *
34356  * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500
34357  * sat/KW), we risk force-closure if we disagree with our peer by:
34358  * * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in
34359  *   both directions (the maximum),
34360  * * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both
34361  *   directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
34362  * * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs
34363  *   in both directions (the maximum),
34364  * * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs
34365  *   in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
34366  *
34367  * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
34368  * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
34369  * for anchor channels we expect our counterparty to use a relatively low feerate estimate
34370  * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and
34371  * feerate disagreement force-closures should only occur when theirs is higher than ours.
34372  *
34373  * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000.
34374  *
34375  * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep
34376  */
34377 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
34378
34379 /**
34380  * The additional fee we're willing to pay to avoid waiting for the counterparty's
34381  * `to_self_delay` to reclaim funds.
34382  *
34383  * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
34384  * closing transaction which both sides find acceptable, ultimately paid by the channel
34385  * funder/initiator.
34386  *
34387  * When we are the funder, because we have to pay the channel closing fee, we bound the
34388  * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
34389  * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
34390  * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
34391  * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
34392  * funds.
34393  *
34394  * When we are not the funder, we require the closing transaction fee pay at least our
34395  * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
34396  * Thus, this value is ignored when we are not the funder.
34397  *
34398  * Default value: 1000 satoshis.
34399  *
34400  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
34401  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
34402  */
34403 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34404
34405 /**
34406  * The additional fee we're willing to pay to avoid waiting for the counterparty's
34407  * `to_self_delay` to reclaim funds.
34408  *
34409  * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
34410  * closing transaction which both sides find acceptable, ultimately paid by the channel
34411  * funder/initiator.
34412  *
34413  * When we are the funder, because we have to pay the channel closing fee, we bound the
34414  * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
34415  * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
34416  * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
34417  * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
34418  * funds.
34419  *
34420  * When we are not the funder, we require the closing transaction fee pay at least our
34421  * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
34422  * Thus, this value is ignored when we are not the funder.
34423  *
34424  * Default value: 1000 satoshis.
34425  *
34426  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
34427  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
34428  */
34429 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
34430
34431 /**
34432  * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
34433  * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
34434  *
34435  * Usage:
34436  * - The payee will set this option and set its invoice route hints to use [intercept scids]
34437  *   generated by this channel's counterparty.
34438  * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
34439  *   [`forward_intercepted_htlc`] with less than the amount provided in
34440  *   [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
34441  *   actual forward amounts is their fee. See
34442  *   <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
34443  *   for how this feature may be used in the LSP use case.
34444  *
34445  * # Note
34446  * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
34447  * as-expected if this feature is activated, otherwise they may lose money!
34448  * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
34449  * counterparty.
34450  *
34451  * # Note
34452  * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
34453  * Unsetting this flag between restarts may lead to payment receive failures.
34454  *
34455  * Default value: false.
34456  *
34457  * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
34458  * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
34459  * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
34460  * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
34461  * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
34462  * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
34463  */
34464 bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
34465
34466 /**
34467  * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
34468  * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
34469  *
34470  * Usage:
34471  * - The payee will set this option and set its invoice route hints to use [intercept scids]
34472  *   generated by this channel's counterparty.
34473  * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
34474  *   [`forward_intercepted_htlc`] with less than the amount provided in
34475  *   [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
34476  *   actual forward amounts is their fee. See
34477  *   <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
34478  *   for how this feature may be used in the LSP use case.
34479  *
34480  * # Note
34481  * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
34482  * as-expected if this feature is activated, otherwise they may lose money!
34483  * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
34484  * counterparty.
34485  *
34486  * # Note
34487  * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
34488  * Unsetting this flag between restarts may lead to payment receive failures.
34489  *
34490  * Default value: false.
34491  *
34492  * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
34493  * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
34494  * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
34495  * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
34496  * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
34497  * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
34498  */
34499 void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
34500
34501 /**
34502  * Constructs a new ChannelConfig given each field
34503  */
34504 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);
34505
34506 /**
34507  * Creates a copy of the ChannelConfig
34508  */
34509 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
34510
34511 /**
34512  * Checks if two ChannelConfigs contain equal inner contents.
34513  * This ignores pointers and is_owned flags and looks at the values in fields.
34514  * Two objects with NULL inner values will be considered "equal" here.
34515  */
34516 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
34517
34518 /**
34519  * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
34520  */
34521 void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
34522
34523 /**
34524  * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
34525  */
34526 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
34527
34528 /**
34529  * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
34530  */
34531 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
34532
34533 /**
34534  * Read a ChannelConfig from a byte array, created by ChannelConfig_write
34535  */
34536 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
34537
34538 /**
34539  * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
34540  */
34541 void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
34542
34543 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34544
34545 void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
34546
34547 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34548
34549 void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
34550
34551 struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34552
34553 void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
34554
34555 /**
34556  *
34557  * Returns a copy of the field.
34558  */
34559 struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34560
34561 void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
34562
34563 struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
34564
34565 void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
34566
34567 /**
34568  * Constructs a new ChannelConfigUpdate given each field
34569  */
34570 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);
34571
34572 /**
34573  * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
34574  */
34575 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
34576
34577 /**
34578  * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
34579  */
34580 void UserConfig_free(struct LDKUserConfig this_obj);
34581
34582 /**
34583  * Channel handshake config that we propose to our counterparty.
34584  */
34585 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34586
34587 /**
34588  * Channel handshake config that we propose to our counterparty.
34589  */
34590 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
34591
34592 /**
34593  * Limits applied to our counterparty's proposed channel handshake config settings.
34594  */
34595 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34596
34597 /**
34598  * Limits applied to our counterparty's proposed channel handshake config settings.
34599  */
34600 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
34601
34602 /**
34603  * Channel config which affects behavior during channel lifetime.
34604  */
34605 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34606
34607 /**
34608  * Channel config which affects behavior during channel lifetime.
34609  */
34610 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
34611
34612 /**
34613  * If this is set to false, we will reject any HTLCs which were to be forwarded over private
34614  * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
34615  * node which is not online reliably.
34616  *
34617  * For nodes which are not online reliably, you should set all channels to *not* be announced
34618  * (using [`ChannelHandshakeConfig::announced_channel`] and
34619  * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
34620  * ensure you are not exposed to any forwarding risk.
34621  *
34622  * Note that because you cannot change a channel's announced state after creation, there is no
34623  * way to disable forwarding on public channels retroactively. Thus, in order to change a node
34624  * from a publicly-announced forwarding node to a private non-forwarding node you must close
34625  * all your channels and open new ones. For privacy, you should also change your node_id
34626  * (swapping all private and public key material for new ones) at that time.
34627  *
34628  * Default value: false.
34629  */
34630 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34631
34632 /**
34633  * If this is set to false, we will reject any HTLCs which were to be forwarded over private
34634  * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
34635  * node which is not online reliably.
34636  *
34637  * For nodes which are not online reliably, you should set all channels to *not* be announced
34638  * (using [`ChannelHandshakeConfig::announced_channel`] and
34639  * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
34640  * ensure you are not exposed to any forwarding risk.
34641  *
34642  * Note that because you cannot change a channel's announced state after creation, there is no
34643  * way to disable forwarding on public channels retroactively. Thus, in order to change a node
34644  * from a publicly-announced forwarding node to a private non-forwarding node you must close
34645  * all your channels and open new ones. For privacy, you should also change your node_id
34646  * (swapping all private and public key material for new ones) at that time.
34647  *
34648  * Default value: false.
34649  */
34650 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34651
34652 /**
34653  * If this is set to false, we do not accept inbound requests to open a new channel.
34654  * Default value: true.
34655  */
34656 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34657
34658 /**
34659  * If this is set to false, we do not accept inbound requests to open a new channel.
34660  * Default value: true.
34661  */
34662 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34663
34664 /**
34665  * If this is set to true, the user needs to manually accept inbound requests to open a new
34666  * channel.
34667  *
34668  * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
34669  * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
34670  * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
34671  * user explicitly chooses to accept the request.
34672  *
34673  * Default value: false.
34674  *
34675  * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
34676  * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
34677  * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
34678  */
34679 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34680
34681 /**
34682  * If this is set to true, the user needs to manually accept inbound requests to open a new
34683  * channel.
34684  *
34685  * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
34686  * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
34687  * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
34688  * user explicitly chooses to accept the request.
34689  *
34690  * Default value: false.
34691  *
34692  * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
34693  * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
34694  * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
34695  */
34696 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34697
34698 /**
34699  *  If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
34700  *  fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
34701  *  intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
34702  *
34703  *  Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
34704  *
34705  *  Default value: false.
34706  *
34707  * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
34708  * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
34709  */
34710 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34711
34712 /**
34713  *  If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
34714  *  fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
34715  *  intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
34716  *
34717  *  Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
34718  *
34719  *  Default value: false.
34720  *
34721  * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
34722  * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
34723  */
34724 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34725
34726 /**
34727  * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
34728  * parts. If this is set to true, we'll accept the payment.
34729  *
34730  * Setting this to true will break backwards compatibility upon downgrading to an LDK
34731  * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
34732  * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
34733  *
34734  * Default value: false.
34735  *
34736  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34737  */
34738 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
34739
34740 /**
34741  * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
34742  * parts. If this is set to true, we'll accept the payment.
34743  *
34744  * Setting this to true will break backwards compatibility upon downgrading to an LDK
34745  * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
34746  * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
34747  *
34748  * Default value: false.
34749  *
34750  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
34751  */
34752 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
34753
34754 /**
34755  * Constructs a new UserConfig given each field
34756  */
34757 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);
34758
34759 /**
34760  * Creates a copy of the UserConfig
34761  */
34762 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
34763
34764 /**
34765  * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
34766  */
34767 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
34768
34769 /**
34770  * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
34771  */
34772 void BestBlock_free(struct LDKBestBlock this_obj);
34773
34774 /**
34775  * The block's hash
34776  */
34777 const uint8_t (*BestBlock_get_block_hash(const struct LDKBestBlock *NONNULL_PTR this_ptr))[32];
34778
34779 /**
34780  * The block's hash
34781  */
34782 void BestBlock_set_block_hash(struct LDKBestBlock *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34783
34784 /**
34785  * The height at which the block was confirmed.
34786  */
34787 uint32_t BestBlock_get_height(const struct LDKBestBlock *NONNULL_PTR this_ptr);
34788
34789 /**
34790  * The height at which the block was confirmed.
34791  */
34792 void BestBlock_set_height(struct LDKBestBlock *NONNULL_PTR this_ptr, uint32_t val);
34793
34794 /**
34795  * Constructs a new BestBlock given each field
34796  */
34797 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash_arg, uint32_t height_arg);
34798
34799 /**
34800  * Creates a copy of the BestBlock
34801  */
34802 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
34803
34804 /**
34805  * Generates a non-cryptographic 64-bit hash of the BestBlock.
34806  */
34807 uint64_t BestBlock_hash(const struct LDKBestBlock *NONNULL_PTR o);
34808
34809 /**
34810  * Checks if two BestBlocks contain equal inner contents.
34811  * This ignores pointers and is_owned flags and looks at the values in fields.
34812  * Two objects with NULL inner values will be considered "equal" here.
34813  */
34814 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
34815
34816 /**
34817  * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
34818  * network.
34819  */
34820 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
34821
34822 /**
34823  * Serialize the BestBlock object into a byte array which can be read by BestBlock_read
34824  */
34825 struct LDKCVec_u8Z BestBlock_write(const struct LDKBestBlock *NONNULL_PTR obj);
34826
34827 /**
34828  * Read a BestBlock from a byte array, created by BestBlock_write
34829  */
34830 struct LDKCResult_BestBlockDecodeErrorZ BestBlock_read(struct LDKu8slice ser);
34831
34832 /**
34833  * Calls the free function if one is set
34834  */
34835 void Listen_free(struct LDKListen this_ptr);
34836
34837 /**
34838  * Calls the free function if one is set
34839  */
34840 void Confirm_free(struct LDKConfirm this_ptr);
34841
34842 /**
34843  * Creates a copy of the ChannelMonitorUpdateStatus
34844  */
34845 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
34846
34847 /**
34848  * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
34849  */
34850 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
34851
34852 /**
34853  * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
34854  */
34855 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
34856
34857 /**
34858  * Utility method to constructs a new UnrecoverableError-variant ChannelMonitorUpdateStatus
34859  */
34860 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_unrecoverable_error(void);
34861
34862 /**
34863  * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
34864  * This ignores pointers and is_owned flags and looks at the values in fields.
34865  */
34866 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
34867
34868 /**
34869  * Calls the free function if one is set
34870  */
34871 void Watch_free(struct LDKWatch this_ptr);
34872
34873 /**
34874  * Calls the free function if one is set
34875  */
34876 void Filter_free(struct LDKFilter this_ptr);
34877
34878 /**
34879  * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
34880  */
34881 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
34882
34883 /**
34884  * First block where the transaction output may have been spent.
34885  */
34886 struct LDKCOption_ThirtyTwoBytesZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
34887
34888 /**
34889  * First block where the transaction output may have been spent.
34890  */
34891 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
34892
34893 /**
34894  * Outpoint identifying the transaction output.
34895  */
34896 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
34897
34898 /**
34899  * Outpoint identifying the transaction output.
34900  */
34901 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
34902
34903 /**
34904  * Spending condition of the transaction output.
34905  */
34906 struct LDKCVec_u8Z WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
34907
34908 /**
34909  * Spending condition of the transaction output.
34910  */
34911 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
34912
34913 /**
34914  * Constructs a new WatchedOutput given each field
34915  */
34916 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_ThirtyTwoBytesZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
34917
34918 /**
34919  * Creates a copy of the WatchedOutput
34920  */
34921 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
34922
34923 /**
34924  * Checks if two WatchedOutputs contain equal inner contents.
34925  * This ignores pointers and is_owned flags and looks at the values in fields.
34926  * Two objects with NULL inner values will be considered "equal" here.
34927  */
34928 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
34929
34930 /**
34931  * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
34932  */
34933 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
34934
34935 /**
34936  * Calls the free function if one is set
34937  */
34938 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
34939
34940 /**
34941  * Creates a copy of the ConfirmationTarget
34942  */
34943 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
34944
34945 /**
34946  * Utility method to constructs a new OnChainSweep-variant ConfirmationTarget
34947  */
34948 enum LDKConfirmationTarget ConfirmationTarget_on_chain_sweep(void);
34949
34950 /**
34951  * Utility method to constructs a new MinAllowedAnchorChannelRemoteFee-variant ConfirmationTarget
34952  */
34953 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(void);
34954
34955 /**
34956  * Utility method to constructs a new MinAllowedNonAnchorChannelRemoteFee-variant ConfirmationTarget
34957  */
34958 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee(void);
34959
34960 /**
34961  * Utility method to constructs a new AnchorChannelFee-variant ConfirmationTarget
34962  */
34963 enum LDKConfirmationTarget ConfirmationTarget_anchor_channel_fee(void);
34964
34965 /**
34966  * Utility method to constructs a new NonAnchorChannelFee-variant ConfirmationTarget
34967  */
34968 enum LDKConfirmationTarget ConfirmationTarget_non_anchor_channel_fee(void);
34969
34970 /**
34971  * Utility method to constructs a new ChannelCloseMinimum-variant ConfirmationTarget
34972  */
34973 enum LDKConfirmationTarget ConfirmationTarget_channel_close_minimum(void);
34974
34975 /**
34976  * Utility method to constructs a new OutputSpendingFee-variant ConfirmationTarget
34977  */
34978 enum LDKConfirmationTarget ConfirmationTarget_output_spending_fee(void);
34979
34980 /**
34981  * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
34982  */
34983 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
34984
34985 /**
34986  * Checks if two ConfirmationTargets contain equal inner contents.
34987  * This ignores pointers and is_owned flags and looks at the values in fields.
34988  */
34989 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
34990
34991 /**
34992  * Calls the free function if one is set
34993  */
34994 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
34995
34996 /**
34997  * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
34998  */
34999 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
35000
35001 /**
35002  * Creates a copy of the MonitorUpdateId
35003  */
35004 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
35005
35006 /**
35007  * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
35008  */
35009 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
35010
35011 /**
35012  * Checks if two MonitorUpdateIds contain equal inner contents.
35013  * This ignores pointers and is_owned flags and looks at the values in fields.
35014  * Two objects with NULL inner values will be considered "equal" here.
35015  */
35016 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
35017
35018 /**
35019  * Calls the free function if one is set
35020  */
35021 void Persist_free(struct LDKPersist this_ptr);
35022
35023 /**
35024  * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
35025  */
35026 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
35027
35028 /**
35029  * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
35030  */
35031 void ChainMonitor_free(struct LDKChainMonitor this_obj);
35032
35033 /**
35034  * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
35035  *
35036  * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
35037  * will call back to it indicating transactions and outputs of interest. This allows clients to
35038  * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
35039  * always need to fetch full blocks absent another means for determining which blocks contain
35040  * transactions relevant to the watched channels.
35041  */
35042 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
35043
35044 /**
35045  * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
35046  * claims which are awaiting confirmation.
35047  *
35048  * Includes the balances from each [`ChannelMonitor`] *except* those included in
35049  * `ignored_channels`, allowing you to filter out balances from channels which are still open
35050  * (and whose balance should likely be pulled from the [`ChannelDetails`]).
35051  *
35052  * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
35053  * inclusion in the return value.
35054  */
35055 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
35056
35057 /**
35058  * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
35059  * such [`ChannelMonitor`] is currently being monitored for.
35060  *
35061  * Note that the result holds a mutex over our monitor set, and should not be held
35062  * indefinitely.
35063  */
35064 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
35065
35066 /**
35067  * Lists the funding outpoint and channel ID of each [`ChannelMonitor`] being monitored.
35068  *
35069  * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
35070  * monitoring for on-chain state resolutions.
35071  */
35072 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointChannelIdZZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35073
35074 /**
35075  * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
35076  */
35077 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35078
35079 /**
35080  * Indicates the persistence of a [`ChannelMonitor`] has completed after
35081  * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
35082  *
35083  * Thus, the anticipated use is, at a high level:
35084  *  1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
35085  *     update to disk and begins updating any remote (e.g. watchtower/backup) copies,
35086  *     returning [`ChannelMonitorUpdateStatus::InProgress`],
35087  *  2) once all remote copies are updated, you call this function with the
35088  *     `completed_update_id` that completed, and once all pending updates have completed the
35089  *     channel will be re-enabled.
35090  *
35091  * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
35092  * registered [`ChannelMonitor`]s.
35093  */
35094 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);
35095
35096 /**
35097  * Gets a [`Future`] that completes when an event is available either via
35098  * [`chain::Watch::release_pending_monitor_events`] or
35099  * [`EventsProvider::process_pending_events`].
35100  *
35101  * Note that callbacks registered on the [`Future`] MUST NOT call back into this
35102  * [`ChainMonitor`] and should instead register actions to be taken later.
35103  *
35104  * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
35105  */
35106 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35107
35108 /**
35109  * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
35110  * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
35111  * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
35112  * invoking this every 30 seconds, or lower if running in an environment with spotty
35113  * connections, like on mobile.
35114  */
35115 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35116
35117 /**
35118  * Triggers rebroadcasts of pending claims from force-closed channels after a transaction
35119  * signature generation failure.
35120  *
35121  * `monitor_opt` can be used as a filter to only trigger them for a specific channel monitor.
35122  *
35123  * Note that monitor_opt (or a relevant inner pointer) may be NULL or all-0s to represent None
35124  */
35125 void ChainMonitor_signer_unblocked(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint monitor_opt);
35126
35127 /**
35128  * Archives fully resolved channel monitors by calling [`Persist::archive_persisted_channel`].
35129  *
35130  * This is useful for pruning fully resolved monitors from the monitor set and primary
35131  * storage so they are not kept in memory and reloaded on restart.
35132  *
35133  * Should be called occasionally (once every handful of blocks or on startup).
35134  *
35135  * Depending on the implementation of [`Persist::archive_persisted_channel`] the monitor
35136  * data could be moved to an archive location or removed entirely.
35137  */
35138 void ChainMonitor_archive_fully_resolved_channel_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35139
35140 /**
35141  * Constructs a new Listen which calls the relevant methods on this_arg.
35142  * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
35143  */
35144 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35145
35146 /**
35147  * Constructs a new Confirm which calls the relevant methods on this_arg.
35148  * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
35149  */
35150 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35151
35152 /**
35153  * Constructs a new Watch which calls the relevant methods on this_arg.
35154  * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
35155  */
35156 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35157
35158 /**
35159  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
35160  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
35161  */
35162 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
35163
35164 /**
35165  * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
35166  */
35167 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
35168
35169 /**
35170  * The sequence number of this update. Updates *must* be replayed in-order according to this
35171  * sequence number (and updates may panic if they are not). The update_id values are strictly
35172  * increasing and increase by one for each new update, with two exceptions specified below.
35173  *
35174  * This sequence number is also used to track up to which points updates which returned
35175  * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
35176  * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
35177  *
35178  * The only instances we allow where update_id values are not strictly increasing have a
35179  * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
35180  * will force close the channel by broadcasting the latest commitment transaction or
35181  * special post-force-close updates, like providing preimages necessary to claim outputs on the
35182  * broadcast commitment transaction. See its docs for more details.
35183  *
35184  * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
35185  */
35186 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
35187
35188 /**
35189  * The sequence number of this update. Updates *must* be replayed in-order according to this
35190  * sequence number (and updates may panic if they are not). The update_id values are strictly
35191  * increasing and increase by one for each new update, with two exceptions specified below.
35192  *
35193  * This sequence number is also used to track up to which points updates which returned
35194  * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
35195  * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
35196  *
35197  * The only instances we allow where update_id values are not strictly increasing have a
35198  * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
35199  * will force close the channel by broadcasting the latest commitment transaction or
35200  * special post-force-close updates, like providing preimages necessary to claim outputs on the
35201  * broadcast commitment transaction. See its docs for more details.
35202  *
35203  * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
35204  */
35205 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
35206
35207 /**
35208  * The channel ID associated with these updates.
35209  *
35210  * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and
35211  * always `Some` otherwise.
35212  *
35213  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35214  */
35215 struct LDKChannelId ChannelMonitorUpdate_get_channel_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
35216
35217 /**
35218  * The channel ID associated with these updates.
35219  *
35220  * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and
35221  * always `Some` otherwise.
35222  *
35223  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35224  */
35225 void ChannelMonitorUpdate_set_channel_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, struct LDKChannelId val);
35226
35227 /**
35228  * Creates a copy of the ChannelMonitorUpdate
35229  */
35230 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
35231
35232 /**
35233  * Checks if two ChannelMonitorUpdates contain equal inner contents.
35234  * This ignores pointers and is_owned flags and looks at the values in fields.
35235  * Two objects with NULL inner values will be considered "equal" here.
35236  */
35237 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
35238
35239 /**
35240  * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
35241  */
35242 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
35243
35244 /**
35245  * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
35246  */
35247 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
35248
35249 /**
35250  * Frees any resources used by the MonitorEvent
35251  */
35252 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
35253
35254 /**
35255  * Creates a copy of the MonitorEvent
35256  */
35257 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
35258
35259 /**
35260  * Utility method to constructs a new HTLCEvent-variant MonitorEvent
35261  */
35262 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
35263
35264 /**
35265  * Utility method to constructs a new HolderForceClosedWithInfo-variant MonitorEvent
35266  */
35267 struct LDKMonitorEvent MonitorEvent_holder_force_closed_with_info(struct LDKClosureReason reason, struct LDKOutPoint outpoint, struct LDKChannelId channel_id);
35268
35269 /**
35270  * Utility method to constructs a new HolderForceClosed-variant MonitorEvent
35271  */
35272 struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a);
35273
35274 /**
35275  * Utility method to constructs a new Completed-variant MonitorEvent
35276  */
35277 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, struct LDKChannelId channel_id, uint64_t monitor_update_id);
35278
35279 /**
35280  * Checks if two MonitorEvents contain equal inner contents.
35281  * This ignores pointers and is_owned flags and looks at the values in fields.
35282  */
35283 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
35284
35285 /**
35286  * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
35287  */
35288 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
35289
35290 /**
35291  * Read a MonitorEvent from a byte array, created by MonitorEvent_write
35292  */
35293 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
35294
35295 /**
35296  * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
35297  */
35298 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
35299
35300 /**
35301  * Creates a copy of the HTLCUpdate
35302  */
35303 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
35304
35305 /**
35306  * Checks if two HTLCUpdates contain equal inner contents.
35307  * This ignores pointers and is_owned flags and looks at the values in fields.
35308  * Two objects with NULL inner values will be considered "equal" here.
35309  */
35310 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
35311
35312 /**
35313  * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
35314  */
35315 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
35316
35317 /**
35318  * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
35319  */
35320 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
35321
35322 /**
35323  * Frees any resources used by the Balance
35324  */
35325 void Balance_free(struct LDKBalance this_ptr);
35326
35327 /**
35328  * Creates a copy of the Balance
35329  */
35330 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
35331
35332 /**
35333  * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
35334  */
35335 struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis);
35336
35337 /**
35338  * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
35339  */
35340 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height);
35341
35342 /**
35343  * Utility method to constructs a new ContentiousClaimable-variant Balance
35344  */
35345 struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
35346
35347 /**
35348  * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
35349  */
35350 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
35351
35352 /**
35353  * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
35354  */
35355 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
35356
35357 /**
35358  * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
35359  */
35360 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis);
35361
35362 /**
35363  * Checks if two Balances contain equal inner contents.
35364  * This ignores pointers and is_owned flags and looks at the values in fields.
35365  */
35366 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
35367
35368 /**
35369  * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
35370  * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
35371  * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
35372  * [`Balance::MaybePreimageClaimableHTLC`].
35373  *
35374  * On-chain fees required to claim the balance are not included in this amount.
35375  */
35376 MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
35377
35378 /**
35379  * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
35380  */
35381 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
35382
35383 /**
35384  * Creates a copy of the ChannelMonitor
35385  */
35386 struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
35387
35388 /**
35389  * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
35390  */
35391 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
35392
35393 /**
35394  * Updates a ChannelMonitor on the basis of some new information provided by the Channel
35395  * itself.
35396  *
35397  * panics if the given update is not the next update by update_id.
35398  */
35399 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);
35400
35401 /**
35402  * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
35403  * ChannelMonitor.
35404  */
35405 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35406
35407 /**
35408  * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
35409  */
35410 MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35411
35412 /**
35413  * Gets the channel_id of the channel this ChannelMonitor is monitoring for.
35414  */
35415 MUST_USE_RES struct LDKChannelId ChannelMonitor_channel_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35416
35417 /**
35418  * Gets a list of txids, with their output scripts (in the order they appear in the
35419  * transaction), which we must learn about spends of via block_connected().
35420  */
35421 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35422
35423 /**
35424  * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
35425  * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
35426  * have been registered.
35427  */
35428 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);
35429
35430 /**
35431  * Get the list of HTLCs who's status has been updated on chain. This should be called by
35432  * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
35433  */
35434 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35435
35436 /**
35437  * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
35438  *
35439  * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
35440  * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
35441  * within each channel. As the confirmation of a commitment transaction may be critical to the
35442  * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
35443  * environment with spotty connections, like on mobile.
35444  *
35445  * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
35446  * order to handle these events.
35447  *
35448  * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
35449  * [`BumpTransaction`]: crate::events::Event::BumpTransaction
35450  */
35451 void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
35452
35453 /**
35454  * Gets the counterparty's initial commitment transaction. The returned commitment
35455  * transaction is unsigned. This is intended to be called during the initial persistence of
35456  * the monitor (inside an implementation of [`Persist::persist_new_channel`]), to allow for
35457  * watchtowers in the persistence pipeline to have enough data to form justice transactions.
35458  *
35459  * This is similar to [`Self::counterparty_commitment_txs_from_update`], except
35460  * that for the initial commitment transaction, we don't have a corresponding update.
35461  *
35462  * This will only return `Some` for channel monitors that have been created after upgrading
35463  * to LDK 0.0.117+.
35464  *
35465  * [`Persist::persist_new_channel`]: crate::chain::chainmonitor::Persist::persist_new_channel
35466  *
35467  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35468  */
35469 MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35470
35471 /**
35472  * Gets all of the counterparty commitment transactions provided by the given update. This
35473  * may be empty if the update doesn't include any new counterparty commitments. Returned
35474  * commitment transactions are unsigned.
35475  *
35476  * This is provided so that watchtower clients in the persistence pipeline are able to build
35477  * justice transactions for each counterparty commitment upon each update. It's intended to be
35478  * used within an implementation of [`Persist::update_persisted_channel`], which is provided
35479  * with a monitor and an update. Once revoked, signing a justice transaction can be done using
35480  * [`Self::sign_to_local_justice_tx`].
35481  *
35482  * It is expected that a watchtower client may use this method to retrieve the latest counterparty
35483  * commitment transaction(s), and then hold the necessary data until a later update in which
35484  * the monitor has been updated with the corresponding revocation data, at which point the
35485  * monitor can sign the justice transaction.
35486  *
35487  * This will only return a non-empty list for monitor updates that have been created after
35488  * upgrading to LDK 0.0.117+. Note that no restriction lies on the monitors themselves, which
35489  * may have been created prior to upgrading.
35490  *
35491  * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel
35492  */
35493 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);
35494
35495 /**
35496  * Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
35497  * signing the justice transaction easier for implementors of
35498  * [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
35499  * signing the input at `input_idx`. This method will only produce a valid signature for
35500  * a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
35501  * be used for revoked HTLC outputs.
35502  *
35503  * `Value` is the value of the output being spent by the input at `input_idx`, committed
35504  * in the BIP 143 signature.
35505  *
35506  * This method will only succeed if this monitor has received the revocation secret for the
35507  * provided `commitment_number`. If a commitment number is provided that does not correspond
35508  * to the commitment transaction being revoked, this will return a signed transaction, but
35509  * the signature will not be valid.
35510  *
35511  * [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_justice_revoked_output
35512  * [`Persist`]: crate::chain::chainmonitor::Persist
35513  */
35514 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);
35515
35516 /**
35517  * Gets the `node_id` of the counterparty for this channel.
35518  *
35519  * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
35520  * otherwise.
35521  *
35522  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35523  */
35524 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35525
35526 /**
35527  * You may use this to broadcast the latest local commitment transaction, either because
35528  * a monitor update failed or because we've fallen behind (i.e. we've received proof that our
35529  * counterparty side knows a revocation secret we gave them that they shouldn't know).
35530  *
35531  * Broadcasting these transactions in this manner is UNSAFE, as they allow counterparty
35532  * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
35533  * close channel with their commitment transaction after a substantial amount of time. Best
35534  * may be to contact the other node operator out-of-band to coordinate other options available
35535  * to you.
35536  */
35537 void ChannelMonitor_broadcast_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
35538
35539 /**
35540  * Processes transactions in a newly connected block, which may result in any of the following:
35541  * - update the monitor's state against resolved HTLCs
35542  * - punish the counterparty in the case of seeing a revoked commitment transaction
35543  * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
35544  * - detect settled outputs for later spending
35545  * - schedule and bump any in-flight claims
35546  *
35547  * Returns any new outputs to watch from `txdata`; after called, these are also included in
35548  * [`get_outputs_to_watch`].
35549  *
35550  * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
35551  */
35552 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);
35553
35554 /**
35555  * Determines if the disconnected block contained any transactions of interest and updates
35556  * appropriately.
35557  */
35558 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);
35559
35560 /**
35561  * Processes transactions confirmed in a block with the given header and height, returning new
35562  * outputs to watch. See [`block_connected`] for details.
35563  *
35564  * Used instead of [`block_connected`] by clients that are notified of transactions rather than
35565  * blocks. See [`chain::Confirm`] for calling expectations.
35566  *
35567  * [`block_connected`]: Self::block_connected
35568  */
35569 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);
35570
35571 /**
35572  * Processes a transaction that was reorganized out of the chain.
35573  *
35574  * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
35575  * than blocks. See [`chain::Confirm`] for calling expectations.
35576  *
35577  * [`block_disconnected`]: Self::block_disconnected
35578  */
35579 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);
35580
35581 /**
35582  * Updates the monitor with the current best chain tip, returning new outputs to watch. See
35583  * [`block_connected`] for details.
35584  *
35585  * Used instead of [`block_connected`] by clients that are notified of transactions rather than
35586  * blocks. See [`chain::Confirm`] for calling expectations.
35587  *
35588  * [`block_connected`]: Self::block_connected
35589  */
35590 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);
35591
35592 /**
35593  * Returns the set of txids that should be monitored for re-organization out of the chain.
35594  */
35595 MUST_USE_RES struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35596
35597 /**
35598  * Gets the latest best block which was connected either via the [`chain::Listen`] or
35599  * [`chain::Confirm`] interfaces.
35600  */
35601 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35602
35603 /**
35604  * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
35605  * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
35606  * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
35607  * invoking this every 30 seconds, or lower if running in an environment with spotty
35608  * connections, like on mobile.
35609  */
35610 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);
35611
35612 /**
35613  * Triggers rebroadcasts of pending claims from a force-closed channel after a transaction
35614  * signature generation failure.
35615  */
35616 void ChannelMonitor_signer_unblocked(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
35617
35618 /**
35619  * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the
35620  * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`]
35621  * confirmations. For [`SpendableOutputDescriptor::DelayedPaymentOutput`] descriptors to be
35622  * returned, the transaction must have at least `max(ANTI_REORG_DELAY, to_self_delay)`
35623  * confirmations.
35624  *
35625  * Descriptors returned by this method are primarily exposed via [`Event::SpendableOutputs`]
35626  * once they are no longer under reorg risk. This method serves as a way to retrieve these
35627  * descriptors at a later time, either for historical purposes, or to replay any
35628  * missed/unhandled descriptors. For the purpose of gathering historical records, if the
35629  * channel close has fully resolved (i.e., [`ChannelMonitor::get_claimable_balances`] returns
35630  * an empty set), you can retrieve all spendable outputs by providing all descendant spending
35631  * transactions starting from the channel's funding transaction and going down three levels.
35632  *
35633  * `tx` is a transaction we'll scan the outputs of. Any transaction can be provided. If any
35634  * outputs which can be spent by us are found, at least one descriptor is returned.
35635  *
35636  * `confirmation_height` must be the height of the block in which `tx` was included in.
35637  */
35638 MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height);
35639
35640 /**
35641  * Checks if the monitor is fully resolved. Resolved monitor is one that has claimed all of
35642  * its outputs and balances (i.e. [`Self::get_claimable_balances`] returns an empty set).
35643  *
35644  * This function returns true only if [`Self::get_claimable_balances`] has been empty for at least
35645  * 4032 blocks as an additional protection against any bugs resulting in spuriously empty balance sets.
35646  */
35647 MUST_USE_RES bool ChannelMonitor_is_fully_resolved(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger);
35648
35649 /**
35650  * Gets the balances in this channel which are either claimable by us if we were to
35651  * force-close the channel now or which are claimable on-chain (possibly awaiting
35652  * confirmation).
35653  *
35654  * Any balances in the channel which are available on-chain (excluding on-chain fees) are
35655  * included here until an [`Event::SpendableOutputs`] event has been generated for the
35656  * balance, or until our counterparty has claimed the balance and accrued several
35657  * confirmations on the claim transaction.
35658  *
35659  * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
35660  * LDK prior to 0.0.111, not all or excess balances may be included.
35661  *
35662  * See [`Balance`] for additional details on the types of claimable balances which
35663  * may be returned here and their meanings.
35664  */
35665 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
35666
35667 /**
35668  * Read a C2Tuple_ThirtyTwoBytesChannelMonitorZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelMonitorZ_write
35669  */
35670 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
35671
35672 /**
35673  * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
35674  */
35675 void OutPoint_free(struct LDKOutPoint this_obj);
35676
35677 /**
35678  * The referenced transaction's txid.
35679  */
35680 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
35681
35682 /**
35683  * The referenced transaction's txid.
35684  */
35685 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35686
35687 /**
35688  * The index of the referenced output in its transaction's vout.
35689  */
35690 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
35691
35692 /**
35693  * The index of the referenced output in its transaction's vout.
35694  */
35695 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
35696
35697 /**
35698  * Constructs a new OutPoint given each field
35699  */
35700 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
35701
35702 /**
35703  * Creates a copy of the OutPoint
35704  */
35705 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
35706
35707 /**
35708  * Checks if two OutPoints contain equal inner contents.
35709  * This ignores pointers and is_owned flags and looks at the values in fields.
35710  * Two objects with NULL inner values will be considered "equal" here.
35711  */
35712 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
35713
35714 /**
35715  * Generates a non-cryptographic 64-bit hash of the OutPoint.
35716  */
35717 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
35718
35719 /**
35720  * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
35721  */
35722 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
35723
35724 /**
35725  * Read a OutPoint from a byte array, created by OutPoint_write
35726  */
35727 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
35728
35729 /**
35730  * Frees any resources used by the InboundHTLCErr, if is_owned is set and inner is non-NULL.
35731  */
35732 void InboundHTLCErr_free(struct LDKInboundHTLCErr this_obj);
35733
35734 /**
35735  * BOLT 4 error code.
35736  */
35737 uint16_t InboundHTLCErr_get_err_code(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
35738
35739 /**
35740  * BOLT 4 error code.
35741  */
35742 void InboundHTLCErr_set_err_code(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, uint16_t val);
35743
35744 /**
35745  * Data attached to this error.
35746  *
35747  * Returns a copy of the field.
35748  */
35749 struct LDKCVec_u8Z InboundHTLCErr_get_err_data(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
35750
35751 /**
35752  * Data attached to this error.
35753  */
35754 void InboundHTLCErr_set_err_data(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
35755
35756 /**
35757  * Error message text.
35758  */
35759 struct LDKStr InboundHTLCErr_get_msg(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
35760
35761 /**
35762  * Error message text.
35763  */
35764 void InboundHTLCErr_set_msg(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKStr val);
35765
35766 /**
35767  * Constructs a new InboundHTLCErr given each field
35768  */
35769 MUST_USE_RES struct LDKInboundHTLCErr InboundHTLCErr_new(uint16_t err_code_arg, struct LDKCVec_u8Z err_data_arg, struct LDKStr msg_arg);
35770
35771 /**
35772  * Peel one layer off an incoming onion, returning a [`PendingHTLCInfo`] that contains information
35773  * about the intended next-hop for the HTLC.
35774  *
35775  * This does all the relevant context-free checks that LDK requires for payment relay or
35776  * acceptance. If the payment is to be received, and the amount matches the expected amount for
35777  * a given invoice, this indicates the [`msgs::UpdateAddHTLC`], once fully committed in the
35778  * channel, will generate an [`Event::PaymentClaimable`].
35779  *
35780  * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
35781  */
35782 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);
35783
35784 /**
35785  * Frees any resources used by the PendingHTLCRouting
35786  */
35787 void PendingHTLCRouting_free(struct LDKPendingHTLCRouting this_ptr);
35788
35789 /**
35790  * Creates a copy of the PendingHTLCRouting
35791  */
35792 struct LDKPendingHTLCRouting PendingHTLCRouting_clone(const struct LDKPendingHTLCRouting *NONNULL_PTR orig);
35793
35794 /**
35795  * Utility method to constructs a new Forward-variant PendingHTLCRouting
35796  */
35797 struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded);
35798
35799 /**
35800  * Utility method to constructs a new Receive-variant PendingHTLCRouting
35801  */
35802 struct LDKPendingHTLCRouting PendingHTLCRouting_receive(struct LDKFinalOnionHopData payment_data, struct LDKCOption_CVec_u8ZZ payment_metadata, struct LDKCOption_PaymentContextZ payment_context, uint32_t incoming_cltv_expiry, struct LDKThirtyTwoBytes phantom_shared_secret, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error);
35803
35804 /**
35805  * Utility method to constructs a new ReceiveKeysend-variant PendingHTLCRouting
35806  */
35807 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, bool requires_blinded_error);
35808
35809 /**
35810  * Frees any resources used by the BlindedForward, if is_owned is set and inner is non-NULL.
35811  */
35812 void BlindedForward_free(struct LDKBlindedForward this_obj);
35813
35814 /**
35815  * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
35816  * onion payload if we're the introduction node. Useful for calculating the next hop's
35817  * [`msgs::UpdateAddHTLC::blinding_point`].
35818  */
35819 struct LDKPublicKey BlindedForward_get_inbound_blinding_point(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
35820
35821 /**
35822  * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
35823  * onion payload if we're the introduction node. Useful for calculating the next hop's
35824  * [`msgs::UpdateAddHTLC::blinding_point`].
35825  */
35826 void BlindedForward_set_inbound_blinding_point(struct LDKBlindedForward *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35827
35828 /**
35829  * If needed, this determines how this HTLC should be failed backwards, based on whether we are
35830  * the introduction node.
35831  */
35832 enum LDKBlindedFailure BlindedForward_get_failure(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
35833
35834 /**
35835  * If needed, this determines how this HTLC should be failed backwards, based on whether we are
35836  * the introduction node.
35837  */
35838 void BlindedForward_set_failure(struct LDKBlindedForward *NONNULL_PTR this_ptr, enum LDKBlindedFailure val);
35839
35840 /**
35841  * Constructs a new BlindedForward given each field
35842  */
35843 MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg);
35844
35845 /**
35846  * Creates a copy of the BlindedForward
35847  */
35848 struct LDKBlindedForward BlindedForward_clone(const struct LDKBlindedForward *NONNULL_PTR orig);
35849
35850 /**
35851  * Generates a non-cryptographic 64-bit hash of the BlindedForward.
35852  */
35853 uint64_t BlindedForward_hash(const struct LDKBlindedForward *NONNULL_PTR o);
35854
35855 /**
35856  * Checks if two BlindedForwards contain equal inner contents.
35857  * This ignores pointers and is_owned flags and looks at the values in fields.
35858  * Two objects with NULL inner values will be considered "equal" here.
35859  */
35860 bool BlindedForward_eq(const struct LDKBlindedForward *NONNULL_PTR a, const struct LDKBlindedForward *NONNULL_PTR b);
35861
35862 /**
35863  * Frees any resources used by the PendingHTLCInfo, if is_owned is set and inner is non-NULL.
35864  */
35865 void PendingHTLCInfo_free(struct LDKPendingHTLCInfo this_obj);
35866
35867 /**
35868  * Further routing details based on whether the HTLC is being forwarded or received.
35869  */
35870 struct LDKPendingHTLCRouting PendingHTLCInfo_get_routing(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
35871
35872 /**
35873  * Further routing details based on whether the HTLC is being forwarded or received.
35874  */
35875 void PendingHTLCInfo_set_routing(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKPendingHTLCRouting val);
35876
35877 /**
35878  * The onion shared secret we build with the sender used to decrypt the onion.
35879  *
35880  * This is later used to encrypt failure packets in the event that the HTLC is failed.
35881  */
35882 const uint8_t (*PendingHTLCInfo_get_incoming_shared_secret(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
35883
35884 /**
35885  * The onion shared secret we build with the sender used to decrypt the onion.
35886  *
35887  * This is later used to encrypt failure packets in the event that the HTLC is failed.
35888  */
35889 void PendingHTLCInfo_set_incoming_shared_secret(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35890
35891 /**
35892  * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
35893  */
35894 const uint8_t (*PendingHTLCInfo_get_payment_hash(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
35895
35896 /**
35897  * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
35898  */
35899 void PendingHTLCInfo_set_payment_hash(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35900
35901 /**
35902  * Amount received in the incoming HTLC.
35903  *
35904  * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
35905  * versions.
35906  */
35907 struct LDKCOption_u64Z PendingHTLCInfo_get_incoming_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
35908
35909 /**
35910  * Amount received in the incoming HTLC.
35911  *
35912  * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
35913  * versions.
35914  */
35915 void PendingHTLCInfo_set_incoming_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
35916
35917 /**
35918  * The amount the sender indicated should be forwarded on to the next hop or amount the sender
35919  * intended for us to receive for received payments.
35920  *
35921  * If the received amount is less than this for received payments, an intermediary hop has
35922  * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
35923  * it along another path).
35924  *
35925  * Because nodes can take less than their required fees, and because senders may wish to
35926  * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
35927  * received payments. In such cases, recipients must handle this HTLC as if it had received
35928  * [`Self::outgoing_amt_msat`].
35929  */
35930 uint64_t PendingHTLCInfo_get_outgoing_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
35931
35932 /**
35933  * The amount the sender indicated should be forwarded on to the next hop or amount the sender
35934  * intended for us to receive for received payments.
35935  *
35936  * If the received amount is less than this for received payments, an intermediary hop has
35937  * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
35938  * it along another path).
35939  *
35940  * Because nodes can take less than their required fees, and because senders may wish to
35941  * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
35942  * received payments. In such cases, recipients must handle this HTLC as if it had received
35943  * [`Self::outgoing_amt_msat`].
35944  */
35945 void PendingHTLCInfo_set_outgoing_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint64_t val);
35946
35947 /**
35948  * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
35949  * should have been set on the received HTLC for received payments).
35950  */
35951 uint32_t PendingHTLCInfo_get_outgoing_cltv_value(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
35952
35953 /**
35954  * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
35955  * should have been set on the received HTLC for received payments).
35956  */
35957 void PendingHTLCInfo_set_outgoing_cltv_value(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint32_t val);
35958
35959 /**
35960  * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
35961  *
35962  * If this is a payment for forwarding, this is the fee we are taking before forwarding the
35963  * HTLC.
35964  *
35965  * If this is a received payment, this is the fee that our counterparty took.
35966  *
35967  * This is used to allow LSPs to take fees as a part of payments, without the sender having to
35968  * shoulder them.
35969  */
35970 struct LDKCOption_u64Z PendingHTLCInfo_get_skimmed_fee_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
35971
35972 /**
35973  * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
35974  *
35975  * If this is a payment for forwarding, this is the fee we are taking before forwarding the
35976  * HTLC.
35977  *
35978  * If this is a received payment, this is the fee that our counterparty took.
35979  *
35980  * This is used to allow LSPs to take fees as a part of payments, without the sender having to
35981  * shoulder them.
35982  */
35983 void PendingHTLCInfo_set_skimmed_fee_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
35984
35985 /**
35986  * Constructs a new PendingHTLCInfo given each field
35987  */
35988 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);
35989
35990 /**
35991  * Creates a copy of the PendingHTLCInfo
35992  */
35993 struct LDKPendingHTLCInfo PendingHTLCInfo_clone(const struct LDKPendingHTLCInfo *NONNULL_PTR orig);
35994
35995 /**
35996  * Creates a copy of the BlindedFailure
35997  */
35998 enum LDKBlindedFailure BlindedFailure_clone(const enum LDKBlindedFailure *NONNULL_PTR orig);
35999
36000 /**
36001  * Utility method to constructs a new FromIntroductionNode-variant BlindedFailure
36002  */
36003 enum LDKBlindedFailure BlindedFailure_from_introduction_node(void);
36004
36005 /**
36006  * Utility method to constructs a new FromBlindedNode-variant BlindedFailure
36007  */
36008 enum LDKBlindedFailure BlindedFailure_from_blinded_node(void);
36009
36010 /**
36011  * Generates a non-cryptographic 64-bit hash of the BlindedFailure.
36012  */
36013 uint64_t BlindedFailure_hash(const enum LDKBlindedFailure *NONNULL_PTR o);
36014
36015 /**
36016  * Checks if two BlindedFailures contain equal inner contents.
36017  * This ignores pointers and is_owned flags and looks at the values in fields.
36018  */
36019 bool BlindedFailure_eq(const enum LDKBlindedFailure *NONNULL_PTR a, const enum LDKBlindedFailure *NONNULL_PTR b);
36020
36021 /**
36022  * Frees any resources used by the FailureCode
36023  */
36024 void FailureCode_free(struct LDKFailureCode this_ptr);
36025
36026 /**
36027  * Creates a copy of the FailureCode
36028  */
36029 struct LDKFailureCode FailureCode_clone(const struct LDKFailureCode *NONNULL_PTR orig);
36030
36031 /**
36032  * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
36033  */
36034 struct LDKFailureCode FailureCode_temporary_node_failure(void);
36035
36036 /**
36037  * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
36038  */
36039 struct LDKFailureCode FailureCode_required_node_feature_missing(void);
36040
36041 /**
36042  * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
36043  */
36044 struct LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
36045
36046 /**
36047  * Utility method to constructs a new InvalidOnionPayload-variant FailureCode
36048  */
36049 struct LDKFailureCode FailureCode_invalid_onion_payload(struct LDKCOption_C2Tuple_u64u16ZZ a);
36050
36051 /**
36052  * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
36053  */
36054 void ChannelManager_free(struct LDKChannelManager this_obj);
36055
36056 /**
36057  * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
36058  */
36059 void ChainParameters_free(struct LDKChainParameters this_obj);
36060
36061 /**
36062  * The network for determining the `chain_hash` in Lightning messages.
36063  */
36064 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
36065
36066 /**
36067  * The network for determining the `chain_hash` in Lightning messages.
36068  */
36069 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
36070
36071 /**
36072  * The hash and height of the latest block successfully connected.
36073  *
36074  * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
36075  */
36076 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
36077
36078 /**
36079  * The hash and height of the latest block successfully connected.
36080  *
36081  * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
36082  */
36083 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
36084
36085 /**
36086  * Constructs a new ChainParameters given each field
36087  */
36088 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
36089
36090 /**
36091  * Creates a copy of the ChainParameters
36092  */
36093 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
36094
36095 /**
36096  * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
36097  */
36098 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
36099
36100 /**
36101  * Base routing fee in millisatoshis.
36102  */
36103 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
36104
36105 /**
36106  * Base routing fee in millisatoshis.
36107  */
36108 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
36109
36110 /**
36111  * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
36112  */
36113 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
36114
36115 /**
36116  * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
36117  */
36118 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
36119
36120 /**
36121  * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
36122  * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
36123  * `cltv_expiry_delta` for more details.
36124  */
36125 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
36126
36127 /**
36128  * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
36129  * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
36130  * `cltv_expiry_delta` for more details.
36131  */
36132 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
36133
36134 /**
36135  * Constructs a new CounterpartyForwardingInfo given each field
36136  */
36137 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);
36138
36139 /**
36140  * Creates a copy of the CounterpartyForwardingInfo
36141  */
36142 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
36143
36144 /**
36145  * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
36146  */
36147 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
36148
36149 /**
36150  * The node_id of our counterparty
36151  */
36152 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36153
36154 /**
36155  * The node_id of our counterparty
36156  */
36157 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36158
36159 /**
36160  * The Features the channel counterparty provided upon last connection.
36161  * Useful for routing as it is the most up-to-date copy of the counterparty's features and
36162  * many routing-relevant features are present in the init context.
36163  */
36164 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36165
36166 /**
36167  * The Features the channel counterparty provided upon last connection.
36168  * Useful for routing as it is the most up-to-date copy of the counterparty's features and
36169  * many routing-relevant features are present in the init context.
36170  */
36171 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
36172
36173 /**
36174  * The value, in satoshis, that must always be held in the channel for our counterparty. This
36175  * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
36176  * claiming at least this value on chain.
36177  *
36178  * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
36179  *
36180  * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
36181  */
36182 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36183
36184 /**
36185  * The value, in satoshis, that must always be held in the channel for our counterparty. This
36186  * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
36187  * claiming at least this value on chain.
36188  *
36189  * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
36190  *
36191  * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
36192  */
36193 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
36194
36195 /**
36196  * Information on the fees and requirements that the counterparty requires when forwarding
36197  * payments to us through this channel.
36198  *
36199  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36200  */
36201 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36202
36203 /**
36204  * Information on the fees and requirements that the counterparty requires when forwarding
36205  * payments to us through this channel.
36206  *
36207  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36208  */
36209 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
36210
36211 /**
36212  * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
36213  * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
36214  * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
36215  */
36216 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36217
36218 /**
36219  * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
36220  * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
36221  * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
36222  */
36223 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36224
36225 /**
36226  * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
36227  */
36228 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
36229
36230 /**
36231  * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
36232  */
36233 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36234
36235 /**
36236  * Constructs a new ChannelCounterparty given each field
36237  *
36238  * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36239  */
36240 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);
36241
36242 /**
36243  * Creates a copy of the ChannelCounterparty
36244  */
36245 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
36246
36247 /**
36248  * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
36249  */
36250 void ChannelDetails_free(struct LDKChannelDetails this_obj);
36251
36252 /**
36253  * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
36254  * thereafter this is the txid of the funding transaction xor the funding transaction output).
36255  * Note that this means this value is *not* persistent - it can change once during the
36256  * lifetime of the channel.
36257  */
36258 struct LDKChannelId ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36259
36260 /**
36261  * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
36262  * thereafter this is the txid of the funding transaction xor the funding transaction output).
36263  * Note that this means this value is *not* persistent - it can change once during the
36264  * lifetime of the channel.
36265  */
36266 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelId val);
36267
36268 /**
36269  * Parameters which apply to our counterparty. See individual fields for more information.
36270  */
36271 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36272
36273 /**
36274  * Parameters which apply to our counterparty. See individual fields for more information.
36275  */
36276 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
36277
36278 /**
36279  * The Channel's funding transaction output, if we've negotiated the funding transaction with
36280  * our counterparty already.
36281  *
36282  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36283  */
36284 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36285
36286 /**
36287  * The Channel's funding transaction output, if we've negotiated the funding transaction with
36288  * our counterparty already.
36289  *
36290  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36291  */
36292 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
36293
36294 /**
36295  * The features which this channel operates with. See individual features for more info.
36296  *
36297  * `None` until negotiation completes and the channel type is finalized.
36298  *
36299  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36300  */
36301 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36302
36303 /**
36304  * The features which this channel operates with. See individual features for more info.
36305  *
36306  * `None` until negotiation completes and the channel type is finalized.
36307  *
36308  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36309  */
36310 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
36311
36312 /**
36313  * The position of the funding transaction in the chain. None if the funding transaction has
36314  * not yet been confirmed and the channel fully opened.
36315  *
36316  * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
36317  * payments instead of this. See [`get_inbound_payment_scid`].
36318  *
36319  * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
36320  * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
36321  *
36322  * [`inbound_scid_alias`]: Self::inbound_scid_alias
36323  * [`outbound_scid_alias`]: Self::outbound_scid_alias
36324  * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
36325  * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
36326  * [`confirmations_required`]: Self::confirmations_required
36327  */
36328 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36329
36330 /**
36331  * The position of the funding transaction in the chain. None if the funding transaction has
36332  * not yet been confirmed and the channel fully opened.
36333  *
36334  * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
36335  * payments instead of this. See [`get_inbound_payment_scid`].
36336  *
36337  * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
36338  * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
36339  *
36340  * [`inbound_scid_alias`]: Self::inbound_scid_alias
36341  * [`outbound_scid_alias`]: Self::outbound_scid_alias
36342  * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
36343  * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
36344  * [`confirmations_required`]: Self::confirmations_required
36345  */
36346 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36347
36348 /**
36349  * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
36350  * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
36351  * the channel has not yet been confirmed (as long as [`confirmations_required`] is
36352  * `Some(0)`).
36353  *
36354  * This will be `None` as long as the channel is not available for routing outbound payments.
36355  *
36356  * [`short_channel_id`]: Self::short_channel_id
36357  * [`confirmations_required`]: Self::confirmations_required
36358  */
36359 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36360
36361 /**
36362  * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
36363  * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
36364  * the channel has not yet been confirmed (as long as [`confirmations_required`] is
36365  * `Some(0)`).
36366  *
36367  * This will be `None` as long as the channel is not available for routing outbound payments.
36368  *
36369  * [`short_channel_id`]: Self::short_channel_id
36370  * [`confirmations_required`]: Self::confirmations_required
36371  */
36372 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36373
36374 /**
36375  * An optional [`short_channel_id`] alias for this channel, randomly generated by our
36376  * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
36377  * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
36378  * when they see a payment to be routed to us.
36379  *
36380  * Our counterparty may choose to rotate this value at any time, though will always recognize
36381  * previous values for inbound payment forwarding.
36382  *
36383  * [`short_channel_id`]: Self::short_channel_id
36384  */
36385 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36386
36387 /**
36388  * An optional [`short_channel_id`] alias for this channel, randomly generated by our
36389  * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
36390  * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
36391  * when they see a payment to be routed to us.
36392  *
36393  * Our counterparty may choose to rotate this value at any time, though will always recognize
36394  * previous values for inbound payment forwarding.
36395  *
36396  * [`short_channel_id`]: Self::short_channel_id
36397  */
36398 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36399
36400 /**
36401  * The value, in satoshis, of this channel as appears in the funding output
36402  */
36403 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36404
36405 /**
36406  * The value, in satoshis, of this channel as appears in the funding output
36407  */
36408 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36409
36410 /**
36411  * The value, in satoshis, that must always be held in the channel for us. This value ensures
36412  * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
36413  * this value on chain.
36414  *
36415  * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
36416  *
36417  * This value will be `None` for outbound channels until the counterparty accepts the channel.
36418  *
36419  * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
36420  */
36421 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36422
36423 /**
36424  * The value, in satoshis, that must always be held in the channel for us. This value ensures
36425  * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
36426  * this value on chain.
36427  *
36428  * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
36429  *
36430  * This value will be `None` for outbound channels until the counterparty accepts the channel.
36431  *
36432  * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
36433  */
36434 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36435
36436 /**
36437  * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
36438  * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
36439  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
36440  * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
36441  * serialized with LDK versions prior to 0.0.113.
36442  *
36443  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
36444  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
36445  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
36446  */
36447 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36448
36449 /**
36450  * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
36451  * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
36452  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
36453  * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
36454  * serialized with LDK versions prior to 0.0.113.
36455  *
36456  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
36457  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
36458  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
36459  */
36460 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
36461
36462 /**
36463  * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
36464  * which is applied to commitment and HTLC transactions.
36465  *
36466  * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
36467  */
36468 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36469
36470 /**
36471  * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
36472  * which is applied to commitment and HTLC transactions.
36473  *
36474  * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
36475  */
36476 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36477
36478 /**
36479  * Our total balance.  This is the amount we would get if we close the channel.
36480  * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
36481  * amount is not likely to be recoverable on close.
36482  *
36483  * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
36484  * balance is not available for inclusion in new outbound HTLCs). This further does not include
36485  * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
36486  * This does not consider any on-chain fees.
36487  *
36488  * See also [`ChannelDetails::outbound_capacity_msat`]
36489  */
36490 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36491
36492 /**
36493  * Our total balance.  This is the amount we would get if we close the channel.
36494  * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
36495  * amount is not likely to be recoverable on close.
36496  *
36497  * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
36498  * balance is not available for inclusion in new outbound HTLCs). This further does not include
36499  * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
36500  * This does not consider any on-chain fees.
36501  *
36502  * See also [`ChannelDetails::outbound_capacity_msat`]
36503  */
36504 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36505
36506 /**
36507  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
36508  * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
36509  * available for inclusion in new outbound HTLCs). This further does not include any pending
36510  * outgoing HTLCs which are awaiting some other resolution to be sent.
36511  *
36512  * See also [`ChannelDetails::balance_msat`]
36513  *
36514  * This value is not exact. Due to various in-flight changes, feerate changes, and our
36515  * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
36516  * should be able to spend nearly this amount.
36517  */
36518 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36519
36520 /**
36521  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
36522  * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
36523  * available for inclusion in new outbound HTLCs). This further does not include any pending
36524  * outgoing HTLCs which are awaiting some other resolution to be sent.
36525  *
36526  * See also [`ChannelDetails::balance_msat`]
36527  *
36528  * This value is not exact. Due to various in-flight changes, feerate changes, and our
36529  * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
36530  * should be able to spend nearly this amount.
36531  */
36532 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36533
36534 /**
36535  * The available outbound capacity for sending a single HTLC to the remote peer. This is
36536  * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
36537  * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
36538  * to use a limit as close as possible to the HTLC limit we can currently send.
36539  *
36540  * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
36541  * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
36542  */
36543 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36544
36545 /**
36546  * The available outbound capacity for sending a single HTLC to the remote peer. This is
36547  * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
36548  * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
36549  * to use a limit as close as possible to the HTLC limit we can currently send.
36550  *
36551  * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
36552  * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
36553  */
36554 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36555
36556 /**
36557  * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
36558  * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
36559  * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
36560  * route which is valid.
36561  */
36562 uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36563
36564 /**
36565  * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
36566  * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
36567  * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
36568  * route which is valid.
36569  */
36570 void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36571
36572 /**
36573  * The available inbound capacity for the remote peer to send HTLCs to us. This does not
36574  * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
36575  * available for inclusion in new inbound HTLCs).
36576  * Note that there are some corner cases not fully handled here, so the actual available
36577  * inbound capacity may be slightly higher than this.
36578  *
36579  * This value is not exact. Due to various in-flight changes, feerate changes, and our
36580  * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
36581  * However, our counterparty should be able to spend nearly this amount.
36582  */
36583 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36584
36585 /**
36586  * The available inbound capacity for the remote peer to send HTLCs to us. This does not
36587  * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
36588  * available for inclusion in new inbound HTLCs).
36589  * Note that there are some corner cases not fully handled here, so the actual available
36590  * inbound capacity may be slightly higher than this.
36591  *
36592  * This value is not exact. Due to various in-flight changes, feerate changes, and our
36593  * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
36594  * However, our counterparty should be able to spend nearly this amount.
36595  */
36596 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
36597
36598 /**
36599  * The number of required confirmations on the funding transaction before the funding will be
36600  * considered \"locked\". This number is selected by the channel fundee (i.e. us if
36601  * [`is_outbound`] is *not* set), and can be selected for inbound channels with
36602  * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
36603  * [`ChannelHandshakeLimits::max_minimum_depth`].
36604  *
36605  * This value will be `None` for outbound channels until the counterparty accepts the channel.
36606  *
36607  * [`is_outbound`]: ChannelDetails::is_outbound
36608  * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
36609  * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
36610  */
36611 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36612
36613 /**
36614  * The number of required confirmations on the funding transaction before the funding will be
36615  * considered \"locked\". This number is selected by the channel fundee (i.e. us if
36616  * [`is_outbound`] is *not* set), and can be selected for inbound channels with
36617  * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
36618  * [`ChannelHandshakeLimits::max_minimum_depth`].
36619  *
36620  * This value will be `None` for outbound channels until the counterparty accepts the channel.
36621  *
36622  * [`is_outbound`]: ChannelDetails::is_outbound
36623  * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
36624  * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
36625  */
36626 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36627
36628 /**
36629  * The current number of confirmations on the funding transaction.
36630  *
36631  * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
36632  */
36633 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36634
36635 /**
36636  * The current number of confirmations on the funding transaction.
36637  *
36638  * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
36639  */
36640 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36641
36642 /**
36643  * The number of blocks (after our commitment transaction confirms) that we will need to wait
36644  * until we can claim our funds after we force-close the channel. During this time our
36645  * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
36646  * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
36647  * time to claim our non-HTLC-encumbered funds.
36648  *
36649  * This value will be `None` for outbound channels until the counterparty accepts the channel.
36650  */
36651 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36652
36653 /**
36654  * The number of blocks (after our commitment transaction confirms) that we will need to wait
36655  * until we can claim our funds after we force-close the channel. During this time our
36656  * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
36657  * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
36658  * time to claim our non-HTLC-encumbered funds.
36659  *
36660  * This value will be `None` for outbound channels until the counterparty accepts the channel.
36661  */
36662 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
36663
36664 /**
36665  * True if the channel was initiated (and thus funded) by us.
36666  */
36667 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36668
36669 /**
36670  * True if the channel was initiated (and thus funded) by us.
36671  */
36672 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
36673
36674 /**
36675  * True if the channel is confirmed, channel_ready messages have been exchanged, and the
36676  * channel is not currently being shut down. `channel_ready` message exchange implies the
36677  * required confirmation count has been reached (and we were connected to the peer at some
36678  * point after the funding transaction received enough confirmations). The required
36679  * confirmation count is provided in [`confirmations_required`].
36680  *
36681  * [`confirmations_required`]: ChannelDetails::confirmations_required
36682  */
36683 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36684
36685 /**
36686  * True if the channel is confirmed, channel_ready messages have been exchanged, and the
36687  * channel is not currently being shut down. `channel_ready` message exchange implies the
36688  * required confirmation count has been reached (and we were connected to the peer at some
36689  * point after the funding transaction received enough confirmations). The required
36690  * confirmation count is provided in [`confirmations_required`].
36691  *
36692  * [`confirmations_required`]: ChannelDetails::confirmations_required
36693  */
36694 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
36695
36696 /**
36697  * The stage of the channel's shutdown.
36698  * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
36699  *
36700  * Returns a copy of the field.
36701  */
36702 struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36703
36704 /**
36705  * The stage of the channel's shutdown.
36706  * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
36707  */
36708 void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
36709
36710 /**
36711  * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
36712  * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
36713  *
36714  * This is a strict superset of `is_channel_ready`.
36715  */
36716 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36717
36718 /**
36719  * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
36720  * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
36721  *
36722  * This is a strict superset of `is_channel_ready`.
36723  */
36724 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
36725
36726 /**
36727  * True if this channel is (or will be) publicly-announced.
36728  */
36729 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36730
36731 /**
36732  * True if this channel is (or will be) publicly-announced.
36733  */
36734 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
36735
36736 /**
36737  * The smallest value HTLC (in msat) we will accept, for this channel. This field
36738  * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
36739  */
36740 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36741
36742 /**
36743  * The smallest value HTLC (in msat) we will accept, for this channel. This field
36744  * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
36745  */
36746 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36747
36748 /**
36749  * The largest value HTLC (in msat) we currently will accept, for this channel.
36750  */
36751 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36752
36753 /**
36754  * The largest value HTLC (in msat) we currently will accept, for this channel.
36755  */
36756 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36757
36758 /**
36759  * Set of configurable parameters that affect channel operation.
36760  *
36761  * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
36762  *
36763  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36764  */
36765 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
36766
36767 /**
36768  * Set of configurable parameters that affect channel operation.
36769  *
36770  * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
36771  *
36772  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36773  */
36774 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
36775
36776 /**
36777  * Creates a copy of the ChannelDetails
36778  */
36779 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
36780
36781 /**
36782  * Gets the current SCID which should be used to identify this channel for inbound payments.
36783  * This should be used for providing invoice hints or in any other context where our
36784  * counterparty will forward a payment to us.
36785  *
36786  * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
36787  * [`ChannelDetails::short_channel_id`]. See those for more information.
36788  */
36789 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
36790
36791 /**
36792  * Gets the current SCID which should be used to identify this channel for outbound payments.
36793  * This should be used in [`Route`]s to describe the first hop or in other contexts where
36794  * we're sending or forwarding a payment outbound over this channel.
36795  *
36796  * This is either the [`ChannelDetails::short_channel_id`], if set, or the
36797  * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
36798  */
36799 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
36800
36801 /**
36802  * Creates a copy of the ChannelShutdownState
36803  */
36804 enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
36805
36806 /**
36807  * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
36808  */
36809 enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
36810
36811 /**
36812  * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
36813  */
36814 enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
36815
36816 /**
36817  * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
36818  */
36819 enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
36820
36821 /**
36822  * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
36823  */
36824 enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
36825
36826 /**
36827  * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
36828  */
36829 enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
36830
36831 /**
36832  * Checks if two ChannelShutdownStates contain equal inner contents.
36833  * This ignores pointers and is_owned flags and looks at the values in fields.
36834  */
36835 bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
36836
36837 /**
36838  * Frees any resources used by the RecentPaymentDetails
36839  */
36840 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
36841
36842 /**
36843  * Creates a copy of the RecentPaymentDetails
36844  */
36845 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
36846
36847 /**
36848  * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
36849  */
36850 struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
36851
36852 /**
36853  * Utility method to constructs a new Pending-variant RecentPaymentDetails
36854  */
36855 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
36856
36857 /**
36858  * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
36859  */
36860 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
36861
36862 /**
36863  * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
36864  */
36865 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
36866
36867 /**
36868  * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
36869  */
36870 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
36871
36872 /**
36873  * The list of channels to be included in the invoice route hints.
36874  */
36875 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
36876
36877 /**
36878  * The list of channels to be included in the invoice route hints.
36879  */
36880 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
36881
36882 /**
36883  * A fake scid used for representing the phantom node's fake channel in generating the invoice
36884  * route hints.
36885  */
36886 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
36887
36888 /**
36889  * A fake scid used for representing the phantom node's fake channel in generating the invoice
36890  * route hints.
36891  */
36892 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
36893
36894 /**
36895  * The pubkey of the real backing node that would ultimately receive the payment.
36896  */
36897 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
36898
36899 /**
36900  * The pubkey of the real backing node that would ultimately receive the payment.
36901  */
36902 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36903
36904 /**
36905  * Constructs a new PhantomRouteHints given each field
36906  */
36907 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
36908
36909 /**
36910  * Creates a copy of the PhantomRouteHints
36911  */
36912 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
36913
36914 /**
36915  * Constructs a new `ChannelManager` to hold several channels and route between them.
36916  *
36917  * The current time or latest block header time can be provided as the `current_timestamp`.
36918  *
36919  * This is the main \"logic hub\" for all channel-related actions, and implements
36920  * [`ChannelMessageHandler`].
36921  *
36922  * Non-proportional fees are fixed according to our risk using the provided fee estimator.
36923  *
36924  * Users need to notify the new `ChannelManager` when a new block is connected or
36925  * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
36926  * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
36927  * more details.
36928  *
36929  * [`block_connected`]: chain::Listen::block_connected
36930  * [`block_disconnected`]: chain::Listen::block_disconnected
36931  * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
36932  */
36933 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);
36934
36935 /**
36936  * Gets the current configuration applied to all new channels.
36937  */
36938 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
36939
36940 /**
36941  * Creates a new outbound channel to the given remote node and with the given value.
36942  *
36943  * `user_channel_id` will be provided back as in
36944  * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
36945  * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
36946  * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
36947  * is simply copied to events and otherwise ignored.
36948  *
36949  * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
36950  * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
36951  *
36952  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
36953  * generate a shutdown scriptpubkey or destination script set by
36954  * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
36955  *
36956  * Note that we do not check if you are currently connected to the given peer. If no
36957  * connection is available, the outbound `open_channel` message may fail to send, resulting in
36958  * the channel eventually being silently forgotten (dropped on reload).
36959  *
36960  * If `temporary_channel_id` is specified, it will be used as the temporary channel ID of the
36961  * channel. Otherwise, a random one will be generated for you.
36962  *
36963  * Returns the new Channel's temporary `channel_id`. This ID will appear as
36964  * [`Event::FundingGenerationReady::temporary_channel_id`] and in
36965  * [`ChannelDetails::channel_id`] until after
36966  * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
36967  * one derived from the funding transaction's TXID. If the counterparty rejects the channel
36968  * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
36969  *
36970  * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
36971  * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
36972  * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
36973  *
36974  * Note that temporary_channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
36975  * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
36976  */
36977 MUST_USE_RES struct LDKCResult_ChannelIdAPIErrorZ 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 LDKChannelId temporary_channel_id, struct LDKUserConfig override_config);
36978
36979 /**
36980  * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
36981  * more information.
36982  */
36983 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
36984
36985 /**
36986  * Gets the list of usable channels, in random order. Useful as an argument to
36987  * [`Router::find_route`] to ensure non-announced channels are used.
36988  *
36989  * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
36990  * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
36991  * are.
36992  */
36993 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
36994
36995 /**
36996  * Gets the list of channels we have with a given counterparty, in random order.
36997  */
36998 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
36999
37000 /**
37001  * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
37002  * successful path, or have unresolved HTLCs.
37003  *
37004  * This can be useful for payments that may have been prepared, but ultimately not sent, as a
37005  * result of a crash. If such a payment exists, is not listed here, and an
37006  * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
37007  *
37008  * [`Event::PaymentSent`]: events::Event::PaymentSent
37009  */
37010 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
37011
37012 /**
37013  * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
37014  * will be accepted on the given channel, and after additional timeout/the closing of all
37015  * pending HTLCs, the channel will be closed on chain.
37016  *
37017  *  * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
37018  *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
37019  *    fee estimate.
37020  *  * If our counterparty is the channel initiator, we will require a channel closing
37021  *    transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
37022  *    would appear on a force-closure transaction, whichever is lower. We will allow our
37023  *    counterparty to pay as much fee as they'd like, however.
37024  *
37025  * May generate a [`SendShutdown`] message event on success, which should be relayed.
37026  *
37027  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
37028  * generate a shutdown scriptpubkey or destination script set by
37029  * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
37030  * channel.
37031  *
37032  * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
37033  * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
37034  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
37035  * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
37036  */
37037 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
37038
37039 /**
37040  * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
37041  * will be accepted on the given channel, and after additional timeout/the closing of all
37042  * pending HTLCs, the channel will be closed on chain.
37043  *
37044  * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
37045  * the channel being closed or not:
37046  *  * If we are the channel initiator, we will pay at least this feerate on the closing
37047  *    transaction. The upper-bound is set by
37048  *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
37049  *    fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
37050  *  * If our counterparty is the channel initiator, we will refuse to accept a channel closure
37051  *    transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
37052  *    will appear on a force-closure transaction, whichever is lower).
37053  *
37054  * The `shutdown_script` provided  will be used as the `scriptPubKey` for the closing transaction.
37055  * Will fail if a shutdown script has already been set for this channel by
37056  * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
37057  * also be compatible with our and the counterparty's features.
37058  *
37059  * May generate a [`SendShutdown`] message event on success, which should be relayed.
37060  *
37061  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
37062  * generate a shutdown scriptpubkey or destination script set by
37063  * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
37064  * channel.
37065  *
37066  * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
37067  * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
37068  * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
37069  *
37070  * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
37071  */
37072 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script);
37073
37074 /**
37075  * Force closes a channel, immediately broadcasting the latest local transaction(s) and
37076  * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
37077  * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
37078  * channel.
37079  */
37080 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
37081
37082 /**
37083  * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
37084  * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
37085  * `counterparty_node_id` isn't the counterparty of the corresponding channel.
37086  *
37087  * You can always broadcast the latest local transaction(s) via
37088  * [`ChannelMonitor::broadcast_latest_holder_commitment_txn`].
37089  */
37090 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
37091
37092 /**
37093  * Force close all channels, immediately broadcasting the latest local commitment transaction
37094  * for each to the chain and rejecting new HTLCs on each.
37095  */
37096 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
37097
37098 /**
37099  * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
37100  * local transaction(s).
37101  */
37102 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
37103
37104 /**
37105  * Sends a payment along a given route.
37106  *
37107  * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
37108  * fields for more info.
37109  *
37110  * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
37111  * [`PeerManager::process_events`]).
37112  *
37113  * # Avoiding Duplicate Payments
37114  *
37115  * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
37116  * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
37117  * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
37118  * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
37119  * second payment with the same [`PaymentId`].
37120  *
37121  * Thus, in order to ensure duplicate payments are not sent, you should implement your own
37122  * tracking of payments, including state to indicate once a payment has completed. Because you
37123  * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
37124  * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
37125  * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
37126  *
37127  * Additionally, in the scenario where we begin the process of sending a payment, but crash
37128  * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
37129  * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
37130  * [`ChannelManager::list_recent_payments`] for more information.
37131  *
37132  * # Possible Error States on [`PaymentSendFailure`]
37133  *
37134  * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
37135  * each entry matching the corresponding-index entry in the route paths, see
37136  * [`PaymentSendFailure`] for more info.
37137  *
37138  * In general, a path may raise:
37139  *  * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
37140  *    node public key) is specified.
37141  *  * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
37142  *    closed, doesn't exist, or the peer is currently disconnected.
37143  *  * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
37144  *    relevant updates.
37145  *
37146  * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
37147  * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
37148  * different route unless you intend to pay twice!
37149  *
37150  * [`RouteHop`]: crate::routing::router::RouteHop
37151  * [`Event::PaymentSent`]: events::Event::PaymentSent
37152  * [`Event::PaymentFailed`]: events::Event::PaymentFailed
37153  * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
37154  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
37155  * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
37156  */
37157 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);
37158
37159 /**
37160  * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
37161  * `route_params` and retry failed payment paths based on `retry_strategy`.
37162  */
37163 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);
37164
37165 /**
37166  * Signals that no further attempts for the given payment should occur. Useful if you have a
37167  * pending outbound payment with retries remaining, but wish to stop retrying the payment before
37168  * retries are exhausted.
37169  *
37170  * # Event Generation
37171  *
37172  * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
37173  * as there are no remaining pending HTLCs for this payment.
37174  *
37175  * Note that calling this method does *not* prevent a payment from succeeding. You must still
37176  * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
37177  * determine the ultimate status of a payment.
37178  *
37179  * # Requested Invoices
37180  *
37181  * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
37182  * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
37183  * and prevent any attempts at paying it once received. The other events may only be generated
37184  * once the invoice has been received.
37185  *
37186  * # Restart Behavior
37187  *
37188  * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
37189  * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for
37190  * [`Event::InvoiceRequestFailed`].
37191  *
37192  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37193  */
37194 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
37195
37196 /**
37197  * Send a spontaneous payment, which is a payment that does not require the recipient to have
37198  * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
37199  * the preimage, it must be a cryptographically secure random value that no intermediate node
37200  * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
37201  * never reach the recipient.
37202  *
37203  * See [`send_payment`] documentation for more details on the return value of this function
37204  * and idempotency guarantees provided by the [`PaymentId`] key.
37205  *
37206  * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
37207  * [`send_payment`] for more information about the risks of duplicate preimage usage.
37208  *
37209  * [`send_payment`]: Self::send_payment
37210  */
37211 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);
37212
37213 /**
37214  * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
37215  * based on `route_params` and retry failed payment paths based on `retry_strategy`.
37216  *
37217  * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
37218  * payments.
37219  *
37220  * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
37221  */
37222 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);
37223
37224 /**
37225  * Send a payment that is probing the given route for liquidity. We calculate the
37226  * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
37227  * us to easily discern them from real payments.
37228  */
37229 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
37230
37231 /**
37232  * Sends payment probes over all paths of a route that would be used to pay the given
37233  * amount to the given `node_id`.
37234  *
37235  * See [`ChannelManager::send_preflight_probes`] for more information.
37236  */
37237 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);
37238
37239 /**
37240  * Sends payment probes over all paths of a route that would be used to pay a route found
37241  * according to the given [`RouteParameters`].
37242  *
37243  * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
37244  * the actual payment. Note this is only useful if there likely is sufficient time for the
37245  * probe to settle before sending out the actual payment, e.g., when waiting for user
37246  * confirmation in a wallet UI.
37247  *
37248  * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
37249  * actual payment. Users should therefore be cautious and might avoid sending probes if
37250  * liquidity is scarce and/or they don't expect the probe to return before they send the
37251  * payment. To mitigate this issue, channels with available liquidity less than the required
37252  * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
37253  * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
37254  */
37255 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);
37256
37257 /**
37258  * Call this upon creation of a funding transaction for the given channel.
37259  *
37260  * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
37261  * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
37262  *
37263  * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
37264  * across the p2p network.
37265  *
37266  * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
37267  * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
37268  *
37269  * May panic if the output found in the funding transaction is duplicative with some other
37270  * channel (note that this should be trivially prevented by using unique funding transaction
37271  * keys per-channel).
37272  *
37273  * Do NOT broadcast the funding transaction yourself. When we have safely received our
37274  * counterparty's signature the funding transaction will automatically be broadcast via the
37275  * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
37276  *
37277  * Note that this includes RBF or similar transaction replacement strategies - lightning does
37278  * not currently support replacing a funding transaction on an existing channel. Instead,
37279  * create a new channel with a conflicting funding transaction.
37280  *
37281  * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
37282  * the wallet software generating the funding transaction to apply anti-fee sniping as
37283  * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
37284  * for more details.
37285  *
37286  * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
37287  * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
37288  */
37289 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction);
37290
37291 /**
37292  * Call this upon creation of a batch funding transaction for the given channels.
37293  *
37294  * Return values are identical to [`Self::funding_transaction_generated`], respective to
37295  * each individual channel and transaction output.
37296  *
37297  * Do NOT broadcast the funding transaction yourself. This batch funding transaction
37298  * will only be broadcast when we have safely received and persisted the counterparty's
37299  * signature for each channel.
37300  *
37301  * If there is an error, all channels in the batch are to be considered closed.
37302  */
37303 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_batch_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ temporary_channels, struct LDKTransaction funding_transaction);
37304
37305 /**
37306  * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
37307  *
37308  * Once the updates are applied, each eligible channel (advertised with a known short channel
37309  * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
37310  * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
37311  * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
37312  *
37313  * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
37314  * `counterparty_node_id` is provided.
37315  *
37316  * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
37317  * below [`MIN_CLTV_EXPIRY_DELTA`].
37318  *
37319  * If an error is returned, none of the updates should be considered applied.
37320  *
37321  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
37322  * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
37323  * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
37324  * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
37325  * [`ChannelUpdate`]: msgs::ChannelUpdate
37326  * [`ChannelUnavailable`]: APIError::ChannelUnavailable
37327  * [`APIMisuseError`]: APIError::APIMisuseError
37328  */
37329 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_ChannelIdZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update);
37330
37331 /**
37332  * Atomically updates the [`ChannelConfig`] for the given channels.
37333  *
37334  * Once the updates are applied, each eligible channel (advertised with a known short channel
37335  * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
37336  * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
37337  * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
37338  *
37339  * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
37340  * `counterparty_node_id` is provided.
37341  *
37342  * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
37343  * below [`MIN_CLTV_EXPIRY_DELTA`].
37344  *
37345  * If an error is returned, none of the updates should be considered applied.
37346  *
37347  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
37348  * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
37349  * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
37350  * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
37351  * [`ChannelUpdate`]: msgs::ChannelUpdate
37352  * [`ChannelUnavailable`]: APIError::ChannelUnavailable
37353  * [`APIMisuseError`]: APIError::APIMisuseError
37354  */
37355 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ChannelIdZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config);
37356
37357 /**
37358  * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
37359  * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
37360  *
37361  * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
37362  * channel to a receiving node if the node lacks sufficient inbound liquidity.
37363  *
37364  * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
37365  * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
37366  * receiver's invoice route hints. These route hints will signal to LDK to generate an
37367  * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
37368  * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
37369  *
37370  * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
37371  * you from forwarding more than you received. See
37372  * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
37373  * than expected.
37374  *
37375  * Errors if the event was not handled in time, in which case the HTLC was automatically failed
37376  * backwards.
37377  *
37378  * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
37379  * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
37380  * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
37381  */
37382 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const struct LDKChannelId *NONNULL_PTR next_hop_channel_id, struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat);
37383
37384 /**
37385  * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
37386  * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
37387  *
37388  * Errors if the event was not handled in time, in which case the HTLC was automatically failed
37389  * backwards.
37390  *
37391  * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
37392  */
37393 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
37394
37395 /**
37396  * Processes HTLCs which are pending waiting on random forward delay.
37397  *
37398  * Should only really ever be called in response to a PendingHTLCsForwardable event.
37399  * Will likely generate further events.
37400  */
37401 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
37402
37403 /**
37404  * Performs actions which should happen on startup and roughly once per minute thereafter.
37405  *
37406  * This currently includes:
37407  *  * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
37408  *  * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
37409  *    than a minute, informing the network that they should no longer attempt to route over
37410  *    the channel.
37411  *  * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
37412  *    with the current [`ChannelConfig`].
37413  *  * Removing peers which have disconnected but and no longer have any channels.
37414  *  * Force-closing and removing channels which have not completed establishment in a timely manner.
37415  *  * Forgetting about stale outbound payments, either those that have already been fulfilled
37416  *    or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
37417  *    The latter is determined using the system clock in `std` and the highest seen block time
37418  *    minus two hours in `no-std`.
37419  *
37420  * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
37421  * estimate fetches.
37422  *
37423  * [`ChannelUpdate`]: msgs::ChannelUpdate
37424  * [`ChannelConfig`]: crate::util::config::ChannelConfig
37425  */
37426 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
37427
37428 /**
37429  * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
37430  * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
37431  * along the path (including in our own channel on which we received it).
37432  *
37433  * Note that in some cases around unclean shutdown, it is possible the payment may have
37434  * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
37435  * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
37436  * may have already been failed automatically by LDK if it was nearing its expiration time.
37437  *
37438  * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
37439  * [`ChannelManager::claim_funds`]), you should still monitor for
37440  * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
37441  * startup during which time claims that were in-progress at shutdown may be replayed.
37442  */
37443 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
37444
37445 /**
37446  * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
37447  * reason for the failure.
37448  *
37449  * See [`FailureCode`] for valid failure codes.
37450  */
37451 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
37452
37453 /**
37454  * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
37455  * [`MessageSendEvent`]s needed to claim the payment.
37456  *
37457  * This method is guaranteed to ensure the payment has been claimed but only if the current
37458  * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
37459  * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
37460  * successful. It will generally be available in the next [`process_pending_events`] call.
37461  *
37462  * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
37463  * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
37464  * event matches your expectation. If you fail to do so and call this method, you may provide
37465  * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
37466  *
37467  * This function will fail the payment if it has custom TLVs with even type numbers, as we
37468  * will assume they are unknown. If you intend to accept even custom TLVs, you should use
37469  * [`claim_funds_with_known_custom_tlvs`].
37470  *
37471  * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
37472  * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
37473  * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
37474  * [`process_pending_events`]: EventsProvider::process_pending_events
37475  * [`create_inbound_payment`]: Self::create_inbound_payment
37476  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
37477  * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
37478  */
37479 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
37480
37481 /**
37482  * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
37483  * even type numbers.
37484  *
37485  * # Note
37486  *
37487  * You MUST check you've understood all even TLVs before using this to
37488  * claim, otherwise you may unintentionally agree to some protocol you do not understand.
37489  *
37490  * [`claim_funds`]: Self::claim_funds
37491  */
37492 void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
37493
37494 /**
37495  * Gets the node_id held by this ChannelManager
37496  */
37497 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
37498
37499 /**
37500  * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
37501  *
37502  * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
37503  * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
37504  * the channel.
37505  *
37506  * The `user_channel_id` parameter will be provided back in
37507  * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
37508  * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
37509  *
37510  * Note that this method will return an error and reject the channel, if it requires support
37511  * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
37512  * used to accept such channels.
37513  *
37514  * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
37515  * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
37516  */
37517 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
37518
37519 /**
37520  * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
37521  * it as confirmed immediately.
37522  *
37523  * The `user_channel_id` parameter will be provided back in
37524  * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
37525  * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
37526  *
37527  * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
37528  * and (if the counterparty agrees), enables forwarding of payments immediately.
37529  *
37530  * This fully trusts that the counterparty has honestly and correctly constructed the funding
37531  * transaction and blindly assumes that it will eventually confirm.
37532  *
37533  * If it does not confirm before we decide to close the channel, or if the funding transaction
37534  * does not pay to the correct script the correct amount, *you will lose funds*.
37535  *
37536  * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
37537  * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
37538  */
37539 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
37540
37541 /**
37542  * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
37543  * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
37544  * [`Bolt12Invoice`] once it is received.
37545  *
37546  * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
37547  * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
37548  * The optional parameters are used in the builder, if `Some`:
37549  * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
37550  *   [`Offer::expects_quantity`] is `true`.
37551  * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
37552  * - `payer_note` for [`InvoiceRequest::payer_note`].
37553  *
37554  * If `max_total_routing_fee_msat` is not specified, The default from
37555  * [`RouteParameters::from_payment_params_and_value`] is applied.
37556  *
37557  * # Payment
37558  *
37559  * The provided `payment_id` is used to ensure that only one invoice is paid for the request
37560  * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
37561  * been sent.
37562  *
37563  * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
37564  * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
37565  * payment will fail with an [`Event::InvoiceRequestFailed`].
37566  *
37567  * # Privacy
37568  *
37569  * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
37570  * as the introduction node and a derived payer id for payer privacy. As such, currently, the
37571  * node must be announced. Otherwise, there is no way to find a path to the introduction node
37572  * in order to send the [`Bolt12Invoice`].
37573  *
37574  * # Limitations
37575  *
37576  * Requires a direct connection to an introduction node in [`Offer::paths`] or to
37577  * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
37578  * [`Bolt12Invoice::payment_paths`].
37579  *
37580  * # Errors
37581  *
37582  * Errors if:
37583  * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
37584  * - the provided parameters are invalid for the offer,
37585  * - the offer is for an unsupported chain, or
37586  * - the parameterized [`Router`] is unable to create a blinded reply path for the invoice
37587  *   request.
37588  *
37589  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
37590  * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
37591  * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
37592  * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
37593  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37594  * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
37595  * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
37596  */
37597 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);
37598
37599 /**
37600  * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
37601  * message.
37602  *
37603  * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
37604  * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding
37605  * [`PaymentPreimage`]. It is returned purely for informational purposes.
37606  *
37607  * # Limitations
37608  *
37609  * Requires a direct connection to an introduction node in [`Refund::paths`] or to
37610  * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
37611  * node meeting the aforementioned criteria, but there's no guarantee that they will be
37612  * received and no retries will be made.
37613  *
37614  * # Errors
37615  *
37616  * Errors if:
37617  * - the refund is for an unsupported chain, or
37618  * - the parameterized [`Router`] is unable to create a blinded payment path or reply path for
37619  *   the invoice.
37620  *
37621  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
37622  */
37623 MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund);
37624
37625 /**
37626  * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
37627  * to pay us.
37628  *
37629  * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
37630  * [`PaymentHash`] and [`PaymentPreimage`] for you.
37631  *
37632  * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`] event, which
37633  * will have the [`PaymentClaimable::purpose`] return `Some` for [`PaymentPurpose::preimage`]. That
37634  * should then be passed directly to [`claim_funds`].
37635  *
37636  * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
37637  *
37638  * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
37639  * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
37640  *
37641  * # Note
37642  *
37643  * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
37644  * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
37645  *
37646  * Errors if `min_value_msat` is greater than total bitcoin supply.
37647  *
37648  * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
37649  * on versions of LDK prior to 0.0.114.
37650  *
37651  * [`claim_funds`]: Self::claim_funds
37652  * [`PaymentClaimable`]: events::Event::PaymentClaimable
37653  * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
37654  * [`PaymentPurpose::preimage`]: events::PaymentPurpose::preimage
37655  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
37656  */
37657 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);
37658
37659 /**
37660  * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
37661  * stored external to LDK.
37662  *
37663  * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
37664  * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
37665  * the `min_value_msat` provided here, if one is provided.
37666  *
37667  * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
37668  * note that LDK will not stop you from registering duplicate payment hashes for inbound
37669  * payments.
37670  *
37671  * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
37672  * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
37673  * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
37674  * sender \"proof-of-payment\" unless they have paid the required amount.
37675  *
37676  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
37677  * in excess of the current time. This should roughly match the expiry time set in the invoice.
37678  * After this many seconds, we will remove the inbound payment, resulting in any attempts to
37679  * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
37680  * invoices when no timeout is set.
37681  *
37682  * Note that we use block header time to time-out pending inbound payments (with some margin
37683  * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
37684  * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
37685  * If you need exact expiry semantics, you should enforce them upon receipt of
37686  * [`PaymentClaimable`].
37687  *
37688  * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
37689  * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
37690  *
37691  * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
37692  * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
37693  *
37694  * # Note
37695  *
37696  * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
37697  * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
37698  *
37699  * Errors if `min_value_msat` is greater than total bitcoin supply.
37700  *
37701  * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
37702  * on versions of LDK prior to 0.0.114.
37703  *
37704  * [`create_inbound_payment`]: Self::create_inbound_payment
37705  * [`PaymentClaimable`]: events::Event::PaymentClaimable
37706  */
37707 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);
37708
37709 /**
37710  * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
37711  * previously returned from [`create_inbound_payment`].
37712  *
37713  * [`create_inbound_payment`]: Self::create_inbound_payment
37714  */
37715 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);
37716
37717 /**
37718  * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
37719  * are used when constructing the phantom invoice's route hints.
37720  *
37721  * [phantom node payments]: crate::sign::PhantomKeysManager
37722  */
37723 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
37724
37725 /**
37726  * Gets route hints for use in receiving [phantom node payments].
37727  *
37728  * [phantom node payments]: crate::sign::PhantomKeysManager
37729  */
37730 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
37731
37732 /**
37733  * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
37734  * used when constructing the route hints for HTLCs intended to be intercepted. See
37735  * [`ChannelManager::forward_intercepted_htlc`].
37736  *
37737  * Note that this method is not guaranteed to return unique values, you may need to call it a few
37738  * times to get a unique scid.
37739  */
37740 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
37741
37742 /**
37743  * Gets inflight HTLC information by processing pending outbound payments that are in
37744  * our channels. May be used during pathfinding to account for in-use channel liquidity.
37745  */
37746 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
37747
37748 /**
37749  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
37750  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
37751  */
37752 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
37753
37754 /**
37755  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
37756  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
37757  */
37758 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
37759
37760 /**
37761  * Constructs a new Listen which calls the relevant methods on this_arg.
37762  * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
37763  */
37764 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
37765
37766 /**
37767  * Constructs a new Confirm which calls the relevant methods on this_arg.
37768  * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
37769  */
37770 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
37771
37772 /**
37773  * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
37774  * may have events that need processing.
37775  *
37776  * In order to check if this [`ChannelManager`] needs persisting, call
37777  * [`Self::get_and_clear_needs_persistence`].
37778  *
37779  * Note that callbacks registered on the [`Future`] MUST NOT call back into this
37780  * [`ChannelManager`] and should instead register actions to be taken later.
37781  */
37782 MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
37783
37784 /**
37785  * Returns true if this [`ChannelManager`] needs to be persisted.
37786  *
37787  * See [`Self::get_event_or_persistence_needed_future`] for retrieving a [`Future`] that
37788  * indicates this should be checked.
37789  */
37790 MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
37791
37792 /**
37793  * Gets the latest best block which was connected either via the [`chain::Listen`] or
37794  * [`chain::Confirm`] interfaces.
37795  */
37796 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
37797
37798 /**
37799  * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
37800  * [`ChannelManager`].
37801  */
37802 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37803
37804 /**
37805  * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
37806  * [`ChannelManager`].
37807  */
37808 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37809
37810 /**
37811  * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
37812  * [`ChannelManager`].
37813  */
37814 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37815
37816 /**
37817  * Fetches the set of [`InitFeatures`] flags that are provided by or required by
37818  * [`ChannelManager`].
37819  */
37820 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
37821
37822 /**
37823  * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
37824  * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
37825  */
37826 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
37827
37828 /**
37829  * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
37830  * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
37831  */
37832 struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
37833
37834 /**
37835  * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
37836  * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
37837  */
37838 struct LDKNodeIdLookUp ChannelManager_as_NodeIdLookUp(const struct LDKChannelManager *NONNULL_PTR this_arg);
37839
37840 /**
37841  * Fetches the set of [`InitFeatures`] flags that are provided by or required by
37842  * [`ChannelManager`].
37843  */
37844 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
37845
37846 /**
37847  * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
37848  */
37849 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
37850
37851 /**
37852  * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
37853  */
37854 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
37855
37856 /**
37857  * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
37858  */
37859 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
37860
37861 /**
37862  * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
37863  */
37864 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
37865
37866 /**
37867  * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
37868  */
37869 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
37870
37871 /**
37872  * Read a ChannelDetails from a byte array, created by ChannelDetails_write
37873  */
37874 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
37875
37876 /**
37877  * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
37878  */
37879 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
37880
37881 /**
37882  * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
37883  */
37884 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
37885
37886 /**
37887  * Serialize the BlindedForward object into a byte array which can be read by BlindedForward_read
37888  */
37889 struct LDKCVec_u8Z BlindedForward_write(const struct LDKBlindedForward *NONNULL_PTR obj);
37890
37891 /**
37892  * Read a BlindedForward from a byte array, created by BlindedForward_write
37893  */
37894 struct LDKCResult_BlindedForwardDecodeErrorZ BlindedForward_read(struct LDKu8slice ser);
37895
37896 /**
37897  * Serialize the PendingHTLCRouting object into a byte array which can be read by PendingHTLCRouting_read
37898  */
37899 struct LDKCVec_u8Z PendingHTLCRouting_write(const struct LDKPendingHTLCRouting *NONNULL_PTR obj);
37900
37901 /**
37902  * Read a PendingHTLCRouting from a byte array, created by PendingHTLCRouting_write
37903  */
37904 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ PendingHTLCRouting_read(struct LDKu8slice ser);
37905
37906 /**
37907  * Serialize the PendingHTLCInfo object into a byte array which can be read by PendingHTLCInfo_read
37908  */
37909 struct LDKCVec_u8Z PendingHTLCInfo_write(const struct LDKPendingHTLCInfo *NONNULL_PTR obj);
37910
37911 /**
37912  * Read a PendingHTLCInfo from a byte array, created by PendingHTLCInfo_write
37913  */
37914 struct LDKCResult_PendingHTLCInfoDecodeErrorZ PendingHTLCInfo_read(struct LDKu8slice ser);
37915
37916 /**
37917  * Serialize the BlindedFailure object into a byte array which can be read by BlindedFailure_read
37918  */
37919 struct LDKCVec_u8Z BlindedFailure_write(const enum LDKBlindedFailure *NONNULL_PTR obj);
37920
37921 /**
37922  * Read a BlindedFailure from a byte array, created by BlindedFailure_write
37923  */
37924 struct LDKCResult_BlindedFailureDecodeErrorZ BlindedFailure_read(struct LDKu8slice ser);
37925
37926 /**
37927  * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
37928  */
37929 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
37930
37931 /**
37932  * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
37933  */
37934 struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
37935
37936 /**
37937  * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
37938  */
37939 struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
37940
37941 /**
37942  * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
37943  */
37944 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
37945
37946 /**
37947  * A cryptographically secure source of entropy.
37948  */
37949 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
37950
37951 /**
37952  * A cryptographically secure source of entropy.
37953  */
37954 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
37955
37956 /**
37957  * A signer that is able to perform node-scoped cryptographic operations.
37958  */
37959 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
37960
37961 /**
37962  * A signer that is able to perform node-scoped cryptographic operations.
37963  */
37964 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
37965
37966 /**
37967  * The keys provider which will give us relevant keys. Some keys will be loaded during
37968  * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
37969  * signing data.
37970  */
37971 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
37972
37973 /**
37974  * The keys provider which will give us relevant keys. Some keys will be loaded during
37975  * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
37976  * signing data.
37977  */
37978 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
37979
37980 /**
37981  * The fee_estimator for use in the ChannelManager in the future.
37982  *
37983  * No calls to the FeeEstimator will be made during deserialization.
37984  */
37985 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
37986
37987 /**
37988  * The fee_estimator for use in the ChannelManager in the future.
37989  *
37990  * No calls to the FeeEstimator will be made during deserialization.
37991  */
37992 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
37993
37994 /**
37995  * The chain::Watch for use in the ChannelManager in the future.
37996  *
37997  * No calls to the chain::Watch will be made during deserialization. It is assumed that
37998  * you have deserialized ChannelMonitors separately and will add them to your
37999  * chain::Watch after deserializing this ChannelManager.
38000  */
38001 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38002
38003 /**
38004  * The chain::Watch for use in the ChannelManager in the future.
38005  *
38006  * No calls to the chain::Watch will be made during deserialization. It is assumed that
38007  * you have deserialized ChannelMonitors separately and will add them to your
38008  * chain::Watch after deserializing this ChannelManager.
38009  */
38010 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
38011
38012 /**
38013  * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
38014  * used to broadcast the latest local commitment transactions of channels which must be
38015  * force-closed during deserialization.
38016  */
38017 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38018
38019 /**
38020  * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
38021  * used to broadcast the latest local commitment transactions of channels which must be
38022  * force-closed during deserialization.
38023  */
38024 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
38025
38026 /**
38027  * The router which will be used in the ChannelManager in the future for finding routes
38028  * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
38029  *
38030  * No calls to the router will be made during deserialization.
38031  */
38032 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38033
38034 /**
38035  * The router which will be used in the ChannelManager in the future for finding routes
38036  * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
38037  *
38038  * No calls to the router will be made during deserialization.
38039  */
38040 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
38041
38042 /**
38043  * The Logger for use in the ChannelManager and which may be used to log information during
38044  * deserialization.
38045  */
38046 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38047
38048 /**
38049  * The Logger for use in the ChannelManager and which may be used to log information during
38050  * deserialization.
38051  */
38052 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
38053
38054 /**
38055  * Default settings used for new channels. Any existing channels will continue to use the
38056  * runtime settings which were stored when the ChannelManager was serialized.
38057  */
38058 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
38059
38060 /**
38061  * Default settings used for new channels. Any existing channels will continue to use the
38062  * runtime settings which were stored when the ChannelManager was serialized.
38063  */
38064 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
38065
38066 /**
38067  * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
38068  * HashMap for you. This is primarily useful for C bindings where it is not practical to
38069  * populate a HashMap directly from C.
38070  */
38071 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);
38072
38073 /**
38074  * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
38075  */
38076 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
38077
38078 /**
38079  * Frees any resources used by the DelayedPaymentBasepoint, if is_owned is set and inner is non-NULL.
38080  */
38081 void DelayedPaymentBasepoint_free(struct LDKDelayedPaymentBasepoint this_obj);
38082
38083 struct LDKPublicKey DelayedPaymentBasepoint_get_a(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr);
38084
38085 void DelayedPaymentBasepoint_set_a(struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38086
38087 /**
38088  * Constructs a new DelayedPaymentBasepoint given each field
38089  */
38090 MUST_USE_RES struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_new(struct LDKPublicKey a_arg);
38091
38092 /**
38093  * Checks if two DelayedPaymentBasepoints contain equal inner contents.
38094  * This ignores pointers and is_owned flags and looks at the values in fields.
38095  * Two objects with NULL inner values will be considered "equal" here.
38096  */
38097 bool DelayedPaymentBasepoint_eq(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR a, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR b);
38098
38099 /**
38100  * Creates a copy of the DelayedPaymentBasepoint
38101  */
38102 struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_clone(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR orig);
38103
38104 /**
38105  * Generates a non-cryptographic 64-bit hash of the DelayedPaymentBasepoint.
38106  */
38107 uint64_t DelayedPaymentBasepoint_hash(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR o);
38108
38109 /**
38110  * Get inner Public Key
38111  */
38112 MUST_USE_RES struct LDKPublicKey DelayedPaymentBasepoint_to_public_key(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg);
38113
38114 /**
38115  *Derives the \"tweak\" used in calculate [`DelayedPaymentKey::from_basepoint`].\n\n[`DelayedPaymentKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
38116  */
38117 MUST_USE_RES struct LDKThirtyTwoBytes DelayedPaymentBasepoint_derive_add_tweak(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
38118
38119 /**
38120  * Serialize the DelayedPaymentBasepoint object into a byte array which can be read by DelayedPaymentBasepoint_read
38121  */
38122 struct LDKCVec_u8Z DelayedPaymentBasepoint_write(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR obj);
38123
38124 /**
38125  * Read a DelayedPaymentBasepoint from a byte array, created by DelayedPaymentBasepoint_write
38126  */
38127 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ DelayedPaymentBasepoint_read(struct LDKu8slice ser);
38128
38129 /**
38130  * Frees any resources used by the DelayedPaymentKey, if is_owned is set and inner is non-NULL.
38131  */
38132 void DelayedPaymentKey_free(struct LDKDelayedPaymentKey this_obj);
38133
38134 struct LDKPublicKey DelayedPaymentKey_get_a(const struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr);
38135
38136 void DelayedPaymentKey_set_a(struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38137
38138 /**
38139  * Constructs a new DelayedPaymentKey given each field
38140  */
38141 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_new(struct LDKPublicKey a_arg);
38142
38143 /**
38144  * Checks if two DelayedPaymentKeys contain equal inner contents.
38145  * This ignores pointers and is_owned flags and looks at the values in fields.
38146  * Two objects with NULL inner values will be considered "equal" here.
38147  */
38148 bool DelayedPaymentKey_eq(const struct LDKDelayedPaymentKey *NONNULL_PTR a, const struct LDKDelayedPaymentKey *NONNULL_PTR b);
38149
38150 /**
38151  * Creates a copy of the DelayedPaymentKey
38152  */
38153 struct LDKDelayedPaymentKey DelayedPaymentKey_clone(const struct LDKDelayedPaymentKey *NONNULL_PTR orig);
38154
38155 /**
38156  *Derive a public delayedpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
38157  */
38158 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_basepoint(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38159
38160 /**
38161  *Build a delayedpubkey directly from an already-derived private key
38162  */
38163 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_secret_key(const uint8_t (*sk)[32]);
38164
38165 /**
38166  * Get inner Public Key
38167  */
38168 MUST_USE_RES struct LDKPublicKey DelayedPaymentKey_to_public_key(const struct LDKDelayedPaymentKey *NONNULL_PTR this_arg);
38169
38170 /**
38171  * Serialize the DelayedPaymentKey object into a byte array which can be read by DelayedPaymentKey_read
38172  */
38173 struct LDKCVec_u8Z DelayedPaymentKey_write(const struct LDKDelayedPaymentKey *NONNULL_PTR obj);
38174
38175 /**
38176  * Read a DelayedPaymentKey from a byte array, created by DelayedPaymentKey_write
38177  */
38178 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ DelayedPaymentKey_read(struct LDKu8slice ser);
38179
38180 /**
38181  * Frees any resources used by the HtlcBasepoint, if is_owned is set and inner is non-NULL.
38182  */
38183 void HtlcBasepoint_free(struct LDKHtlcBasepoint this_obj);
38184
38185 struct LDKPublicKey HtlcBasepoint_get_a(const struct LDKHtlcBasepoint *NONNULL_PTR this_ptr);
38186
38187 void HtlcBasepoint_set_a(struct LDKHtlcBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38188
38189 /**
38190  * Constructs a new HtlcBasepoint given each field
38191  */
38192 MUST_USE_RES struct LDKHtlcBasepoint HtlcBasepoint_new(struct LDKPublicKey a_arg);
38193
38194 /**
38195  * Checks if two HtlcBasepoints contain equal inner contents.
38196  * This ignores pointers and is_owned flags and looks at the values in fields.
38197  * Two objects with NULL inner values will be considered "equal" here.
38198  */
38199 bool HtlcBasepoint_eq(const struct LDKHtlcBasepoint *NONNULL_PTR a, const struct LDKHtlcBasepoint *NONNULL_PTR b);
38200
38201 /**
38202  * Creates a copy of the HtlcBasepoint
38203  */
38204 struct LDKHtlcBasepoint HtlcBasepoint_clone(const struct LDKHtlcBasepoint *NONNULL_PTR orig);
38205
38206 /**
38207  * Generates a non-cryptographic 64-bit hash of the HtlcBasepoint.
38208  */
38209 uint64_t HtlcBasepoint_hash(const struct LDKHtlcBasepoint *NONNULL_PTR o);
38210
38211 /**
38212  * Get inner Public Key
38213  */
38214 MUST_USE_RES struct LDKPublicKey HtlcBasepoint_to_public_key(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg);
38215
38216 /**
38217  *Derives the \"tweak\" used in calculate [`HtlcKey::from_basepoint`].\n\n[`HtlcKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
38218  */
38219 MUST_USE_RES struct LDKThirtyTwoBytes HtlcBasepoint_derive_add_tweak(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
38220
38221 /**
38222  * Serialize the HtlcBasepoint object into a byte array which can be read by HtlcBasepoint_read
38223  */
38224 struct LDKCVec_u8Z HtlcBasepoint_write(const struct LDKHtlcBasepoint *NONNULL_PTR obj);
38225
38226 /**
38227  * Read a HtlcBasepoint from a byte array, created by HtlcBasepoint_write
38228  */
38229 struct LDKCResult_HtlcBasepointDecodeErrorZ HtlcBasepoint_read(struct LDKu8slice ser);
38230
38231 /**
38232  * Frees any resources used by the HtlcKey, if is_owned is set and inner is non-NULL.
38233  */
38234 void HtlcKey_free(struct LDKHtlcKey this_obj);
38235
38236 struct LDKPublicKey HtlcKey_get_a(const struct LDKHtlcKey *NONNULL_PTR this_ptr);
38237
38238 void HtlcKey_set_a(struct LDKHtlcKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38239
38240 /**
38241  * Constructs a new HtlcKey given each field
38242  */
38243 MUST_USE_RES struct LDKHtlcKey HtlcKey_new(struct LDKPublicKey a_arg);
38244
38245 /**
38246  * Checks if two HtlcKeys contain equal inner contents.
38247  * This ignores pointers and is_owned flags and looks at the values in fields.
38248  * Two objects with NULL inner values will be considered "equal" here.
38249  */
38250 bool HtlcKey_eq(const struct LDKHtlcKey *NONNULL_PTR a, const struct LDKHtlcKey *NONNULL_PTR b);
38251
38252 /**
38253  * Creates a copy of the HtlcKey
38254  */
38255 struct LDKHtlcKey HtlcKey_clone(const struct LDKHtlcKey *NONNULL_PTR orig);
38256
38257 /**
38258  *Derive a public htlcpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
38259  */
38260 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_basepoint(const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38261
38262 /**
38263  *Build a htlcpubkey directly from an already-derived private key
38264  */
38265 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_secret_key(const uint8_t (*sk)[32]);
38266
38267 /**
38268  * Get inner Public Key
38269  */
38270 MUST_USE_RES struct LDKPublicKey HtlcKey_to_public_key(const struct LDKHtlcKey *NONNULL_PTR this_arg);
38271
38272 /**
38273  * Serialize the HtlcKey object into a byte array which can be read by HtlcKey_read
38274  */
38275 struct LDKCVec_u8Z HtlcKey_write(const struct LDKHtlcKey *NONNULL_PTR obj);
38276
38277 /**
38278  * Read a HtlcKey from a byte array, created by HtlcKey_write
38279  */
38280 struct LDKCResult_HtlcKeyDecodeErrorZ HtlcKey_read(struct LDKu8slice ser);
38281
38282 /**
38283  * Adds a tweak to a public key to derive a new public key.
38284  *
38285  * May panic if `tweak` is not the output of a SHA-256 hash.
38286  */
38287 struct LDKPublicKey add_public_key_tweak(struct LDKPublicKey base_point, const uint8_t (*tweak)[32]);
38288
38289 /**
38290  * Frees any resources used by the RevocationBasepoint, if is_owned is set and inner is non-NULL.
38291  */
38292 void RevocationBasepoint_free(struct LDKRevocationBasepoint this_obj);
38293
38294 struct LDKPublicKey RevocationBasepoint_get_a(const struct LDKRevocationBasepoint *NONNULL_PTR this_ptr);
38295
38296 void RevocationBasepoint_set_a(struct LDKRevocationBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38297
38298 /**
38299  * Constructs a new RevocationBasepoint given each field
38300  */
38301 MUST_USE_RES struct LDKRevocationBasepoint RevocationBasepoint_new(struct LDKPublicKey a_arg);
38302
38303 /**
38304  * Checks if two RevocationBasepoints contain equal inner contents.
38305  * This ignores pointers and is_owned flags and looks at the values in fields.
38306  * Two objects with NULL inner values will be considered "equal" here.
38307  */
38308 bool RevocationBasepoint_eq(const struct LDKRevocationBasepoint *NONNULL_PTR a, const struct LDKRevocationBasepoint *NONNULL_PTR b);
38309
38310 /**
38311  * Creates a copy of the RevocationBasepoint
38312  */
38313 struct LDKRevocationBasepoint RevocationBasepoint_clone(const struct LDKRevocationBasepoint *NONNULL_PTR orig);
38314
38315 /**
38316  * Generates a non-cryptographic 64-bit hash of the RevocationBasepoint.
38317  */
38318 uint64_t RevocationBasepoint_hash(const struct LDKRevocationBasepoint *NONNULL_PTR o);
38319
38320 /**
38321  * Get inner Public Key
38322  */
38323 MUST_USE_RES struct LDKPublicKey RevocationBasepoint_to_public_key(const struct LDKRevocationBasepoint *NONNULL_PTR this_arg);
38324
38325 /**
38326  * Serialize the RevocationBasepoint object into a byte array which can be read by RevocationBasepoint_read
38327  */
38328 struct LDKCVec_u8Z RevocationBasepoint_write(const struct LDKRevocationBasepoint *NONNULL_PTR obj);
38329
38330 /**
38331  * Read a RevocationBasepoint from a byte array, created by RevocationBasepoint_write
38332  */
38333 struct LDKCResult_RevocationBasepointDecodeErrorZ RevocationBasepoint_read(struct LDKu8slice ser);
38334
38335 /**
38336  * Frees any resources used by the RevocationKey, if is_owned is set and inner is non-NULL.
38337  */
38338 void RevocationKey_free(struct LDKRevocationKey this_obj);
38339
38340 struct LDKPublicKey RevocationKey_get_a(const struct LDKRevocationKey *NONNULL_PTR this_ptr);
38341
38342 void RevocationKey_set_a(struct LDKRevocationKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38343
38344 /**
38345  * Constructs a new RevocationKey given each field
38346  */
38347 MUST_USE_RES struct LDKRevocationKey RevocationKey_new(struct LDKPublicKey a_arg);
38348
38349 /**
38350  * Checks if two RevocationKeys contain equal inner contents.
38351  * This ignores pointers and is_owned flags and looks at the values in fields.
38352  * Two objects with NULL inner values will be considered "equal" here.
38353  */
38354 bool RevocationKey_eq(const struct LDKRevocationKey *NONNULL_PTR a, const struct LDKRevocationKey *NONNULL_PTR b);
38355
38356 /**
38357  * Creates a copy of the RevocationKey
38358  */
38359 struct LDKRevocationKey RevocationKey_clone(const struct LDKRevocationKey *NONNULL_PTR orig);
38360
38361 /**
38362  * Generates a non-cryptographic 64-bit hash of the RevocationKey.
38363  */
38364 uint64_t RevocationKey_hash(const struct LDKRevocationKey *NONNULL_PTR o);
38365
38366 /**
38367  * Derives a per-commitment-transaction revocation public key from one party's per-commitment
38368  * point and the other party's [`RevocationBasepoint`]. This is the public equivalent of
38369  * [`chan_utils::derive_private_revocation_key`] - using only public keys to derive a public
38370  * key instead of private keys.
38371  *
38372  * Note that this is infallible iff we trust that at least one of the two input keys are randomly
38373  * generated (ie our own).
38374  *
38375  * [`chan_utils::derive_private_revocation_key`]: crate::ln::chan_utils::derive_private_revocation_key
38376  */
38377 MUST_USE_RES struct LDKRevocationKey RevocationKey_from_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
38378
38379 /**
38380  * Get inner Public Key
38381  */
38382 MUST_USE_RES struct LDKPublicKey RevocationKey_to_public_key(const struct LDKRevocationKey *NONNULL_PTR this_arg);
38383
38384 /**
38385  * Serialize the RevocationKey object into a byte array which can be read by RevocationKey_read
38386  */
38387 struct LDKCVec_u8Z RevocationKey_write(const struct LDKRevocationKey *NONNULL_PTR obj);
38388
38389 /**
38390  * Read a RevocationKey from a byte array, created by RevocationKey_write
38391  */
38392 struct LDKCResult_RevocationKeyDecodeErrorZ RevocationKey_read(struct LDKu8slice ser);
38393
38394 /**
38395  * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
38396  */
38397 void ExpandedKey_free(struct LDKExpandedKey this_obj);
38398
38399 /**
38400  * Create a  new [`ExpandedKey`] for generating an inbound payment hash and secret.
38401  *
38402  * It is recommended to cache this value and not regenerate it for each new inbound payment.
38403  */
38404 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
38405
38406 /**
38407  * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
38408  * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
38409  * a `ChannelManager`.
38410  *
38411  * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
38412  * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
38413  * regenerate it for each new inbound payment.
38414  *
38415  * `current_time` is a Unix timestamp representing the current time.
38416  *
38417  * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
38418  * on versions of LDK prior to 0.0.114.
38419  *
38420  * [phantom node payments]: crate::sign::PhantomKeysManager
38421  * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
38422  */
38423 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);
38424
38425 /**
38426  * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
38427  * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
38428  * without a `ChannelManager`.
38429  *
38430  * See [`create`] for information on the `keys` and `current_time` parameters.
38431  *
38432  * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
38433  * on versions of LDK prior to 0.0.114.
38434  *
38435  * [phantom node payments]: crate::sign::PhantomKeysManager
38436  */
38437 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);
38438
38439 /**
38440  * Frees any resources used by the DecodeError
38441  */
38442 void DecodeError_free(struct LDKDecodeError this_ptr);
38443
38444 /**
38445  * Creates a copy of the DecodeError
38446  */
38447 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
38448
38449 /**
38450  * Utility method to constructs a new UnknownVersion-variant DecodeError
38451  */
38452 struct LDKDecodeError DecodeError_unknown_version(void);
38453
38454 /**
38455  * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
38456  */
38457 struct LDKDecodeError DecodeError_unknown_required_feature(void);
38458
38459 /**
38460  * Utility method to constructs a new InvalidValue-variant DecodeError
38461  */
38462 struct LDKDecodeError DecodeError_invalid_value(void);
38463
38464 /**
38465  * Utility method to constructs a new ShortRead-variant DecodeError
38466  */
38467 struct LDKDecodeError DecodeError_short_read(void);
38468
38469 /**
38470  * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
38471  */
38472 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
38473
38474 /**
38475  * Utility method to constructs a new Io-variant DecodeError
38476  */
38477 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
38478
38479 /**
38480  * Utility method to constructs a new UnsupportedCompression-variant DecodeError
38481  */
38482 struct LDKDecodeError DecodeError_unsupported_compression(void);
38483
38484 /**
38485  * Utility method to constructs a new DangerousValue-variant DecodeError
38486  */
38487 struct LDKDecodeError DecodeError_dangerous_value(void);
38488
38489 /**
38490  * Generates a non-cryptographic 64-bit hash of the DecodeError.
38491  */
38492 uint64_t DecodeError_hash(const struct LDKDecodeError *NONNULL_PTR o);
38493
38494 /**
38495  * Checks if two DecodeErrors contain equal inner contents.
38496  * This ignores pointers and is_owned flags and looks at the values in fields.
38497  */
38498 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
38499
38500 /**
38501  * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
38502  */
38503 void Init_free(struct LDKInit this_obj);
38504
38505 /**
38506  * The relevant features which the sender supports.
38507  */
38508 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
38509
38510 /**
38511  * The relevant features which the sender supports.
38512  */
38513 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
38514
38515 /**
38516  * Indicates chains the sender is interested in.
38517  *
38518  * If there are no common chains, the connection will be closed.
38519  *
38520  * Returns a copy of the field.
38521  */
38522 struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
38523
38524 /**
38525  * Indicates chains the sender is interested in.
38526  *
38527  * If there are no common chains, the connection will be closed.
38528  */
38529 void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
38530
38531 /**
38532  * The receipient's network address.
38533  *
38534  * This adds the option to report a remote IP address back to a connecting peer using the init
38535  * message. A node can decide to use that information to discover a potential update to its
38536  * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
38537  * the new address.
38538  */
38539 struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
38540
38541 /**
38542  * The receipient's network address.
38543  *
38544  * This adds the option to report a remote IP address back to a connecting peer using the init
38545  * message. A node can decide to use that information to discover a potential update to its
38546  * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
38547  * the new address.
38548  */
38549 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
38550
38551 /**
38552  * Constructs a new Init given each field
38553  */
38554 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
38555
38556 /**
38557  * Creates a copy of the Init
38558  */
38559 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
38560
38561 /**
38562  * Generates a non-cryptographic 64-bit hash of the Init.
38563  */
38564 uint64_t Init_hash(const struct LDKInit *NONNULL_PTR o);
38565
38566 /**
38567  * Checks if two Inits contain equal inner contents.
38568  * This ignores pointers and is_owned flags and looks at the values in fields.
38569  * Two objects with NULL inner values will be considered "equal" here.
38570  */
38571 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
38572
38573 /**
38574  * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
38575  */
38576 void ErrorMessage_free(struct LDKErrorMessage this_obj);
38577
38578 /**
38579  * The channel ID involved in the error.
38580  *
38581  * All-0s indicates a general error unrelated to a specific channel, after which all channels
38582  * with the sending peer should be closed.
38583  */
38584 struct LDKChannelId ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
38585
38586 /**
38587  * The channel ID involved in the error.
38588  *
38589  * All-0s indicates a general error unrelated to a specific channel, after which all channels
38590  * with the sending peer should be closed.
38591  */
38592 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
38593
38594 /**
38595  * A possibly human-readable error description.
38596  *
38597  * The string should be sanitized before it is used (e.g., emitted to logs or printed to
38598  * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
38599  * the terminal emulator or the logging subsystem.
38600  */
38601 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
38602
38603 /**
38604  * A possibly human-readable error description.
38605  *
38606  * The string should be sanitized before it is used (e.g., emitted to logs or printed to
38607  * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
38608  * the terminal emulator or the logging subsystem.
38609  */
38610 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
38611
38612 /**
38613  * Constructs a new ErrorMessage given each field
38614  */
38615 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
38616
38617 /**
38618  * Creates a copy of the ErrorMessage
38619  */
38620 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
38621
38622 /**
38623  * Generates a non-cryptographic 64-bit hash of the ErrorMessage.
38624  */
38625 uint64_t ErrorMessage_hash(const struct LDKErrorMessage *NONNULL_PTR o);
38626
38627 /**
38628  * Checks if two ErrorMessages contain equal inner contents.
38629  * This ignores pointers and is_owned flags and looks at the values in fields.
38630  * Two objects with NULL inner values will be considered "equal" here.
38631  */
38632 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
38633
38634 /**
38635  * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
38636  */
38637 void WarningMessage_free(struct LDKWarningMessage this_obj);
38638
38639 /**
38640  * The channel ID involved in the warning.
38641  *
38642  * All-0s indicates a warning unrelated to a specific channel.
38643  */
38644 struct LDKChannelId WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
38645
38646 /**
38647  * The channel ID involved in the warning.
38648  *
38649  * All-0s indicates a warning unrelated to a specific channel.
38650  */
38651 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
38652
38653 /**
38654  * A possibly human-readable warning description.
38655  *
38656  * The string should be sanitized before it is used (e.g. emitted to logs or printed to
38657  * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
38658  * the terminal emulator or the logging subsystem.
38659  */
38660 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
38661
38662 /**
38663  * A possibly human-readable warning description.
38664  *
38665  * The string should be sanitized before it is used (e.g. emitted to logs or printed to
38666  * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
38667  * the terminal emulator or the logging subsystem.
38668  */
38669 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
38670
38671 /**
38672  * Constructs a new WarningMessage given each field
38673  */
38674 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
38675
38676 /**
38677  * Creates a copy of the WarningMessage
38678  */
38679 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
38680
38681 /**
38682  * Generates a non-cryptographic 64-bit hash of the WarningMessage.
38683  */
38684 uint64_t WarningMessage_hash(const struct LDKWarningMessage *NONNULL_PTR o);
38685
38686 /**
38687  * Checks if two WarningMessages contain equal inner contents.
38688  * This ignores pointers and is_owned flags and looks at the values in fields.
38689  * Two objects with NULL inner values will be considered "equal" here.
38690  */
38691 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
38692
38693 /**
38694  * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
38695  */
38696 void Ping_free(struct LDKPing this_obj);
38697
38698 /**
38699  * The desired response length.
38700  */
38701 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
38702
38703 /**
38704  * The desired response length.
38705  */
38706 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
38707
38708 /**
38709  * The ping packet size.
38710  *
38711  * This field is not sent on the wire. byteslen zeros are sent.
38712  */
38713 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
38714
38715 /**
38716  * The ping packet size.
38717  *
38718  * This field is not sent on the wire. byteslen zeros are sent.
38719  */
38720 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
38721
38722 /**
38723  * Constructs a new Ping given each field
38724  */
38725 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
38726
38727 /**
38728  * Creates a copy of the Ping
38729  */
38730 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
38731
38732 /**
38733  * Generates a non-cryptographic 64-bit hash of the Ping.
38734  */
38735 uint64_t Ping_hash(const struct LDKPing *NONNULL_PTR o);
38736
38737 /**
38738  * Checks if two Pings contain equal inner contents.
38739  * This ignores pointers and is_owned flags and looks at the values in fields.
38740  * Two objects with NULL inner values will be considered "equal" here.
38741  */
38742 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
38743
38744 /**
38745  * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
38746  */
38747 void Pong_free(struct LDKPong this_obj);
38748
38749 /**
38750  * The pong packet size.
38751  *
38752  * This field is not sent on the wire. byteslen zeros are sent.
38753  */
38754 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
38755
38756 /**
38757  * The pong packet size.
38758  *
38759  * This field is not sent on the wire. byteslen zeros are sent.
38760  */
38761 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
38762
38763 /**
38764  * Constructs a new Pong given each field
38765  */
38766 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
38767
38768 /**
38769  * Creates a copy of the Pong
38770  */
38771 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
38772
38773 /**
38774  * Generates a non-cryptographic 64-bit hash of the Pong.
38775  */
38776 uint64_t Pong_hash(const struct LDKPong *NONNULL_PTR o);
38777
38778 /**
38779  * Checks if two Pongs contain equal inner contents.
38780  * This ignores pointers and is_owned flags and looks at the values in fields.
38781  * Two objects with NULL inner values will be considered "equal" here.
38782  */
38783 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
38784
38785 /**
38786  * Frees any resources used by the CommonOpenChannelFields, if is_owned is set and inner is non-NULL.
38787  */
38788 void CommonOpenChannelFields_free(struct LDKCommonOpenChannelFields this_obj);
38789
38790 /**
38791  * The genesis hash of the blockchain where the channel is to be opened
38792  */
38793 const uint8_t (*CommonOpenChannelFields_get_chain_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr))[32];
38794
38795 /**
38796  * The genesis hash of the blockchain where the channel is to be opened
38797  */
38798 void CommonOpenChannelFields_set_chain_hash(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38799
38800 /**
38801  * A temporary channel ID
38802  * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
38803  * For V1 channels: a temporary channel ID, until the funding outpoint is announced
38804  */
38805 struct LDKChannelId CommonOpenChannelFields_get_temporary_channel_id(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38806
38807 /**
38808  * A temporary channel ID
38809  * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
38810  * For V1 channels: a temporary channel ID, until the funding outpoint is announced
38811  */
38812 void CommonOpenChannelFields_set_temporary_channel_id(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
38813
38814 /**
38815  * For V1 channels: The channel value
38816  * For V2 channels: Part of the channel value contributed by the channel initiator
38817  */
38818 uint64_t CommonOpenChannelFields_get_funding_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38819
38820 /**
38821  * For V1 channels: The channel value
38822  * For V2 channels: Part of the channel value contributed by the channel initiator
38823  */
38824 void CommonOpenChannelFields_set_funding_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
38825
38826 /**
38827  * The threshold below which outputs on transactions broadcast by the channel initiator will be
38828  * omitted
38829  */
38830 uint64_t CommonOpenChannelFields_get_dust_limit_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38831
38832 /**
38833  * The threshold below which outputs on transactions broadcast by the channel initiator will be
38834  * omitted
38835  */
38836 void CommonOpenChannelFields_set_dust_limit_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
38837
38838 /**
38839  * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
38840  */
38841 uint64_t CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38842
38843 /**
38844  * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
38845  */
38846 void CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
38847
38848 /**
38849  * The minimum HTLC size incoming to channel initiator, in milli-satoshi
38850  */
38851 uint64_t CommonOpenChannelFields_get_htlc_minimum_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38852
38853 /**
38854  * The minimum HTLC size incoming to channel initiator, in milli-satoshi
38855  */
38856 void CommonOpenChannelFields_set_htlc_minimum_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
38857
38858 /**
38859  * The feerate for the commitment transaction set by the channel initiator until updated by
38860  * [`UpdateFee`]
38861  */
38862 uint32_t CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38863
38864 /**
38865  * The feerate for the commitment transaction set by the channel initiator until updated by
38866  * [`UpdateFee`]
38867  */
38868 void CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint32_t val);
38869
38870 /**
38871  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
38872  * broadcast a commitment transaction
38873  */
38874 uint16_t CommonOpenChannelFields_get_to_self_delay(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38875
38876 /**
38877  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
38878  * broadcast a commitment transaction
38879  */
38880 void CommonOpenChannelFields_set_to_self_delay(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
38881
38882 /**
38883  * The maximum number of inbound HTLCs towards channel initiator
38884  */
38885 uint16_t CommonOpenChannelFields_get_max_accepted_htlcs(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38886
38887 /**
38888  * The maximum number of inbound HTLCs towards channel initiator
38889  */
38890 void CommonOpenChannelFields_set_max_accepted_htlcs(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
38891
38892 /**
38893  * The channel initiator's key controlling the funding transaction
38894  */
38895 struct LDKPublicKey CommonOpenChannelFields_get_funding_pubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38896
38897 /**
38898  * The channel initiator's key controlling the funding transaction
38899  */
38900 void CommonOpenChannelFields_set_funding_pubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38901
38902 /**
38903  * Used to derive a revocation key for transactions broadcast by counterparty
38904  */
38905 struct LDKPublicKey CommonOpenChannelFields_get_revocation_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38906
38907 /**
38908  * Used to derive a revocation key for transactions broadcast by counterparty
38909  */
38910 void CommonOpenChannelFields_set_revocation_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38911
38912 /**
38913  * A payment key to channel initiator for transactions broadcast by counterparty
38914  */
38915 struct LDKPublicKey CommonOpenChannelFields_get_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38916
38917 /**
38918  * A payment key to channel initiator for transactions broadcast by counterparty
38919  */
38920 void CommonOpenChannelFields_set_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38921
38922 /**
38923  * Used to derive a payment key to channel initiator for transactions broadcast by channel
38924  * initiator
38925  */
38926 struct LDKPublicKey CommonOpenChannelFields_get_delayed_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38927
38928 /**
38929  * Used to derive a payment key to channel initiator for transactions broadcast by channel
38930  * initiator
38931  */
38932 void CommonOpenChannelFields_set_delayed_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38933
38934 /**
38935  * Used to derive an HTLC payment key to channel initiator
38936  */
38937 struct LDKPublicKey CommonOpenChannelFields_get_htlc_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38938
38939 /**
38940  * Used to derive an HTLC payment key to channel initiator
38941  */
38942 void CommonOpenChannelFields_set_htlc_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38943
38944 /**
38945  * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
38946  */
38947 struct LDKPublicKey CommonOpenChannelFields_get_first_per_commitment_point(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38948
38949 /**
38950  * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
38951  */
38952 void CommonOpenChannelFields_set_first_per_commitment_point(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38953
38954 /**
38955  * The channel flags to be used
38956  */
38957 uint8_t CommonOpenChannelFields_get_channel_flags(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38958
38959 /**
38960  * The channel flags to be used
38961  */
38962 void CommonOpenChannelFields_set_channel_flags(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint8_t val);
38963
38964 /**
38965  * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
38966  * collaboratively close
38967  */
38968 struct LDKCOption_CVec_u8ZZ CommonOpenChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38969
38970 /**
38971  * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
38972  * collaboratively close
38973  */
38974 void CommonOpenChannelFields_set_shutdown_scriptpubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
38975
38976 /**
38977  * The channel type that this channel will represent
38978  *
38979  * If this is `None`, we derive the channel type from the intersection of our
38980  * feature bits with our counterparty's feature bits from the [`Init`] message.
38981  *
38982  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38983  */
38984 struct LDKChannelTypeFeatures CommonOpenChannelFields_get_channel_type(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
38985
38986 /**
38987  * The channel type that this channel will represent
38988  *
38989  * If this is `None`, we derive the channel type from the intersection of our
38990  * feature bits with our counterparty's feature bits from the [`Init`] message.
38991  *
38992  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
38993  */
38994 void CommonOpenChannelFields_set_channel_type(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
38995
38996 /**
38997  * Constructs a new CommonOpenChannelFields given each field
38998  *
38999  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39000  */
39001 MUST_USE_RES struct LDKCommonOpenChannelFields CommonOpenChannelFields_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKChannelId 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 commitment_feerate_sat_per_1000_weight_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, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
39002
39003 /**
39004  * Creates a copy of the CommonOpenChannelFields
39005  */
39006 struct LDKCommonOpenChannelFields CommonOpenChannelFields_clone(const struct LDKCommonOpenChannelFields *NONNULL_PTR orig);
39007
39008 /**
39009  * Generates a non-cryptographic 64-bit hash of the CommonOpenChannelFields.
39010  */
39011 uint64_t CommonOpenChannelFields_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR o);
39012
39013 /**
39014  * Checks if two CommonOpenChannelFieldss contain equal inner contents.
39015  * This ignores pointers and is_owned flags and looks at the values in fields.
39016  * Two objects with NULL inner values will be considered "equal" here.
39017  */
39018 bool CommonOpenChannelFields_eq(const struct LDKCommonOpenChannelFields *NONNULL_PTR a, const struct LDKCommonOpenChannelFields *NONNULL_PTR b);
39019
39020 /**
39021  * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
39022  */
39023 void OpenChannel_free(struct LDKOpenChannel this_obj);
39024
39025 /**
39026  * Common fields of `open_channel(2)`-like messages
39027  */
39028 struct LDKCommonOpenChannelFields OpenChannel_get_common_fields(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
39029
39030 /**
39031  * Common fields of `open_channel(2)`-like messages
39032  */
39033 void OpenChannel_set_common_fields(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
39034
39035 /**
39036  * The amount to push to the counterparty as part of the open, in milli-satoshi
39037  */
39038 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
39039
39040 /**
39041  * The amount to push to the counterparty as part of the open, in milli-satoshi
39042  */
39043 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
39044
39045 /**
39046  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
39047  */
39048 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
39049
39050 /**
39051  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
39052  */
39053 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
39054
39055 /**
39056  * Constructs a new OpenChannel given each field
39057  */
39058 MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKCommonOpenChannelFields common_fields_arg, uint64_t push_msat_arg, uint64_t channel_reserve_satoshis_arg);
39059
39060 /**
39061  * Creates a copy of the OpenChannel
39062  */
39063 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
39064
39065 /**
39066  * Generates a non-cryptographic 64-bit hash of the OpenChannel.
39067  */
39068 uint64_t OpenChannel_hash(const struct LDKOpenChannel *NONNULL_PTR o);
39069
39070 /**
39071  * Checks if two OpenChannels contain equal inner contents.
39072  * This ignores pointers and is_owned flags and looks at the values in fields.
39073  * Two objects with NULL inner values will be considered "equal" here.
39074  */
39075 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
39076
39077 /**
39078  * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
39079  */
39080 void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
39081
39082 /**
39083  * Common fields of `open_channel(2)`-like messages
39084  */
39085 struct LDKCommonOpenChannelFields OpenChannelV2_get_common_fields(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39086
39087 /**
39088  * Common fields of `open_channel(2)`-like messages
39089  */
39090 void OpenChannelV2_set_common_fields(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
39091
39092 /**
39093  * The feerate for the funding transaction set by the channel initiator
39094  */
39095 uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39096
39097 /**
39098  * The feerate for the funding transaction set by the channel initiator
39099  */
39100 void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
39101
39102 /**
39103  * The locktime for the funding transaction
39104  */
39105 uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39106
39107 /**
39108  * The locktime for the funding transaction
39109  */
39110 void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
39111
39112 /**
39113  * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
39114  */
39115 struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39116
39117 /**
39118  * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
39119  */
39120 void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39121
39122 /**
39123  * Optionally, a requirement that only confirmed inputs can be added
39124  */
39125 enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
39126
39127 /**
39128  * Optionally, a requirement that only confirmed inputs can be added
39129  */
39130 void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
39131
39132 /**
39133  * Constructs a new OpenChannelV2 given each field
39134  */
39135 MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKCommonOpenChannelFields common_fields_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t locktime_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
39136
39137 /**
39138  * Creates a copy of the OpenChannelV2
39139  */
39140 struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
39141
39142 /**
39143  * Generates a non-cryptographic 64-bit hash of the OpenChannelV2.
39144  */
39145 uint64_t OpenChannelV2_hash(const struct LDKOpenChannelV2 *NONNULL_PTR o);
39146
39147 /**
39148  * Checks if two OpenChannelV2s contain equal inner contents.
39149  * This ignores pointers and is_owned flags and looks at the values in fields.
39150  * Two objects with NULL inner values will be considered "equal" here.
39151  */
39152 bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
39153
39154 /**
39155  * Frees any resources used by the CommonAcceptChannelFields, if is_owned is set and inner is non-NULL.
39156  */
39157 void CommonAcceptChannelFields_free(struct LDKCommonAcceptChannelFields this_obj);
39158
39159 /**
39160  * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
39161  */
39162 struct LDKChannelId CommonAcceptChannelFields_get_temporary_channel_id(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39163
39164 /**
39165  * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
39166  */
39167 void CommonAcceptChannelFields_set_temporary_channel_id(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
39168
39169 /**
39170  * The threshold below which outputs on transactions broadcast by the channel acceptor will be
39171  * omitted
39172  */
39173 uint64_t CommonAcceptChannelFields_get_dust_limit_satoshis(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39174
39175 /**
39176  * The threshold below which outputs on transactions broadcast by the channel acceptor will be
39177  * omitted
39178  */
39179 void CommonAcceptChannelFields_set_dust_limit_satoshis(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39180
39181 /**
39182  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
39183  */
39184 uint64_t CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39185
39186 /**
39187  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
39188  */
39189 void CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39190
39191 /**
39192  * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
39193  */
39194 uint64_t CommonAcceptChannelFields_get_htlc_minimum_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39195
39196 /**
39197  * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
39198  */
39199 void CommonAcceptChannelFields_set_htlc_minimum_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
39200
39201 /**
39202  * Minimum depth of the funding transaction before the channel is considered open
39203  */
39204 uint32_t CommonAcceptChannelFields_get_minimum_depth(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39205
39206 /**
39207  * Minimum depth of the funding transaction before the channel is considered open
39208  */
39209 void CommonAcceptChannelFields_set_minimum_depth(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint32_t val);
39210
39211 /**
39212  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
39213  * broadcast a commitment transaction
39214  */
39215 uint16_t CommonAcceptChannelFields_get_to_self_delay(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39216
39217 /**
39218  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
39219  * broadcast a commitment transaction
39220  */
39221 void CommonAcceptChannelFields_set_to_self_delay(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
39222
39223 /**
39224  * The maximum number of inbound HTLCs towards channel acceptor
39225  */
39226 uint16_t CommonAcceptChannelFields_get_max_accepted_htlcs(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39227
39228 /**
39229  * The maximum number of inbound HTLCs towards channel acceptor
39230  */
39231 void CommonAcceptChannelFields_set_max_accepted_htlcs(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
39232
39233 /**
39234  * The channel acceptor's key controlling the funding transaction
39235  */
39236 struct LDKPublicKey CommonAcceptChannelFields_get_funding_pubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39237
39238 /**
39239  * The channel acceptor's key controlling the funding transaction
39240  */
39241 void CommonAcceptChannelFields_set_funding_pubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39242
39243 /**
39244  * Used to derive a revocation key for transactions broadcast by counterparty
39245  */
39246 struct LDKPublicKey CommonAcceptChannelFields_get_revocation_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39247
39248 /**
39249  * Used to derive a revocation key for transactions broadcast by counterparty
39250  */
39251 void CommonAcceptChannelFields_set_revocation_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39252
39253 /**
39254  * A payment key to channel acceptor for transactions broadcast by counterparty
39255  */
39256 struct LDKPublicKey CommonAcceptChannelFields_get_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39257
39258 /**
39259  * A payment key to channel acceptor for transactions broadcast by counterparty
39260  */
39261 void CommonAcceptChannelFields_set_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39262
39263 /**
39264  * Used to derive a payment key to channel acceptor for transactions broadcast by channel
39265  * acceptor
39266  */
39267 struct LDKPublicKey CommonAcceptChannelFields_get_delayed_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39268
39269 /**
39270  * Used to derive a payment key to channel acceptor for transactions broadcast by channel
39271  * acceptor
39272  */
39273 void CommonAcceptChannelFields_set_delayed_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39274
39275 /**
39276  * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
39277  */
39278 struct LDKPublicKey CommonAcceptChannelFields_get_htlc_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39279
39280 /**
39281  * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
39282  */
39283 void CommonAcceptChannelFields_set_htlc_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39284
39285 /**
39286  * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
39287  */
39288 struct LDKPublicKey CommonAcceptChannelFields_get_first_per_commitment_point(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39289
39290 /**
39291  * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
39292  */
39293 void CommonAcceptChannelFields_set_first_per_commitment_point(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39294
39295 /**
39296  * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
39297  * collaboratively close
39298  */
39299 struct LDKCOption_CVec_u8ZZ CommonAcceptChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39300
39301 /**
39302  * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
39303  * collaboratively close
39304  */
39305 void CommonAcceptChannelFields_set_shutdown_scriptpubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
39306
39307 /**
39308  * The channel type that this channel will represent. If none is set, we derive the channel
39309  * type from the intersection of our feature bits with our counterparty's feature bits from
39310  * the Init message.
39311  *
39312  * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
39313  * [`CommonOpenChannelFields::channel_type`].
39314  *
39315  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39316  */
39317 struct LDKChannelTypeFeatures CommonAcceptChannelFields_get_channel_type(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
39318
39319 /**
39320  * The channel type that this channel will represent. If none is set, we derive the channel
39321  * type from the intersection of our feature bits with our counterparty's feature bits from
39322  * the Init message.
39323  *
39324  * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
39325  * [`CommonOpenChannelFields::channel_type`].
39326  *
39327  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
39328  */
39329 void CommonAcceptChannelFields_set_channel_type(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
39330
39331 /**
39332  * Constructs a new CommonAcceptChannelFields given each field
39333  *
39334  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39335  */
39336 MUST_USE_RES struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_new(struct LDKChannelId temporary_channel_id_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 LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
39337
39338 /**
39339  * Creates a copy of the CommonAcceptChannelFields
39340  */
39341 struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_clone(const struct LDKCommonAcceptChannelFields *NONNULL_PTR orig);
39342
39343 /**
39344  * Generates a non-cryptographic 64-bit hash of the CommonAcceptChannelFields.
39345  */
39346 uint64_t CommonAcceptChannelFields_hash(const struct LDKCommonAcceptChannelFields *NONNULL_PTR o);
39347
39348 /**
39349  * Checks if two CommonAcceptChannelFieldss contain equal inner contents.
39350  * This ignores pointers and is_owned flags and looks at the values in fields.
39351  * Two objects with NULL inner values will be considered "equal" here.
39352  */
39353 bool CommonAcceptChannelFields_eq(const struct LDKCommonAcceptChannelFields *NONNULL_PTR a, const struct LDKCommonAcceptChannelFields *NONNULL_PTR b);
39354
39355 /**
39356  * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
39357  */
39358 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
39359
39360 /**
39361  * Common fields of `accept_channel(2)`-like messages
39362  */
39363 struct LDKCommonAcceptChannelFields AcceptChannel_get_common_fields(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
39364
39365 /**
39366  * Common fields of `accept_channel(2)`-like messages
39367  */
39368 void AcceptChannel_set_common_fields(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
39369
39370 /**
39371  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
39372  */
39373 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
39374
39375 /**
39376  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
39377  */
39378 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
39379
39380 /**
39381  * Constructs a new AcceptChannel given each field
39382  */
39383 MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t channel_reserve_satoshis_arg);
39384
39385 /**
39386  * Creates a copy of the AcceptChannel
39387  */
39388 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
39389
39390 /**
39391  * Generates a non-cryptographic 64-bit hash of the AcceptChannel.
39392  */
39393 uint64_t AcceptChannel_hash(const struct LDKAcceptChannel *NONNULL_PTR o);
39394
39395 /**
39396  * Checks if two AcceptChannels contain equal inner contents.
39397  * This ignores pointers and is_owned flags and looks at the values in fields.
39398  * Two objects with NULL inner values will be considered "equal" here.
39399  */
39400 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
39401
39402 /**
39403  * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
39404  */
39405 void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
39406
39407 /**
39408  * Common fields of `accept_channel(2)`-like messages
39409  */
39410 struct LDKCommonAcceptChannelFields AcceptChannelV2_get_common_fields(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
39411
39412 /**
39413  * Common fields of `accept_channel(2)`-like messages
39414  */
39415 void AcceptChannelV2_set_common_fields(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
39416
39417 /**
39418  * Part of the channel value contributed by the channel acceptor
39419  */
39420 uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
39421
39422 /**
39423  * Part of the channel value contributed by the channel acceptor
39424  */
39425 void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
39426
39427 /**
39428  * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
39429  */
39430 struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
39431
39432 /**
39433  * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
39434  */
39435 void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39436
39437 /**
39438  * Optionally, a requirement that only confirmed inputs can be added
39439  */
39440 enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
39441
39442 /**
39443  * Optionally, a requirement that only confirmed inputs can be added
39444  */
39445 void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
39446
39447 /**
39448  * Constructs a new AcceptChannelV2 given each field
39449  */
39450 MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t funding_satoshis_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
39451
39452 /**
39453  * Creates a copy of the AcceptChannelV2
39454  */
39455 struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
39456
39457 /**
39458  * Generates a non-cryptographic 64-bit hash of the AcceptChannelV2.
39459  */
39460 uint64_t AcceptChannelV2_hash(const struct LDKAcceptChannelV2 *NONNULL_PTR o);
39461
39462 /**
39463  * Checks if two AcceptChannelV2s contain equal inner contents.
39464  * This ignores pointers and is_owned flags and looks at the values in fields.
39465  * Two objects with NULL inner values will be considered "equal" here.
39466  */
39467 bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
39468
39469 /**
39470  * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
39471  */
39472 void FundingCreated_free(struct LDKFundingCreated this_obj);
39473
39474 /**
39475  * A temporary channel ID, until the funding is established
39476  */
39477 struct LDKChannelId FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
39478
39479 /**
39480  * A temporary channel ID, until the funding is established
39481  */
39482 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKChannelId val);
39483
39484 /**
39485  * The funding transaction ID
39486  */
39487 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
39488
39489 /**
39490  * The funding transaction ID
39491  */
39492 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
39493
39494 /**
39495  * The specific output index funding this channel
39496  */
39497 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
39498
39499 /**
39500  * The specific output index funding this channel
39501  */
39502 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
39503
39504 /**
39505  * The signature of the channel initiator (funder) on the initial commitment transaction
39506  */
39507 struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
39508
39509 /**
39510  * The signature of the channel initiator (funder) on the initial commitment transaction
39511  */
39512 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
39513
39514 /**
39515  * Constructs a new FundingCreated given each field
39516  */
39517 MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKChannelId temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKECDSASignature signature_arg);
39518
39519 /**
39520  * Creates a copy of the FundingCreated
39521  */
39522 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
39523
39524 /**
39525  * Generates a non-cryptographic 64-bit hash of the FundingCreated.
39526  */
39527 uint64_t FundingCreated_hash(const struct LDKFundingCreated *NONNULL_PTR o);
39528
39529 /**
39530  * Checks if two FundingCreateds contain equal inner contents.
39531  * This ignores pointers and is_owned flags and looks at the values in fields.
39532  * Two objects with NULL inner values will be considered "equal" here.
39533  */
39534 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
39535
39536 /**
39537  * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
39538  */
39539 void FundingSigned_free(struct LDKFundingSigned this_obj);
39540
39541 /**
39542  * The channel ID
39543  */
39544 struct LDKChannelId FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
39545
39546 /**
39547  * The channel ID
39548  */
39549 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
39550
39551 /**
39552  * The signature of the channel acceptor (fundee) on the initial commitment transaction
39553  */
39554 struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
39555
39556 /**
39557  * The signature of the channel acceptor (fundee) on the initial commitment transaction
39558  */
39559 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
39560
39561 /**
39562  * Constructs a new FundingSigned given each field
39563  */
39564 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg);
39565
39566 /**
39567  * Creates a copy of the FundingSigned
39568  */
39569 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
39570
39571 /**
39572  * Generates a non-cryptographic 64-bit hash of the FundingSigned.
39573  */
39574 uint64_t FundingSigned_hash(const struct LDKFundingSigned *NONNULL_PTR o);
39575
39576 /**
39577  * Checks if two FundingSigneds contain equal inner contents.
39578  * This ignores pointers and is_owned flags and looks at the values in fields.
39579  * Two objects with NULL inner values will be considered "equal" here.
39580  */
39581 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
39582
39583 /**
39584  * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
39585  */
39586 void ChannelReady_free(struct LDKChannelReady this_obj);
39587
39588 /**
39589  * The channel ID
39590  */
39591 struct LDKChannelId ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr);
39592
39593 /**
39594  * The channel ID
39595  */
39596 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKChannelId val);
39597
39598 /**
39599  * The per-commitment point of the second commitment transaction
39600  */
39601 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
39602
39603 /**
39604  * The per-commitment point of the second commitment transaction
39605  */
39606 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39607
39608 /**
39609  * If set, provides a `short_channel_id` alias for this channel.
39610  *
39611  * The sender will accept payments to be forwarded over this SCID and forward them to this
39612  * messages' recipient.
39613  */
39614 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
39615
39616 /**
39617  * If set, provides a `short_channel_id` alias for this channel.
39618  *
39619  * The sender will accept payments to be forwarded over this SCID and forward them to this
39620  * messages' recipient.
39621  */
39622 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39623
39624 /**
39625  * Constructs a new ChannelReady given each field
39626  */
39627 MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKChannelId channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg);
39628
39629 /**
39630  * Creates a copy of the ChannelReady
39631  */
39632 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
39633
39634 /**
39635  * Generates a non-cryptographic 64-bit hash of the ChannelReady.
39636  */
39637 uint64_t ChannelReady_hash(const struct LDKChannelReady *NONNULL_PTR o);
39638
39639 /**
39640  * Checks if two ChannelReadys contain equal inner contents.
39641  * This ignores pointers and is_owned flags and looks at the values in fields.
39642  * Two objects with NULL inner values will be considered "equal" here.
39643  */
39644 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
39645
39646 /**
39647  * Frees any resources used by the Stfu, if is_owned is set and inner is non-NULL.
39648  */
39649 void Stfu_free(struct LDKStfu this_obj);
39650
39651 /**
39652  * The channel ID where quiescence is intended
39653  */
39654 struct LDKChannelId Stfu_get_channel_id(const struct LDKStfu *NONNULL_PTR this_ptr);
39655
39656 /**
39657  * The channel ID where quiescence is intended
39658  */
39659 void Stfu_set_channel_id(struct LDKStfu *NONNULL_PTR this_ptr, struct LDKChannelId val);
39660
39661 /**
39662  * Initiator flag, 1 if initiating, 0 if replying to an stfu.
39663  */
39664 uint8_t Stfu_get_initiator(const struct LDKStfu *NONNULL_PTR this_ptr);
39665
39666 /**
39667  * Initiator flag, 1 if initiating, 0 if replying to an stfu.
39668  */
39669 void Stfu_set_initiator(struct LDKStfu *NONNULL_PTR this_ptr, uint8_t val);
39670
39671 /**
39672  * Constructs a new Stfu given each field
39673  */
39674 MUST_USE_RES struct LDKStfu Stfu_new(struct LDKChannelId channel_id_arg, uint8_t initiator_arg);
39675
39676 /**
39677  * Creates a copy of the Stfu
39678  */
39679 struct LDKStfu Stfu_clone(const struct LDKStfu *NONNULL_PTR orig);
39680
39681 /**
39682  * Checks if two Stfus contain equal inner contents.
39683  * This ignores pointers and is_owned flags and looks at the values in fields.
39684  * Two objects with NULL inner values will be considered "equal" here.
39685  */
39686 bool Stfu_eq(const struct LDKStfu *NONNULL_PTR a, const struct LDKStfu *NONNULL_PTR b);
39687
39688 /**
39689  * Frees any resources used by the Splice, if is_owned is set and inner is non-NULL.
39690  */
39691 void Splice_free(struct LDKSplice this_obj);
39692
39693 /**
39694  * The channel ID where splicing is intended
39695  */
39696 struct LDKChannelId Splice_get_channel_id(const struct LDKSplice *NONNULL_PTR this_ptr);
39697
39698 /**
39699  * The channel ID where splicing is intended
39700  */
39701 void Splice_set_channel_id(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKChannelId val);
39702
39703 /**
39704  * The genesis hash of the blockchain where the channel is intended to be spliced
39705  */
39706 const uint8_t (*Splice_get_chain_hash(const struct LDKSplice *NONNULL_PTR this_ptr))[32];
39707
39708 /**
39709  * The genesis hash of the blockchain where the channel is intended to be spliced
39710  */
39711 void Splice_set_chain_hash(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
39712
39713 /**
39714  * The intended change in channel capacity: the amount to be added (positive value)
39715  * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
39716  */
39717 int64_t Splice_get_relative_satoshis(const struct LDKSplice *NONNULL_PTR this_ptr);
39718
39719 /**
39720  * The intended change in channel capacity: the amount to be added (positive value)
39721  * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
39722  */
39723 void Splice_set_relative_satoshis(struct LDKSplice *NONNULL_PTR this_ptr, int64_t val);
39724
39725 /**
39726  * The feerate for the new funding transaction, set by the splice initiator
39727  */
39728 uint32_t Splice_get_funding_feerate_perkw(const struct LDKSplice *NONNULL_PTR this_ptr);
39729
39730 /**
39731  * The feerate for the new funding transaction, set by the splice initiator
39732  */
39733 void Splice_set_funding_feerate_perkw(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
39734
39735 /**
39736  * The locktime for the new funding transaction
39737  */
39738 uint32_t Splice_get_locktime(const struct LDKSplice *NONNULL_PTR this_ptr);
39739
39740 /**
39741  * The locktime for the new funding transaction
39742  */
39743 void Splice_set_locktime(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
39744
39745 /**
39746  * The key of the sender (splice initiator) controlling the new funding transaction
39747  */
39748 struct LDKPublicKey Splice_get_funding_pubkey(const struct LDKSplice *NONNULL_PTR this_ptr);
39749
39750 /**
39751  * The key of the sender (splice initiator) controlling the new funding transaction
39752  */
39753 void Splice_set_funding_pubkey(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39754
39755 /**
39756  * Constructs a new Splice given each field
39757  */
39758 MUST_USE_RES struct LDKSplice Splice_new(struct LDKChannelId 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);
39759
39760 /**
39761  * Creates a copy of the Splice
39762  */
39763 struct LDKSplice Splice_clone(const struct LDKSplice *NONNULL_PTR orig);
39764
39765 /**
39766  * Checks if two Splices contain equal inner contents.
39767  * This ignores pointers and is_owned flags and looks at the values in fields.
39768  * Two objects with NULL inner values will be considered "equal" here.
39769  */
39770 bool Splice_eq(const struct LDKSplice *NONNULL_PTR a, const struct LDKSplice *NONNULL_PTR b);
39771
39772 /**
39773  * Frees any resources used by the SpliceAck, if is_owned is set and inner is non-NULL.
39774  */
39775 void SpliceAck_free(struct LDKSpliceAck this_obj);
39776
39777 /**
39778  * The channel ID where splicing is intended
39779  */
39780 struct LDKChannelId SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
39781
39782 /**
39783  * The channel ID where splicing is intended
39784  */
39785 void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKChannelId val);
39786
39787 /**
39788  * The genesis hash of the blockchain where the channel is intended to be spliced
39789  */
39790 const uint8_t (*SpliceAck_get_chain_hash(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32];
39791
39792 /**
39793  * The genesis hash of the blockchain where the channel is intended to be spliced
39794  */
39795 void SpliceAck_set_chain_hash(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
39796
39797 /**
39798  * The intended change in channel capacity: the amount to be added (positive value)
39799  * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
39800  */
39801 int64_t SpliceAck_get_relative_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
39802
39803 /**
39804  * The intended change in channel capacity: the amount to be added (positive value)
39805  * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
39806  */
39807 void SpliceAck_set_relative_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val);
39808
39809 /**
39810  * The key of the sender (splice acceptor) controlling the new funding transaction
39811  */
39812 struct LDKPublicKey SpliceAck_get_funding_pubkey(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
39813
39814 /**
39815  * The key of the sender (splice acceptor) controlling the new funding transaction
39816  */
39817 void SpliceAck_set_funding_pubkey(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39818
39819 /**
39820  * Constructs a new SpliceAck given each field
39821  */
39822 MUST_USE_RES struct LDKSpliceAck SpliceAck_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, struct LDKPublicKey funding_pubkey_arg);
39823
39824 /**
39825  * Creates a copy of the SpliceAck
39826  */
39827 struct LDKSpliceAck SpliceAck_clone(const struct LDKSpliceAck *NONNULL_PTR orig);
39828
39829 /**
39830  * Checks if two SpliceAcks contain equal inner contents.
39831  * This ignores pointers and is_owned flags and looks at the values in fields.
39832  * Two objects with NULL inner values will be considered "equal" here.
39833  */
39834 bool SpliceAck_eq(const struct LDKSpliceAck *NONNULL_PTR a, const struct LDKSpliceAck *NONNULL_PTR b);
39835
39836 /**
39837  * Frees any resources used by the SpliceLocked, if is_owned is set and inner is non-NULL.
39838  */
39839 void SpliceLocked_free(struct LDKSpliceLocked this_obj);
39840
39841 /**
39842  * The channel ID
39843  */
39844 struct LDKChannelId SpliceLocked_get_channel_id(const struct LDKSpliceLocked *NONNULL_PTR this_ptr);
39845
39846 /**
39847  * The channel ID
39848  */
39849 void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKChannelId val);
39850
39851 /**
39852  * Constructs a new SpliceLocked given each field
39853  */
39854 MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKChannelId channel_id_arg);
39855
39856 /**
39857  * Creates a copy of the SpliceLocked
39858  */
39859 struct LDKSpliceLocked SpliceLocked_clone(const struct LDKSpliceLocked *NONNULL_PTR orig);
39860
39861 /**
39862  * Checks if two SpliceLockeds contain equal inner contents.
39863  * This ignores pointers and is_owned flags and looks at the values in fields.
39864  * Two objects with NULL inner values will be considered "equal" here.
39865  */
39866 bool SpliceLocked_eq(const struct LDKSpliceLocked *NONNULL_PTR a, const struct LDKSpliceLocked *NONNULL_PTR b);
39867
39868 /**
39869  * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
39870  */
39871 void TxAddInput_free(struct LDKTxAddInput this_obj);
39872
39873 /**
39874  * The channel ID
39875  */
39876 struct LDKChannelId TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
39877
39878 /**
39879  * The channel ID
39880  */
39881 void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
39882
39883 /**
39884  * A randomly chosen unique identifier for this input, which is even for initiators and odd for
39885  * non-initiators.
39886  */
39887 uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
39888
39889 /**
39890  * A randomly chosen unique identifier for this input, which is even for initiators and odd for
39891  * non-initiators.
39892  */
39893 void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
39894
39895 /**
39896  * Serialized transaction that contains the output this input spends to verify that it is non
39897  * malleable.
39898  */
39899 struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
39900
39901 /**
39902  * Serialized transaction that contains the output this input spends to verify that it is non
39903  * malleable.
39904  */
39905 void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
39906
39907 /**
39908  * The index of the output being spent
39909  */
39910 uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
39911
39912 /**
39913  * The index of the output being spent
39914  */
39915 void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
39916
39917 /**
39918  * The sequence number of this input
39919  */
39920 uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
39921
39922 /**
39923  * The sequence number of this input
39924  */
39925 void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
39926
39927 /**
39928  * Constructs a new TxAddInput given each field
39929  */
39930 MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg);
39931
39932 /**
39933  * Creates a copy of the TxAddInput
39934  */
39935 struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
39936
39937 /**
39938  * Generates a non-cryptographic 64-bit hash of the TxAddInput.
39939  */
39940 uint64_t TxAddInput_hash(const struct LDKTxAddInput *NONNULL_PTR o);
39941
39942 /**
39943  * Checks if two TxAddInputs contain equal inner contents.
39944  * This ignores pointers and is_owned flags and looks at the values in fields.
39945  * Two objects with NULL inner values will be considered "equal" here.
39946  */
39947 bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
39948
39949 /**
39950  * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
39951  */
39952 void TxAddOutput_free(struct LDKTxAddOutput this_obj);
39953
39954 /**
39955  * The channel ID
39956  */
39957 struct LDKChannelId TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
39958
39959 /**
39960  * The channel ID
39961  */
39962 void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
39963
39964 /**
39965  * A randomly chosen unique identifier for this output, which is even for initiators and odd for
39966  * non-initiators.
39967  */
39968 uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
39969
39970 /**
39971  * A randomly chosen unique identifier for this output, which is even for initiators and odd for
39972  * non-initiators.
39973  */
39974 void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
39975
39976 /**
39977  * The satoshi value of the output
39978  */
39979 uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
39980
39981 /**
39982  * The satoshi value of the output
39983  */
39984 void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
39985
39986 /**
39987  * The scriptPubKey for the output
39988  */
39989 struct LDKCVec_u8Z TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
39990
39991 /**
39992  * The scriptPubKey for the output
39993  */
39994 void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
39995
39996 /**
39997  * Constructs a new TxAddOutput given each field
39998  */
39999 MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg);
40000
40001 /**
40002  * Creates a copy of the TxAddOutput
40003  */
40004 struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
40005
40006 /**
40007  * Generates a non-cryptographic 64-bit hash of the TxAddOutput.
40008  */
40009 uint64_t TxAddOutput_hash(const struct LDKTxAddOutput *NONNULL_PTR o);
40010
40011 /**
40012  * Checks if two TxAddOutputs contain equal inner contents.
40013  * This ignores pointers and is_owned flags and looks at the values in fields.
40014  * Two objects with NULL inner values will be considered "equal" here.
40015  */
40016 bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
40017
40018 /**
40019  * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
40020  */
40021 void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
40022
40023 /**
40024  * The channel ID
40025  */
40026 struct LDKChannelId TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
40027
40028 /**
40029  * The channel ID
40030  */
40031 void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
40032
40033 /**
40034  * The serial ID of the input to be removed
40035  */
40036 uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
40037
40038 /**
40039  * The serial ID of the input to be removed
40040  */
40041 void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
40042
40043 /**
40044  * Constructs a new TxRemoveInput given each field
40045  */
40046 MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
40047
40048 /**
40049  * Creates a copy of the TxRemoveInput
40050  */
40051 struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
40052
40053 /**
40054  * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
40055  */
40056 uint64_t TxRemoveInput_hash(const struct LDKTxRemoveInput *NONNULL_PTR o);
40057
40058 /**
40059  * Checks if two TxRemoveInputs contain equal inner contents.
40060  * This ignores pointers and is_owned flags and looks at the values in fields.
40061  * Two objects with NULL inner values will be considered "equal" here.
40062  */
40063 bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
40064
40065 /**
40066  * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
40067  */
40068 void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
40069
40070 /**
40071  * The channel ID
40072  */
40073 struct LDKChannelId TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
40074
40075 /**
40076  * The channel ID
40077  */
40078 void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
40079
40080 /**
40081  * The serial ID of the output to be removed
40082  */
40083 uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
40084
40085 /**
40086  * The serial ID of the output to be removed
40087  */
40088 void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
40089
40090 /**
40091  * Constructs a new TxRemoveOutput given each field
40092  */
40093 MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
40094
40095 /**
40096  * Creates a copy of the TxRemoveOutput
40097  */
40098 struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
40099
40100 /**
40101  * Generates a non-cryptographic 64-bit hash of the TxRemoveOutput.
40102  */
40103 uint64_t TxRemoveOutput_hash(const struct LDKTxRemoveOutput *NONNULL_PTR o);
40104
40105 /**
40106  * Checks if two TxRemoveOutputs contain equal inner contents.
40107  * This ignores pointers and is_owned flags and looks at the values in fields.
40108  * Two objects with NULL inner values will be considered "equal" here.
40109  */
40110 bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
40111
40112 /**
40113  * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
40114  */
40115 void TxComplete_free(struct LDKTxComplete this_obj);
40116
40117 /**
40118  * The channel ID
40119  */
40120 struct LDKChannelId TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr);
40121
40122 /**
40123  * The channel ID
40124  */
40125 void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKChannelId val);
40126
40127 /**
40128  * Constructs a new TxComplete given each field
40129  */
40130 MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKChannelId channel_id_arg);
40131
40132 /**
40133  * Creates a copy of the TxComplete
40134  */
40135 struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
40136
40137 /**
40138  * Generates a non-cryptographic 64-bit hash of the TxComplete.
40139  */
40140 uint64_t TxComplete_hash(const struct LDKTxComplete *NONNULL_PTR o);
40141
40142 /**
40143  * Checks if two TxCompletes contain equal inner contents.
40144  * This ignores pointers and is_owned flags and looks at the values in fields.
40145  * Two objects with NULL inner values will be considered "equal" here.
40146  */
40147 bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
40148
40149 /**
40150  * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
40151  */
40152 void TxSignatures_free(struct LDKTxSignatures this_obj);
40153
40154 /**
40155  * The channel ID
40156  */
40157 struct LDKChannelId TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
40158
40159 /**
40160  * The channel ID
40161  */
40162 void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
40163
40164 /**
40165  * The TXID
40166  */
40167 const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
40168
40169 /**
40170  * The TXID
40171  */
40172 void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40173
40174 /**
40175  * The list of witnesses
40176  *
40177  * Returns a copy of the field.
40178  */
40179 struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
40180
40181 /**
40182  * The list of witnesses
40183  */
40184 void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
40185
40186 /**
40187  * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
40188  */
40189 struct LDKCOption_ECDSASignatureZ TxSignatures_get_funding_outpoint_sig(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
40190
40191 /**
40192  * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
40193  */
40194 void TxSignatures_set_funding_outpoint_sig(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCOption_ECDSASignatureZ val);
40195
40196 /**
40197  * Constructs a new TxSignatures given each field
40198  */
40199 MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg, struct LDKCOption_ECDSASignatureZ funding_outpoint_sig_arg);
40200
40201 /**
40202  * Creates a copy of the TxSignatures
40203  */
40204 struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
40205
40206 /**
40207  * Generates a non-cryptographic 64-bit hash of the TxSignatures.
40208  */
40209 uint64_t TxSignatures_hash(const struct LDKTxSignatures *NONNULL_PTR o);
40210
40211 /**
40212  * Checks if two TxSignaturess contain equal inner contents.
40213  * This ignores pointers and is_owned flags and looks at the values in fields.
40214  * Two objects with NULL inner values will be considered "equal" here.
40215  */
40216 bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
40217
40218 /**
40219  * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
40220  */
40221 void TxInitRbf_free(struct LDKTxInitRbf this_obj);
40222
40223 /**
40224  * The channel ID
40225  */
40226 struct LDKChannelId TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
40227
40228 /**
40229  * The channel ID
40230  */
40231 void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
40232
40233 /**
40234  * The locktime of the transaction
40235  */
40236 uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
40237
40238 /**
40239  * The locktime of the transaction
40240  */
40241 void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
40242
40243 /**
40244  * The feerate of the transaction
40245  */
40246 uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
40247
40248 /**
40249  * The feerate of the transaction
40250  */
40251 void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
40252
40253 /**
40254  * The number of satoshis the sender will contribute to or, if negative, remove from
40255  * (e.g. splice-out) the funding output of the transaction
40256  */
40257 struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
40258
40259 /**
40260  * The number of satoshis the sender will contribute to or, if negative, remove from
40261  * (e.g. splice-out) the funding output of the transaction
40262  */
40263 void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
40264
40265 /**
40266  * Constructs a new TxInitRbf given each field
40267  */
40268 MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKChannelId channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
40269
40270 /**
40271  * Creates a copy of the TxInitRbf
40272  */
40273 struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
40274
40275 /**
40276  * Generates a non-cryptographic 64-bit hash of the TxInitRbf.
40277  */
40278 uint64_t TxInitRbf_hash(const struct LDKTxInitRbf *NONNULL_PTR o);
40279
40280 /**
40281  * Checks if two TxInitRbfs contain equal inner contents.
40282  * This ignores pointers and is_owned flags and looks at the values in fields.
40283  * Two objects with NULL inner values will be considered "equal" here.
40284  */
40285 bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
40286
40287 /**
40288  * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
40289  */
40290 void TxAckRbf_free(struct LDKTxAckRbf this_obj);
40291
40292 /**
40293  * The channel ID
40294  */
40295 struct LDKChannelId TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
40296
40297 /**
40298  * The channel ID
40299  */
40300 void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
40301
40302 /**
40303  * The number of satoshis the sender will contribute to or, if negative, remove from
40304  * (e.g. splice-out) the funding output of the transaction
40305  */
40306 struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
40307
40308 /**
40309  * The number of satoshis the sender will contribute to or, if negative, remove from
40310  * (e.g. splice-out) the funding output of the transaction
40311  */
40312 void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
40313
40314 /**
40315  * Constructs a new TxAckRbf given each field
40316  */
40317 MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKChannelId channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
40318
40319 /**
40320  * Creates a copy of the TxAckRbf
40321  */
40322 struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
40323
40324 /**
40325  * Generates a non-cryptographic 64-bit hash of the TxAckRbf.
40326  */
40327 uint64_t TxAckRbf_hash(const struct LDKTxAckRbf *NONNULL_PTR o);
40328
40329 /**
40330  * Checks if two TxAckRbfs contain equal inner contents.
40331  * This ignores pointers and is_owned flags and looks at the values in fields.
40332  * Two objects with NULL inner values will be considered "equal" here.
40333  */
40334 bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
40335
40336 /**
40337  * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
40338  */
40339 void TxAbort_free(struct LDKTxAbort this_obj);
40340
40341 /**
40342  * The channel ID
40343  */
40344 struct LDKChannelId TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr);
40345
40346 /**
40347  * The channel ID
40348  */
40349 void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKChannelId val);
40350
40351 /**
40352  * Message data
40353  *
40354  * Returns a copy of the field.
40355  */
40356 struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
40357
40358 /**
40359  * Message data
40360  */
40361 void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
40362
40363 /**
40364  * Constructs a new TxAbort given each field
40365  */
40366 MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z data_arg);
40367
40368 /**
40369  * Creates a copy of the TxAbort
40370  */
40371 struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
40372
40373 /**
40374  * Generates a non-cryptographic 64-bit hash of the TxAbort.
40375  */
40376 uint64_t TxAbort_hash(const struct LDKTxAbort *NONNULL_PTR o);
40377
40378 /**
40379  * Checks if two TxAborts contain equal inner contents.
40380  * This ignores pointers and is_owned flags and looks at the values in fields.
40381  * Two objects with NULL inner values will be considered "equal" here.
40382  */
40383 bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
40384
40385 /**
40386  * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
40387  */
40388 void Shutdown_free(struct LDKShutdown this_obj);
40389
40390 /**
40391  * The channel ID
40392  */
40393 struct LDKChannelId Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr);
40394
40395 /**
40396  * The channel ID
40397  */
40398 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKChannelId val);
40399
40400 /**
40401  * The destination of this peer's funds on closing.
40402  *
40403  * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
40404  */
40405 struct LDKCVec_u8Z Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
40406
40407 /**
40408  * The destination of this peer's funds on closing.
40409  *
40410  * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
40411  */
40412 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
40413
40414 /**
40415  * Constructs a new Shutdown given each field
40416  */
40417 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
40418
40419 /**
40420  * Creates a copy of the Shutdown
40421  */
40422 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
40423
40424 /**
40425  * Generates a non-cryptographic 64-bit hash of the Shutdown.
40426  */
40427 uint64_t Shutdown_hash(const struct LDKShutdown *NONNULL_PTR o);
40428
40429 /**
40430  * Checks if two Shutdowns contain equal inner contents.
40431  * This ignores pointers and is_owned flags and looks at the values in fields.
40432  * Two objects with NULL inner values will be considered "equal" here.
40433  */
40434 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
40435
40436 /**
40437  * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
40438  */
40439 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
40440
40441 /**
40442  * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
40443  * transaction.
40444  */
40445 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
40446
40447 /**
40448  * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
40449  * transaction.
40450  */
40451 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
40452
40453 /**
40454  * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
40455  * transaction.
40456  */
40457 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
40458
40459 /**
40460  * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
40461  * transaction.
40462  */
40463 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
40464
40465 /**
40466  * Constructs a new ClosingSignedFeeRange given each field
40467  */
40468 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
40469
40470 /**
40471  * Creates a copy of the ClosingSignedFeeRange
40472  */
40473 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
40474
40475 /**
40476  * Generates a non-cryptographic 64-bit hash of the ClosingSignedFeeRange.
40477  */
40478 uint64_t ClosingSignedFeeRange_hash(const struct LDKClosingSignedFeeRange *NONNULL_PTR o);
40479
40480 /**
40481  * Checks if two ClosingSignedFeeRanges contain equal inner contents.
40482  * This ignores pointers and is_owned flags and looks at the values in fields.
40483  * Two objects with NULL inner values will be considered "equal" here.
40484  */
40485 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
40486
40487 /**
40488  * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
40489  */
40490 void ClosingSigned_free(struct LDKClosingSigned this_obj);
40491
40492 /**
40493  * The channel ID
40494  */
40495 struct LDKChannelId ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
40496
40497 /**
40498  * The channel ID
40499  */
40500 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
40501
40502 /**
40503  * The proposed total fee for the closing transaction
40504  */
40505 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
40506
40507 /**
40508  * The proposed total fee for the closing transaction
40509  */
40510 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
40511
40512 /**
40513  * A signature on the closing transaction
40514  */
40515 struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
40516
40517 /**
40518  * A signature on the closing transaction
40519  */
40520 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
40521
40522 /**
40523  * The minimum and maximum fees which the sender is willing to accept, provided only by new
40524  * nodes.
40525  *
40526  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40527  */
40528 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
40529
40530 /**
40531  * The minimum and maximum fees which the sender is willing to accept, provided only by new
40532  * nodes.
40533  *
40534  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40535  */
40536 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
40537
40538 /**
40539  * Constructs a new ClosingSigned given each field
40540  *
40541  * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40542  */
40543 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKChannelId channel_id_arg, uint64_t fee_satoshis_arg, struct LDKECDSASignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
40544
40545 /**
40546  * Creates a copy of the ClosingSigned
40547  */
40548 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
40549
40550 /**
40551  * Generates a non-cryptographic 64-bit hash of the ClosingSigned.
40552  */
40553 uint64_t ClosingSigned_hash(const struct LDKClosingSigned *NONNULL_PTR o);
40554
40555 /**
40556  * Checks if two ClosingSigneds contain equal inner contents.
40557  * This ignores pointers and is_owned flags and looks at the values in fields.
40558  * Two objects with NULL inner values will be considered "equal" here.
40559  */
40560 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
40561
40562 /**
40563  * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
40564  */
40565 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
40566
40567 /**
40568  * The channel ID
40569  */
40570 struct LDKChannelId UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40571
40572 /**
40573  * The channel ID
40574  */
40575 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
40576
40577 /**
40578  * The HTLC ID
40579  */
40580 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40581
40582 /**
40583  * The HTLC ID
40584  */
40585 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
40586
40587 /**
40588  * The HTLC value in milli-satoshi
40589  */
40590 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40591
40592 /**
40593  * The HTLC value in milli-satoshi
40594  */
40595 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
40596
40597 /**
40598  * The payment hash, the pre-image of which controls HTLC redemption
40599  */
40600 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
40601
40602 /**
40603  * The payment hash, the pre-image of which controls HTLC redemption
40604  */
40605 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40606
40607 /**
40608  * The expiry height of the HTLC
40609  */
40610 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40611
40612 /**
40613  * The expiry height of the HTLC
40614  */
40615 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
40616
40617 /**
40618  * The extra fee skimmed by the sender of this message. See
40619  * [`ChannelConfig::accept_underpaying_htlcs`].
40620  *
40621  * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
40622  */
40623 struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40624
40625 /**
40626  * The extra fee skimmed by the sender of this message. See
40627  * [`ChannelConfig::accept_underpaying_htlcs`].
40628  *
40629  * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
40630  */
40631 void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
40632
40633 /**
40634  * The onion routing packet with encrypted data for the next hop.
40635  */
40636 struct LDKOnionPacket UpdateAddHTLC_get_onion_routing_packet(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40637
40638 /**
40639  * The onion routing packet with encrypted data for the next hop.
40640  */
40641 void UpdateAddHTLC_set_onion_routing_packet(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKOnionPacket val);
40642
40643 /**
40644  * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
40645  * routing packet and the recipient-provided encrypted payload within.
40646  *
40647  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40648  */
40649 struct LDKPublicKey UpdateAddHTLC_get_blinding_point(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
40650
40651 /**
40652  * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
40653  * routing packet and the recipient-provided encrypted payload within.
40654  *
40655  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40656  */
40657 void UpdateAddHTLC_set_blinding_point(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40658
40659 /**
40660  * Constructs a new UpdateAddHTLC given each field
40661  *
40662  * Note that blinding_point_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40663  */
40664 MUST_USE_RES struct LDKUpdateAddHTLC UpdateAddHTLC_new(struct LDKChannelId 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);
40665
40666 /**
40667  * Creates a copy of the UpdateAddHTLC
40668  */
40669 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
40670
40671 /**
40672  * Generates a non-cryptographic 64-bit hash of the UpdateAddHTLC.
40673  */
40674 uint64_t UpdateAddHTLC_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR o);
40675
40676 /**
40677  * Checks if two UpdateAddHTLCs contain equal inner contents.
40678  * This ignores pointers and is_owned flags and looks at the values in fields.
40679  * Two objects with NULL inner values will be considered "equal" here.
40680  */
40681 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
40682
40683 /**
40684  * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
40685  */
40686 void OnionMessage_free(struct LDKOnionMessage this_obj);
40687
40688 /**
40689  * Used in decrypting the onion packet's payload.
40690  */
40691 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
40692
40693 /**
40694  * Used in decrypting the onion packet's payload.
40695  */
40696 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40697
40698 /**
40699  * The full onion packet including hop data, pubkey, and hmac
40700  */
40701 struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
40702
40703 /**
40704  * The full onion packet including hop data, pubkey, and hmac
40705  */
40706 void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
40707
40708 /**
40709  * Constructs a new OnionMessage given each field
40710  */
40711 MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
40712
40713 /**
40714  * Creates a copy of the OnionMessage
40715  */
40716 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
40717
40718 /**
40719  * Generates a non-cryptographic 64-bit hash of the OnionMessage.
40720  */
40721 uint64_t OnionMessage_hash(const struct LDKOnionMessage *NONNULL_PTR o);
40722
40723 /**
40724  * Checks if two OnionMessages contain equal inner contents.
40725  * This ignores pointers and is_owned flags and looks at the values in fields.
40726  * Two objects with NULL inner values will be considered "equal" here.
40727  */
40728 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
40729
40730 /**
40731  * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
40732  */
40733 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
40734
40735 /**
40736  * The channel ID
40737  */
40738 struct LDKChannelId UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
40739
40740 /**
40741  * The channel ID
40742  */
40743 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
40744
40745 /**
40746  * The HTLC ID
40747  */
40748 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
40749
40750 /**
40751  * The HTLC ID
40752  */
40753 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
40754
40755 /**
40756  * The pre-image of the payment hash, allowing HTLC redemption
40757  */
40758 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
40759
40760 /**
40761  * The pre-image of the payment hash, allowing HTLC redemption
40762  */
40763 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40764
40765 /**
40766  * Constructs a new UpdateFulfillHTLC given each field
40767  */
40768 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
40769
40770 /**
40771  * Creates a copy of the UpdateFulfillHTLC
40772  */
40773 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
40774
40775 /**
40776  * Generates a non-cryptographic 64-bit hash of the UpdateFulfillHTLC.
40777  */
40778 uint64_t UpdateFulfillHTLC_hash(const struct LDKUpdateFulfillHTLC *NONNULL_PTR o);
40779
40780 /**
40781  * Checks if two UpdateFulfillHTLCs contain equal inner contents.
40782  * This ignores pointers and is_owned flags and looks at the values in fields.
40783  * Two objects with NULL inner values will be considered "equal" here.
40784  */
40785 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
40786
40787 /**
40788  * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
40789  */
40790 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
40791
40792 /**
40793  * The channel ID
40794  */
40795 struct LDKChannelId UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
40796
40797 /**
40798  * The channel ID
40799  */
40800 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
40801
40802 /**
40803  * The HTLC ID
40804  */
40805 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
40806
40807 /**
40808  * The HTLC ID
40809  */
40810 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
40811
40812 /**
40813  * Creates a copy of the UpdateFailHTLC
40814  */
40815 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
40816
40817 /**
40818  * Generates a non-cryptographic 64-bit hash of the UpdateFailHTLC.
40819  */
40820 uint64_t UpdateFailHTLC_hash(const struct LDKUpdateFailHTLC *NONNULL_PTR o);
40821
40822 /**
40823  * Checks if two UpdateFailHTLCs contain equal inner contents.
40824  * This ignores pointers and is_owned flags and looks at the values in fields.
40825  * Two objects with NULL inner values will be considered "equal" here.
40826  */
40827 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
40828
40829 /**
40830  * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
40831  */
40832 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
40833
40834 /**
40835  * The channel ID
40836  */
40837 struct LDKChannelId UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
40838
40839 /**
40840  * The channel ID
40841  */
40842 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
40843
40844 /**
40845  * The HTLC ID
40846  */
40847 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
40848
40849 /**
40850  * The HTLC ID
40851  */
40852 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
40853
40854 /**
40855  * The failure code
40856  */
40857 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
40858
40859 /**
40860  * The failure code
40861  */
40862 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
40863
40864 /**
40865  * Creates a copy of the UpdateFailMalformedHTLC
40866  */
40867 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
40868
40869 /**
40870  * Generates a non-cryptographic 64-bit hash of the UpdateFailMalformedHTLC.
40871  */
40872 uint64_t UpdateFailMalformedHTLC_hash(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR o);
40873
40874 /**
40875  * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
40876  * This ignores pointers and is_owned flags and looks at the values in fields.
40877  * Two objects with NULL inner values will be considered "equal" here.
40878  */
40879 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
40880
40881 /**
40882  * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
40883  */
40884 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
40885
40886 /**
40887  * The channel ID
40888  */
40889 struct LDKChannelId CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
40890
40891 /**
40892  * The channel ID
40893  */
40894 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
40895
40896 /**
40897  * A signature on the commitment transaction
40898  */
40899 struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
40900
40901 /**
40902  * A signature on the commitment transaction
40903  */
40904 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
40905
40906 /**
40907  * Signatures on the HTLC transactions
40908  *
40909  * Returns a copy of the field.
40910  */
40911 struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
40912
40913 /**
40914  * Signatures on the HTLC transactions
40915  */
40916 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
40917
40918 /**
40919  * Constructs a new CommitmentSigned given each field
40920  */
40921 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg);
40922
40923 /**
40924  * Creates a copy of the CommitmentSigned
40925  */
40926 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
40927
40928 /**
40929  * Generates a non-cryptographic 64-bit hash of the CommitmentSigned.
40930  */
40931 uint64_t CommitmentSigned_hash(const struct LDKCommitmentSigned *NONNULL_PTR o);
40932
40933 /**
40934  * Checks if two CommitmentSigneds contain equal inner contents.
40935  * This ignores pointers and is_owned flags and looks at the values in fields.
40936  * Two objects with NULL inner values will be considered "equal" here.
40937  */
40938 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
40939
40940 /**
40941  * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
40942  */
40943 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
40944
40945 /**
40946  * The channel ID
40947  */
40948 struct LDKChannelId RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
40949
40950 /**
40951  * The channel ID
40952  */
40953 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKChannelId val);
40954
40955 /**
40956  * The secret corresponding to the per-commitment point
40957  */
40958 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
40959
40960 /**
40961  * The secret corresponding to the per-commitment point
40962  */
40963 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40964
40965 /**
40966  * The next sender-broadcast commitment transaction's per-commitment point
40967  */
40968 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
40969
40970 /**
40971  * The next sender-broadcast commitment transaction's per-commitment point
40972  */
40973 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
40974
40975 /**
40976  * Constructs a new RevokeAndACK given each field
40977  */
40978 MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg);
40979
40980 /**
40981  * Creates a copy of the RevokeAndACK
40982  */
40983 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
40984
40985 /**
40986  * Generates a non-cryptographic 64-bit hash of the RevokeAndACK.
40987  */
40988 uint64_t RevokeAndACK_hash(const struct LDKRevokeAndACK *NONNULL_PTR o);
40989
40990 /**
40991  * Checks if two RevokeAndACKs contain equal inner contents.
40992  * This ignores pointers and is_owned flags and looks at the values in fields.
40993  * Two objects with NULL inner values will be considered "equal" here.
40994  */
40995 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
40996
40997 /**
40998  * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
40999  */
41000 void UpdateFee_free(struct LDKUpdateFee this_obj);
41001
41002 /**
41003  * The channel ID
41004  */
41005 struct LDKChannelId UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
41006
41007 /**
41008  * The channel ID
41009  */
41010 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKChannelId val);
41011
41012 /**
41013  * Fee rate per 1000-weight of the transaction
41014  */
41015 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
41016
41017 /**
41018  * Fee rate per 1000-weight of the transaction
41019  */
41020 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
41021
41022 /**
41023  * Constructs a new UpdateFee given each field
41024  */
41025 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKChannelId channel_id_arg, uint32_t feerate_per_kw_arg);
41026
41027 /**
41028  * Creates a copy of the UpdateFee
41029  */
41030 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
41031
41032 /**
41033  * Generates a non-cryptographic 64-bit hash of the UpdateFee.
41034  */
41035 uint64_t UpdateFee_hash(const struct LDKUpdateFee *NONNULL_PTR o);
41036
41037 /**
41038  * Checks if two UpdateFees contain equal inner contents.
41039  * This ignores pointers and is_owned flags and looks at the values in fields.
41040  * Two objects with NULL inner values will be considered "equal" here.
41041  */
41042 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
41043
41044 /**
41045  * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
41046  */
41047 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
41048
41049 /**
41050  * The channel ID
41051  */
41052 struct LDKChannelId ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41053
41054 /**
41055  * The channel ID
41056  */
41057 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKChannelId val);
41058
41059 /**
41060  * The next commitment number for the sender
41061  */
41062 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41063
41064 /**
41065  * The next commitment number for the sender
41066  */
41067 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
41068
41069 /**
41070  * The next commitment number for the recipient
41071  */
41072 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41073
41074 /**
41075  * The next commitment number for the recipient
41076  */
41077 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
41078
41079 /**
41080  * Proof that the sender knows the per-commitment secret of a specific commitment transaction
41081  * belonging to the recipient
41082  */
41083 const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
41084
41085 /**
41086  * Proof that the sender knows the per-commitment secret of a specific commitment transaction
41087  * belonging to the recipient
41088  */
41089 void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41090
41091 /**
41092  * The sender's per-commitment point for their current commitment transaction
41093  */
41094 struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41095
41096 /**
41097  * The sender's per-commitment point for their current commitment transaction
41098  */
41099 void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41100
41101 /**
41102  * The next funding transaction ID
41103  */
41104 struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
41105
41106 /**
41107  * The next funding transaction ID
41108  */
41109 void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
41110
41111 /**
41112  * Constructs a new ChannelReestablish given each field
41113  */
41114 MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKChannelId 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);
41115
41116 /**
41117  * Creates a copy of the ChannelReestablish
41118  */
41119 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
41120
41121 /**
41122  * Generates a non-cryptographic 64-bit hash of the ChannelReestablish.
41123  */
41124 uint64_t ChannelReestablish_hash(const struct LDKChannelReestablish *NONNULL_PTR o);
41125
41126 /**
41127  * Checks if two ChannelReestablishs contain equal inner contents.
41128  * This ignores pointers and is_owned flags and looks at the values in fields.
41129  * Two objects with NULL inner values will be considered "equal" here.
41130  */
41131 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
41132
41133 /**
41134  * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
41135  */
41136 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
41137
41138 /**
41139  * The channel ID
41140  */
41141 struct LDKChannelId AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
41142
41143 /**
41144  * The channel ID
41145  */
41146 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
41147
41148 /**
41149  * The short channel ID
41150  */
41151 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
41152
41153 /**
41154  * The short channel ID
41155  */
41156 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
41157
41158 /**
41159  * A signature by the node key
41160  */
41161 struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
41162
41163 /**
41164  * A signature by the node key
41165  */
41166 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41167
41168 /**
41169  * A signature by the funding key
41170  */
41171 struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
41172
41173 /**
41174  * A signature by the funding key
41175  */
41176 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41177
41178 /**
41179  * Constructs a new AnnouncementSignatures given each field
41180  */
41181 MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKChannelId channel_id_arg, uint64_t short_channel_id_arg, struct LDKECDSASignature node_signature_arg, struct LDKECDSASignature bitcoin_signature_arg);
41182
41183 /**
41184  * Creates a copy of the AnnouncementSignatures
41185  */
41186 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
41187
41188 /**
41189  * Generates a non-cryptographic 64-bit hash of the AnnouncementSignatures.
41190  */
41191 uint64_t AnnouncementSignatures_hash(const struct LDKAnnouncementSignatures *NONNULL_PTR o);
41192
41193 /**
41194  * Checks if two AnnouncementSignaturess contain equal inner contents.
41195  * This ignores pointers and is_owned flags and looks at the values in fields.
41196  * Two objects with NULL inner values will be considered "equal" here.
41197  */
41198 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
41199
41200 /**
41201  * Frees any resources used by the SocketAddress
41202  */
41203 void SocketAddress_free(struct LDKSocketAddress this_ptr);
41204
41205 /**
41206  * Creates a copy of the SocketAddress
41207  */
41208 struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
41209
41210 /**
41211  * Utility method to constructs a new TcpIpV4-variant SocketAddress
41212  */
41213 struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
41214
41215 /**
41216  * Utility method to constructs a new TcpIpV6-variant SocketAddress
41217  */
41218 struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
41219
41220 /**
41221  * Utility method to constructs a new OnionV2-variant SocketAddress
41222  */
41223 struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
41224
41225 /**
41226  * Utility method to constructs a new OnionV3-variant SocketAddress
41227  */
41228 struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
41229
41230 /**
41231  * Utility method to constructs a new Hostname-variant SocketAddress
41232  */
41233 struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
41234
41235 /**
41236  * Generates a non-cryptographic 64-bit hash of the SocketAddress.
41237  */
41238 uint64_t SocketAddress_hash(const struct LDKSocketAddress *NONNULL_PTR o);
41239
41240 /**
41241  * Checks if two SocketAddresss contain equal inner contents.
41242  * This ignores pointers and is_owned flags and looks at the values in fields.
41243  */
41244 bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
41245
41246 /**
41247  * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
41248  */
41249 struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
41250
41251 /**
41252  * Read a SocketAddress from a byte array, created by SocketAddress_write
41253  */
41254 struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
41255
41256 /**
41257  * Creates a copy of the SocketAddressParseError
41258  */
41259 enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
41260
41261 /**
41262  * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
41263  */
41264 enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
41265
41266 /**
41267  * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
41268  */
41269 enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
41270
41271 /**
41272  * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
41273  */
41274 enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
41275
41276 /**
41277  * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
41278  */
41279 enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
41280
41281 /**
41282  * Generates a non-cryptographic 64-bit hash of the SocketAddressParseError.
41283  */
41284 uint64_t SocketAddressParseError_hash(const enum LDKSocketAddressParseError *NONNULL_PTR o);
41285
41286 /**
41287  * Checks if two SocketAddressParseErrors contain equal inner contents.
41288  * This ignores pointers and is_owned flags and looks at the values in fields.
41289  */
41290 bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
41291
41292 /**
41293  * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
41294  *
41295  * The host part must end with \".onion\".
41296  */
41297 struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
41298
41299 /**
41300  * Get the string representation of a SocketAddress object
41301  */
41302 struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o);
41303
41304 /**
41305  * Read a SocketAddress object from a string
41306  */
41307 struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
41308
41309 /**
41310  * Frees any resources used by the UnsignedGossipMessage
41311  */
41312 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
41313
41314 /**
41315  * Creates a copy of the UnsignedGossipMessage
41316  */
41317 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
41318
41319 /**
41320  * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
41321  */
41322 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
41323
41324 /**
41325  * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
41326  */
41327 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
41328
41329 /**
41330  * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
41331  */
41332 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
41333
41334 /**
41335  * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
41336  */
41337 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
41338
41339 /**
41340  * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
41341  */
41342 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
41343
41344 /**
41345  * The advertised features
41346  */
41347 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41348
41349 /**
41350  * The advertised features
41351  */
41352 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
41353
41354 /**
41355  * A strictly monotonic announcement counter, with gaps allowed
41356  */
41357 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41358
41359 /**
41360  * A strictly monotonic announcement counter, with gaps allowed
41361  */
41362 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
41363
41364 /**
41365  * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
41366  * to this node).
41367  */
41368 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41369
41370 /**
41371  * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
41372  * to this node).
41373  */
41374 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41375
41376 /**
41377  * An RGB color for UI purposes
41378  */
41379 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
41380
41381 /**
41382  * An RGB color for UI purposes
41383  */
41384 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
41385
41386 /**
41387  * An alias, for UI purposes.
41388  *
41389  * This should be sanitized before use. There is no guarantee of uniqueness.
41390  */
41391 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41392
41393 /**
41394  * An alias, for UI purposes.
41395  *
41396  * This should be sanitized before use. There is no guarantee of uniqueness.
41397  */
41398 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
41399
41400 /**
41401  * List of addresses on which this node is reachable
41402  *
41403  * Returns a copy of the field.
41404  */
41405 struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41406
41407 /**
41408  * List of addresses on which this node is reachable
41409  */
41410 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
41411
41412 /**
41413  * Excess address data which was signed as a part of the message which we do not (yet) understand how
41414  * to decode.
41415  *
41416  * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
41417  *
41418  * Returns a copy of the field.
41419  */
41420 struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_address_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41421
41422 /**
41423  * Excess address data which was signed as a part of the message which we do not (yet) understand how
41424  * to decode.
41425  *
41426  * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
41427  */
41428 void UnsignedNodeAnnouncement_set_excess_address_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41429
41430 /**
41431  * Excess data which was signed as a part of the message which we do not (yet) understand how
41432  * to decode.
41433  *
41434  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41435  *
41436  * Returns a copy of the field.
41437  */
41438 struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
41439
41440 /**
41441  * Excess data which was signed as a part of the message which we do not (yet) understand how
41442  * to decode.
41443  *
41444  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41445  */
41446 void UnsignedNodeAnnouncement_set_excess_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41447
41448 /**
41449  * Constructs a new UnsignedNodeAnnouncement given each field
41450  */
41451 MUST_USE_RES struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_new(struct LDKNodeFeatures features_arg, uint32_t timestamp_arg, struct LDKNodeId node_id_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_SocketAddressZ addresses_arg, struct LDKCVec_u8Z excess_address_data_arg, struct LDKCVec_u8Z excess_data_arg);
41452
41453 /**
41454  * Creates a copy of the UnsignedNodeAnnouncement
41455  */
41456 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
41457
41458 /**
41459  * Generates a non-cryptographic 64-bit hash of the UnsignedNodeAnnouncement.
41460  */
41461 uint64_t UnsignedNodeAnnouncement_hash(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR o);
41462
41463 /**
41464  * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
41465  * This ignores pointers and is_owned flags and looks at the values in fields.
41466  * Two objects with NULL inner values will be considered "equal" here.
41467  */
41468 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
41469
41470 /**
41471  * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
41472  */
41473 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
41474
41475 /**
41476  * The signature by the node key
41477  */
41478 struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
41479
41480 /**
41481  * The signature by the node key
41482  */
41483 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41484
41485 /**
41486  * The actual content of the announcement
41487  */
41488 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
41489
41490 /**
41491  * The actual content of the announcement
41492  */
41493 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
41494
41495 /**
41496  * Constructs a new NodeAnnouncement given each field
41497  */
41498 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
41499
41500 /**
41501  * Creates a copy of the NodeAnnouncement
41502  */
41503 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
41504
41505 /**
41506  * Generates a non-cryptographic 64-bit hash of the NodeAnnouncement.
41507  */
41508 uint64_t NodeAnnouncement_hash(const struct LDKNodeAnnouncement *NONNULL_PTR o);
41509
41510 /**
41511  * Checks if two NodeAnnouncements contain equal inner contents.
41512  * This ignores pointers and is_owned flags and looks at the values in fields.
41513  * Two objects with NULL inner values will be considered "equal" here.
41514  */
41515 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
41516
41517 /**
41518  * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
41519  */
41520 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
41521
41522 /**
41523  * The advertised channel features
41524  */
41525 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41526
41527 /**
41528  * The advertised channel features
41529  */
41530 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
41531
41532 /**
41533  * The genesis hash of the blockchain where the channel is to be opened
41534  */
41535 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
41536
41537 /**
41538  * The genesis hash of the blockchain where the channel is to be opened
41539  */
41540 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41541
41542 /**
41543  * The short channel ID
41544  */
41545 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41546
41547 /**
41548  * The short channel ID
41549  */
41550 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
41551
41552 /**
41553  * One of the two `node_id`s which are endpoints of this channel
41554  */
41555 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41556
41557 /**
41558  * One of the two `node_id`s which are endpoints of this channel
41559  */
41560 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41561
41562 /**
41563  * The other of the two `node_id`s which are endpoints of this channel
41564  */
41565 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41566
41567 /**
41568  * The other of the two `node_id`s which are endpoints of this channel
41569  */
41570 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41571
41572 /**
41573  * The funding key for the first node
41574  */
41575 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41576
41577 /**
41578  * The funding key for the first node
41579  */
41580 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41581
41582 /**
41583  * The funding key for the second node
41584  */
41585 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41586
41587 /**
41588  * The funding key for the second node
41589  */
41590 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
41591
41592 /**
41593  * Excess data which was signed as a part of the message which we do not (yet) understand how
41594  * to decode.
41595  *
41596  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41597  *
41598  * Returns a copy of the field.
41599  */
41600 struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
41601
41602 /**
41603  * Excess data which was signed as a part of the message which we do not (yet) understand how
41604  * to decode.
41605  *
41606  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41607  */
41608 void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41609
41610 /**
41611  * Constructs a new UnsignedChannelAnnouncement given each field
41612  */
41613 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);
41614
41615 /**
41616  * Creates a copy of the UnsignedChannelAnnouncement
41617  */
41618 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
41619
41620 /**
41621  * Generates a non-cryptographic 64-bit hash of the UnsignedChannelAnnouncement.
41622  */
41623 uint64_t UnsignedChannelAnnouncement_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR o);
41624
41625 /**
41626  * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
41627  * This ignores pointers and is_owned flags and looks at the values in fields.
41628  * Two objects with NULL inner values will be considered "equal" here.
41629  */
41630 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
41631
41632 /**
41633  * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
41634  */
41635 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
41636
41637 /**
41638  * Authentication of the announcement by the first public node
41639  */
41640 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41641
41642 /**
41643  * Authentication of the announcement by the first public node
41644  */
41645 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41646
41647 /**
41648  * Authentication of the announcement by the second public node
41649  */
41650 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41651
41652 /**
41653  * Authentication of the announcement by the second public node
41654  */
41655 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41656
41657 /**
41658  * Proof of funding UTXO ownership by the first public node
41659  */
41660 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41661
41662 /**
41663  * Proof of funding UTXO ownership by the first public node
41664  */
41665 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41666
41667 /**
41668  * Proof of funding UTXO ownership by the second public node
41669  */
41670 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41671
41672 /**
41673  * Proof of funding UTXO ownership by the second public node
41674  */
41675 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41676
41677 /**
41678  * The actual announcement
41679  */
41680 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
41681
41682 /**
41683  * The actual announcement
41684  */
41685 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
41686
41687 /**
41688  * Constructs a new ChannelAnnouncement given each field
41689  */
41690 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);
41691
41692 /**
41693  * Creates a copy of the ChannelAnnouncement
41694  */
41695 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
41696
41697 /**
41698  * Generates a non-cryptographic 64-bit hash of the ChannelAnnouncement.
41699  */
41700 uint64_t ChannelAnnouncement_hash(const struct LDKChannelAnnouncement *NONNULL_PTR o);
41701
41702 /**
41703  * Checks if two ChannelAnnouncements contain equal inner contents.
41704  * This ignores pointers and is_owned flags and looks at the values in fields.
41705  * Two objects with NULL inner values will be considered "equal" here.
41706  */
41707 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
41708
41709 /**
41710  * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
41711  */
41712 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
41713
41714 /**
41715  * The genesis hash of the blockchain where the channel is to be opened
41716  */
41717 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
41718
41719 /**
41720  * The genesis hash of the blockchain where the channel is to be opened
41721  */
41722 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41723
41724 /**
41725  * The short channel ID
41726  */
41727 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41728
41729 /**
41730  * The short channel ID
41731  */
41732 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
41733
41734 /**
41735  * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
41736  */
41737 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41738
41739 /**
41740  * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
41741  */
41742 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
41743
41744 /**
41745  * Channel flags
41746  */
41747 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41748
41749 /**
41750  * Channel flags
41751  */
41752 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
41753
41754 /**
41755  * The number of blocks such that if:
41756  * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
41757  * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
41758  * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
41759  * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
41760  * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
41761  * forwarding. Note that the HTLC sender is the one who originally sets this value when
41762  * constructing the route.
41763  */
41764 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41765
41766 /**
41767  * The number of blocks such that if:
41768  * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
41769  * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
41770  * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
41771  * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
41772  * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
41773  * forwarding. Note that the HTLC sender is the one who originally sets this value when
41774  * constructing the route.
41775  */
41776 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
41777
41778 /**
41779  * The minimum HTLC size incoming to sender, in milli-satoshi
41780  */
41781 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41782
41783 /**
41784  * The minimum HTLC size incoming to sender, in milli-satoshi
41785  */
41786 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
41787
41788 /**
41789  * The maximum HTLC value incoming to sender, in milli-satoshi.
41790  *
41791  * This used to be optional.
41792  */
41793 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41794
41795 /**
41796  * The maximum HTLC value incoming to sender, in milli-satoshi.
41797  *
41798  * This used to be optional.
41799  */
41800 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
41801
41802 /**
41803  * The base HTLC fee charged by sender, in milli-satoshi
41804  */
41805 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41806
41807 /**
41808  * The base HTLC fee charged by sender, in milli-satoshi
41809  */
41810 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
41811
41812 /**
41813  * The amount to fee multiplier, in micro-satoshi
41814  */
41815 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41816
41817 /**
41818  * The amount to fee multiplier, in micro-satoshi
41819  */
41820 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
41821
41822 /**
41823  * Excess data which was signed as a part of the message which we do not (yet) understand how
41824  * to decode.
41825  *
41826  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41827  *
41828  * Returns a copy of the field.
41829  */
41830 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
41831
41832 /**
41833  * Excess data which was signed as a part of the message which we do not (yet) understand how
41834  * to decode.
41835  *
41836  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
41837  */
41838 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
41839
41840 /**
41841  * Constructs a new UnsignedChannelUpdate given each field
41842  */
41843 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);
41844
41845 /**
41846  * Creates a copy of the UnsignedChannelUpdate
41847  */
41848 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
41849
41850 /**
41851  * Generates a non-cryptographic 64-bit hash of the UnsignedChannelUpdate.
41852  */
41853 uint64_t UnsignedChannelUpdate_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR o);
41854
41855 /**
41856  * Checks if two UnsignedChannelUpdates contain equal inner contents.
41857  * This ignores pointers and is_owned flags and looks at the values in fields.
41858  * Two objects with NULL inner values will be considered "equal" here.
41859  */
41860 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
41861
41862 /**
41863  * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
41864  */
41865 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
41866
41867 /**
41868  * A signature of the channel update
41869  */
41870 struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
41871
41872 /**
41873  * A signature of the channel update
41874  */
41875 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
41876
41877 /**
41878  * The actual channel update
41879  */
41880 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
41881
41882 /**
41883  * The actual channel update
41884  */
41885 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
41886
41887 /**
41888  * Constructs a new ChannelUpdate given each field
41889  */
41890 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
41891
41892 /**
41893  * Creates a copy of the ChannelUpdate
41894  */
41895 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
41896
41897 /**
41898  * Generates a non-cryptographic 64-bit hash of the ChannelUpdate.
41899  */
41900 uint64_t ChannelUpdate_hash(const struct LDKChannelUpdate *NONNULL_PTR o);
41901
41902 /**
41903  * Checks if two ChannelUpdates contain equal inner contents.
41904  * This ignores pointers and is_owned flags and looks at the values in fields.
41905  * Two objects with NULL inner values will be considered "equal" here.
41906  */
41907 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
41908
41909 /**
41910  * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
41911  */
41912 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
41913
41914 /**
41915  * The genesis hash of the blockchain being queried
41916  */
41917 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
41918
41919 /**
41920  * The genesis hash of the blockchain being queried
41921  */
41922 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41923
41924 /**
41925  * The height of the first block for the channel UTXOs being queried
41926  */
41927 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
41928
41929 /**
41930  * The height of the first block for the channel UTXOs being queried
41931  */
41932 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
41933
41934 /**
41935  * The number of blocks to include in the query results
41936  */
41937 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
41938
41939 /**
41940  * The number of blocks to include in the query results
41941  */
41942 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
41943
41944 /**
41945  * Constructs a new QueryChannelRange given each field
41946  */
41947 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
41948
41949 /**
41950  * Creates a copy of the QueryChannelRange
41951  */
41952 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
41953
41954 /**
41955  * Generates a non-cryptographic 64-bit hash of the QueryChannelRange.
41956  */
41957 uint64_t QueryChannelRange_hash(const struct LDKQueryChannelRange *NONNULL_PTR o);
41958
41959 /**
41960  * Checks if two QueryChannelRanges contain equal inner contents.
41961  * This ignores pointers and is_owned flags and looks at the values in fields.
41962  * Two objects with NULL inner values will be considered "equal" here.
41963  */
41964 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
41965
41966 /**
41967  * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
41968  */
41969 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
41970
41971 /**
41972  * The genesis hash of the blockchain being queried
41973  */
41974 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
41975
41976 /**
41977  * The genesis hash of the blockchain being queried
41978  */
41979 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41980
41981 /**
41982  * The height of the first block in the range of the reply
41983  */
41984 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
41985
41986 /**
41987  * The height of the first block in the range of the reply
41988  */
41989 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
41990
41991 /**
41992  * The number of blocks included in the range of the reply
41993  */
41994 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
41995
41996 /**
41997  * The number of blocks included in the range of the reply
41998  */
41999 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
42000
42001 /**
42002  * True when this is the final reply for a query
42003  */
42004 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
42005
42006 /**
42007  * True when this is the final reply for a query
42008  */
42009 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
42010
42011 /**
42012  * The `short_channel_id`s in the channel range
42013  *
42014  * Returns a copy of the field.
42015  */
42016 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
42017
42018 /**
42019  * The `short_channel_id`s in the channel range
42020  */
42021 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
42022
42023 /**
42024  * Constructs a new ReplyChannelRange given each field
42025  */
42026 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);
42027
42028 /**
42029  * Creates a copy of the ReplyChannelRange
42030  */
42031 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
42032
42033 /**
42034  * Generates a non-cryptographic 64-bit hash of the ReplyChannelRange.
42035  */
42036 uint64_t ReplyChannelRange_hash(const struct LDKReplyChannelRange *NONNULL_PTR o);
42037
42038 /**
42039  * Checks if two ReplyChannelRanges contain equal inner contents.
42040  * This ignores pointers and is_owned flags and looks at the values in fields.
42041  * Two objects with NULL inner values will be considered "equal" here.
42042  */
42043 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
42044
42045 /**
42046  * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
42047  */
42048 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
42049
42050 /**
42051  * The genesis hash of the blockchain being queried
42052  */
42053 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
42054
42055 /**
42056  * The genesis hash of the blockchain being queried
42057  */
42058 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42059
42060 /**
42061  * The short_channel_ids that are being queried
42062  *
42063  * Returns a copy of the field.
42064  */
42065 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
42066
42067 /**
42068  * The short_channel_ids that are being queried
42069  */
42070 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
42071
42072 /**
42073  * Constructs a new QueryShortChannelIds given each field
42074  */
42075 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
42076
42077 /**
42078  * Creates a copy of the QueryShortChannelIds
42079  */
42080 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
42081
42082 /**
42083  * Generates a non-cryptographic 64-bit hash of the QueryShortChannelIds.
42084  */
42085 uint64_t QueryShortChannelIds_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR o);
42086
42087 /**
42088  * Checks if two QueryShortChannelIdss contain equal inner contents.
42089  * This ignores pointers and is_owned flags and looks at the values in fields.
42090  * Two objects with NULL inner values will be considered "equal" here.
42091  */
42092 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
42093
42094 /**
42095  * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
42096  */
42097 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
42098
42099 /**
42100  * The genesis hash of the blockchain that was queried
42101  */
42102 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
42103
42104 /**
42105  * The genesis hash of the blockchain that was queried
42106  */
42107 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42108
42109 /**
42110  * Indicates if the query recipient maintains up-to-date channel
42111  * information for the `chain_hash`
42112  */
42113 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
42114
42115 /**
42116  * Indicates if the query recipient maintains up-to-date channel
42117  * information for the `chain_hash`
42118  */
42119 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
42120
42121 /**
42122  * Constructs a new ReplyShortChannelIdsEnd given each field
42123  */
42124 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
42125
42126 /**
42127  * Creates a copy of the ReplyShortChannelIdsEnd
42128  */
42129 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
42130
42131 /**
42132  * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
42133  */
42134 uint64_t ReplyShortChannelIdsEnd_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR o);
42135
42136 /**
42137  * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
42138  * This ignores pointers and is_owned flags and looks at the values in fields.
42139  * Two objects with NULL inner values will be considered "equal" here.
42140  */
42141 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
42142
42143 /**
42144  * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
42145  */
42146 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
42147
42148 /**
42149  * The genesis hash of the blockchain for channel and node information
42150  */
42151 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
42152
42153 /**
42154  * The genesis hash of the blockchain for channel and node information
42155  */
42156 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42157
42158 /**
42159  * The starting unix timestamp
42160  */
42161 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
42162
42163 /**
42164  * The starting unix timestamp
42165  */
42166 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
42167
42168 /**
42169  * The range of information in seconds
42170  */
42171 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
42172
42173 /**
42174  * The range of information in seconds
42175  */
42176 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
42177
42178 /**
42179  * Constructs a new GossipTimestampFilter given each field
42180  */
42181 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
42182
42183 /**
42184  * Creates a copy of the GossipTimestampFilter
42185  */
42186 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
42187
42188 /**
42189  * Generates a non-cryptographic 64-bit hash of the GossipTimestampFilter.
42190  */
42191 uint64_t GossipTimestampFilter_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR o);
42192
42193 /**
42194  * Checks if two GossipTimestampFilters contain equal inner contents.
42195  * This ignores pointers and is_owned flags and looks at the values in fields.
42196  * Two objects with NULL inner values will be considered "equal" here.
42197  */
42198 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
42199
42200 /**
42201  * Frees any resources used by the ErrorAction
42202  */
42203 void ErrorAction_free(struct LDKErrorAction this_ptr);
42204
42205 /**
42206  * Creates a copy of the ErrorAction
42207  */
42208 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
42209
42210 /**
42211  * Utility method to constructs a new DisconnectPeer-variant ErrorAction
42212  */
42213 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
42214
42215 /**
42216  * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
42217  */
42218 struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
42219
42220 /**
42221  * Utility method to constructs a new IgnoreError-variant ErrorAction
42222  */
42223 struct LDKErrorAction ErrorAction_ignore_error(void);
42224
42225 /**
42226  * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
42227  */
42228 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
42229
42230 /**
42231  * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
42232  */
42233 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
42234
42235 /**
42236  * Utility method to constructs a new SendErrorMessage-variant ErrorAction
42237  */
42238 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
42239
42240 /**
42241  * Utility method to constructs a new SendWarningMessage-variant ErrorAction
42242  */
42243 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
42244
42245 /**
42246  * Generates a non-cryptographic 64-bit hash of the ErrorAction.
42247  */
42248 uint64_t ErrorAction_hash(const struct LDKErrorAction *NONNULL_PTR o);
42249
42250 /**
42251  * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
42252  */
42253 void LightningError_free(struct LDKLightningError this_obj);
42254
42255 /**
42256  * A human-readable message describing the error
42257  */
42258 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
42259
42260 /**
42261  * A human-readable message describing the error
42262  */
42263 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
42264
42265 /**
42266  * The action which should be taken against the offending peer.
42267  */
42268 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
42269
42270 /**
42271  * The action which should be taken against the offending peer.
42272  */
42273 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
42274
42275 /**
42276  * Constructs a new LightningError given each field
42277  */
42278 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
42279
42280 /**
42281  * Creates a copy of the LightningError
42282  */
42283 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
42284
42285 /**
42286  * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
42287  */
42288 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
42289
42290 /**
42291  * `update_add_htlc` messages which should be sent
42292  */
42293 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42294
42295 /**
42296  * `update_add_htlc` messages which should be sent
42297  */
42298 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
42299
42300 /**
42301  * `update_fulfill_htlc` messages which should be sent
42302  */
42303 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42304
42305 /**
42306  * `update_fulfill_htlc` messages which should be sent
42307  */
42308 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
42309
42310 /**
42311  * `update_fail_htlc` messages which should be sent
42312  */
42313 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42314
42315 /**
42316  * `update_fail_htlc` messages which should be sent
42317  */
42318 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
42319
42320 /**
42321  * `update_fail_malformed_htlc` messages which should be sent
42322  */
42323 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42324
42325 /**
42326  * `update_fail_malformed_htlc` messages which should be sent
42327  */
42328 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
42329
42330 /**
42331  * An `update_fee` message which should be sent
42332  *
42333  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42334  */
42335 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42336
42337 /**
42338  * An `update_fee` message which should be sent
42339  *
42340  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
42341  */
42342 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
42343
42344 /**
42345  * A `commitment_signed` message which should be sent
42346  */
42347 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
42348
42349 /**
42350  * A `commitment_signed` message which should be sent
42351  */
42352 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
42353
42354 /**
42355  * Constructs a new CommitmentUpdate given each field
42356  *
42357  * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
42358  */
42359 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);
42360
42361 /**
42362  * Creates a copy of the CommitmentUpdate
42363  */
42364 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
42365
42366 /**
42367  * Generates a non-cryptographic 64-bit hash of the CommitmentUpdate.
42368  */
42369 uint64_t CommitmentUpdate_hash(const struct LDKCommitmentUpdate *NONNULL_PTR o);
42370
42371 /**
42372  * Checks if two CommitmentUpdates contain equal inner contents.
42373  * This ignores pointers and is_owned flags and looks at the values in fields.
42374  * Two objects with NULL inner values will be considered "equal" here.
42375  */
42376 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
42377
42378 /**
42379  * Calls the free function if one is set
42380  */
42381 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
42382
42383 /**
42384  * Calls the free function if one is set
42385  */
42386 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
42387
42388 /**
42389  * Calls the free function if one is set
42390  */
42391 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
42392
42393 /**
42394  * Frees any resources used by the FinalOnionHopData, if is_owned is set and inner is non-NULL.
42395  */
42396 void FinalOnionHopData_free(struct LDKFinalOnionHopData this_obj);
42397
42398 /**
42399  * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
42400  * Because it is generated by the recipient and included in the invoice, it also provides
42401  * proof to the recipient that the payment was sent by someone with the generated invoice.
42402  */
42403 const uint8_t (*FinalOnionHopData_get_payment_secret(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr))[32];
42404
42405 /**
42406  * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
42407  * Because it is generated by the recipient and included in the invoice, it also provides
42408  * proof to the recipient that the payment was sent by someone with the generated invoice.
42409  */
42410 void FinalOnionHopData_set_payment_secret(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42411
42412 /**
42413  * The intended total amount that this payment is for.
42414  *
42415  * Message serialization may panic if this value is more than 21 million Bitcoin.
42416  */
42417 uint64_t FinalOnionHopData_get_total_msat(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr);
42418
42419 /**
42420  * The intended total amount that this payment is for.
42421  *
42422  * Message serialization may panic if this value is more than 21 million Bitcoin.
42423  */
42424 void FinalOnionHopData_set_total_msat(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, uint64_t val);
42425
42426 /**
42427  * Constructs a new FinalOnionHopData given each field
42428  */
42429 MUST_USE_RES struct LDKFinalOnionHopData FinalOnionHopData_new(struct LDKThirtyTwoBytes payment_secret_arg, uint64_t total_msat_arg);
42430
42431 /**
42432  * Creates a copy of the FinalOnionHopData
42433  */
42434 struct LDKFinalOnionHopData FinalOnionHopData_clone(const struct LDKFinalOnionHopData *NONNULL_PTR orig);
42435
42436 /**
42437  * Frees any resources used by the OnionPacket, if is_owned is set and inner is non-NULL.
42438  */
42439 void OnionPacket_free(struct LDKOnionPacket this_obj);
42440
42441 /**
42442  * BOLT 4 version number.
42443  */
42444 uint8_t OnionPacket_get_version(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
42445
42446 /**
42447  * BOLT 4 version number.
42448  */
42449 void OnionPacket_set_version(struct LDKOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
42450
42451 /**
42452  * In order to ensure we always return an error on onion decode in compliance with [BOLT
42453  * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
42454  * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
42455  * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
42456  * like.
42457  *
42458  * Returns a copy of the field.
42459  */
42460 struct LDKCResult_PublicKeySecp256k1ErrorZ OnionPacket_get_public_key(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
42461
42462 /**
42463  * In order to ensure we always return an error on onion decode in compliance with [BOLT
42464  * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
42465  * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
42466  * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
42467  * like.
42468  */
42469 void OnionPacket_set_public_key(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKCResult_PublicKeySecp256k1ErrorZ val);
42470
42471 /**
42472  * HMAC to verify the integrity of hop_data.
42473  */
42474 const uint8_t (*OnionPacket_get_hmac(const struct LDKOnionPacket *NONNULL_PTR this_ptr))[32];
42475
42476 /**
42477  * HMAC to verify the integrity of hop_data.
42478  */
42479 void OnionPacket_set_hmac(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42480
42481 /**
42482  * Creates a copy of the OnionPacket
42483  */
42484 struct LDKOnionPacket OnionPacket_clone(const struct LDKOnionPacket *NONNULL_PTR orig);
42485
42486 /**
42487  * Generates a non-cryptographic 64-bit hash of the OnionPacket.
42488  */
42489 uint64_t OnionPacket_hash(const struct LDKOnionPacket *NONNULL_PTR o);
42490
42491 /**
42492  * Checks if two OnionPackets contain equal inner contents.
42493  * This ignores pointers and is_owned flags and looks at the values in fields.
42494  * Two objects with NULL inner values will be considered "equal" here.
42495  */
42496 bool OnionPacket_eq(const struct LDKOnionPacket *NONNULL_PTR a, const struct LDKOnionPacket *NONNULL_PTR b);
42497
42498 /**
42499  * Frees any resources used by the TrampolineOnionPacket, if is_owned is set and inner is non-NULL.
42500  */
42501 void TrampolineOnionPacket_free(struct LDKTrampolineOnionPacket this_obj);
42502
42503 /**
42504  * Bolt 04 version number
42505  */
42506 uint8_t TrampolineOnionPacket_get_version(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
42507
42508 /**
42509  * Bolt 04 version number
42510  */
42511 void TrampolineOnionPacket_set_version(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
42512
42513 /**
42514  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
42515  */
42516 struct LDKPublicKey TrampolineOnionPacket_get_public_key(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
42517
42518 /**
42519  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
42520  */
42521 void TrampolineOnionPacket_set_public_key(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42522
42523 /**
42524  * Encrypted payload for the next hop
42525  *
42526  * Returns a copy of the field.
42527  */
42528 struct LDKCVec_u8Z TrampolineOnionPacket_get_hop_data(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr);
42529
42530 /**
42531  * Encrypted payload for the next hop
42532  */
42533 void TrampolineOnionPacket_set_hop_data(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
42534
42535 /**
42536  * HMAC to verify the integrity of hop_data
42537  */
42538 const uint8_t (*TrampolineOnionPacket_get_hmac(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr))[32];
42539
42540 /**
42541  * HMAC to verify the integrity of hop_data
42542  */
42543 void TrampolineOnionPacket_set_hmac(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
42544
42545 /**
42546  * Constructs a new TrampolineOnionPacket given each field
42547  */
42548 MUST_USE_RES struct LDKTrampolineOnionPacket TrampolineOnionPacket_new(uint8_t version_arg, struct LDKPublicKey public_key_arg, struct LDKCVec_u8Z hop_data_arg, struct LDKThirtyTwoBytes hmac_arg);
42549
42550 /**
42551  * Creates a copy of the TrampolineOnionPacket
42552  */
42553 struct LDKTrampolineOnionPacket TrampolineOnionPacket_clone(const struct LDKTrampolineOnionPacket *NONNULL_PTR orig);
42554
42555 /**
42556  * Generates a non-cryptographic 64-bit hash of the TrampolineOnionPacket.
42557  */
42558 uint64_t TrampolineOnionPacket_hash(const struct LDKTrampolineOnionPacket *NONNULL_PTR o);
42559
42560 /**
42561  * Checks if two TrampolineOnionPackets contain equal inner contents.
42562  * This ignores pointers and is_owned flags and looks at the values in fields.
42563  * Two objects with NULL inner values will be considered "equal" here.
42564  */
42565 bool TrampolineOnionPacket_eq(const struct LDKTrampolineOnionPacket *NONNULL_PTR a, const struct LDKTrampolineOnionPacket *NONNULL_PTR b);
42566
42567 /**
42568  * Serialize the TrampolineOnionPacket object into a byte array which can be read by TrampolineOnionPacket_read
42569  */
42570 struct LDKCVec_u8Z TrampolineOnionPacket_write(const struct LDKTrampolineOnionPacket *NONNULL_PTR obj);
42571
42572 /**
42573  * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
42574  */
42575 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
42576
42577 /**
42578  * Read a AcceptChannel from a byte array, created by AcceptChannel_write
42579  */
42580 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
42581
42582 /**
42583  * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
42584  */
42585 struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
42586
42587 /**
42588  * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
42589  */
42590 struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
42591
42592 /**
42593  * Serialize the Stfu object into a byte array which can be read by Stfu_read
42594  */
42595 struct LDKCVec_u8Z Stfu_write(const struct LDKStfu *NONNULL_PTR obj);
42596
42597 /**
42598  * Read a Stfu from a byte array, created by Stfu_write
42599  */
42600 struct LDKCResult_StfuDecodeErrorZ Stfu_read(struct LDKu8slice ser);
42601
42602 /**
42603  * Serialize the Splice object into a byte array which can be read by Splice_read
42604  */
42605 struct LDKCVec_u8Z Splice_write(const struct LDKSplice *NONNULL_PTR obj);
42606
42607 /**
42608  * Read a Splice from a byte array, created by Splice_write
42609  */
42610 struct LDKCResult_SpliceDecodeErrorZ Splice_read(struct LDKu8slice ser);
42611
42612 /**
42613  * Serialize the SpliceAck object into a byte array which can be read by SpliceAck_read
42614  */
42615 struct LDKCVec_u8Z SpliceAck_write(const struct LDKSpliceAck *NONNULL_PTR obj);
42616
42617 /**
42618  * Read a SpliceAck from a byte array, created by SpliceAck_write
42619  */
42620 struct LDKCResult_SpliceAckDecodeErrorZ SpliceAck_read(struct LDKu8slice ser);
42621
42622 /**
42623  * Serialize the SpliceLocked object into a byte array which can be read by SpliceLocked_read
42624  */
42625 struct LDKCVec_u8Z SpliceLocked_write(const struct LDKSpliceLocked *NONNULL_PTR obj);
42626
42627 /**
42628  * Read a SpliceLocked from a byte array, created by SpliceLocked_write
42629  */
42630 struct LDKCResult_SpliceLockedDecodeErrorZ SpliceLocked_read(struct LDKu8slice ser);
42631
42632 /**
42633  * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
42634  */
42635 struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
42636
42637 /**
42638  * Read a TxAddInput from a byte array, created by TxAddInput_write
42639  */
42640 struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
42641
42642 /**
42643  * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
42644  */
42645 struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
42646
42647 /**
42648  * Read a TxAddOutput from a byte array, created by TxAddOutput_write
42649  */
42650 struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
42651
42652 /**
42653  * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
42654  */
42655 struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
42656
42657 /**
42658  * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
42659  */
42660 struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
42661
42662 /**
42663  * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
42664  */
42665 struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
42666
42667 /**
42668  * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
42669  */
42670 struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
42671
42672 /**
42673  * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
42674  */
42675 struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
42676
42677 /**
42678  * Read a TxComplete from a byte array, created by TxComplete_write
42679  */
42680 struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
42681
42682 /**
42683  * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
42684  */
42685 struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
42686
42687 /**
42688  * Read a TxSignatures from a byte array, created by TxSignatures_write
42689  */
42690 struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
42691
42692 /**
42693  * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
42694  */
42695 struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
42696
42697 /**
42698  * Read a TxInitRbf from a byte array, created by TxInitRbf_write
42699  */
42700 struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
42701
42702 /**
42703  * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
42704  */
42705 struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
42706
42707 /**
42708  * Read a TxAckRbf from a byte array, created by TxAckRbf_write
42709  */
42710 struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
42711
42712 /**
42713  * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
42714  */
42715 struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
42716
42717 /**
42718  * Read a TxAbort from a byte array, created by TxAbort_write
42719  */
42720 struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
42721
42722 /**
42723  * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
42724  */
42725 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
42726
42727 /**
42728  * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
42729  */
42730 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
42731
42732 /**
42733  * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
42734  */
42735 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
42736
42737 /**
42738  * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
42739  */
42740 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
42741
42742 /**
42743  * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
42744  */
42745 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
42746
42747 /**
42748  * Read a ClosingSigned from a byte array, created by ClosingSigned_write
42749  */
42750 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
42751
42752 /**
42753  * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
42754  */
42755 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
42756
42757 /**
42758  * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
42759  */
42760 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
42761
42762 /**
42763  * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
42764  */
42765 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
42766
42767 /**
42768  * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
42769  */
42770 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
42771
42772 /**
42773  * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
42774  */
42775 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
42776
42777 /**
42778  * Read a FundingCreated from a byte array, created by FundingCreated_write
42779  */
42780 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
42781
42782 /**
42783  * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
42784  */
42785 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
42786
42787 /**
42788  * Read a FundingSigned from a byte array, created by FundingSigned_write
42789  */
42790 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
42791
42792 /**
42793  * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
42794  */
42795 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
42796
42797 /**
42798  * Read a ChannelReady from a byte array, created by ChannelReady_write
42799  */
42800 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
42801
42802 /**
42803  * Serialize the Init object into a byte array which can be read by Init_read
42804  */
42805 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
42806
42807 /**
42808  * Read a Init from a byte array, created by Init_write
42809  */
42810 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
42811
42812 /**
42813  * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
42814  */
42815 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
42816
42817 /**
42818  * Read a OpenChannel from a byte array, created by OpenChannel_write
42819  */
42820 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
42821
42822 /**
42823  * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
42824  */
42825 struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
42826
42827 /**
42828  * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
42829  */
42830 struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
42831
42832 /**
42833  * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
42834  */
42835 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
42836
42837 /**
42838  * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
42839  */
42840 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
42841
42842 /**
42843  * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
42844  */
42845 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
42846
42847 /**
42848  * Read a Shutdown from a byte array, created by Shutdown_write
42849  */
42850 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
42851
42852 /**
42853  * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
42854  */
42855 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
42856
42857 /**
42858  * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
42859  */
42860 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
42861
42862 /**
42863  * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
42864  */
42865 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
42866
42867 /**
42868  * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
42869  */
42870 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
42871
42872 /**
42873  * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
42874  */
42875 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
42876
42877 /**
42878  * Read a UpdateFee from a byte array, created by UpdateFee_write
42879  */
42880 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
42881
42882 /**
42883  * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
42884  */
42885 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
42886
42887 /**
42888  * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
42889  */
42890 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
42891
42892 /**
42893  * Serialize the OnionPacket object into a byte array which can be read by OnionPacket_read
42894  */
42895 struct LDKCVec_u8Z OnionPacket_write(const struct LDKOnionPacket *NONNULL_PTR obj);
42896
42897 /**
42898  * Read a OnionPacket from a byte array, created by OnionPacket_write
42899  */
42900 struct LDKCResult_OnionPacketDecodeErrorZ OnionPacket_read(struct LDKu8slice ser);
42901
42902 /**
42903  * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
42904  */
42905 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
42906
42907 /**
42908  * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
42909  */
42910 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
42911
42912 /**
42913  * Read a OnionMessage from a byte array, created by OnionMessage_write
42914  */
42915 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
42916
42917 /**
42918  * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
42919  */
42920 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
42921
42922 /**
42923  * Serialize the FinalOnionHopData object into a byte array which can be read by FinalOnionHopData_read
42924  */
42925 struct LDKCVec_u8Z FinalOnionHopData_write(const struct LDKFinalOnionHopData *NONNULL_PTR obj);
42926
42927 /**
42928  * Read a FinalOnionHopData from a byte array, created by FinalOnionHopData_write
42929  */
42930 struct LDKCResult_FinalOnionHopDataDecodeErrorZ FinalOnionHopData_read(struct LDKu8slice ser);
42931
42932 /**
42933  * Serialize the Ping object into a byte array which can be read by Ping_read
42934  */
42935 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
42936
42937 /**
42938  * Read a Ping from a byte array, created by Ping_write
42939  */
42940 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
42941
42942 /**
42943  * Serialize the Pong object into a byte array which can be read by Pong_read
42944  */
42945 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
42946
42947 /**
42948  * Read a Pong from a byte array, created by Pong_write
42949  */
42950 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
42951
42952 /**
42953  * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
42954  */
42955 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
42956
42957 /**
42958  * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
42959  */
42960 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
42961
42962 /**
42963  * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
42964  */
42965 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
42966
42967 /**
42968  * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
42969  */
42970 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
42971
42972 /**
42973  * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
42974  */
42975 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
42976
42977 /**
42978  * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
42979  */
42980 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
42981
42982 /**
42983  * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
42984  */
42985 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
42986
42987 /**
42988  * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
42989  */
42990 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
42991
42992 /**
42993  * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
42994  */
42995 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
42996
42997 /**
42998  * Read a ErrorMessage from a byte array, created by ErrorMessage_write
42999  */
43000 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
43001
43002 /**
43003  * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
43004  */
43005 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
43006
43007 /**
43008  * Read a WarningMessage from a byte array, created by WarningMessage_write
43009  */
43010 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
43011
43012 /**
43013  * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
43014  */
43015 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
43016
43017 /**
43018  * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
43019  */
43020 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
43021
43022 /**
43023  * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
43024  */
43025 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
43026
43027 /**
43028  * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
43029  */
43030 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
43031
43032 /**
43033  * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
43034  */
43035 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
43036
43037 /**
43038  * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
43039  */
43040 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
43041
43042 /**
43043  * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
43044  */
43045 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
43046
43047 /**
43048  * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
43049  */
43050 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
43051
43052 /**
43053  * Calculates the overflow safe ending block height for the query.
43054  *
43055  * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
43056  */
43057 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
43058
43059 /**
43060  * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
43061  */
43062 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
43063
43064 /**
43065  * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
43066  */
43067 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
43068
43069 /**
43070  * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
43071  */
43072 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
43073
43074 /**
43075  * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
43076  */
43077 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
43078
43079 /**
43080  * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
43081  */
43082 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
43083
43084 /**
43085  * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
43086  */
43087 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
43088
43089 /**
43090  * Calls the free function if one is set
43091  */
43092 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
43093
43094 /**
43095  * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
43096  */
43097 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
43098
43099 /**
43100  * Constructs a new IgnoringMessageHandler given each field
43101  */
43102 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
43103
43104 /**
43105  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
43106  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
43107  */
43108 struct LDKEventsProvider IgnoringMessageHandler_as_EventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43109
43110 /**
43111  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
43112  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
43113  */
43114 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43115
43116 /**
43117  * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
43118  * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
43119  */
43120 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43121
43122 /**
43123  * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
43124  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
43125  */
43126 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43127
43128 /**
43129  * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
43130  * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
43131  */
43132 struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43133
43134 /**
43135  * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
43136  * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
43137  */
43138 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43139
43140 /**
43141  * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
43142  * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
43143  */
43144 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43145
43146 /**
43147  * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
43148  * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
43149  */
43150 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
43151
43152 /**
43153  * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
43154  */
43155 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
43156
43157 /**
43158  * Constructs a new ErroringMessageHandler
43159  */
43160 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
43161
43162 /**
43163  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
43164  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
43165  */
43166 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
43167
43168 /**
43169  * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
43170  * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
43171  */
43172 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
43173
43174 /**
43175  * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
43176  */
43177 void MessageHandler_free(struct LDKMessageHandler this_obj);
43178
43179 /**
43180  * A message handler which handles messages specific to channels. Usually this is just a
43181  * [`ChannelManager`] object or an [`ErroringMessageHandler`].
43182  *
43183  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
43184  */
43185 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
43186
43187 /**
43188  * A message handler which handles messages specific to channels. Usually this is just a
43189  * [`ChannelManager`] object or an [`ErroringMessageHandler`].
43190  *
43191  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
43192  */
43193 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
43194
43195 /**
43196  * A message handler which handles messages updating our knowledge of the network channel
43197  * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
43198  *
43199  * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
43200  */
43201 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
43202
43203 /**
43204  * A message handler which handles messages updating our knowledge of the network channel
43205  * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
43206  *
43207  * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
43208  */
43209 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
43210
43211 /**
43212  * A message handler which handles onion messages. This should generally be an
43213  * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
43214  *
43215  * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
43216  */
43217 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
43218
43219 /**
43220  * A message handler which handles onion messages. This should generally be an
43221  * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
43222  *
43223  * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
43224  */
43225 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
43226
43227 /**
43228  * A message handler which handles custom messages. The only LDK-provided implementation is
43229  * [`IgnoringMessageHandler`].
43230  */
43231 const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
43232
43233 /**
43234  * A message handler which handles custom messages. The only LDK-provided implementation is
43235  * [`IgnoringMessageHandler`].
43236  */
43237 void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
43238
43239 /**
43240  * Constructs a new MessageHandler given each field
43241  */
43242 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);
43243
43244 /**
43245  * Creates a copy of a SocketDescriptor
43246  */
43247 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
43248
43249 /**
43250  * Calls the free function if one is set
43251  */
43252 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
43253
43254 /**
43255  * Frees any resources used by the PeerDetails, if is_owned is set and inner is non-NULL.
43256  */
43257 void PeerDetails_free(struct LDKPeerDetails this_obj);
43258
43259 /**
43260  * The node id of the peer.
43261  *
43262  * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
43263  * passed in to [`PeerManager::new_outbound_connection`].
43264  */
43265 struct LDKPublicKey PeerDetails_get_counterparty_node_id(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
43266
43267 /**
43268  * The node id of the peer.
43269  *
43270  * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter
43271  * passed in to [`PeerManager::new_outbound_connection`].
43272  */
43273 void PeerDetails_set_counterparty_node_id(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43274
43275 /**
43276  * The socket address the peer provided in the initial handshake.
43277  *
43278  * Will only be `Some` if an address had been previously provided to
43279  * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
43280  *
43281  * Returns a copy of the field.
43282  */
43283 struct LDKCOption_SocketAddressZ PeerDetails_get_socket_address(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
43284
43285 /**
43286  * The socket address the peer provided in the initial handshake.
43287  *
43288  * Will only be `Some` if an address had been previously provided to
43289  * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`].
43290  */
43291 void PeerDetails_set_socket_address(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
43292
43293 /**
43294  * The features the peer provided in the initial handshake.
43295  */
43296 struct LDKInitFeatures PeerDetails_get_init_features(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
43297
43298 /**
43299  * The features the peer provided in the initial handshake.
43300  */
43301 void PeerDetails_set_init_features(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
43302
43303 /**
43304  * Indicates the direction of the peer connection.
43305  *
43306  * Will be `true` for inbound connections, and `false` for outbound connections.
43307  */
43308 bool PeerDetails_get_is_inbound_connection(const struct LDKPeerDetails *NONNULL_PTR this_ptr);
43309
43310 /**
43311  * Indicates the direction of the peer connection.
43312  *
43313  * Will be `true` for inbound connections, and `false` for outbound connections.
43314  */
43315 void PeerDetails_set_is_inbound_connection(struct LDKPeerDetails *NONNULL_PTR this_ptr, bool val);
43316
43317 /**
43318  * Constructs a new PeerDetails given each field
43319  */
43320 MUST_USE_RES struct LDKPeerDetails PeerDetails_new(struct LDKPublicKey counterparty_node_id_arg, struct LDKCOption_SocketAddressZ socket_address_arg, struct LDKInitFeatures init_features_arg, bool is_inbound_connection_arg);
43321
43322 /**
43323  * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
43324  */
43325 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
43326
43327 /**
43328  * Constructs a new PeerHandleError given each field
43329  */
43330 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
43331
43332 /**
43333  * Creates a copy of the PeerHandleError
43334  */
43335 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
43336
43337 /**
43338  * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
43339  */
43340 void PeerManager_free(struct LDKPeerManager this_obj);
43341
43342 /**
43343  * Constructs a new `PeerManager` with the given message handlers.
43344  *
43345  * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
43346  * cryptographically secure random bytes.
43347  *
43348  * `current_time` is used as an always-increasing counter that survives across restarts and is
43349  * incremented irregularly internally. In general it is best to simply use the current UNIX
43350  * timestamp, however if it is not available a persistent counter that increases once per
43351  * minute should suffice.
43352  */
43353 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);
43354
43355 /**
43356  * Returns a list of [`PeerDetails`] for connected peers that have completed the initial
43357  * handshake.
43358  */
43359 MUST_USE_RES struct LDKCVec_PeerDetailsZ PeerManager_list_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
43360
43361 /**
43362  * Returns the [`PeerDetails`] of a connected peer that has completed the initial handshake.
43363  *
43364  * Will return `None` if the peer is unknown or it hasn't completed the initial handshake.
43365  *
43366  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43367  */
43368 MUST_USE_RES struct LDKPeerDetails PeerManager_peer_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id);
43369
43370 /**
43371  * Indicates a new outbound connection has been established to a node with the given `node_id`
43372  * and an optional remote network address.
43373  *
43374  * The remote network address adds the option to report a remote IP address back to a connecting
43375  * peer using the init message.
43376  * The user should pass the remote network address of the host they are connected to.
43377  *
43378  * If an `Err` is returned here you must disconnect the connection immediately.
43379  *
43380  * Returns a small number of bytes to send to the remote node (currently always 50).
43381  *
43382  * Panics if descriptor is duplicative with some other descriptor which has not yet been
43383  * [`socket_disconnected`].
43384  *
43385  * [`socket_disconnected`]: PeerManager::socket_disconnected
43386  */
43387 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);
43388
43389 /**
43390  * Indicates a new inbound connection has been established to a node with an optional remote
43391  * network address.
43392  *
43393  * The remote network address adds the option to report a remote IP address back to a connecting
43394  * peer using the init message.
43395  * The user should pass the remote network address of the host they are connected to.
43396  *
43397  * May refuse the connection by returning an Err, but will never write bytes to the remote end
43398  * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
43399  * the connection immediately.
43400  *
43401  * Panics if descriptor is duplicative with some other descriptor which has not yet been
43402  * [`socket_disconnected`].
43403  *
43404  * [`socket_disconnected`]: PeerManager::socket_disconnected
43405  */
43406 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);
43407
43408 /**
43409  * Indicates that there is room to write data to the given socket descriptor.
43410  *
43411  * May return an Err to indicate that the connection should be closed.
43412  *
43413  * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
43414  * returning. Thus, be very careful with reentrancy issues! The invariants around calling
43415  * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
43416  * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
43417  * sufficient!
43418  *
43419  * [`send_data`]: SocketDescriptor::send_data
43420  * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
43421  */
43422 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
43423
43424 /**
43425  * Indicates that data was read from the given socket descriptor.
43426  *
43427  * May return an Err to indicate that the connection should be closed.
43428  *
43429  * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
43430  * Thus, however, you should call [`process_events`] after any `read_event` to generate
43431  * [`send_data`] calls to handle responses.
43432  *
43433  * If `Ok(true)` is returned, further read_events should not be triggered until a
43434  * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
43435  * send buffer).
43436  *
43437  * In order to avoid processing too many messages at once per peer, `data` should be on the
43438  * order of 4KiB.
43439  *
43440  * [`send_data`]: SocketDescriptor::send_data
43441  * [`process_events`]: PeerManager::process_events
43442  */
43443 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);
43444
43445 /**
43446  * Checks for any events generated by our handlers and processes them. Includes sending most
43447  * response messages as well as messages generated by calls to handler functions directly (eg
43448  * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
43449  *
43450  * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
43451  * issues!
43452  *
43453  * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
43454  * or one of the other clients provided in our language bindings.
43455  *
43456  * Note that if there are any other calls to this function waiting on lock(s) this may return
43457  * without doing any work. All available events that need handling will be handled before the
43458  * other calls return.
43459  *
43460  * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
43461  * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
43462  * [`send_data`]: SocketDescriptor::send_data
43463  */
43464 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
43465
43466 /**
43467  * Indicates that the given socket descriptor's connection is now closed.
43468  */
43469 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
43470
43471 /**
43472  * Disconnect a peer given its node id.
43473  *
43474  * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
43475  * peer. Thus, be very careful about reentrancy issues.
43476  *
43477  * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
43478  */
43479 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
43480
43481 /**
43482  * Disconnects all currently-connected peers. This is useful on platforms where there may be
43483  * an indication that TCP sockets have stalled even if we weren't around to time them out
43484  * using regular ping/pongs.
43485  */
43486 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
43487
43488 /**
43489  * Send pings to each peer and disconnect those which did not respond to the last round of
43490  * pings.
43491  *
43492  * This may be called on any timescale you want, however, roughly once every ten seconds is
43493  * preferred. The call rate determines both how often we send a ping to our peers and how much
43494  * time they have to respond before we disconnect them.
43495  *
43496  * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
43497  * issues!
43498  *
43499  * [`send_data`]: SocketDescriptor::send_data
43500  */
43501 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
43502
43503 /**
43504  * Generates a signed node_announcement from the given arguments, sending it to all connected
43505  * peers. Note that peers will likely ignore this message unless we have at least one public
43506  * channel which has at least six confirmations on-chain.
43507  *
43508  * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
43509  * node to humans. They carry no in-protocol meaning.
43510  *
43511  * `addresses` represent the set (possibly empty) of socket addresses on which this node
43512  * accepts incoming connections. These will be included in the node_announcement, publicly
43513  * tying these addresses together and to this node. If you wish to preserve user privacy,
43514  * addresses should likely contain only Tor Onion addresses.
43515  *
43516  * Panics if `addresses` is absurdly large (more than 100).
43517  *
43518  * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
43519  */
43520 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
43521
43522 /**
43523  * Gets the weight for an HTLC-Success transaction.
43524  */
43525 uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
43526
43527 /**
43528  * Gets the weight for an HTLC-Timeout transaction.
43529  */
43530 uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
43531
43532 /**
43533  * Creates a copy of the HTLCClaim
43534  */
43535 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
43536
43537 /**
43538  * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
43539  */
43540 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
43541
43542 /**
43543  * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
43544  */
43545 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
43546
43547 /**
43548  * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
43549  */
43550 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
43551
43552 /**
43553  * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
43554  */
43555 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
43556
43557 /**
43558  * Utility method to constructs a new Revocation-variant HTLCClaim
43559  */
43560 enum LDKHTLCClaim HTLCClaim_revocation(void);
43561
43562 /**
43563  * Checks if two HTLCClaims contain equal inner contents.
43564  * This ignores pointers and is_owned flags and looks at the values in fields.
43565  */
43566 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
43567
43568 /**
43569  * Check if a given input witness attempts to claim a HTLC.
43570  */
43571 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
43572
43573 /**
43574  * Build the commitment secret from the seed and the commitment number
43575  */
43576 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
43577
43578 /**
43579  * Build a closing transaction
43580  */
43581 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);
43582
43583 /**
43584  * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
43585  */
43586 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
43587
43588 /**
43589  * Creates a copy of the CounterpartyCommitmentSecrets
43590  */
43591 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
43592
43593 /**
43594  * Creates a new empty `CounterpartyCommitmentSecrets` structure.
43595  */
43596 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
43597
43598 /**
43599  * Returns the minimum index of all stored secrets. Note that indexes start
43600  * at 1 << 48 and get decremented by one for each new secret.
43601  */
43602 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
43603
43604 /**
43605  * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
43606  * was generated in accordance with BOLT 3 and is consistent with previous secrets.
43607  */
43608 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
43609
43610 /**
43611  * Returns the secret at `idx`.
43612  * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
43613  *
43614  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43615  */
43616 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
43617
43618 /**
43619  * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
43620  */
43621 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
43622
43623 /**
43624  * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
43625  */
43626 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
43627
43628 /**
43629  * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
43630  * from the base secret and the per_commitment_point.
43631  */
43632 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
43633
43634 /**
43635  * Derives a per-commitment-transaction revocation key from its constituent parts.
43636  *
43637  * Only the cheating participant owns a valid witness to propagate a revoked
43638  * commitment transaction, thus per_commitment_secret always come from cheater
43639  * and revocation_base_secret always come from punisher, which is the broadcaster
43640  * of the transaction spending with this key knowledge.
43641  */
43642 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
43643
43644 /**
43645  * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
43646  */
43647 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
43648
43649 /**
43650  * The broadcaster's per-commitment public key which was used to derive the other keys.
43651  */
43652 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43653
43654 /**
43655  * The broadcaster's per-commitment public key which was used to derive the other keys.
43656  */
43657 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43658
43659 /**
43660  * The revocation key which is used to allow the broadcaster of the commitment
43661  * transaction to provide their counterparty the ability to punish them if they broadcast
43662  * an old state.
43663  */
43664 struct LDKRevocationKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43665
43666 /**
43667  * The revocation key which is used to allow the broadcaster of the commitment
43668  * transaction to provide their counterparty the ability to punish them if they broadcast
43669  * an old state.
43670  */
43671 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
43672
43673 /**
43674  * Broadcaster's HTLC Key
43675  */
43676 struct LDKHtlcKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43677
43678 /**
43679  * Broadcaster's HTLC Key
43680  */
43681 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
43682
43683 /**
43684  * Countersignatory's HTLC Key
43685  */
43686 struct LDKHtlcKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43687
43688 /**
43689  * Countersignatory's HTLC Key
43690  */
43691 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
43692
43693 /**
43694  * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
43695  */
43696 struct LDKDelayedPaymentKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
43697
43698 /**
43699  * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
43700  */
43701 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentKey val);
43702
43703 /**
43704  * Constructs a new TxCreationKeys given each field
43705  */
43706 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);
43707
43708 /**
43709  * Checks if two TxCreationKeyss contain equal inner contents.
43710  * This ignores pointers and is_owned flags and looks at the values in fields.
43711  * Two objects with NULL inner values will be considered "equal" here.
43712  */
43713 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
43714
43715 /**
43716  * Creates a copy of the TxCreationKeys
43717  */
43718 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
43719
43720 /**
43721  * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
43722  */
43723 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
43724
43725 /**
43726  * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
43727  */
43728 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
43729
43730 /**
43731  * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
43732  */
43733 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
43734
43735 /**
43736  * The public key which is used to sign all commitment transactions, as it appears in the
43737  * on-chain channel lock-in 2-of-2 multisig output.
43738  */
43739 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
43740
43741 /**
43742  * The public key which is used to sign all commitment transactions, as it appears in the
43743  * on-chain channel lock-in 2-of-2 multisig output.
43744  */
43745 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43746
43747 /**
43748  * The base point which is used (with derive_public_revocation_key) to derive per-commitment
43749  * revocation keys. This is combined with the per-commitment-secret generated by the
43750  * counterparty to create a secret which the counterparty can reveal to revoke previous
43751  * states.
43752  */
43753 struct LDKRevocationBasepoint ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
43754
43755 /**
43756  * The base point which is used (with derive_public_revocation_key) to derive per-commitment
43757  * revocation keys. This is combined with the per-commitment-secret generated by the
43758  * counterparty to create a secret which the counterparty can reveal to revoke previous
43759  * states.
43760  */
43761 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKRevocationBasepoint val);
43762
43763 /**
43764  * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
43765  * spendable primary channel balance on the broadcaster's commitment transaction. This key is
43766  * static across every commitment transaction.
43767  */
43768 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
43769
43770 /**
43771  * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
43772  * spendable primary channel balance on the broadcaster's commitment transaction. This key is
43773  * static across every commitment transaction.
43774  */
43775 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43776
43777 /**
43778  * The base point which is used (with derive_public_key) to derive a per-commitment payment
43779  * public key which receives non-HTLC-encumbered funds which are only available for spending
43780  * after some delay (or can be claimed via the revocation path).
43781  */
43782 struct LDKDelayedPaymentBasepoint ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
43783
43784 /**
43785  * The base point which is used (with derive_public_key) to derive a per-commitment payment
43786  * public key which receives non-HTLC-encumbered funds which are only available for spending
43787  * after some delay (or can be claimed via the revocation path).
43788  */
43789 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentBasepoint val);
43790
43791 /**
43792  * The base point which is used (with derive_public_key) to derive a per-commitment public key
43793  * which is used to encumber HTLC-in-flight outputs.
43794  */
43795 struct LDKHtlcBasepoint ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
43796
43797 /**
43798  * The base point which is used (with derive_public_key) to derive a per-commitment public key
43799  * which is used to encumber HTLC-in-flight outputs.
43800  */
43801 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKHtlcBasepoint val);
43802
43803 /**
43804  * Constructs a new ChannelPublicKeys given each field
43805  */
43806 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);
43807
43808 /**
43809  * Creates a copy of the ChannelPublicKeys
43810  */
43811 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
43812
43813 /**
43814  * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
43815  */
43816 uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
43817
43818 /**
43819  * Checks if two ChannelPublicKeyss contain equal inner contents.
43820  * This ignores pointers and is_owned flags and looks at the values in fields.
43821  * Two objects with NULL inner values will be considered "equal" here.
43822  */
43823 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
43824
43825 /**
43826  * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
43827  */
43828 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
43829
43830 /**
43831  * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
43832  */
43833 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
43834
43835 /**
43836  * Create per-state keys from channel base points and the per-commitment point.
43837  * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
43838  */
43839 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);
43840
43841 /**
43842  * Generate per-state keys from channel static keys.
43843  * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
43844  */
43845 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);
43846
43847 /**
43848  * A script either spendable by the revocation
43849  * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
43850  * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
43851  */
43852 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);
43853
43854 /**
43855  * Returns the script for the counterparty's output on a holder's commitment transaction based on
43856  * the channel type.
43857  */
43858 struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
43859
43860 /**
43861  * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
43862  */
43863 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
43864
43865 /**
43866  * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
43867  * Note that this is not the same as whether it is ountbound *from us*. To determine that you
43868  * need to compare this value to whether the commitment transaction in question is that of
43869  * the counterparty or our own.
43870  */
43871 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
43872
43873 /**
43874  * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
43875  * Note that this is not the same as whether it is ountbound *from us*. To determine that you
43876  * need to compare this value to whether the commitment transaction in question is that of
43877  * the counterparty or our own.
43878  */
43879 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
43880
43881 /**
43882  * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
43883  * this divided by 1000.
43884  */
43885 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
43886
43887 /**
43888  * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
43889  * this divided by 1000.
43890  */
43891 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
43892
43893 /**
43894  * The CLTV lock-time at which this HTLC expires.
43895  */
43896 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
43897
43898 /**
43899  * The CLTV lock-time at which this HTLC expires.
43900  */
43901 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
43902
43903 /**
43904  * The hash of the preimage which unlocks this HTLC.
43905  */
43906 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
43907
43908 /**
43909  * The hash of the preimage which unlocks this HTLC.
43910  */
43911 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43912
43913 /**
43914  * The position within the commitment transactions' outputs. This may be None if the value is
43915  * below the dust limit (in which case no output appears in the commitment transaction and the
43916  * value is spent to additional transaction fees).
43917  */
43918 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
43919
43920 /**
43921  * The position within the commitment transactions' outputs. This may be None if the value is
43922  * below the dust limit (in which case no output appears in the commitment transaction and the
43923  * value is spent to additional transaction fees).
43924  */
43925 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
43926
43927 /**
43928  * Constructs a new HTLCOutputInCommitment given each field
43929  */
43930 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);
43931
43932 /**
43933  * Creates a copy of the HTLCOutputInCommitment
43934  */
43935 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
43936
43937 /**
43938  * Checks if two HTLCOutputInCommitments contain equal inner contents.
43939  * This ignores pointers and is_owned flags and looks at the values in fields.
43940  * Two objects with NULL inner values will be considered "equal" here.
43941  */
43942 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
43943
43944 /**
43945  * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
43946  */
43947 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
43948
43949 /**
43950  * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
43951  */
43952 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
43953
43954 /**
43955  * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
43956  * does not need to have its previous_output_index filled.
43957  */
43958 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);
43959
43960 /**
43961  * Gets the redeemscript for a funding output from the two funding public keys.
43962  * Note that the order of funding public keys does not matter.
43963  */
43964 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
43965
43966 /**
43967  * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
43968  * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
43969  * transaction which needs signing, and can be used to construct an HTLC transaction which is
43970  * broadcastable given a counterparty HTLC signature.
43971  *
43972  * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
43973  * commitment transaction).
43974  */
43975 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);
43976
43977 /**
43978  * Returns the witness required to satisfy and spend a HTLC input.
43979  */
43980 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);
43981
43982 /**
43983  * Gets the witnessScript for the to_remote output when anchors are enabled.
43984  */
43985 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
43986
43987 /**
43988  * Gets the witnessScript for an anchor output from the funding public key.
43989  * The witness in the spending input must be:
43990  * <BIP 143 funding_signature>
43991  * After 16 blocks of confirmation, an alternative satisfying witness could be:
43992  * <>
43993  * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
43994  */
43995 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
43996
43997 /**
43998  * Returns the witness required to satisfy and spend an anchor input.
43999  */
44000 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
44001
44002 /**
44003  * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
44004  */
44005 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
44006
44007 /**
44008  * Holder public keys
44009  */
44010 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44011
44012 /**
44013  * Holder public keys
44014  */
44015 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
44016
44017 /**
44018  * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
44019  */
44020 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44021
44022 /**
44023  * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
44024  */
44025 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
44026
44027 /**
44028  * Whether the holder is the initiator of this channel.
44029  * This is an input to the commitment number obscure factor computation.
44030  */
44031 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44032
44033 /**
44034  * Whether the holder is the initiator of this channel.
44035  * This is an input to the commitment number obscure factor computation.
44036  */
44037 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
44038
44039 /**
44040  * The late-bound counterparty channel transaction parameters.
44041  * These parameters are populated at the point in the protocol where the counterparty provides them.
44042  *
44043  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44044  */
44045 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44046
44047 /**
44048  * The late-bound counterparty channel transaction parameters.
44049  * These parameters are populated at the point in the protocol where the counterparty provides them.
44050  *
44051  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44052  */
44053 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
44054
44055 /**
44056  * The late-bound funding outpoint
44057  *
44058  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44059  */
44060 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44061
44062 /**
44063  * The late-bound funding outpoint
44064  *
44065  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44066  */
44067 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
44068
44069 /**
44070  * This channel's type, as negotiated during channel open. For old objects where this field
44071  * wasn't serialized, it will default to static_remote_key at deserialization.
44072  */
44073 struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
44074
44075 /**
44076  * This channel's type, as negotiated during channel open. For old objects where this field
44077  * wasn't serialized, it will default to static_remote_key at deserialization.
44078  */
44079 void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
44080
44081 /**
44082  * Constructs a new ChannelTransactionParameters given each field
44083  *
44084  * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
44085  * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
44086  */
44087 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);
44088
44089 /**
44090  * Creates a copy of the ChannelTransactionParameters
44091  */
44092 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
44093
44094 /**
44095  * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
44096  */
44097 uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
44098
44099 /**
44100  * Checks if two ChannelTransactionParameterss contain equal inner contents.
44101  * This ignores pointers and is_owned flags and looks at the values in fields.
44102  * Two objects with NULL inner values will be considered "equal" here.
44103  */
44104 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
44105
44106 /**
44107  * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
44108  */
44109 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
44110
44111 /**
44112  * Counter-party public keys
44113  */
44114 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
44115
44116 /**
44117  * Counter-party public keys
44118  */
44119 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
44120
44121 /**
44122  * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
44123  */
44124 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
44125
44126 /**
44127  * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
44128  */
44129 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
44130
44131 /**
44132  * Constructs a new CounterpartyChannelTransactionParameters given each field
44133  */
44134 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
44135
44136 /**
44137  * Creates a copy of the CounterpartyChannelTransactionParameters
44138  */
44139 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
44140
44141 /**
44142  * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
44143  */
44144 uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
44145
44146 /**
44147  * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
44148  * This ignores pointers and is_owned flags and looks at the values in fields.
44149  * Two objects with NULL inner values will be considered "equal" here.
44150  */
44151 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
44152
44153 /**
44154  * Whether the late bound parameters are populated.
44155  */
44156 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
44157
44158 /**
44159  * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
44160  * given that the holder is the broadcaster.
44161  *
44162  * self.is_populated() must be true before calling this function.
44163  */
44164 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
44165
44166 /**
44167  * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
44168  * given that the counterparty is the broadcaster.
44169  *
44170  * self.is_populated() must be true before calling this function.
44171  */
44172 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
44173
44174 /**
44175  * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
44176  */
44177 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
44178
44179 /**
44180  * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
44181  */
44182 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
44183
44184 /**
44185  * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
44186  */
44187 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
44188
44189 /**
44190  * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
44191  */
44192 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
44193
44194 /**
44195  * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
44196  */
44197 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
44198
44199 /**
44200  * Get the channel pubkeys for the broadcaster
44201  */
44202 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44203
44204 /**
44205  * Get the channel pubkeys for the countersignatory
44206  */
44207 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44208
44209 /**
44210  * Get the contest delay applicable to the transactions.
44211  * Note that the contest delay was selected by the countersignatory.
44212  */
44213 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44214
44215 /**
44216  * Whether the channel is outbound from the broadcaster.
44217  *
44218  * The boolean representing the side that initiated the channel is
44219  * an input to the commitment number obscure factor computation.
44220  */
44221 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44222
44223 /**
44224  * The funding outpoint
44225  */
44226 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44227
44228 /**
44229  * Whether to use anchors for this channel
44230  */
44231 MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
44232
44233 /**
44234  * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
44235  */
44236 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
44237
44238 /**
44239  * Our counterparty's signature for the transaction
44240  */
44241 struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
44242
44243 /**
44244  * Our counterparty's signature for the transaction
44245  */
44246 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
44247
44248 /**
44249  * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
44250  *
44251  * Returns a copy of the field.
44252  */
44253 struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
44254
44255 /**
44256  * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
44257  */
44258 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
44259
44260 /**
44261  * Creates a copy of the HolderCommitmentTransaction
44262  */
44263 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
44264
44265 /**
44266  * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
44267  */
44268 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
44269
44270 /**
44271  * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
44272  */
44273 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
44274
44275 /**
44276  * Create a new holder transaction with the given counterparty signatures.
44277  * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
44278  */
44279 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);
44280
44281 /**
44282  * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
44283  */
44284 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
44285
44286 /**
44287  * The commitment transaction
44288  */
44289 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
44290
44291 /**
44292  * The commitment transaction
44293  */
44294 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
44295
44296 /**
44297  * The txid for the commitment transaction.
44298  *
44299  * This is provided as a performance optimization, instead of calling transaction.txid()
44300  * multiple times.
44301  */
44302 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
44303
44304 /**
44305  * The txid for the commitment transaction.
44306  *
44307  * This is provided as a performance optimization, instead of calling transaction.txid()
44308  * multiple times.
44309  */
44310 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44311
44312 /**
44313  * Constructs a new BuiltCommitmentTransaction given each field
44314  */
44315 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
44316
44317 /**
44318  * Creates a copy of the BuiltCommitmentTransaction
44319  */
44320 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
44321
44322 /**
44323  * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
44324  */
44325 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
44326
44327 /**
44328  * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
44329  */
44330 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
44331
44332 /**
44333  * Get the SIGHASH_ALL sighash value of the transaction.
44334  *
44335  * This can be used to verify a signature.
44336  */
44337 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);
44338
44339 /**
44340  * Signs the counterparty's commitment transaction.
44341  */
44342 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);
44343
44344 /**
44345  * Signs the holder commitment transaction because we are about to broadcast it.
44346  */
44347 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);
44348
44349 /**
44350  * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
44351  */
44352 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
44353
44354 /**
44355  * Creates a copy of the ClosingTransaction
44356  */
44357 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
44358
44359 /**
44360  * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
44361  */
44362 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
44363
44364 /**
44365  * Checks if two ClosingTransactions contain equal inner contents.
44366  * This ignores pointers and is_owned flags and looks at the values in fields.
44367  * Two objects with NULL inner values will be considered "equal" here.
44368  */
44369 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
44370
44371 /**
44372  * Construct an object of the class
44373  */
44374 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);
44375
44376 /**
44377  * Trust our pre-built transaction.
44378  *
44379  * Applies a wrapper which allows access to the transaction.
44380  *
44381  * This should only be used if you fully trust the builder of this object. It should not
44382  * be used by an external signer - instead use the verify function.
44383  */
44384 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44385
44386 /**
44387  * Verify our pre-built transaction.
44388  *
44389  * Applies a wrapper which allows access to the transaction.
44390  *
44391  * An external validating signer must call this method before signing
44392  * or using the built transaction.
44393  */
44394 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
44395
44396 /**
44397  * The value to be sent to the holder, or zero if the output will be omitted
44398  */
44399 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44400
44401 /**
44402  * The value to be sent to the counterparty, or zero if the output will be omitted
44403  */
44404 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44405
44406 /**
44407  * The destination of the holder's output
44408  */
44409 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44410
44411 /**
44412  * The destination of the counterparty's output
44413  */
44414 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
44415
44416 /**
44417  * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
44418  */
44419 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
44420
44421 /**
44422  * The pre-built Bitcoin commitment transaction
44423  */
44424 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
44425
44426 /**
44427  * Get the SIGHASH_ALL sighash value of the transaction.
44428  *
44429  * This can be used to verify a signature.
44430  */
44431 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);
44432
44433 /**
44434  * Sign a transaction, either because we are counter-signing the counterparty's transaction or
44435  * because we are about to broadcast a holder transaction.
44436  */
44437 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);
44438
44439 /**
44440  * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
44441  */
44442 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
44443
44444 /**
44445  * Creates a copy of the CommitmentTransaction
44446  */
44447 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
44448
44449 /**
44450  * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
44451  */
44452 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
44453
44454 /**
44455  * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
44456  */
44457 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
44458
44459 /**
44460  * The backwards-counting commitment number
44461  */
44462 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44463
44464 /**
44465  * The per commitment point used by the broadcaster.
44466  */
44467 MUST_USE_RES struct LDKPublicKey CommitmentTransaction_per_commitment_point(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44468
44469 /**
44470  * The value to be sent to the broadcaster
44471  */
44472 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44473
44474 /**
44475  * The value to be sent to the counterparty
44476  */
44477 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44478
44479 /**
44480  * The feerate paid per 1000-weight-unit in this commitment transaction.
44481  */
44482 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44483
44484 /**
44485  * Trust our pre-built transaction and derived transaction creation public keys.
44486  *
44487  * Applies a wrapper which allows access to these fields.
44488  *
44489  * This should only be used if you fully trust the builder of this object.  It should not
44490  * be used by an external signer - instead use the verify function.
44491  */
44492 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
44493
44494 /**
44495  * Verify our pre-built transaction and derived transaction creation public keys.
44496  *
44497  * Applies a wrapper which allows access to these fields.
44498  *
44499  * An external validating signer must call this method before signing
44500  * or using the built transaction.
44501  */
44502 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);
44503
44504 /**
44505  * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
44506  */
44507 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
44508
44509 /**
44510  * The transaction ID of the built Bitcoin transaction
44511  */
44512 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44513
44514 /**
44515  * The pre-built Bitcoin commitment transaction
44516  */
44517 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44518
44519 /**
44520  * The pre-calculated transaction creation public keys.
44521  */
44522 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44523
44524 /**
44525  * Should anchors be used.
44526  */
44527 MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44528
44529 /**
44530  * Get a signature for each HTLC which was included in the commitment transaction (ie for
44531  * which HTLCOutputInCommitment::transaction_output_index.is_some()).
44532  *
44533  * The returned Vec has one entry for each HTLC, and in the same order.
44534  *
44535  * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
44536  */
44537 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);
44538
44539 /**
44540  * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
44541  * the broadcaster, in the built transaction, if any exists.
44542  *
44543  * There are two cases where this may return `None`:
44544  * - The balance of the revokeable output is below the dust limit (only found on commitments
44545  * early in the channel's lifetime, i.e. before the channel reserve is met).
44546  * - This commitment was created before LDK 0.0.117. In this case, the
44547  * commitment transaction previously didn't contain enough information to locate the
44548  * revokeable output.
44549  */
44550 MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
44551
44552 /**
44553  * Helper method to build an unsigned justice transaction spending the revokeable
44554  * `to_local` output to a destination script. Fee estimation accounts for the expected
44555  * revocation witness data that will be added when signed.
44556  *
44557  * This method will error if the given fee rate results in a fee greater than the value
44558  * of the output being spent, or if there exists no revokeable `to_local` output on this
44559  * commitment transaction. See [`Self::revokeable_output_index`] for more details.
44560  *
44561  * The built transaction will allow fee bumping with RBF, and this method takes
44562  * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
44563  * fee rates may be built.
44564  */
44565 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);
44566
44567 /**
44568  * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
44569  * shared secret first. This prevents on-chain observers from discovering how many commitment
44570  * transactions occurred in a channel before it was closed.
44571  *
44572  * This function gets the shared secret from relevant channel public keys and can be used to
44573  * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
44574  */
44575 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
44576
44577 /**
44578  * Checks if two InitFeaturess contain equal inner contents.
44579  * This ignores pointers and is_owned flags and looks at the values in fields.
44580  * Two objects with NULL inner values will be considered "equal" here.
44581  */
44582 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
44583
44584 /**
44585  * Checks if two NodeFeaturess contain equal inner contents.
44586  * This ignores pointers and is_owned flags and looks at the values in fields.
44587  * Two objects with NULL inner values will be considered "equal" here.
44588  */
44589 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
44590
44591 /**
44592  * Checks if two ChannelFeaturess contain equal inner contents.
44593  * This ignores pointers and is_owned flags and looks at the values in fields.
44594  * Two objects with NULL inner values will be considered "equal" here.
44595  */
44596 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
44597
44598 /**
44599  * Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
44600  * This ignores pointers and is_owned flags and looks at the values in fields.
44601  * Two objects with NULL inner values will be considered "equal" here.
44602  */
44603 bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
44604
44605 /**
44606  * Checks if two OfferFeaturess contain equal inner contents.
44607  * This ignores pointers and is_owned flags and looks at the values in fields.
44608  * Two objects with NULL inner values will be considered "equal" here.
44609  */
44610 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
44611
44612 /**
44613  * Checks if two InvoiceRequestFeaturess contain equal inner contents.
44614  * This ignores pointers and is_owned flags and looks at the values in fields.
44615  * Two objects with NULL inner values will be considered "equal" here.
44616  */
44617 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
44618
44619 /**
44620  * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
44621  * This ignores pointers and is_owned flags and looks at the values in fields.
44622  * Two objects with NULL inner values will be considered "equal" here.
44623  */
44624 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
44625
44626 /**
44627  * Checks if two BlindedHopFeaturess contain equal inner contents.
44628  * This ignores pointers and is_owned flags and looks at the values in fields.
44629  * Two objects with NULL inner values will be considered "equal" here.
44630  */
44631 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
44632
44633 /**
44634  * Checks if two ChannelTypeFeaturess contain equal inner contents.
44635  * This ignores pointers and is_owned flags and looks at the values in fields.
44636  * Two objects with NULL inner values will be considered "equal" here.
44637  */
44638 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
44639
44640 /**
44641  * Creates a copy of the InitFeatures
44642  */
44643 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
44644
44645 /**
44646  * Creates a copy of the NodeFeatures
44647  */
44648 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
44649
44650 /**
44651  * Creates a copy of the ChannelFeatures
44652  */
44653 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
44654
44655 /**
44656  * Creates a copy of the Bolt11InvoiceFeatures
44657  */
44658 struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
44659
44660 /**
44661  * Creates a copy of the OfferFeatures
44662  */
44663 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
44664
44665 /**
44666  * Creates a copy of the InvoiceRequestFeatures
44667  */
44668 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
44669
44670 /**
44671  * Creates a copy of the Bolt12InvoiceFeatures
44672  */
44673 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
44674
44675 /**
44676  * Creates a copy of the BlindedHopFeatures
44677  */
44678 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
44679
44680 /**
44681  * Creates a copy of the ChannelTypeFeatures
44682  */
44683 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
44684
44685 /**
44686  * Generates a non-cryptographic 64-bit hash of the InitFeatures.
44687  */
44688 uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o);
44689
44690 /**
44691  * Generates a non-cryptographic 64-bit hash of the NodeFeatures.
44692  */
44693 uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o);
44694
44695 /**
44696  * Generates a non-cryptographic 64-bit hash of the ChannelFeatures.
44697  */
44698 uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o);
44699
44700 /**
44701  * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceFeatures.
44702  */
44703 uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o);
44704
44705 /**
44706  * Generates a non-cryptographic 64-bit hash of the OfferFeatures.
44707  */
44708 uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o);
44709
44710 /**
44711  * Generates a non-cryptographic 64-bit hash of the InvoiceRequestFeatures.
44712  */
44713 uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o);
44714
44715 /**
44716  * Generates a non-cryptographic 64-bit hash of the Bolt12InvoiceFeatures.
44717  */
44718 uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o);
44719
44720 /**
44721  * Generates a non-cryptographic 64-bit hash of the BlindedHopFeatures.
44722  */
44723 uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o);
44724
44725 /**
44726  * Generates a non-cryptographic 64-bit hash of the ChannelTypeFeatures.
44727  */
44728 uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o);
44729
44730 /**
44731  * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
44732  */
44733 void InitFeatures_free(struct LDKInitFeatures this_obj);
44734
44735 /**
44736  * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
44737  */
44738 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
44739
44740 /**
44741  * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
44742  */
44743 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
44744
44745 /**
44746  * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
44747  */
44748 void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
44749
44750 /**
44751  * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
44752  */
44753 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
44754
44755 /**
44756  * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
44757  */
44758 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
44759
44760 /**
44761  * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
44762  */
44763 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
44764
44765 /**
44766  * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
44767  */
44768 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
44769
44770 /**
44771  * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
44772  */
44773 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
44774
44775 /**
44776  * Create a blank Features with no features set
44777  */
44778 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
44779
44780 /**
44781  * Returns true if this `Features` object contains required features unknown by `other`.
44782  */
44783 MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
44784
44785 /**
44786  * Returns true if this `Features` object contains unknown feature flags which are set as
44787  * \"required\".
44788  */
44789 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
44790
44791 /**
44792  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
44793  * by [BOLT 9].
44794  *
44795  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44796  * be set instead (i.e., `bit - 1`).
44797  *
44798  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44799  */
44800 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44801
44802 /**
44803  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
44804  * by [BOLT 9].
44805  *
44806  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44807  * set instead (i.e., `bit + 1`).
44808  *
44809  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44810  */
44811 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44812
44813 /**
44814  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
44815  * by [bLIP 2] or if it is a known `T` feature.
44816  *
44817  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44818  * be set instead (i.e., `bit - 1`).
44819  *
44820  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
44821  */
44822 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44823
44824 /**
44825  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
44826  * by [bLIP 2] or if it is a known `T` feature.
44827  *
44828  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44829  * set instead (i.e., `bit + 1`).
44830  *
44831  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
44832  */
44833 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44834
44835 /**
44836  * Create a blank Features with no features set
44837  */
44838 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
44839
44840 /**
44841  * Returns true if this `Features` object contains required features unknown by `other`.
44842  */
44843 MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
44844
44845 /**
44846  * Returns true if this `Features` object contains unknown feature flags which are set as
44847  * \"required\".
44848  */
44849 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
44850
44851 /**
44852  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
44853  * by [BOLT 9].
44854  *
44855  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44856  * be set instead (i.e., `bit - 1`).
44857  *
44858  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44859  */
44860 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44861
44862 /**
44863  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
44864  * by [BOLT 9].
44865  *
44866  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44867  * set instead (i.e., `bit + 1`).
44868  *
44869  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44870  */
44871 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44872
44873 /**
44874  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
44875  * by [bLIP 2] or if it is a known `T` feature.
44876  *
44877  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44878  * be set instead (i.e., `bit - 1`).
44879  *
44880  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
44881  */
44882 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44883
44884 /**
44885  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
44886  * by [bLIP 2] or if it is a known `T` feature.
44887  *
44888  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44889  * set instead (i.e., `bit + 1`).
44890  *
44891  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
44892  */
44893 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44894
44895 /**
44896  * Create a blank Features with no features set
44897  */
44898 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
44899
44900 /**
44901  * Returns true if this `Features` object contains required features unknown by `other`.
44902  */
44903 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
44904
44905 /**
44906  * Returns true if this `Features` object contains unknown feature flags which are set as
44907  * \"required\".
44908  */
44909 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
44910
44911 /**
44912  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
44913  * by [BOLT 9].
44914  *
44915  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44916  * be set instead (i.e., `bit - 1`).
44917  *
44918  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44919  */
44920 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44921
44922 /**
44923  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
44924  * by [BOLT 9].
44925  *
44926  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44927  * set instead (i.e., `bit + 1`).
44928  *
44929  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44930  */
44931 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44932
44933 /**
44934  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
44935  * by [bLIP 2] or if it is a known `T` feature.
44936  *
44937  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44938  * be set instead (i.e., `bit - 1`).
44939  *
44940  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
44941  */
44942 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44943
44944 /**
44945  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
44946  * by [bLIP 2] or if it is a known `T` feature.
44947  *
44948  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44949  * set instead (i.e., `bit + 1`).
44950  *
44951  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
44952  */
44953 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44954
44955 /**
44956  * Create a blank Features with no features set
44957  */
44958 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
44959
44960 /**
44961  * Returns true if this `Features` object contains required features unknown by `other`.
44962  */
44963 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
44964
44965 /**
44966  * Returns true if this `Features` object contains unknown feature flags which are set as
44967  * \"required\".
44968  */
44969 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
44970
44971 /**
44972  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
44973  * by [BOLT 9].
44974  *
44975  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44976  * be set instead (i.e., `bit - 1`).
44977  *
44978  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44979  */
44980 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44981
44982 /**
44983  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
44984  * by [BOLT 9].
44985  *
44986  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
44987  * set instead (i.e., `bit + 1`).
44988  *
44989  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
44990  */
44991 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
44992
44993 /**
44994  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
44995  * by [bLIP 2] or if it is a known `T` feature.
44996  *
44997  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
44998  * be set instead (i.e., `bit - 1`).
44999  *
45000  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45001  */
45002 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45003
45004 /**
45005  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45006  * by [bLIP 2] or if it is a known `T` feature.
45007  *
45008  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45009  * set instead (i.e., `bit + 1`).
45010  *
45011  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45012  */
45013 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45014
45015 /**
45016  * Create a blank Features with no features set
45017  */
45018 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
45019
45020 /**
45021  * Returns true if this `Features` object contains required features unknown by `other`.
45022  */
45023 MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
45024
45025 /**
45026  * Returns true if this `Features` object contains unknown feature flags which are set as
45027  * \"required\".
45028  */
45029 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
45030
45031 /**
45032  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45033  * by [BOLT 9].
45034  *
45035  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45036  * be set instead (i.e., `bit - 1`).
45037  *
45038  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45039  */
45040 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45041
45042 /**
45043  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45044  * by [BOLT 9].
45045  *
45046  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45047  * set instead (i.e., `bit + 1`).
45048  *
45049  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45050  */
45051 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45052
45053 /**
45054  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45055  * by [bLIP 2] or if it is a known `T` feature.
45056  *
45057  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45058  * be set instead (i.e., `bit - 1`).
45059  *
45060  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45061  */
45062 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45063
45064 /**
45065  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45066  * by [bLIP 2] or if it is a known `T` feature.
45067  *
45068  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45069  * set instead (i.e., `bit + 1`).
45070  *
45071  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45072  */
45073 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45074
45075 /**
45076  * Create a blank Features with no features set
45077  */
45078 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
45079
45080 /**
45081  * Returns true if this `Features` object contains required features unknown by `other`.
45082  */
45083 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
45084
45085 /**
45086  * Returns true if this `Features` object contains unknown feature flags which are set as
45087  * \"required\".
45088  */
45089 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
45090
45091 /**
45092  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45093  * by [BOLT 9].
45094  *
45095  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45096  * be set instead (i.e., `bit - 1`).
45097  *
45098  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45099  */
45100 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45101
45102 /**
45103  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45104  * by [BOLT 9].
45105  *
45106  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45107  * set instead (i.e., `bit + 1`).
45108  *
45109  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45110  */
45111 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45112
45113 /**
45114  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45115  * by [bLIP 2] or if it is a known `T` feature.
45116  *
45117  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45118  * be set instead (i.e., `bit - 1`).
45119  *
45120  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45121  */
45122 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45123
45124 /**
45125  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45126  * by [bLIP 2] or if it is a known `T` feature.
45127  *
45128  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45129  * set instead (i.e., `bit + 1`).
45130  *
45131  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45132  */
45133 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45134
45135 /**
45136  * Create a blank Features with no features set
45137  */
45138 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
45139
45140 /**
45141  * Returns true if this `Features` object contains required features unknown by `other`.
45142  */
45143 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
45144
45145 /**
45146  * Returns true if this `Features` object contains unknown feature flags which are set as
45147  * \"required\".
45148  */
45149 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
45150
45151 /**
45152  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45153  * by [BOLT 9].
45154  *
45155  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45156  * be set instead (i.e., `bit - 1`).
45157  *
45158  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45159  */
45160 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45161
45162 /**
45163  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45164  * by [BOLT 9].
45165  *
45166  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45167  * set instead (i.e., `bit + 1`).
45168  *
45169  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45170  */
45171 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45172
45173 /**
45174  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45175  * by [bLIP 2] or if it is a known `T` feature.
45176  *
45177  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45178  * be set instead (i.e., `bit - 1`).
45179  *
45180  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45181  */
45182 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45183
45184 /**
45185  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45186  * by [bLIP 2] or if it is a known `T` feature.
45187  *
45188  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45189  * set instead (i.e., `bit + 1`).
45190  *
45191  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45192  */
45193 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45194
45195 /**
45196  * Create a blank Features with no features set
45197  */
45198 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
45199
45200 /**
45201  * Returns true if this `Features` object contains required features unknown by `other`.
45202  */
45203 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
45204
45205 /**
45206  * Returns true if this `Features` object contains unknown feature flags which are set as
45207  * \"required\".
45208  */
45209 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
45210
45211 /**
45212  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45213  * by [BOLT 9].
45214  *
45215  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45216  * be set instead (i.e., `bit - 1`).
45217  *
45218  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45219  */
45220 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45221
45222 /**
45223  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45224  * by [BOLT 9].
45225  *
45226  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45227  * set instead (i.e., `bit + 1`).
45228  *
45229  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45230  */
45231 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45232
45233 /**
45234  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45235  * by [bLIP 2] or if it is a known `T` feature.
45236  *
45237  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45238  * be set instead (i.e., `bit - 1`).
45239  *
45240  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45241  */
45242 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45243
45244 /**
45245  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45246  * by [bLIP 2] or if it is a known `T` feature.
45247  *
45248  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45249  * set instead (i.e., `bit + 1`).
45250  *
45251  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45252  */
45253 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45254
45255 /**
45256  * Create a blank Features with no features set
45257  */
45258 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
45259
45260 /**
45261  * Returns true if this `Features` object contains required features unknown by `other`.
45262  */
45263 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
45264
45265 /**
45266  * Returns true if this `Features` object contains unknown feature flags which are set as
45267  * \"required\".
45268  */
45269 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45270
45271 /**
45272  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
45273  * by [BOLT 9].
45274  *
45275  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45276  * be set instead (i.e., `bit - 1`).
45277  *
45278  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45279  */
45280 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45281
45282 /**
45283  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
45284  * by [BOLT 9].
45285  *
45286  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45287  * set instead (i.e., `bit + 1`).
45288  *
45289  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
45290  */
45291 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45292
45293 /**
45294  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
45295  * by [bLIP 2] or if it is a known `T` feature.
45296  *
45297  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
45298  * be set instead (i.e., `bit - 1`).
45299  *
45300  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45301  */
45302 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45303
45304 /**
45305  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
45306  * by [bLIP 2] or if it is a known `T` feature.
45307  *
45308  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
45309  * set instead (i.e., `bit + 1`).
45310  *
45311  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
45312  */
45313 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
45314
45315 /**
45316  * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
45317  */
45318 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
45319
45320 /**
45321  * Read a InitFeatures from a byte array, created by InitFeatures_write
45322  */
45323 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
45324
45325 /**
45326  * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
45327  */
45328 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
45329
45330 /**
45331  * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
45332  */
45333 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
45334
45335 /**
45336  * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
45337  */
45338 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
45339
45340 /**
45341  * Read a NodeFeatures from a byte array, created by NodeFeatures_write
45342  */
45343 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
45344
45345 /**
45346  * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
45347  */
45348 struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
45349
45350 /**
45351  * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
45352  */
45353 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
45354
45355 /**
45356  * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
45357  */
45358 struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
45359
45360 /**
45361  * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
45362  */
45363 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
45364
45365 /**
45366  * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
45367  */
45368 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
45369
45370 /**
45371  * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
45372  */
45373 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
45374
45375 /**
45376  * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
45377  */
45378 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
45379
45380 /**
45381  * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
45382  */
45383 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
45384
45385 /**
45386  * Set this feature as optional.
45387  */
45388 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45389
45390 /**
45391  * Set this feature as required.
45392  */
45393 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45394
45395 /**
45396  * Checks if this feature is supported.
45397  */
45398 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45399
45400 /**
45401  * Set this feature as optional.
45402  */
45403 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45404
45405 /**
45406  * Set this feature as required.
45407  */
45408 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45409
45410 /**
45411  * Checks if this feature is supported.
45412  */
45413 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45414
45415 /**
45416  * Checks if this feature is required.
45417  */
45418 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45419
45420 /**
45421  * Checks if this feature is required.
45422  */
45423 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45424
45425 /**
45426  * Set this feature as optional.
45427  */
45428 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45429
45430 /**
45431  * Set this feature as required.
45432  */
45433 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45434
45435 /**
45436  * Checks if this feature is supported.
45437  */
45438 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45439
45440 /**
45441  * Set this feature as optional.
45442  */
45443 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45444
45445 /**
45446  * Set this feature as required.
45447  */
45448 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45449
45450 /**
45451  * Checks if this feature is supported.
45452  */
45453 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45454
45455 /**
45456  * Set this feature as optional.
45457  */
45458 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45459
45460 /**
45461  * Set this feature as required.
45462  */
45463 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45464
45465 /**
45466  * Checks if this feature is supported.
45467  */
45468 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45469
45470 /**
45471  * Checks if this feature is required.
45472  */
45473 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45474
45475 /**
45476  * Checks if this feature is required.
45477  */
45478 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45479
45480 /**
45481  * Set this feature as optional.
45482  */
45483 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45484
45485 /**
45486  * Set this feature as required.
45487  */
45488 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45489
45490 /**
45491  * Checks if this feature is supported.
45492  */
45493 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45494
45495 /**
45496  * Set this feature as optional.
45497  */
45498 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45499
45500 /**
45501  * Set this feature as required.
45502  */
45503 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45504
45505 /**
45506  * Checks if this feature is supported.
45507  */
45508 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45509
45510 /**
45511  * Checks if this feature is required.
45512  */
45513 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45514
45515 /**
45516  * Checks if this feature is required.
45517  */
45518 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45519
45520 /**
45521  * Set this feature as optional.
45522  */
45523 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45524
45525 /**
45526  * Set this feature as required.
45527  */
45528 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45529
45530 /**
45531  * Checks if this feature is supported.
45532  */
45533 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45534
45535 /**
45536  * Set this feature as optional.
45537  */
45538 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45539
45540 /**
45541  * Set this feature as required.
45542  */
45543 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45544
45545 /**
45546  * Checks if this feature is supported.
45547  */
45548 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45549
45550 /**
45551  * Set this feature as optional.
45552  */
45553 void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45554
45555 /**
45556  * Set this feature as required.
45557  */
45558 void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45559
45560 /**
45561  * Checks if this feature is supported.
45562  */
45563 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45564
45565 /**
45566  * Checks if this feature is required.
45567  */
45568 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45569
45570 /**
45571  * Checks if this feature is required.
45572  */
45573 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45574
45575 /**
45576  * Checks if this feature is required.
45577  */
45578 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45579
45580 /**
45581  * Set this feature as optional.
45582  */
45583 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45584
45585 /**
45586  * Set this feature as required.
45587  */
45588 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45589
45590 /**
45591  * Checks if this feature is supported.
45592  */
45593 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45594
45595 /**
45596  * Set this feature as optional.
45597  */
45598 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45599
45600 /**
45601  * Set this feature as required.
45602  */
45603 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45604
45605 /**
45606  * Checks if this feature is supported.
45607  */
45608 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45609
45610 /**
45611  * Set this feature as optional.
45612  */
45613 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45614
45615 /**
45616  * Set this feature as required.
45617  */
45618 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45619
45620 /**
45621  * Checks if this feature is supported.
45622  */
45623 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45624
45625 /**
45626  * Checks if this feature is required.
45627  */
45628 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45629
45630 /**
45631  * Checks if this feature is required.
45632  */
45633 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45634
45635 /**
45636  * Checks if this feature is required.
45637  */
45638 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45639
45640 /**
45641  * Set this feature as optional.
45642  */
45643 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45644
45645 /**
45646  * Set this feature as required.
45647  */
45648 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45649
45650 /**
45651  * Checks if this feature is supported.
45652  */
45653 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45654
45655 /**
45656  * Set this feature as optional.
45657  */
45658 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45659
45660 /**
45661  * Set this feature as required.
45662  */
45663 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45664
45665 /**
45666  * Checks if this feature is supported.
45667  */
45668 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45669
45670 /**
45671  * Set this feature as optional.
45672  */
45673 void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45674
45675 /**
45676  * Set this feature as required.
45677  */
45678 void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45679
45680 /**
45681  * Checks if this feature is supported.
45682  */
45683 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45684
45685 /**
45686  * Checks if this feature is required.
45687  */
45688 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45689
45690 /**
45691  * Checks if this feature is required.
45692  */
45693 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45694
45695 /**
45696  * Checks if this feature is required.
45697  */
45698 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45699
45700 /**
45701  * Set this feature as optional.
45702  */
45703 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45704
45705 /**
45706  * Set this feature as required.
45707  */
45708 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45709
45710 /**
45711  * Checks if this feature is supported.
45712  */
45713 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45714
45715 /**
45716  * Set this feature as optional.
45717  */
45718 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45719
45720 /**
45721  * Set this feature as required.
45722  */
45723 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45724
45725 /**
45726  * Checks if this feature is supported.
45727  */
45728 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45729
45730 /**
45731  * Set this feature as optional.
45732  */
45733 void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45734
45735 /**
45736  * Set this feature as required.
45737  */
45738 void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45739
45740 /**
45741  * Checks if this feature is supported.
45742  */
45743 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45744
45745 /**
45746  * Set this feature as optional.
45747  */
45748 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
45749
45750 /**
45751  * Set this feature as required.
45752  */
45753 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
45754
45755 /**
45756  * Checks if this feature is supported.
45757  */
45758 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
45759
45760 /**
45761  * Checks if this feature is required.
45762  */
45763 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45764
45765 /**
45766  * Checks if this feature is required.
45767  */
45768 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45769
45770 /**
45771  * Checks if this feature is required.
45772  */
45773 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
45774
45775 /**
45776  * Checks if this feature is required.
45777  */
45778 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
45779
45780 /**
45781  * Set this feature as optional.
45782  */
45783 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45784
45785 /**
45786  * Set this feature as required.
45787  */
45788 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45789
45790 /**
45791  * Checks if this feature is supported.
45792  */
45793 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45794
45795 /**
45796  * Set this feature as optional.
45797  */
45798 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45799
45800 /**
45801  * Set this feature as required.
45802  */
45803 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45804
45805 /**
45806  * Checks if this feature is supported.
45807  */
45808 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45809
45810 /**
45811  * Checks if this feature is required.
45812  */
45813 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45814
45815 /**
45816  * Checks if this feature is required.
45817  */
45818 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45819
45820 /**
45821  * Set this feature as optional.
45822  */
45823 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45824
45825 /**
45826  * Set this feature as required.
45827  */
45828 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45829
45830 /**
45831  * Checks if this feature is supported.
45832  */
45833 MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45834
45835 /**
45836  * Set this feature as optional.
45837  */
45838 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45839
45840 /**
45841  * Set this feature as required.
45842  */
45843 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45844
45845 /**
45846  * Checks if this feature is supported.
45847  */
45848 MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45849
45850 /**
45851  * Set this feature as optional.
45852  */
45853 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45854
45855 /**
45856  * Set this feature as required.
45857  */
45858 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45859
45860 /**
45861  * Checks if this feature is supported.
45862  */
45863 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45864
45865 /**
45866  * Checks if this feature is required.
45867  */
45868 MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45869
45870 /**
45871  * Checks if this feature is required.
45872  */
45873 MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45874
45875 /**
45876  * Checks if this feature is required.
45877  */
45878 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45879
45880 /**
45881  * Set this feature as optional.
45882  */
45883 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45884
45885 /**
45886  * Set this feature as required.
45887  */
45888 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45889
45890 /**
45891  * Checks if this feature is supported.
45892  */
45893 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45894
45895 /**
45896  * Set this feature as optional.
45897  */
45898 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45899
45900 /**
45901  * Set this feature as required.
45902  */
45903 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45904
45905 /**
45906  * Checks if this feature is supported.
45907  */
45908 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45909
45910 /**
45911  * Set this feature as optional.
45912  */
45913 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45914
45915 /**
45916  * Set this feature as required.
45917  */
45918 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45919
45920 /**
45921  * Checks if this feature is supported.
45922  */
45923 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45924
45925 /**
45926  * Checks if this feature is required.
45927  */
45928 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45929
45930 /**
45931  * Checks if this feature is required.
45932  */
45933 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45934
45935 /**
45936  * Checks if this feature is required.
45937  */
45938 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
45939
45940 /**
45941  * Set this feature as optional.
45942  */
45943 void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45944
45945 /**
45946  * Set this feature as required.
45947  */
45948 void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45949
45950 /**
45951  * Checks if this feature is supported.
45952  */
45953 MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45954
45955 /**
45956  * Set this feature as optional.
45957  */
45958 void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45959
45960 /**
45961  * Set this feature as required.
45962  */
45963 void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45964
45965 /**
45966  * Checks if this feature is supported.
45967  */
45968 MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45969
45970 /**
45971  * Checks if this feature is required.
45972  */
45973 MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45974
45975 /**
45976  * Checks if this feature is required.
45977  */
45978 MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
45979
45980 /**
45981  * Set this feature as optional.
45982  */
45983 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
45984
45985 /**
45986  * Set this feature as required.
45987  */
45988 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
45989
45990 /**
45991  * Checks if this feature is supported.
45992  */
45993 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
45994
45995 /**
45996  * Set this feature as optional.
45997  */
45998 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
45999
46000 /**
46001  * Set this feature as required.
46002  */
46003 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46004
46005 /**
46006  * Checks if this feature is supported.
46007  */
46008 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46009
46010 /**
46011  * Checks if this feature is required.
46012  */
46013 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46014
46015 /**
46016  * Checks if this feature is required.
46017  */
46018 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46019
46020 /**
46021  * Set this feature as optional.
46022  */
46023 void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46024
46025 /**
46026  * Set this feature as required.
46027  */
46028 void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46029
46030 /**
46031  * Checks if this feature is supported.
46032  */
46033 MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46034
46035 /**
46036  * Set this feature as optional.
46037  */
46038 void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46039
46040 /**
46041  * Set this feature as required.
46042  */
46043 void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46044
46045 /**
46046  * Checks if this feature is supported.
46047  */
46048 MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46049
46050 /**
46051  * Set this feature as optional.
46052  */
46053 void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46054
46055 /**
46056  * Set this feature as required.
46057  */
46058 void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46059
46060 /**
46061  * Checks if this feature is supported.
46062  */
46063 MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46064
46065 /**
46066  * Checks if this feature is required.
46067  */
46068 MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46069
46070 /**
46071  * Checks if this feature is required.
46072  */
46073 MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46074
46075 /**
46076  * Checks if this feature is required.
46077  */
46078 MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46079
46080 /**
46081  * Set this feature as optional.
46082  */
46083 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46084
46085 /**
46086  * Set this feature as required.
46087  */
46088 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46089
46090 /**
46091  * Checks if this feature is supported.
46092  */
46093 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46094
46095 /**
46096  * Set this feature as optional.
46097  */
46098 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46099
46100 /**
46101  * Set this feature as required.
46102  */
46103 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46104
46105 /**
46106  * Checks if this feature is supported.
46107  */
46108 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46109
46110 /**
46111  * Checks if this feature is required.
46112  */
46113 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46114
46115 /**
46116  * Checks if this feature is required.
46117  */
46118 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46119
46120 /**
46121  * Set this feature as optional.
46122  */
46123 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46124
46125 /**
46126  * Set this feature as required.
46127  */
46128 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46129
46130 /**
46131  * Checks if this feature is supported.
46132  */
46133 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46134
46135 /**
46136  * Set this feature as optional.
46137  */
46138 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46139
46140 /**
46141  * Set this feature as required.
46142  */
46143 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46144
46145 /**
46146  * Checks if this feature is supported.
46147  */
46148 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46149
46150 /**
46151  * Checks if this feature is required.
46152  */
46153 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46154
46155 /**
46156  * Checks if this feature is required.
46157  */
46158 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46159
46160 /**
46161  * Set this feature as optional.
46162  */
46163 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46164
46165 /**
46166  * Set this feature as required.
46167  */
46168 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46169
46170 /**
46171  * Checks if this feature is supported.
46172  */
46173 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46174
46175 /**
46176  * Set this feature as optional.
46177  */
46178 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46179
46180 /**
46181  * Set this feature as required.
46182  */
46183 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46184
46185 /**
46186  * Checks if this feature is supported.
46187  */
46188 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46189
46190 /**
46191  * Set this feature as optional.
46192  */
46193 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46194
46195 /**
46196  * Set this feature as required.
46197  */
46198 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46199
46200 /**
46201  * Checks if this feature is supported.
46202  */
46203 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46204
46205 /**
46206  * Checks if this feature is required.
46207  */
46208 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46209
46210 /**
46211  * Checks if this feature is required.
46212  */
46213 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46214
46215 /**
46216  * Checks if this feature is required.
46217  */
46218 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46219
46220 /**
46221  * Set this feature as optional.
46222  */
46223 void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46224
46225 /**
46226  * Set this feature as required.
46227  */
46228 void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46229
46230 /**
46231  * Checks if this feature is supported.
46232  */
46233 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46234
46235 /**
46236  * Checks if this feature is required.
46237  */
46238 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46239
46240 /**
46241  * Set this feature as optional.
46242  */
46243 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46244
46245 /**
46246  * Set this feature as required.
46247  */
46248 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46249
46250 /**
46251  * Checks if this feature is supported.
46252  */
46253 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46254
46255 /**
46256  * Set this feature as optional.
46257  */
46258 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46259
46260 /**
46261  * Set this feature as required.
46262  */
46263 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46264
46265 /**
46266  * Checks if this feature is supported.
46267  */
46268 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46269
46270 /**
46271  * Set this feature as optional.
46272  */
46273 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46274
46275 /**
46276  * Set this feature as required.
46277  */
46278 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46279
46280 /**
46281  * Checks if this feature is supported.
46282  */
46283 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46284
46285 /**
46286  * Checks if this feature is required.
46287  */
46288 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46289
46290 /**
46291  * Checks if this feature is required.
46292  */
46293 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46294
46295 /**
46296  * Checks if this feature is required.
46297  */
46298 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
46299
46300 /**
46301  * Set this feature as optional.
46302  */
46303 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46304
46305 /**
46306  * Set this feature as required.
46307  */
46308 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46309
46310 /**
46311  * Checks if this feature is supported.
46312  */
46313 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46314
46315 /**
46316  * Checks if this feature is required.
46317  */
46318 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46319
46320 /**
46321  * Set this feature as optional.
46322  */
46323 void InitFeatures_set_trampoline_routing_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
46324
46325 /**
46326  * Set this feature as required.
46327  */
46328 void InitFeatures_set_trampoline_routing_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
46329
46330 /**
46331  * Checks if this feature is supported.
46332  */
46333 MUST_USE_RES bool InitFeatures_supports_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46334
46335 /**
46336  * Set this feature as optional.
46337  */
46338 void NodeFeatures_set_trampoline_routing_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46339
46340 /**
46341  * Set this feature as required.
46342  */
46343 void NodeFeatures_set_trampoline_routing_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
46344
46345 /**
46346  * Checks if this feature is supported.
46347  */
46348 MUST_USE_RES bool NodeFeatures_supports_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46349
46350 /**
46351  * Set this feature as optional.
46352  */
46353 void Bolt11InvoiceFeatures_set_trampoline_routing_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46354
46355 /**
46356  * Set this feature as required.
46357  */
46358 void Bolt11InvoiceFeatures_set_trampoline_routing_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46359
46360 /**
46361  * Checks if this feature is supported.
46362  */
46363 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46364
46365 /**
46366  * Checks if this feature is required.
46367  */
46368 MUST_USE_RES bool InitFeatures_requires_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg);
46369
46370 /**
46371  * Checks if this feature is required.
46372  */
46373 MUST_USE_RES bool NodeFeatures_requires_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
46374
46375 /**
46376  * Checks if this feature is required.
46377  */
46378 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
46379
46380 /**
46381  * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
46382  */
46383 void ShutdownScript_free(struct LDKShutdownScript this_obj);
46384
46385 /**
46386  * Creates a copy of the ShutdownScript
46387  */
46388 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
46389
46390 /**
46391  * Checks if two ShutdownScripts contain equal inner contents.
46392  * This ignores pointers and is_owned flags and looks at the values in fields.
46393  * Two objects with NULL inner values will be considered "equal" here.
46394  */
46395 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
46396
46397 /**
46398  * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
46399  */
46400 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
46401
46402 /**
46403  * The script that did not meet the requirements from [BOLT #2].
46404  *
46405  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
46406  */
46407 struct LDKCVec_u8Z InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
46408
46409 /**
46410  * The script that did not meet the requirements from [BOLT #2].
46411  *
46412  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
46413  */
46414 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
46415
46416 /**
46417  * Constructs a new InvalidShutdownScript given each field
46418  */
46419 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
46420
46421 /**
46422  * Creates a copy of the InvalidShutdownScript
46423  */
46424 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
46425
46426 /**
46427  * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
46428  */
46429 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
46430
46431 /**
46432  * Read a ShutdownScript from a byte array, created by ShutdownScript_write
46433  */
46434 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
46435
46436 /**
46437  * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
46438  */
46439 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
46440
46441 /**
46442  * Generates a P2WSH script pubkey from the given [`WScriptHash`].
46443  */
46444 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
46445
46446 /**
46447  * Generates a witness script pubkey from the given segwit version and program.
46448  *
46449  * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
46450  * [`ShutdownScript::new_p2wsh`] instead.
46451  *
46452  * # Errors
46453  *
46454  * This function may return an error if `program` is invalid for the segwit `version`.
46455  */
46456 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessProgram witness_program);
46457
46458 /**
46459  * Converts the shutdown script into the underlying [`ScriptBuf`].
46460  */
46461 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
46462
46463 /**
46464  * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
46465  *
46466  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46467  */
46468 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
46469
46470 /**
46471  * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
46472  *
46473  * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
46474  */
46475 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
46476
46477 /**
46478  * Frees any resources used by the ChannelId, if is_owned is set and inner is non-NULL.
46479  */
46480 void ChannelId_free(struct LDKChannelId this_obj);
46481
46482 const uint8_t (*ChannelId_get_a(const struct LDKChannelId *NONNULL_PTR this_ptr))[32];
46483
46484 void ChannelId_set_a(struct LDKChannelId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
46485
46486 /**
46487  * Constructs a new ChannelId given each field
46488  */
46489 MUST_USE_RES struct LDKChannelId ChannelId_new(struct LDKThirtyTwoBytes a_arg);
46490
46491 /**
46492  * Creates a copy of the ChannelId
46493  */
46494 struct LDKChannelId ChannelId_clone(const struct LDKChannelId *NONNULL_PTR orig);
46495
46496 /**
46497  * Checks if two ChannelIds contain equal inner contents.
46498  * This ignores pointers and is_owned flags and looks at the values in fields.
46499  * Two objects with NULL inner values will be considered "equal" here.
46500  */
46501 bool ChannelId_eq(const struct LDKChannelId *NONNULL_PTR a, const struct LDKChannelId *NONNULL_PTR b);
46502
46503 /**
46504  * Generates a non-cryptographic 64-bit hash of the ChannelId.
46505  */
46506 uint64_t ChannelId_hash(const struct LDKChannelId *NONNULL_PTR o);
46507
46508 /**
46509  * Create _v1_ channel ID based on a funding TX ID and output index
46510  */
46511 MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_txid(const uint8_t (*txid)[32], uint16_t output_index);
46512
46513 /**
46514  * Create _v1_ channel ID from a funding tx outpoint
46515  */
46516 MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_outpoint(struct LDKOutPoint outpoint);
46517
46518 /**
46519  * Create a _temporary_ channel ID randomly, based on an entropy source.
46520  */
46521 MUST_USE_RES struct LDKChannelId ChannelId_temporary_from_entropy_source(const struct LDKEntropySource *NONNULL_PTR entropy_source);
46522
46523 /**
46524  * Generic constructor; create a new channel ID from the provided data.
46525  * Use a more specific `*_from_*` constructor when possible.
46526  */
46527 MUST_USE_RES struct LDKChannelId ChannelId_from_bytes(struct LDKThirtyTwoBytes data);
46528
46529 /**
46530  * Create a channel ID consisting of all-zeros data (e.g. when uninitialized or a placeholder).
46531  */
46532 MUST_USE_RES struct LDKChannelId ChannelId_new_zero(void);
46533
46534 /**
46535  * Check whether ID is consisting of all zeros (uninitialized)
46536  */
46537 MUST_USE_RES bool ChannelId_is_zero(const struct LDKChannelId *NONNULL_PTR this_arg);
46538
46539 /**
46540  * Create _v2_ channel ID by concatenating the holder revocation basepoint with the counterparty
46541  * revocation basepoint and hashing the result. The basepoints will be concatenated in increasing
46542  * sorted order.
46543  */
46544 MUST_USE_RES struct LDKChannelId ChannelId_v2_from_revocation_basepoints(const struct LDKRevocationBasepoint *NONNULL_PTR ours, const struct LDKRevocationBasepoint *NONNULL_PTR theirs);
46545
46546 /**
46547  * Create temporary _v2_ channel ID by concatenating a zeroed out basepoint with the holder
46548  * revocation basepoint and hashing the result.
46549  */
46550 MUST_USE_RES struct LDKChannelId ChannelId_temporary_v2_from_revocation_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR our_revocation_basepoint);
46551
46552 /**
46553  * Serialize the ChannelId object into a byte array which can be read by ChannelId_read
46554  */
46555 struct LDKCVec_u8Z ChannelId_write(const struct LDKChannelId *NONNULL_PTR obj);
46556
46557 /**
46558  * Read a ChannelId from a byte array, created by ChannelId_write
46559  */
46560 struct LDKCResult_ChannelIdDecodeErrorZ ChannelId_read(struct LDKu8slice ser);
46561
46562 /**
46563  * Frees any resources used by the Retry
46564  */
46565 void Retry_free(struct LDKRetry this_ptr);
46566
46567 /**
46568  * Creates a copy of the Retry
46569  */
46570 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
46571
46572 /**
46573  * Utility method to constructs a new Attempts-variant Retry
46574  */
46575 struct LDKRetry Retry_attempts(uint32_t a);
46576
46577 /**
46578  * Utility method to constructs a new Timeout-variant Retry
46579  */
46580 struct LDKRetry Retry_timeout(uint64_t a);
46581
46582 /**
46583  * Checks if two Retrys contain equal inner contents.
46584  * This ignores pointers and is_owned flags and looks at the values in fields.
46585  */
46586 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
46587
46588 /**
46589  * Generates a non-cryptographic 64-bit hash of the Retry.
46590  */
46591 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
46592
46593 /**
46594  * Serialize the Retry object into a byte array which can be read by Retry_read
46595  */
46596 struct LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
46597
46598 /**
46599  * Read a Retry from a byte array, created by Retry_write
46600  */
46601 struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
46602
46603 /**
46604  * Creates a copy of the RetryableSendFailure
46605  */
46606 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
46607
46608 /**
46609  * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
46610  */
46611 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
46612
46613 /**
46614  * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
46615  */
46616 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
46617
46618 /**
46619  * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
46620  */
46621 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
46622
46623 /**
46624  * Checks if two RetryableSendFailures contain equal inner contents.
46625  * This ignores pointers and is_owned flags and looks at the values in fields.
46626  */
46627 bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
46628
46629 /**
46630  * Frees any resources used by the PaymentSendFailure
46631  */
46632 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
46633
46634 /**
46635  * Creates a copy of the PaymentSendFailure
46636  */
46637 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
46638
46639 /**
46640  * Utility method to constructs a new ParameterError-variant PaymentSendFailure
46641  */
46642 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
46643
46644 /**
46645  * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
46646  */
46647 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
46648
46649 /**
46650  * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
46651  */
46652 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
46653
46654 /**
46655  * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
46656  */
46657 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
46658
46659 /**
46660  * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
46661  */
46662 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
46663
46664 /**
46665  * Checks if two PaymentSendFailures contain equal inner contents.
46666  * This ignores pointers and is_owned flags and looks at the values in fields.
46667  */
46668 bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
46669
46670 /**
46671  * Frees any resources used by the ProbeSendFailure
46672  */
46673 void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
46674
46675 /**
46676  * Creates a copy of the ProbeSendFailure
46677  */
46678 struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
46679
46680 /**
46681  * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
46682  */
46683 struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
46684
46685 /**
46686  * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
46687  */
46688 struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
46689
46690 /**
46691  * Checks if two ProbeSendFailures contain equal inner contents.
46692  * This ignores pointers and is_owned flags and looks at the values in fields.
46693  */
46694 bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
46695
46696 /**
46697  * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
46698  */
46699 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
46700
46701 /**
46702  * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
46703  * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
46704  * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
46705  * attacks.
46706  *
46707  * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
46708  * multi-path payments require a recipient-provided secret.
46709  *
46710  * Some implementations may reject spontaneous payments with payment secrets, so you may only
46711  * want to provide a secret for a spontaneous payment if MPP is needed and you know your
46712  * recipient will not reject it.
46713  */
46714 struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
46715
46716 /**
46717  * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
46718  * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
46719  * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
46720  * attacks.
46721  *
46722  * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
46723  * multi-path payments require a recipient-provided secret.
46724  *
46725  * Some implementations may reject spontaneous payments with payment secrets, so you may only
46726  * want to provide a secret for a spontaneous payment if MPP is needed and you know your
46727  * recipient will not reject it.
46728  */
46729 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
46730
46731 /**
46732  * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
46733  * arbitrary length. This gives recipients substantially more flexibility to receive
46734  * additional data.
46735  *
46736  * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
46737  * scheme to authenticate received payments against expected payments and invoices, this field
46738  * is not used in LDK for received payments, and can be used to store arbitrary data in
46739  * invoices which will be received with the payment.
46740  *
46741  * Note that this field was added to the lightning specification more recently than
46742  * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
46743  * may not be supported as universally.
46744  *
46745  * Returns a copy of the field.
46746  */
46747 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
46748
46749 /**
46750  * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
46751  * arbitrary length. This gives recipients substantially more flexibility to receive
46752  * additional data.
46753  *
46754  * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
46755  * scheme to authenticate received payments against expected payments and invoices, this field
46756  * is not used in LDK for received payments, and can be used to store arbitrary data in
46757  * invoices which will be received with the payment.
46758  *
46759  * Note that this field was added to the lightning specification more recently than
46760  * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
46761  * may not be supported as universally.
46762  */
46763 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
46764
46765 /**
46766  * Creates a copy of the RecipientOnionFields
46767  */
46768 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
46769
46770 /**
46771  * Checks if two RecipientOnionFieldss contain equal inner contents.
46772  * This ignores pointers and is_owned flags and looks at the values in fields.
46773  * Two objects with NULL inner values will be considered "equal" here.
46774  */
46775 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
46776
46777 /**
46778  * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
46779  */
46780 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
46781
46782 /**
46783  * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
46784  */
46785 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
46786
46787 /**
46788  * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
46789  * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
46790  * but do not require or provide any further data.
46791  */
46792 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
46793
46794 /**
46795  * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
46796  * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
46797  * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
46798  * a spontaneous MPP this will not work as all MPP require payment secrets; you may
46799  * instead want to use [`RecipientOnionFields::secret_only`].
46800  *
46801  * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
46802  * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
46803  */
46804 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
46805
46806 /**
46807  * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
46808  * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
46809  * respectively. TLV type numbers must be unique and within the range
46810  * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
46811  *
46812  * This method will also error for types in the experimental range which have been
46813  * standardized within the protocol, which only includes 5482373484 (keysend) for now.
46814  *
46815  * See [`Self::custom_tlvs`] for more info.
46816  */
46817 MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
46818
46819 /**
46820  * Gets the custom TLVs that will be sent or have been received.
46821  *
46822  * Custom TLVs allow sending extra application-specific data with a payment. They provide
46823  * additional flexibility on top of payment metadata, as while other implementations may
46824  * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
46825  * do not have this restriction.
46826  *
46827  * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
46828  * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
46829  * This is validated when setting this field using [`Self::with_custom_tlvs`].
46830  */
46831 MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
46832
46833 /**
46834  * Calls the free function if one is set
46835  */
46836 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
46837
46838 /**
46839  * Creates a copy of a Type
46840  */
46841 struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
46842
46843 /**
46844  * Calls the free function if one is set
46845  */
46846 void Type_free(struct LDKType this_ptr);
46847
46848 /**
46849  * Frees any resources used by the OfferId, if is_owned is set and inner is non-NULL.
46850  */
46851 void OfferId_free(struct LDKOfferId this_obj);
46852
46853 const uint8_t (*OfferId_get_a(const struct LDKOfferId *NONNULL_PTR this_ptr))[32];
46854
46855 void OfferId_set_a(struct LDKOfferId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
46856
46857 /**
46858  * Constructs a new OfferId given each field
46859  */
46860 MUST_USE_RES struct LDKOfferId OfferId_new(struct LDKThirtyTwoBytes a_arg);
46861
46862 /**
46863  * Creates a copy of the OfferId
46864  */
46865 struct LDKOfferId OfferId_clone(const struct LDKOfferId *NONNULL_PTR orig);
46866
46867 /**
46868  * Checks if two OfferIds contain equal inner contents.
46869  * This ignores pointers and is_owned flags and looks at the values in fields.
46870  * Two objects with NULL inner values will be considered "equal" here.
46871  */
46872 bool OfferId_eq(const struct LDKOfferId *NONNULL_PTR a, const struct LDKOfferId *NONNULL_PTR b);
46873
46874 /**
46875  * Serialize the OfferId object into a byte array which can be read by OfferId_read
46876  */
46877 struct LDKCVec_u8Z OfferId_write(const struct LDKOfferId *NONNULL_PTR obj);
46878
46879 /**
46880  * Read a OfferId from a byte array, created by OfferId_write
46881  */
46882 struct LDKCResult_OfferIdDecodeErrorZ OfferId_read(struct LDKu8slice ser);
46883
46884 /**
46885  * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
46886  */
46887 void Offer_free(struct LDKOffer this_obj);
46888
46889 /**
46890  * Creates a copy of the Offer
46891  */
46892 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
46893
46894 /**
46895  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
46896  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
46897  * for the selected chain.
46898  */
46899 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
46900
46901 /**
46902  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
46903  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
46904  */
46905 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
46906
46907 /**
46908  * The minimum amount required for a successful payment of a single item.
46909  */
46910 MUST_USE_RES struct LDKCOption_AmountZ Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
46911
46912 /**
46913  * A complete description of the purpose of the payment. Intended to be displayed to the user
46914  * but with the caveat that it has not been verified in any way.
46915  *
46916  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46917  */
46918 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
46919
46920 /**
46921  * Features pertaining to the offer.
46922  */
46923 MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
46924
46925 /**
46926  * Duration since the Unix epoch when an invoice should no longer be requested.
46927  *
46928  * If `None`, the offer does not expire.
46929  */
46930 MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
46931
46932 /**
46933  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
46934  * displayed to the user but with the caveat that it has not been verified in any way.
46935  *
46936  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46937  */
46938 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
46939
46940 /**
46941  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
46942  * recipient privacy by obfuscating its node id.
46943  */
46944 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
46945
46946 /**
46947  * The quantity of items supported.
46948  */
46949 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
46950
46951 /**
46952  * The public key used by the recipient to sign invoices.
46953  *
46954  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46955  */
46956 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
46957
46958 /**
46959  * Returns the id of the offer.
46960  */
46961 MUST_USE_RES struct LDKOfferId Offer_id(const struct LDKOffer *NONNULL_PTR this_arg);
46962
46963 /**
46964  * Returns whether the given chain is supported by the offer.
46965  */
46966 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
46967
46968 /**
46969  * Whether the offer has expired.
46970  */
46971 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
46972
46973 /**
46974  * Whether the offer has expired given the duration since the Unix epoch.
46975  */
46976 MUST_USE_RES bool Offer_is_expired_no_std(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
46977
46978 /**
46979  * Returns whether the given quantity is valid for the offer.
46980  */
46981 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
46982
46983 /**
46984  * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
46985  *
46986  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
46987  */
46988 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
46989
46990 /**
46991  * Similar to [`Offer::request_invoice`] except it:
46992  * - derives the [`InvoiceRequest::payer_id`] such that a different key can be used for each
46993  *   request,
46994  * - sets [`InvoiceRequest::payer_metadata`] when [`InvoiceRequestBuilder::build`] is called
46995  *   such that it can be used by [`Bolt12Invoice::verify`] to determine if the invoice was
46996  *   requested using a base [`ExpandedKey`] from which the payer id was derived, and
46997  * - includes the [`PaymentId`] encrypted in [`InvoiceRequest::payer_metadata`] so that it can
46998  *   be used when sending the payment for the requested invoice.
46999  *
47000  * Useful to protect the sender's privacy.
47001  *
47002  * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
47003  * [`InvoiceRequest::payer_metadata`]: crate::offers::invoice_request::InvoiceRequest::payer_metadata
47004  * [`Bolt12Invoice::verify`]: crate::offers::invoice::Bolt12Invoice::verify
47005  * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
47006  */
47007 MUST_USE_RES struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_payer_id(const struct LDKOffer *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, struct LDKThirtyTwoBytes payment_id);
47008
47009 /**
47010  * Similar to [`Offer::request_invoice_deriving_payer_id`] except uses `payer_id` for the
47011  * [`InvoiceRequest::payer_id`] instead of deriving a different key for each request.
47012  *
47013  * Useful for recurring payments using the same `payer_id` with different invoices.
47014  *
47015  * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id
47016  */
47017 MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_metadata(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKPublicKey payer_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, struct LDKThirtyTwoBytes payment_id);
47018
47019 /**
47020  * Creates an [`InvoiceRequestBuilder`] for the offer with the given `metadata` and `payer_id`,
47021  * which will be reflected in the `Bolt12Invoice` response.
47022  *
47023  * The `metadata` is useful for including information about the derivation of `payer_id` such
47024  * that invoice response handling can be stateless. Also serves as payer-provided entropy while
47025  * hashing in the signature calculation.
47026  *
47027  * This should not leak any information such as by using a simple BIP-32 derivation path.
47028  * Otherwise, payments may be correlated.
47029  *
47030  * Errors if the offer contains unknown required features.
47031  *
47032  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
47033  */
47034 MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id);
47035
47036 /**
47037  * Generates a non-cryptographic 64-bit hash of the Offer.
47038  */
47039 uint64_t Offer_hash(const struct LDKOffer *NONNULL_PTR o);
47040
47041 /**
47042  * Serialize the Offer object into a byte array which can be read by Offer_read
47043  */
47044 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
47045
47046 /**
47047  * Frees any resources used by the Amount
47048  */
47049 void Amount_free(struct LDKAmount this_ptr);
47050
47051 /**
47052  * Creates a copy of the Amount
47053  */
47054 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
47055
47056 /**
47057  * Utility method to constructs a new Bitcoin-variant Amount
47058  */
47059 struct LDKAmount Amount_bitcoin(uint64_t amount_msats);
47060
47061 /**
47062  * Utility method to constructs a new Currency-variant Amount
47063  */
47064 struct LDKAmount Amount_currency(struct LDKThreeBytes iso4217_code, uint64_t amount);
47065
47066 /**
47067  * Frees any resources used by the Quantity
47068  */
47069 void Quantity_free(struct LDKQuantity this_ptr);
47070
47071 /**
47072  * Creates a copy of the Quantity
47073  */
47074 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
47075
47076 /**
47077  * Utility method to constructs a new Bounded-variant Quantity
47078  */
47079 struct LDKQuantity Quantity_bounded(uint64_t a);
47080
47081 /**
47082  * Utility method to constructs a new Unbounded-variant Quantity
47083  */
47084 struct LDKQuantity Quantity_unbounded(void);
47085
47086 /**
47087  * Utility method to constructs a new One-variant Quantity
47088  */
47089 struct LDKQuantity Quantity_one(void);
47090
47091 /**
47092  * Read a Offer object from a string
47093  */
47094 struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
47095
47096 /**
47097  * Frees any resources used by the InvoiceWithExplicitSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
47098  */
47099 void InvoiceWithExplicitSigningPubkeyBuilder_free(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj);
47100
47101 /**
47102  * Frees any resources used by the InvoiceWithDerivedSigningPubkeyBuilder, if is_owned is set and inner is non-NULL.
47103  */
47104 void InvoiceWithDerivedSigningPubkeyBuilder_free(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj);
47105
47106 /**
47107  * Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. It can be signed by
47108  * [`UnsignedBolt12Invoice::sign`].
47109  */
47110 MUST_USE_RES struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ InvoiceWithExplicitSigningPubkeyBuilder_build(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
47111
47112 /**
47113  * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`].
47114  * Any expiry that has already passed is valid and can be checked for using
47115  * [`Bolt12Invoice::is_expired`].
47116  *
47117  * Successive calls to this method will override the previous setting.
47118  */
47119 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
47120
47121 /**
47122  * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
47123  *
47124  * Successive calls to this method will add another address. Caller is responsible for not
47125  * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
47126  */
47127 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
47128
47129 /**
47130  * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
47131  *
47132  * Successive calls to this method will add another address. Caller is responsible for not
47133  * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
47134  */
47135 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
47136
47137 /**
47138  * Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
47139  *
47140  * Successive calls to this method will add another address. Caller is responsible for not
47141  * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
47142  */
47143 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
47144
47145 /**
47146  * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is
47147  * disallowed.
47148  */
47149 MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg);
47150
47151 /**
47152  * Builds a signed [`Bolt12Invoice`] after checking for valid semantics.
47153  */
47154 MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
47155
47156 /**
47157  * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`].
47158  * Any expiry that has already passed is valid and can be checked for using
47159  * [`Bolt12Invoice::is_expired`].
47160  *
47161  * Successive calls to this method will override the previous setting.
47162  */
47163 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs);
47164
47165 /**
47166  * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`].
47167  *
47168  * Successive calls to this method will add another address. Caller is responsible for not
47169  * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses.
47170  */
47171 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]);
47172
47173 /**
47174  * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`].
47175  *
47176  * Successive calls to this method will add another address. Caller is responsible for not
47177  * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses.
47178  */
47179 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]);
47180
47181 /**
47182  * Adds a P2TR address to [`Bolt12Invoice::fallbacks`].
47183  *
47184  * Successive calls to this method will add another address. Caller is responsible for not
47185  * adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
47186  */
47187 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key);
47188
47189 /**
47190  * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is
47191  * disallowed.
47192  */
47193 MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg);
47194
47195 /**
47196  * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
47197  */
47198 void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
47199
47200 /**
47201  * Calls the free function if one is set
47202  */
47203 void SignBolt12InvoiceFn_free(struct LDKSignBolt12InvoiceFn this_ptr);
47204
47205 /**
47206  * Returns the [`TaggedHash`] of the invoice to sign.
47207  */
47208 MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47209
47210 /**
47211  * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
47212  */
47213 void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
47214
47215 /**
47216  * Creates a copy of the Bolt12Invoice
47217  */
47218 struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
47219
47220 /**
47221  * The chains that may be used when paying a requested invoice.
47222  *
47223  * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
47224  *
47225  * [`Offer::chains`]: crate::offers::offer::Offer::chains
47226  */
47227 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47228
47229 /**
47230  * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
47231  * invoice originated from an offer.
47232  *
47233  * From [`InvoiceRequest::chain`] or [`Refund::chain`].
47234  *
47235  * [`offer_chains`]: Self::offer_chains
47236  * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
47237  */
47238 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47239
47240 /**
47241  * Opaque bytes set by the originating [`Offer`].
47242  *
47243  * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
47244  * if the [`Offer`] did not set it.
47245  *
47246  * [`Offer`]: crate::offers::offer::Offer
47247  * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
47248  */
47249 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47250
47251 /**
47252  * The minimum amount required for a successful payment of a single item.
47253  *
47254  * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
47255  * the [`Offer`] did not set it.
47256  *
47257  * [`Offer`]: crate::offers::offer::Offer
47258  * [`Offer::amount`]: crate::offers::offer::Offer::amount
47259  */
47260 MUST_USE_RES struct LDKCOption_AmountZ UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47261
47262 /**
47263  * Features pertaining to the originating [`Offer`].
47264  *
47265  * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
47266  * [`Refund`].
47267  *
47268  * [`Offer`]: crate::offers::offer::Offer
47269  * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
47270  *
47271  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47272  */
47273 MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47274
47275 /**
47276  * A complete description of the purpose of the originating offer or refund.
47277  *
47278  * From [`Offer::description`] or [`Refund::description`].
47279  *
47280  * [`Offer::description`]: crate::offers::offer::Offer::description
47281  *
47282  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47283  */
47284 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47285
47286 /**
47287  * Duration since the Unix epoch when an invoice should no longer be requested.
47288  *
47289  * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
47290  *
47291  * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
47292  */
47293 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47294
47295 /**
47296  * The issuer of the offer or refund.
47297  *
47298  * From [`Offer::issuer`] or [`Refund::issuer`].
47299  *
47300  * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
47301  *
47302  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47303  */
47304 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47305
47306 /**
47307  * Paths to the recipient originating from publicly reachable nodes.
47308  *
47309  * From [`Offer::paths`] or [`Refund::paths`].
47310  *
47311  * [`Offer::paths`]: crate::offers::offer::Offer::paths
47312  */
47313 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47314
47315 /**
47316  * The quantity of items supported.
47317  *
47318  * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
47319  * [`Refund`].
47320  *
47321  * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
47322  */
47323 MUST_USE_RES struct LDKCOption_QuantityZ UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47324
47325 /**
47326  * An unpredictable series of bytes from the payer.
47327  *
47328  * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
47329  */
47330 MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47331
47332 /**
47333  * Features pertaining to requesting an invoice.
47334  *
47335  * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
47336  */
47337 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47338
47339 /**
47340  * The quantity of items requested or refunded for.
47341  *
47342  * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
47343  */
47344 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47345
47346 /**
47347  * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
47348  * refund in case there are no [`message_paths`].
47349  *
47350  * [`message_paths`]: Self::message_paths
47351  */
47352 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47353
47354 /**
47355  * A payer-provided note reflected back in the invoice.
47356  *
47357  * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
47358  *
47359  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47360  */
47361 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47362
47363 /**
47364  * Duration since the Unix epoch when the invoice was created.
47365  */
47366 MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47367
47368 /**
47369  * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
47370  * should no longer be paid.
47371  */
47372 MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47373
47374 /**
47375  * Whether the invoice has expired.
47376  */
47377 MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47378
47379 /**
47380  * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
47381  */
47382 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47383
47384 /**
47385  * The minimum amount required for a successful payment of the invoice.
47386  */
47387 MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47388
47389 /**
47390  * Features pertaining to paying an invoice.
47391  */
47392 MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47393
47394 /**
47395  * The public key corresponding to the key used to sign the invoice.
47396  */
47397 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
47398
47399 /**
47400  * The chains that may be used when paying a requested invoice.
47401  *
47402  * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
47403  *
47404  * [`Offer::chains`]: crate::offers::offer::Offer::chains
47405  */
47406 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47407
47408 /**
47409  * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
47410  * invoice originated from an offer.
47411  *
47412  * From [`InvoiceRequest::chain`] or [`Refund::chain`].
47413  *
47414  * [`offer_chains`]: Self::offer_chains
47415  * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
47416  */
47417 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47418
47419 /**
47420  * Opaque bytes set by the originating [`Offer`].
47421  *
47422  * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
47423  * if the [`Offer`] did not set it.
47424  *
47425  * [`Offer`]: crate::offers::offer::Offer
47426  * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
47427  */
47428 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47429
47430 /**
47431  * The minimum amount required for a successful payment of a single item.
47432  *
47433  * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
47434  * the [`Offer`] did not set it.
47435  *
47436  * [`Offer`]: crate::offers::offer::Offer
47437  * [`Offer::amount`]: crate::offers::offer::Offer::amount
47438  */
47439 MUST_USE_RES struct LDKCOption_AmountZ Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47440
47441 /**
47442  * Features pertaining to the originating [`Offer`].
47443  *
47444  * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
47445  * [`Refund`].
47446  *
47447  * [`Offer`]: crate::offers::offer::Offer
47448  * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
47449  *
47450  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47451  */
47452 MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47453
47454 /**
47455  * A complete description of the purpose of the originating offer or refund.
47456  *
47457  * From [`Offer::description`] or [`Refund::description`].
47458  *
47459  * [`Offer::description`]: crate::offers::offer::Offer::description
47460  *
47461  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47462  */
47463 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47464
47465 /**
47466  * Duration since the Unix epoch when an invoice should no longer be requested.
47467  *
47468  * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
47469  *
47470  * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
47471  */
47472 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47473
47474 /**
47475  * The issuer of the offer or refund.
47476  *
47477  * From [`Offer::issuer`] or [`Refund::issuer`].
47478  *
47479  * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
47480  *
47481  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47482  */
47483 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47484
47485 /**
47486  * Paths to the recipient originating from publicly reachable nodes.
47487  *
47488  * From [`Offer::paths`] or [`Refund::paths`].
47489  *
47490  * [`Offer::paths`]: crate::offers::offer::Offer::paths
47491  */
47492 MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47493
47494 /**
47495  * The quantity of items supported.
47496  *
47497  * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
47498  * [`Refund`].
47499  *
47500  * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
47501  */
47502 MUST_USE_RES struct LDKCOption_QuantityZ Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47503
47504 /**
47505  * An unpredictable series of bytes from the payer.
47506  *
47507  * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
47508  */
47509 MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47510
47511 /**
47512  * Features pertaining to requesting an invoice.
47513  *
47514  * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
47515  */
47516 MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47517
47518 /**
47519  * The quantity of items requested or refunded for.
47520  *
47521  * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
47522  */
47523 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47524
47525 /**
47526  * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
47527  * refund in case there are no [`message_paths`].
47528  *
47529  * [`message_paths`]: Self::message_paths
47530  */
47531 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47532
47533 /**
47534  * A payer-provided note reflected back in the invoice.
47535  *
47536  * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
47537  *
47538  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47539  */
47540 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47541
47542 /**
47543  * Duration since the Unix epoch when the invoice was created.
47544  */
47545 MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47546
47547 /**
47548  * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
47549  * should no longer be paid.
47550  */
47551 MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47552
47553 /**
47554  * Whether the invoice has expired.
47555  */
47556 MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47557
47558 /**
47559  * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
47560  */
47561 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47562
47563 /**
47564  * The minimum amount required for a successful payment of the invoice.
47565  */
47566 MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47567
47568 /**
47569  * Features pertaining to paying an invoice.
47570  */
47571 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47572
47573 /**
47574  * The public key corresponding to the key used to sign the invoice.
47575  */
47576 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47577
47578 /**
47579  * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
47580  */
47581 MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47582
47583 /**
47584  * Hash that was used for signing the invoice.
47585  */
47586 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
47587
47588 /**
47589  * Verifies that the invoice was for a request or refund created using the given key. Returns
47590  * the associated [`PaymentId`] to use when sending the payment.
47591  */
47592 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
47593
47594 /**
47595  * Generates a non-cryptographic 64-bit hash of the Bolt12Invoice.
47596  */
47597 uint64_t Bolt12Invoice_hash(const struct LDKBolt12Invoice *NONNULL_PTR o);
47598
47599 /**
47600  * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
47601  */
47602 struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
47603
47604 /**
47605  * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
47606  */
47607 struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
47608
47609 /**
47610  * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
47611  */
47612 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
47613
47614 /**
47615  * Base fee charged (in millisatoshi) for the entire blinded path.
47616  */
47617 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
47618
47619 /**
47620  * Base fee charged (in millisatoshi) for the entire blinded path.
47621  */
47622 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
47623
47624 /**
47625  * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
47626  * (i.e., 10,000 is 1%).
47627  */
47628 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
47629
47630 /**
47631  * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
47632  * (i.e., 10,000 is 1%).
47633  */
47634 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
47635
47636 /**
47637  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
47638  * path.
47639  */
47640 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
47641
47642 /**
47643  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
47644  * path.
47645  */
47646 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
47647
47648 /**
47649  * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
47650  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
47651  * seen by the recipient.
47652  */
47653 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
47654
47655 /**
47656  * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
47657  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
47658  * seen by the recipient.
47659  */
47660 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
47661
47662 /**
47663  * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
47664  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
47665  * seen by the recipient.
47666  */
47667 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
47668
47669 /**
47670  * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
47671  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
47672  * seen by the recipient.
47673  */
47674 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
47675
47676 /**
47677  * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
47678  * onion payload.
47679  */
47680 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
47681
47682 /**
47683  * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
47684  * onion payload.
47685  */
47686 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
47687
47688 /**
47689  * Constructs a new BlindedPayInfo given each field
47690  */
47691 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);
47692
47693 /**
47694  * Creates a copy of the BlindedPayInfo
47695  */
47696 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
47697
47698 /**
47699  * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
47700  */
47701 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
47702
47703 /**
47704  * Checks if two BlindedPayInfos contain equal inner contents.
47705  * This ignores pointers and is_owned flags and looks at the values in fields.
47706  * Two objects with NULL inner values will be considered "equal" here.
47707  */
47708 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
47709
47710 /**
47711  * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
47712  */
47713 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
47714
47715 /**
47716  * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
47717  */
47718 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
47719
47720 /**
47721  * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
47722  */
47723 void InvoiceError_free(struct LDKInvoiceError this_obj);
47724
47725 /**
47726  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
47727  *
47728  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
47729  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
47730  *
47731  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47732  */
47733 struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
47734
47735 /**
47736  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
47737  *
47738  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
47739  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
47740  *
47741  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
47742  */
47743 void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
47744
47745 /**
47746  * An explanation of the error.
47747  */
47748 struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
47749
47750 /**
47751  * An explanation of the error.
47752  */
47753 void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
47754
47755 /**
47756  * Constructs a new InvoiceError given each field
47757  *
47758  * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
47759  */
47760 MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
47761
47762 /**
47763  * Creates a copy of the InvoiceError
47764  */
47765 struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
47766
47767 /**
47768  * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
47769  */
47770 void ErroneousField_free(struct LDKErroneousField this_obj);
47771
47772 /**
47773  * The type number of the TLV field containing the error.
47774  */
47775 uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
47776
47777 /**
47778  * The type number of the TLV field containing the error.
47779  */
47780 void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
47781
47782 /**
47783  * A value to use for the TLV field to avoid the error.
47784  *
47785  * Returns a copy of the field.
47786  */
47787 struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
47788
47789 /**
47790  * A value to use for the TLV field to avoid the error.
47791  */
47792 void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
47793
47794 /**
47795  * Constructs a new ErroneousField given each field
47796  */
47797 MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
47798
47799 /**
47800  * Creates a copy of the ErroneousField
47801  */
47802 struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
47803
47804 /**
47805  * Creates an [`InvoiceError`] with the given message.
47806  */
47807 MUST_USE_RES struct LDKInvoiceError InvoiceError_from_string(struct LDKStr s);
47808
47809 /**
47810  * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
47811  */
47812 struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
47813
47814 /**
47815  * Read a InvoiceError from a byte array, created by InvoiceError_write
47816  */
47817 struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
47818
47819 /**
47820  * Frees any resources used by the InvoiceRequestWithExplicitPayerIdBuilder, if is_owned is set and inner is non-NULL.
47821  */
47822 void InvoiceRequestWithExplicitPayerIdBuilder_free(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj);
47823
47824 /**
47825  * Frees any resources used by the InvoiceRequestWithDerivedPayerIdBuilder, if is_owned is set and inner is non-NULL.
47826  */
47827 void InvoiceRequestWithDerivedPayerIdBuilder_free(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj);
47828
47829 /**
47830  * Builds an unsigned [`InvoiceRequest`] after checking for valid semantics. It can be signed
47831  * by [`UnsignedInvoiceRequest::sign`].
47832  */
47833 MUST_USE_RES struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_build(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg);
47834
47835 /**
47836  * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
47837  * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
47838  * by the offer.
47839  *
47840  * Successive calls to this method will override the previous setting.
47841  */
47842 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_chain(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, enum LDKNetwork network);
47843
47844 /**
47845  * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
47846  * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
47847  *
47848  * Successive calls to this method will override the previous setting.
47849  *
47850  * [`quantity`]: Self::quantity
47851  */
47852 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t amount_msats);
47853
47854 /**
47855  * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
47856  * does not conform to [`Offer::is_valid_quantity`].
47857  *
47858  * Successive calls to this method will override the previous setting.
47859  */
47860 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_quantity(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t quantity);
47861
47862 /**
47863  * Sets the [`InvoiceRequest::payer_note`].
47864  *
47865  * Successive calls to this method will override the previous setting.
47866  */
47867 MUST_USE_RES void InvoiceRequestWithExplicitPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, struct LDKStr payer_note);
47868
47869 /**
47870  * Builds a signed [`InvoiceRequest`] after checking for valid semantics.
47871  */
47872 MUST_USE_RES struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg);
47873
47874 /**
47875  * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not
47876  * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported
47877  * by the offer.
47878  *
47879  * Successive calls to this method will override the previous setting.
47880  */
47881 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_chain(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, enum LDKNetwork network);
47882
47883 /**
47884  * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is
47885  * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]).
47886  *
47887  * Successive calls to this method will override the previous setting.
47888  *
47889  * [`quantity`]: Self::quantity
47890  */
47891 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t amount_msats);
47892
47893 /**
47894  * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity`
47895  * does not conform to [`Offer::is_valid_quantity`].
47896  *
47897  * Successive calls to this method will override the previous setting.
47898  */
47899 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_quantity(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t quantity);
47900
47901 /**
47902  * Sets the [`InvoiceRequest::payer_note`].
47903  *
47904  * Successive calls to this method will override the previous setting.
47905  */
47906 MUST_USE_RES void InvoiceRequestWithDerivedPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, struct LDKStr payer_note);
47907
47908 /**
47909  * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
47910  */
47911 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
47912
47913 /**
47914  * Calls the free function if one is set
47915  */
47916 void SignInvoiceRequestFn_free(struct LDKSignInvoiceRequestFn this_ptr);
47917
47918 /**
47919  * Returns the [`TaggedHash`] of the invoice to sign.
47920  */
47921 MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
47922
47923 /**
47924  * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
47925  */
47926 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
47927
47928 /**
47929  * Creates a copy of the InvoiceRequest
47930  */
47931 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
47932
47933 /**
47934  * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
47935  */
47936 void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
47937
47938 /**
47939  * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
47940  */
47941 struct LDKOfferId VerifiedInvoiceRequest_get_offer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
47942
47943 /**
47944  * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
47945  */
47946 void VerifiedInvoiceRequest_set_offer_id(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKOfferId val);
47947
47948 /**
47949  * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
47950  *
47951  * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
47952  * [`respond_with`].
47953  *
47954  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
47955  * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
47956  * [`respond_with`]: Self::respond_with
47957  */
47958 struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
47959
47960 /**
47961  * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
47962  *
47963  * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
47964  * [`respond_with`].
47965  *
47966  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
47967  * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
47968  * [`respond_with`]: Self::respond_with
47969  */
47970 void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val);
47971
47972 /**
47973  * Creates a copy of the VerifiedInvoiceRequest
47974  */
47975 struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
47976
47977 /**
47978  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
47979  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
47980  * for the selected chain.
47981  */
47982 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
47983
47984 /**
47985  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
47986  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
47987  */
47988 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
47989
47990 /**
47991  * The minimum amount required for a successful payment of a single item.
47992  */
47993 MUST_USE_RES struct LDKCOption_AmountZ UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
47994
47995 /**
47996  * A complete description of the purpose of the payment. Intended to be displayed to the user
47997  * but with the caveat that it has not been verified in any way.
47998  *
47999  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48000  */
48001 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48002
48003 /**
48004  * Features pertaining to the offer.
48005  */
48006 MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48007
48008 /**
48009  * Duration since the Unix epoch when an invoice should no longer be requested.
48010  *
48011  * If `None`, the offer does not expire.
48012  */
48013 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48014
48015 /**
48016  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
48017  * displayed to the user but with the caveat that it has not been verified in any way.
48018  *
48019  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48020  */
48021 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48022
48023 /**
48024  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
48025  * recipient privacy by obfuscating its node id.
48026  */
48027 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48028
48029 /**
48030  * The quantity of items supported.
48031  */
48032 MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48033
48034 /**
48035  * The public key used by the recipient to sign invoices.
48036  *
48037  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48038  */
48039 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48040
48041 /**
48042  * An unpredictable series of bytes, typically containing information about the derivation of
48043  * [`payer_id`].
48044  *
48045  * [`payer_id`]: Self::payer_id
48046  */
48047 MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48048
48049 /**
48050  * A chain from [`Offer::chains`] that the offer is valid for.
48051  */
48052 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48053
48054 /**
48055  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
48056  * must be greater than or equal to [`Offer::amount`], converted if necessary.
48057  *
48058  * [`chain`]: Self::chain
48059  */
48060 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48061
48062 /**
48063  * Features pertaining to requesting an invoice.
48064  */
48065 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48066
48067 /**
48068  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48069  */
48070 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48071
48072 /**
48073  * A possibly transient pubkey used to sign the invoice request.
48074  */
48075 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48076
48077 /**
48078  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48079  * response.
48080  *
48081  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48082  */
48083 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
48084
48085 /**
48086  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
48087  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
48088  * for the selected chain.
48089  */
48090 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48091
48092 /**
48093  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
48094  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
48095  */
48096 MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48097
48098 /**
48099  * The minimum amount required for a successful payment of a single item.
48100  */
48101 MUST_USE_RES struct LDKCOption_AmountZ InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48102
48103 /**
48104  * A complete description of the purpose of the payment. Intended to be displayed to the user
48105  * but with the caveat that it has not been verified in any way.
48106  *
48107  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48108  */
48109 MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48110
48111 /**
48112  * Features pertaining to the offer.
48113  */
48114 MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48115
48116 /**
48117  * Duration since the Unix epoch when an invoice should no longer be requested.
48118  *
48119  * If `None`, the offer does not expire.
48120  */
48121 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48122
48123 /**
48124  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
48125  * displayed to the user but with the caveat that it has not been verified in any way.
48126  *
48127  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48128  */
48129 MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48130
48131 /**
48132  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
48133  * recipient privacy by obfuscating its node id.
48134  */
48135 MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48136
48137 /**
48138  * The quantity of items supported.
48139  */
48140 MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48141
48142 /**
48143  * The public key used by the recipient to sign invoices.
48144  *
48145  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48146  */
48147 MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48148
48149 /**
48150  * An unpredictable series of bytes, typically containing information about the derivation of
48151  * [`payer_id`].
48152  *
48153  * [`payer_id`]: Self::payer_id
48154  */
48155 MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48156
48157 /**
48158  * A chain from [`Offer::chains`] that the offer is valid for.
48159  */
48160 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48161
48162 /**
48163  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
48164  * must be greater than or equal to [`Offer::amount`], converted if necessary.
48165  *
48166  * [`chain`]: Self::chain
48167  */
48168 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48169
48170 /**
48171  * Features pertaining to requesting an invoice.
48172  */
48173 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48174
48175 /**
48176  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48177  */
48178 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48179
48180 /**
48181  * A possibly transient pubkey used to sign the invoice request.
48182  */
48183 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48184
48185 /**
48186  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48187  * response.
48188  *
48189  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48190  */
48191 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48192
48193 /**
48194  * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
48195  * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
48196  *
48197  * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
48198  * creation time is used for the `created_at` parameter.
48199  *
48200  * [`Duration`]: core::time::Duration
48201  */
48202 MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
48203
48204 /**
48205  * Creates an [`InvoiceBuilder`] for the request with the given required fields.
48206  *
48207  * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
48208  * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
48209  * where [`std::time::SystemTime`] is not available.
48210  *
48211  * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
48212  * for the invoice.
48213  *
48214  * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
48215  * must contain one or more elements ordered from most-preferred to least-preferred, if there's
48216  * a preference. Note, however, that any privacy is lost if a public node id was used for
48217  * [`Offer::signing_pubkey`].
48218  *
48219  * Errors if the request contains unknown required features.
48220  *
48221  * # Note
48222  *
48223  * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
48224  * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead.
48225  *
48226  * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
48227  * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
48228  */
48229 MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with_no_std(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
48230
48231 /**
48232  * Verifies that the request was for an offer created using the given key. Returns the verified
48233  * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request
48234  * if they could be extracted from the metadata.
48235  *
48236  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48237  */
48238 MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
48239
48240 /**
48241  * Signature of the invoice request using [`payer_id`].
48242  *
48243  * [`payer_id`]: Self::payer_id
48244  */
48245 MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
48246
48247 /**
48248  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
48249  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
48250  * for the selected chain.
48251  */
48252 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48253
48254 /**
48255  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
48256  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
48257  */
48258 MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48259
48260 /**
48261  * The minimum amount required for a successful payment of a single item.
48262  */
48263 MUST_USE_RES struct LDKCOption_AmountZ VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48264
48265 /**
48266  * A complete description of the purpose of the payment. Intended to be displayed to the user
48267  * but with the caveat that it has not been verified in any way.
48268  *
48269  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48270  */
48271 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48272
48273 /**
48274  * Features pertaining to the offer.
48275  */
48276 MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48277
48278 /**
48279  * Duration since the Unix epoch when an invoice should no longer be requested.
48280  *
48281  * If `None`, the offer does not expire.
48282  */
48283 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48284
48285 /**
48286  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
48287  * displayed to the user but with the caveat that it has not been verified in any way.
48288  *
48289  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48290  */
48291 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48292
48293 /**
48294  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
48295  * recipient privacy by obfuscating its node id.
48296  */
48297 MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48298
48299 /**
48300  * The quantity of items supported.
48301  */
48302 MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48303
48304 /**
48305  * The public key used by the recipient to sign invoices.
48306  *
48307  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48308  */
48309 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48310
48311 /**
48312  * An unpredictable series of bytes, typically containing information about the derivation of
48313  * [`payer_id`].
48314  *
48315  * [`payer_id`]: Self::payer_id
48316  */
48317 MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48318
48319 /**
48320  * A chain from [`Offer::chains`] that the offer is valid for.
48321  */
48322 MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48323
48324 /**
48325  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
48326  * must be greater than or equal to [`Offer::amount`], converted if necessary.
48327  *
48328  * [`chain`]: Self::chain
48329  */
48330 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48331
48332 /**
48333  * Features pertaining to requesting an invoice.
48334  */
48335 MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48336
48337 /**
48338  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48339  */
48340 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48341
48342 /**
48343  * A possibly transient pubkey used to sign the invoice request.
48344  */
48345 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48346
48347 /**
48348  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48349  * response.
48350  *
48351  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48352  */
48353 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
48354
48355 /**
48356  * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the
48357  * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time.
48358  *
48359  * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned
48360  * creation time is used for the `created_at` parameter.
48361  *
48362  * [`Duration`]: core::time::Duration
48363  */
48364 MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
48365
48366 /**
48367  * Creates an [`InvoiceBuilder`] for the request with the given required fields.
48368  *
48369  * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after
48370  * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds
48371  * where [`std::time::SystemTime`] is not available.
48372  *
48373  * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment
48374  * for the invoice.
48375  *
48376  * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It
48377  * must contain one or more elements ordered from most-preferred to least-preferred, if there's
48378  * a preference. Note, however, that any privacy is lost if a public node id was used for
48379  * [`Offer::signing_pubkey`].
48380  *
48381  * Errors if the request contains unknown required features.
48382  *
48383  * # Note
48384  *
48385  * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
48386  * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead.
48387  *
48388  * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
48389  * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey
48390  */
48391 MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
48392
48393 /**
48394  * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
48395  * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
48396  * the same [`ExpandedKey`] as the one used to create the offer.
48397  *
48398  * See [`InvoiceRequest::respond_with`] for further details.
48399  *
48400  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48401  */
48402 MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash);
48403
48404 /**
48405  * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses
48406  * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use
48407  * the same [`ExpandedKey`] as the one used to create the offer.
48408  *
48409  * See [`InvoiceRequest::respond_with_no_std`] for further details.
48410  *
48411  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48412  */
48413 MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at);
48414
48415 /**
48416  * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
48417  */
48418 struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
48419
48420 /**
48421  * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
48422  */
48423 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
48424
48425 /**
48426  * Frees any resources used by the InvoiceRequestFields, if is_owned is set and inner is non-NULL.
48427  */
48428 void InvoiceRequestFields_free(struct LDKInvoiceRequestFields this_obj);
48429
48430 /**
48431  * A possibly transient pubkey used to sign the invoice request.
48432  */
48433 struct LDKPublicKey InvoiceRequestFields_get_payer_id(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
48434
48435 /**
48436  * A possibly transient pubkey used to sign the invoice request.
48437  */
48438 void InvoiceRequestFields_set_payer_id(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48439
48440 /**
48441  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48442  */
48443 struct LDKCOption_u64Z InvoiceRequestFields_get_quantity(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
48444
48445 /**
48446  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
48447  */
48448 void InvoiceRequestFields_set_quantity(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
48449
48450 /**
48451  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48452  * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
48453  *
48454  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48455  */
48456 struct LDKUntrustedString InvoiceRequestFields_get_payer_note_truncated(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr);
48457
48458 /**
48459  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
48460  * response. Truncated to [`PAYER_NOTE_LIMIT`] characters.
48461  *
48462  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
48463  */
48464 void InvoiceRequestFields_set_payer_note_truncated(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
48465
48466 /**
48467  * Constructs a new InvoiceRequestFields given each field
48468  *
48469  * Note that payer_note_truncated_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
48470  */
48471 MUST_USE_RES struct LDKInvoiceRequestFields InvoiceRequestFields_new(struct LDKPublicKey payer_id_arg, struct LDKCOption_u64Z quantity_arg, struct LDKUntrustedString payer_note_truncated_arg);
48472
48473 /**
48474  * Creates a copy of the InvoiceRequestFields
48475  */
48476 struct LDKInvoiceRequestFields InvoiceRequestFields_clone(const struct LDKInvoiceRequestFields *NONNULL_PTR orig);
48477
48478 /**
48479  * Checks if two InvoiceRequestFieldss contain equal inner contents.
48480  * This ignores pointers and is_owned flags and looks at the values in fields.
48481  * Two objects with NULL inner values will be considered "equal" here.
48482  */
48483 bool InvoiceRequestFields_eq(const struct LDKInvoiceRequestFields *NONNULL_PTR a, const struct LDKInvoiceRequestFields *NONNULL_PTR b);
48484
48485 /**
48486  * Serialize the InvoiceRequestFields object into a byte array which can be read by InvoiceRequestFields_read
48487  */
48488 struct LDKCVec_u8Z InvoiceRequestFields_write(const struct LDKInvoiceRequestFields *NONNULL_PTR obj);
48489
48490 /**
48491  * Read a InvoiceRequestFields from a byte array, created by InvoiceRequestFields_write
48492  */
48493 struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ InvoiceRequestFields_read(struct LDKu8slice ser);
48494
48495 /**
48496  * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
48497  */
48498 void TaggedHash_free(struct LDKTaggedHash this_obj);
48499
48500 /**
48501  * Creates a copy of the TaggedHash
48502  */
48503 struct LDKTaggedHash TaggedHash_clone(const struct LDKTaggedHash *NONNULL_PTR orig);
48504
48505 /**
48506  * Returns the digest to sign.
48507  */
48508 MUST_USE_RES const uint8_t (*TaggedHash_as_digest(const struct LDKTaggedHash *NONNULL_PTR this_arg))[32];
48509
48510 /**
48511  * Returns the tag used in the tagged hash.
48512  */
48513 MUST_USE_RES struct LDKStr TaggedHash_tag(const struct LDKTaggedHash *NONNULL_PTR this_arg);
48514
48515 /**
48516  * Returns the merkle root used in the tagged hash.
48517  */
48518 MUST_USE_RES struct LDKThirtyTwoBytes TaggedHash_merkle_root(const struct LDKTaggedHash *NONNULL_PTR this_arg);
48519
48520 /**
48521  * Frees any resources used by the SignError
48522  */
48523 void SignError_free(struct LDKSignError this_ptr);
48524
48525 /**
48526  * Creates a copy of the SignError
48527  */
48528 struct LDKSignError SignError_clone(const struct LDKSignError *NONNULL_PTR orig);
48529
48530 /**
48531  * Utility method to constructs a new Signing-variant SignError
48532  */
48533 struct LDKSignError SignError_signing(void);
48534
48535 /**
48536  * Utility method to constructs a new Verification-variant SignError
48537  */
48538 struct LDKSignError SignError_verification(enum LDKSecp256k1Error a);
48539
48540 /**
48541  * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
48542  */
48543 void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
48544
48545 /**
48546  * Creates a copy of the Bolt12ParseError
48547  */
48548 struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
48549
48550 /**
48551  * Creates a copy of the Bolt12SemanticError
48552  */
48553 enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
48554
48555 /**
48556  * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
48557  */
48558 enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
48559
48560 /**
48561  * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
48562  */
48563 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
48564
48565 /**
48566  * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
48567  */
48568 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
48569
48570 /**
48571  * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
48572  */
48573 enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
48574
48575 /**
48576  * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
48577  */
48578 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
48579
48580 /**
48581  * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
48582  */
48583 enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
48584
48585 /**
48586  * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
48587  */
48588 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
48589
48590 /**
48591  * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
48592  */
48593 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
48594
48595 /**
48596  * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
48597  */
48598 enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
48599
48600 /**
48601  * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
48602  */
48603 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
48604
48605 /**
48606  * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
48607  */
48608 enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
48609
48610 /**
48611  * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
48612  */
48613 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
48614
48615 /**
48616  * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
48617  */
48618 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
48619
48620 /**
48621  * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
48622  */
48623 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
48624
48625 /**
48626  * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
48627  */
48628 enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
48629
48630 /**
48631  * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
48632  */
48633 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
48634
48635 /**
48636  * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
48637  */
48638 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
48639
48640 /**
48641  * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
48642  */
48643 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
48644
48645 /**
48646  * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
48647  */
48648 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
48649
48650 /**
48651  * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
48652  */
48653 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
48654
48655 /**
48656  * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
48657  */
48658 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
48659
48660 /**
48661  * Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
48662  */
48663 enum LDKBolt12SemanticError Bolt12SemanticError_duplicate_payment_id(void);
48664
48665 /**
48666  * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
48667  */
48668 enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
48669
48670 /**
48671  * Utility method to constructs a new UnexpectedPaths-variant Bolt12SemanticError
48672  */
48673 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_paths(void);
48674
48675 /**
48676  * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
48677  */
48678 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
48679
48680 /**
48681  * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
48682  */
48683 enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
48684
48685 /**
48686  * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
48687  */
48688 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
48689
48690 /**
48691  * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
48692  */
48693 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
48694
48695 /**
48696  * Frees any resources used by the RefundMaybeWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
48697  */
48698 void RefundMaybeWithDerivedMetadataBuilder_free(struct LDKRefundMaybeWithDerivedMetadataBuilder this_obj);
48699
48700 /**
48701  * Creates a new builder for a refund using the [`Refund::payer_id`] for the public node id to
48702  * send to if no [`Refund::paths`] are set. Otherwise, it may be a transient pubkey.
48703  *
48704  * Additionally, sets the required (empty) [`Refund::description`], [`Refund::payer_metadata`],
48705  * and [`Refund::amount_msats`].
48706  *
48707  * # Note
48708  *
48709  * If constructing a [`Refund`] for use with a [`ChannelManager`], use
48710  * [`ChannelManager::create_refund_builder`] instead of [`RefundBuilder::new`].
48711  *
48712  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
48713  * [`ChannelManager::create_refund_builder`]: crate::ln::channelmanager::ChannelManager::create_refund_builder
48714  */
48715 MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_new(struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id, uint64_t amount_msats);
48716
48717 /**
48718  * Similar to [`RefundBuilder::new`] except, if [`RefundBuilder::path`] is called, the payer id
48719  * is derived from the given [`ExpandedKey`] and nonce. This provides sender privacy by using a
48720  * different payer id for each refund, assuming a different nonce is used.  Otherwise, the
48721  * provided `node_id` is used for the payer id.
48722  *
48723  * Also, sets the metadata when [`RefundBuilder::build`] is called such that it can be used to
48724  * verify that an [`InvoiceRequest`] was produced for the refund given an [`ExpandedKey`].
48725  *
48726  * The `payment_id` is encrypted in the metadata and should be unique. This ensures that only
48727  * one invoice will be paid for the refund and that payments can be uniquely identified.
48728  *
48729  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
48730  * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
48731  */
48732 MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id);
48733
48734 /**
48735  * Sets the [`Refund::description`].
48736  *
48737  * Successive calls to this method will override the previous setting.
48738  */
48739 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_description(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr description);
48740
48741 /**
48742  * Sets the [`Refund::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
48743  * already passed is valid and can be checked for using [`Refund::is_expired`].
48744  *
48745  * Successive calls to this method will override the previous setting.
48746  */
48747 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry);
48748
48749 /**
48750  * Sets the [`Refund::issuer`].
48751  *
48752  * Successive calls to this method will override the previous setting.
48753  */
48754 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_issuer(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr issuer);
48755
48756 /**
48757  * Adds a blinded path to [`Refund::paths`]. Must include at least one path if only connected
48758  * by private channels or if [`Refund::payer_id`] is not a public node id.
48759  *
48760  * Successive calls to this method will add another blinded path. Caller is responsible for not
48761  * adding duplicate paths.
48762  */
48763 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_path(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path);
48764
48765 /**
48766  * Sets the [`Refund::chain`] of the given [`Network`] for paying an invoice. If not
48767  * called, [`Network::Bitcoin`] is assumed.
48768  *
48769  * Successive calls to this method will override the previous setting.
48770  */
48771 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_chain(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, enum LDKNetwork network);
48772
48773 /**
48774  * Sets [`Refund::quantity`] of items. This is purely for informational purposes. It is useful
48775  * when the refund pertains to a [`Bolt12Invoice`] that paid for more than one item from an
48776  * [`Offer`] as specified by [`InvoiceRequest::quantity`].
48777  *
48778  * Successive calls to this method will override the previous setting.
48779  *
48780  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
48781  * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
48782  * [`Offer`]: crate::offers::offer::Offer
48783  */
48784 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_quantity(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t quantity);
48785
48786 /**
48787  * Sets the [`Refund::payer_note`].
48788  *
48789  * Successive calls to this method will override the previous setting.
48790  */
48791 MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_payer_note(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr payer_note);
48792
48793 /**
48794  * Builds a [`Refund`] after checking for valid semantics.
48795  */
48796 MUST_USE_RES struct LDKCResult_RefundBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_build(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg);
48797
48798 /**
48799  * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
48800  */
48801 void Refund_free(struct LDKRefund this_obj);
48802
48803 /**
48804  * Creates a copy of the Refund
48805  */
48806 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
48807
48808 /**
48809  * A complete description of the purpose of the refund. Intended to be displayed to the user
48810  * but with the caveat that it has not been verified in any way.
48811  */
48812 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
48813
48814 /**
48815  * Duration since the Unix epoch when an invoice should no longer be sent.
48816  *
48817  * If `None`, the refund does not expire.
48818  */
48819 MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
48820
48821 /**
48822  * Whether the refund has expired.
48823  */
48824 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
48825
48826 /**
48827  * Whether the refund has expired given the duration since the Unix epoch.
48828  */
48829 MUST_USE_RES bool Refund_is_expired_no_std(const struct LDKRefund *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
48830
48831 /**
48832  * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
48833  * displayed to the user but with the caveat that it has not been verified in any way.
48834  *
48835  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48836  */
48837 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
48838
48839 /**
48840  * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
48841  * privacy by obfuscating its node id.
48842  */
48843 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
48844
48845 /**
48846  * An unpredictable series of bytes, typically containing information about the derivation of
48847  * [`payer_id`].
48848  *
48849  * [`payer_id`]: Self::payer_id
48850  */
48851 MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
48852
48853 /**
48854  * A chain that the refund is valid for.
48855  */
48856 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
48857
48858 /**
48859  * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
48860  *
48861  * [`chain`]: Self::chain
48862  */
48863 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
48864
48865 /**
48866  * Features pertaining to requesting an invoice.
48867  */
48868 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
48869
48870 /**
48871  * The quantity of an item that refund is for.
48872  */
48873 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
48874
48875 /**
48876  * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
48877  * transient pubkey.
48878  *
48879  * [`paths`]: Self::paths
48880  */
48881 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
48882
48883 /**
48884  * Payer provided note to include in the invoice.
48885  *
48886  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
48887  */
48888 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
48889
48890 /**
48891  * Generates a non-cryptographic 64-bit hash of the Refund.
48892  */
48893 uint64_t Refund_hash(const struct LDKRefund *NONNULL_PTR o);
48894
48895 /**
48896  * Serialize the Refund object into a byte array which can be read by Refund_read
48897  */
48898 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
48899
48900 /**
48901  * Read a Refund object from a string
48902  */
48903 struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
48904
48905 /**
48906  * Creates a copy of the UtxoLookupError
48907  */
48908 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
48909
48910 /**
48911  * Utility method to constructs a new UnknownChain-variant UtxoLookupError
48912  */
48913 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
48914
48915 /**
48916  * Utility method to constructs a new UnknownTx-variant UtxoLookupError
48917  */
48918 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
48919
48920 /**
48921  * Frees any resources used by the UtxoResult
48922  */
48923 void UtxoResult_free(struct LDKUtxoResult this_ptr);
48924
48925 /**
48926  * Creates a copy of the UtxoResult
48927  */
48928 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
48929
48930 /**
48931  * Utility method to constructs a new Sync-variant UtxoResult
48932  */
48933 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
48934
48935 /**
48936  * Utility method to constructs a new Async-variant UtxoResult
48937  */
48938 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
48939
48940 /**
48941  * Calls the free function if one is set
48942  */
48943 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
48944
48945 /**
48946  * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
48947  */
48948 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
48949
48950 /**
48951  * Creates a copy of the UtxoFuture
48952  */
48953 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
48954
48955 /**
48956  * Builds a new future for later resolution.
48957  */
48958 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
48959
48960 /**
48961  * Resolves this future against the given `graph` and with the given `result`.
48962  *
48963  * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
48964  * forwarding the validated gossip message onwards to peers.
48965  *
48966  * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
48967  * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
48968  * after this.
48969  *
48970  * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
48971  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
48972  */
48973 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
48974
48975 /**
48976  * Resolves this future against the given `graph` and with the given `result`.
48977  *
48978  * The given `gossip` is used to broadcast any validated messages onwards to all peers which
48979  * have available buffer space.
48980  *
48981  * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
48982  * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
48983  * after this.
48984  *
48985  * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
48986  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
48987  */
48988 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);
48989
48990 /**
48991  * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
48992  */
48993 void NodeId_free(struct LDKNodeId this_obj);
48994
48995 /**
48996  * Creates a copy of the NodeId
48997  */
48998 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
48999
49000 /**
49001  * Create a new NodeId from a public key
49002  */
49003 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
49004
49005 /**
49006  * Create a new NodeId from a slice of bytes
49007  */
49008 MUST_USE_RES struct LDKCResult_NodeIdDecodeErrorZ NodeId_from_slice(struct LDKu8slice bytes);
49009
49010 /**
49011  * Get the public key slice from this NodeId
49012  */
49013 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
49014
49015 /**
49016  * Get the public key as an array from this NodeId
49017  */
49018 MUST_USE_RES const uint8_t (*NodeId_as_array(const struct LDKNodeId *NONNULL_PTR this_arg))[33];
49019
49020 /**
49021  * Get the public key from this NodeId
49022  */
49023 MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
49024
49025 /**
49026  * Generates a non-cryptographic 64-bit hash of the NodeId.
49027  */
49028 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
49029
49030 /**
49031  * Serialize the NodeId object into a byte array which can be read by NodeId_read
49032  */
49033 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
49034
49035 /**
49036  * Read a NodeId from a byte array, created by NodeId_write
49037  */
49038 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
49039
49040 /**
49041  * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
49042  */
49043 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
49044
49045 /**
49046  * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
49047  */
49048 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
49049
49050 /**
49051  * Frees any resources used by the NetworkUpdate
49052  */
49053 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
49054
49055 /**
49056  * Creates a copy of the NetworkUpdate
49057  */
49058 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
49059
49060 /**
49061  * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
49062  */
49063 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
49064
49065 /**
49066  * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
49067  */
49068 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
49069
49070 /**
49071  * Utility method to constructs a new NodeFailure-variant NetworkUpdate
49072  */
49073 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
49074
49075 /**
49076  * Checks if two NetworkUpdates contain equal inner contents.
49077  * This ignores pointers and is_owned flags and looks at the values in fields.
49078  */
49079 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
49080
49081 /**
49082  * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
49083  */
49084 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
49085
49086 /**
49087  * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
49088  */
49089 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
49090
49091 /**
49092  * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
49093  */
49094 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
49095
49096 /**
49097  * Creates a new tracker of the actual state of the network of channels and nodes,
49098  * assuming an existing [`NetworkGraph`].
49099  * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
49100  * correct, and the announcement is signed with channel owners' keys.
49101  */
49102 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
49103
49104 /**
49105  * Adds a provider used to check new announcements. Does not affect
49106  * existing announcements unless they are updated.
49107  * Add, update or remove the provider would replace the current one.
49108  */
49109 void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
49110
49111 /**
49112  * Handles any network updates originating from [`Event`]s.
49113  * Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid
49114  * leaking possibly identifying information of the sender to the public network.
49115  *
49116  * [`Event`]: crate::events::Event
49117  */
49118 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
49119
49120 /**
49121  * Gets the chain hash for this network graph.
49122  */
49123 MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_chain_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
49124
49125 /**
49126  * Verifies the signature of a [`NodeAnnouncement`].
49127  *
49128  * Returns an error if it is invalid.
49129  */
49130 struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
49131
49132 /**
49133  * Verifies all signatures included in a [`ChannelAnnouncement`].
49134  *
49135  * Returns an error if one of the signatures is invalid.
49136  */
49137 struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
49138
49139 /**
49140  * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
49141  * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
49142  */
49143 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
49144
49145 /**
49146  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
49147  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
49148  */
49149 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
49150
49151 /**
49152  * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
49153  */
49154 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
49155
49156 /**
49157  * When the last update to the channel direction was issued.
49158  * Value is opaque, as set in the announcement.
49159  */
49160 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49161
49162 /**
49163  * When the last update to the channel direction was issued.
49164  * Value is opaque, as set in the announcement.
49165  */
49166 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
49167
49168 /**
49169  * Whether the channel can be currently used for payments (in this one direction).
49170  */
49171 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49172
49173 /**
49174  * Whether the channel can be currently used for payments (in this one direction).
49175  */
49176 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
49177
49178 /**
49179  * The difference in CLTV values that you must have when routing through this channel.
49180  */
49181 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49182
49183 /**
49184  * The difference in CLTV values that you must have when routing through this channel.
49185  */
49186 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
49187
49188 /**
49189  * The minimum value, which must be relayed to the next hop via the channel
49190  */
49191 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49192
49193 /**
49194  * The minimum value, which must be relayed to the next hop via the channel
49195  */
49196 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
49197
49198 /**
49199  * The maximum value which may be relayed to the next hop via the channel.
49200  */
49201 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49202
49203 /**
49204  * The maximum value which may be relayed to the next hop via the channel.
49205  */
49206 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
49207
49208 /**
49209  * Fees charged when the channel is used for routing
49210  */
49211 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49212
49213 /**
49214  * Fees charged when the channel is used for routing
49215  */
49216 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
49217
49218 /**
49219  * Most recent update for the channel received from the network
49220  * Mostly redundant with the data we store in fields explicitly.
49221  * Everything else is useful only for sending out for initial routing sync.
49222  * Not stored if contains excess data to prevent DoS.
49223  *
49224  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49225  */
49226 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
49227
49228 /**
49229  * Most recent update for the channel received from the network
49230  * Mostly redundant with the data we store in fields explicitly.
49231  * Everything else is useful only for sending out for initial routing sync.
49232  * Not stored if contains excess data to prevent DoS.
49233  *
49234  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49235  */
49236 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
49237
49238 /**
49239  * Constructs a new ChannelUpdateInfo given each field
49240  *
49241  * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
49242  */
49243 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);
49244
49245 /**
49246  * Creates a copy of the ChannelUpdateInfo
49247  */
49248 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
49249
49250 /**
49251  * Checks if two ChannelUpdateInfos contain equal inner contents.
49252  * This ignores pointers and is_owned flags and looks at the values in fields.
49253  * Two objects with NULL inner values will be considered "equal" here.
49254  */
49255 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
49256
49257 /**
49258  * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
49259  */
49260 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
49261
49262 /**
49263  * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
49264  */
49265 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
49266
49267 /**
49268  * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
49269  */
49270 void ChannelInfo_free(struct LDKChannelInfo this_obj);
49271
49272 /**
49273  * Protocol features of a channel communicated during its announcement
49274  */
49275 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49276
49277 /**
49278  * Protocol features of a channel communicated during its announcement
49279  */
49280 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
49281
49282 /**
49283  * Source node of the first direction of a channel
49284  */
49285 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49286
49287 /**
49288  * Source node of the first direction of a channel
49289  */
49290 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
49291
49292 /**
49293  * Details about the first direction of a channel
49294  *
49295  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49296  */
49297 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49298
49299 /**
49300  * Details about the first direction of a channel
49301  *
49302  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49303  */
49304 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
49305
49306 /**
49307  * Source node of the second direction of a channel
49308  */
49309 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49310
49311 /**
49312  * Source node of the second direction of a channel
49313  */
49314 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
49315
49316 /**
49317  * Details about the second direction of a channel
49318  *
49319  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49320  */
49321 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49322
49323 /**
49324  * Details about the second direction of a channel
49325  *
49326  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49327  */
49328 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
49329
49330 /**
49331  * The channel capacity as seen on-chain, if chain lookup is available.
49332  */
49333 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49334
49335 /**
49336  * The channel capacity as seen on-chain, if chain lookup is available.
49337  */
49338 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
49339
49340 /**
49341  * An initial announcement of the channel
49342  * Mostly redundant with the data we store in fields explicitly.
49343  * Everything else is useful only for sending out for initial routing sync.
49344  * Not stored if contains excess data to prevent DoS.
49345  *
49346  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49347  */
49348 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
49349
49350 /**
49351  * An initial announcement of the channel
49352  * Mostly redundant with the data we store in fields explicitly.
49353  * Everything else is useful only for sending out for initial routing sync.
49354  * Not stored if contains excess data to prevent DoS.
49355  *
49356  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49357  */
49358 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
49359
49360 /**
49361  * Creates a copy of the ChannelInfo
49362  */
49363 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
49364
49365 /**
49366  * Checks if two ChannelInfos contain equal inner contents.
49367  * This ignores pointers and is_owned flags and looks at the values in fields.
49368  * Two objects with NULL inner values will be considered "equal" here.
49369  */
49370 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
49371
49372 /**
49373  * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
49374  *
49375  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49376  */
49377 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
49378
49379 /**
49380  * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
49381  */
49382 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
49383
49384 /**
49385  * Read a ChannelInfo from a byte array, created by ChannelInfo_write
49386  */
49387 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
49388
49389 /**
49390  * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
49391  */
49392 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
49393
49394 /**
49395  * Creates a copy of the DirectedChannelInfo
49396  */
49397 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
49398
49399 /**
49400  * Returns information for the channel.
49401  */
49402 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
49403
49404 /**
49405  * Returns the [`EffectiveCapacity`] of the channel in the direction.
49406  *
49407  * This is either the total capacity from the funding transaction, if known, or the
49408  * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
49409  * otherwise.
49410  */
49411 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
49412
49413 /**
49414  * Returns the `node_id` of the source hop.
49415  *
49416  * Refers to the `node_id` forwarding the payment to the next hop.
49417  */
49418 MUST_USE_RES struct LDKNodeId DirectedChannelInfo_source(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
49419
49420 /**
49421  * Returns the `node_id` of the target hop.
49422  *
49423  * Refers to the `node_id` receiving the payment from the previous hop.
49424  */
49425 MUST_USE_RES struct LDKNodeId DirectedChannelInfo_target(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
49426
49427 /**
49428  * Frees any resources used by the EffectiveCapacity
49429  */
49430 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
49431
49432 /**
49433  * Creates a copy of the EffectiveCapacity
49434  */
49435 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
49436
49437 /**
49438  * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
49439  */
49440 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
49441
49442 /**
49443  * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
49444  */
49445 struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
49446
49447 /**
49448  * Utility method to constructs a new Total-variant EffectiveCapacity
49449  */
49450 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
49451
49452 /**
49453  * Utility method to constructs a new Infinite-variant EffectiveCapacity
49454  */
49455 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
49456
49457 /**
49458  * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
49459  */
49460 struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
49461
49462 /**
49463  * Utility method to constructs a new Unknown-variant EffectiveCapacity
49464  */
49465 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
49466
49467 /**
49468  * Returns the effective capacity denominated in millisatoshi.
49469  */
49470 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
49471
49472 /**
49473  * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
49474  */
49475 void RoutingFees_free(struct LDKRoutingFees this_obj);
49476
49477 /**
49478  * Flat routing fee in millisatoshis.
49479  */
49480 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
49481
49482 /**
49483  * Flat routing fee in millisatoshis.
49484  */
49485 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
49486
49487 /**
49488  * Liquidity-based routing fee in millionths of a routed amount.
49489  * In other words, 10000 is 1%.
49490  */
49491 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
49492
49493 /**
49494  * Liquidity-based routing fee in millionths of a routed amount.
49495  * In other words, 10000 is 1%.
49496  */
49497 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
49498
49499 /**
49500  * Constructs a new RoutingFees given each field
49501  */
49502 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
49503
49504 /**
49505  * Checks if two RoutingFeess contain equal inner contents.
49506  * This ignores pointers and is_owned flags and looks at the values in fields.
49507  * Two objects with NULL inner values will be considered "equal" here.
49508  */
49509 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
49510
49511 /**
49512  * Creates a copy of the RoutingFees
49513  */
49514 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
49515
49516 /**
49517  * Generates a non-cryptographic 64-bit hash of the RoutingFees.
49518  */
49519 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
49520
49521 /**
49522  * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
49523  */
49524 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
49525
49526 /**
49527  * Read a RoutingFees from a byte array, created by RoutingFees_write
49528  */
49529 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
49530
49531 /**
49532  * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
49533  */
49534 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
49535
49536 /**
49537  * Protocol features the node announced support for
49538  */
49539 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
49540
49541 /**
49542  * Protocol features the node announced support for
49543  */
49544 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
49545
49546 /**
49547  * When the last known update to the node state was issued.
49548  * Value is opaque, as set in the announcement.
49549  */
49550 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
49551
49552 /**
49553  * When the last known update to the node state was issued.
49554  * Value is opaque, as set in the announcement.
49555  */
49556 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
49557
49558 /**
49559  * Color assigned to the node
49560  */
49561 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
49562
49563 /**
49564  * Color assigned to the node
49565  */
49566 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
49567
49568 /**
49569  * Moniker assigned to the node.
49570  * May be invalid or malicious (eg control chars),
49571  * should not be exposed to the user.
49572  */
49573 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
49574
49575 /**
49576  * Moniker assigned to the node.
49577  * May be invalid or malicious (eg control chars),
49578  * should not be exposed to the user.
49579  */
49580 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
49581
49582 /**
49583  * An initial announcement of the node
49584  * Mostly redundant with the data we store in fields explicitly.
49585  * Everything else is useful only for sending out for initial routing sync.
49586  * Not stored if contains excess data to prevent DoS.
49587  *
49588  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49589  */
49590 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
49591
49592 /**
49593  * An initial announcement of the node
49594  * Mostly redundant with the data we store in fields explicitly.
49595  * Everything else is useful only for sending out for initial routing sync.
49596  * Not stored if contains excess data to prevent DoS.
49597  *
49598  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49599  */
49600 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
49601
49602 /**
49603  * Constructs a new NodeAnnouncementInfo given each field
49604  *
49605  * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
49606  */
49607 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);
49608
49609 /**
49610  * Creates a copy of the NodeAnnouncementInfo
49611  */
49612 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
49613
49614 /**
49615  * Checks if two NodeAnnouncementInfos contain equal inner contents.
49616  * This ignores pointers and is_owned flags and looks at the values in fields.
49617  * Two objects with NULL inner values will be considered "equal" here.
49618  */
49619 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
49620
49621 /**
49622  * Internet-level addresses via which one can connect to the node
49623  */
49624 MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
49625
49626 /**
49627  * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
49628  */
49629 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
49630
49631 /**
49632  * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
49633  */
49634 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
49635
49636 /**
49637  * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
49638  */
49639 void NodeAlias_free(struct LDKNodeAlias this_obj);
49640
49641 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
49642
49643 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
49644
49645 /**
49646  * Constructs a new NodeAlias given each field
49647  */
49648 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
49649
49650 /**
49651  * Creates a copy of the NodeAlias
49652  */
49653 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
49654
49655 /**
49656  * Generates a non-cryptographic 64-bit hash of the NodeAlias.
49657  */
49658 uint64_t NodeAlias_hash(const struct LDKNodeAlias *NONNULL_PTR o);
49659
49660 /**
49661  * Checks if two NodeAliass contain equal inner contents.
49662  * This ignores pointers and is_owned flags and looks at the values in fields.
49663  * Two objects with NULL inner values will be considered "equal" here.
49664  */
49665 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
49666
49667 /**
49668  * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
49669  */
49670 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
49671
49672 /**
49673  * Read a NodeAlias from a byte array, created by NodeAlias_write
49674  */
49675 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
49676
49677 /**
49678  * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
49679  */
49680 void NodeInfo_free(struct LDKNodeInfo this_obj);
49681
49682 /**
49683  * All valid channels a node has announced
49684  *
49685  * Returns a copy of the field.
49686  */
49687 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
49688
49689 /**
49690  * All valid channels a node has announced
49691  */
49692 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
49693
49694 /**
49695  * More information about a node from node_announcement.
49696  * Optional because we store a Node entry after learning about it from
49697  * a channel announcement, but before receiving a node announcement.
49698  *
49699  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49700  */
49701 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
49702
49703 /**
49704  * More information about a node from node_announcement.
49705  * Optional because we store a Node entry after learning about it from
49706  * a channel announcement, but before receiving a node announcement.
49707  *
49708  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
49709  */
49710 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
49711
49712 /**
49713  * Constructs a new NodeInfo given each field
49714  *
49715  * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
49716  */
49717 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
49718
49719 /**
49720  * Creates a copy of the NodeInfo
49721  */
49722 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
49723
49724 /**
49725  * Checks if two NodeInfos contain equal inner contents.
49726  * This ignores pointers and is_owned flags and looks at the values in fields.
49727  * Two objects with NULL inner values will be considered "equal" here.
49728  */
49729 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
49730
49731 /**
49732  * Returns whether the node has only announced Tor addresses.
49733  */
49734 MUST_USE_RES bool NodeInfo_is_tor_only(const struct LDKNodeInfo *NONNULL_PTR this_arg);
49735
49736 /**
49737  * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
49738  */
49739 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
49740
49741 /**
49742  * Read a NodeInfo from a byte array, created by NodeInfo_write
49743  */
49744 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
49745
49746 /**
49747  * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
49748  */
49749 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
49750
49751 /**
49752  * Read a NetworkGraph from a byte array, created by NetworkGraph_write
49753  */
49754 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
49755
49756 /**
49757  * Creates a new, empty, network graph.
49758  */
49759 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
49760
49761 /**
49762  * Returns a read-only view of the network graph.
49763  */
49764 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
49765
49766 /**
49767  * The unix timestamp provided by the most recent rapid gossip sync.
49768  * It will be set by the rapid sync process after every sync completion.
49769  */
49770 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
49771
49772 /**
49773  * Update the unix timestamp provided by the most recent rapid gossip sync.
49774  * This should be done automatically by the rapid sync process after every sync completion.
49775  */
49776 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
49777
49778 /**
49779  * For an already known node (from channel announcements), update its stored properties from a
49780  * given node announcement.
49781  *
49782  * You probably don't want to call this directly, instead relying on a P2PGossipSync's
49783  * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
49784  * routing messages from a source using a protocol other than the lightning P2P protocol.
49785  */
49786 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
49787
49788 /**
49789  * For an already known node (from channel announcements), update its stored properties from a
49790  * given node announcement without verifying the associated signatures. Because we aren't
49791  * given the associated signatures here we cannot relay the node announcement to any of our
49792  * peers.
49793  */
49794 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);
49795
49796 /**
49797  * Store or update channel info from a channel announcement.
49798  *
49799  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
49800  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
49801  * routing messages from a source using a protocol other than the lightning P2P protocol.
49802  *
49803  * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
49804  * the corresponding UTXO exists on chain and is correctly-formatted.
49805  */
49806 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);
49807
49808 /**
49809  * Store or update channel info from a channel announcement.
49810  *
49811  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
49812  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
49813  * routing messages from a source using a protocol other than the lightning P2P protocol.
49814  *
49815  * This will skip verification of if the channel is actually on-chain.
49816  */
49817 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);
49818
49819 /**
49820  * Store or update channel info from a channel announcement without verifying the associated
49821  * signatures. Because we aren't given the associated signatures here we cannot relay the
49822  * channel announcement to any of our peers.
49823  *
49824  * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
49825  * the corresponding UTXO exists on chain and is correctly-formatted.
49826  */
49827 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);
49828
49829 /**
49830  * Update channel from partial announcement data received via rapid gossip sync
49831  *
49832  * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
49833  * rapid gossip sync server)
49834  *
49835  * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
49836  */
49837 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);
49838
49839 /**
49840  * Marks a channel in the graph as failed permanently.
49841  *
49842  * The channel and any node for which this was their last channel are removed from the graph.
49843  */
49844 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
49845
49846 /**
49847  * Marks a node in the graph as permanently failed, effectively removing it and its channels
49848  * from local storage.
49849  */
49850 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
49851
49852 /**
49853  * Removes information about channels that we haven't heard any updates about in some time.
49854  * This can be used regularly to prune the network graph of channels that likely no longer
49855  * exist.
49856  *
49857  * While there is no formal requirement that nodes regularly re-broadcast their channel
49858  * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
49859  * pruning occur for updates which are at least two weeks old, which we implement here.
49860  *
49861  * Note that for users of the `lightning-background-processor` crate this method may be
49862  * automatically called regularly for you.
49863  *
49864  * This method will also cause us to stop tracking removed nodes and channels if they have been
49865  * in the map for a while so that these can be resynced from gossip in the future.
49866  *
49867  * This method is only available with the `std` feature. See
49868  * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
49869  */
49870 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
49871
49872 /**
49873  * Removes information about channels that we haven't heard any updates about in some time.
49874  * This can be used regularly to prune the network graph of channels that likely no longer
49875  * exist.
49876  *
49877  * While there is no formal requirement that nodes regularly re-broadcast their channel
49878  * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
49879  * pruning occur for updates which are at least two weeks old, which we implement here.
49880  *
49881  * This method will also cause us to stop tracking removed nodes and channels if they have been
49882  * in the map for a while so that these can be resynced from gossip in the future.
49883  *
49884  * This function takes the current unix time as an argument. For users with the `std` feature
49885  * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
49886  */
49887 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
49888
49889 /**
49890  * For an already known (from announcement) channel, update info about one of the directions
49891  * of the channel.
49892  *
49893  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
49894  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
49895  * routing messages from a source using a protocol other than the lightning P2P protocol.
49896  *
49897  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
49898  * materially in the future will be rejected.
49899  */
49900 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
49901
49902 /**
49903  * For an already known (from announcement) channel, update info about one of the directions
49904  * of the channel without verifying the associated signatures. Because we aren't given the
49905  * associated signatures here we cannot relay the channel update to any of our peers.
49906  *
49907  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
49908  * materially in the future will be rejected.
49909  */
49910 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
49911
49912 /**
49913  * For an already known (from announcement) channel, verify the given [`ChannelUpdate`].
49914  *
49915  * This checks whether the update currently is applicable by [`Self::update_channel`].
49916  *
49917  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
49918  * materially in the future will be rejected.
49919  */
49920 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_verify_channel_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
49921
49922 /**
49923  * Returns information on a channel with the given id.
49924  *
49925  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49926  */
49927 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
49928
49929 /**
49930  * Returns the list of channels in the graph
49931  */
49932 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
49933
49934 /**
49935  * Returns information on a node with the given id.
49936  *
49937  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
49938  */
49939 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
49940
49941 /**
49942  * Returns the list of nodes in the graph
49943  */
49944 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
49945
49946 /**
49947  * Get network addresses by node id.
49948  * Returns None if the requested node is completely unknown,
49949  * or if node announcement for the node was never received.
49950  */
49951 MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
49952
49953 /**
49954  * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
49955  */
49956 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
49957
49958 /**
49959  * Creates a new router.
49960  */
49961 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);
49962
49963 /**
49964  * Constructs a new Router which calls the relevant methods on this_arg.
49965  * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
49966  */
49967 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
49968
49969 /**
49970  * Constructs a new MessageRouter which calls the relevant methods on this_arg.
49971  * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
49972  */
49973 struct LDKMessageRouter DefaultRouter_as_MessageRouter(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
49974
49975 /**
49976  * Calls the free function if one is set
49977  */
49978 void Router_free(struct LDKRouter this_ptr);
49979
49980 /**
49981  * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
49982  */
49983 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
49984
49985 /**
49986  * Initialize a new `ScorerAccountingForInFlightHtlcs`.
49987  */
49988 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
49989
49990 /**
49991  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
49992  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
49993  */
49994 struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
49995
49996 /**
49997  * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
49998  */
49999 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
50000
50001 /**
50002  * Creates a copy of the InFlightHtlcs
50003  */
50004 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
50005
50006 /**
50007  * Constructs an empty `InFlightHtlcs`.
50008  */
50009 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
50010
50011 /**
50012  * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
50013  */
50014 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
50015
50016 /**
50017  * Adds a known HTLC given the public key of the HTLC source, target, and short channel
50018  * id.
50019  */
50020 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);
50021
50022 /**
50023  * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
50024  * id.
50025  */
50026 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);
50027
50028 /**
50029  * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
50030  */
50031 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
50032
50033 /**
50034  * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
50035  */
50036 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
50037
50038 /**
50039  * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
50040  */
50041 void RouteHop_free(struct LDKRouteHop this_obj);
50042
50043 /**
50044  * The node_id of the node at this hop.
50045  */
50046 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50047
50048 /**
50049  * The node_id of the node at this hop.
50050  */
50051 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
50052
50053 /**
50054  * The node_announcement features of the node at this hop. For the last hop, these may be
50055  * amended to match the features present in the invoice this node generated.
50056  */
50057 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50058
50059 /**
50060  * The node_announcement features of the node at this hop. For the last hop, these may be
50061  * amended to match the features present in the invoice this node generated.
50062  */
50063 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
50064
50065 /**
50066  * The channel that should be used from the previous hop to reach this node.
50067  */
50068 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50069
50070 /**
50071  * The channel that should be used from the previous hop to reach this node.
50072  */
50073 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
50074
50075 /**
50076  * The channel_announcement features of the channel that should be used from the previous hop
50077  * to reach this node.
50078  */
50079 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50080
50081 /**
50082  * The channel_announcement features of the channel that should be used from the previous hop
50083  * to reach this node.
50084  */
50085 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
50086
50087 /**
50088  * The fee taken on this hop (for paying for the use of the *next* channel in the path).
50089  * If this is the last hop in [`Path::hops`]:
50090  * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
50091  * * otherwise, this is the full value of this [`Path`]'s part of the payment
50092  *
50093  * [`BlindedPath`]: crate::blinded_path::BlindedPath
50094  */
50095 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50096
50097 /**
50098  * The fee taken on this hop (for paying for the use of the *next* channel in the path).
50099  * If this is the last hop in [`Path::hops`]:
50100  * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
50101  * * otherwise, this is the full value of this [`Path`]'s part of the payment
50102  *
50103  * [`BlindedPath`]: crate::blinded_path::BlindedPath
50104  */
50105 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
50106
50107 /**
50108  * The CLTV delta added for this hop.
50109  * If this is the last hop in [`Path::hops`]:
50110  * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
50111  * * otherwise, this is the CLTV delta expected at the destination
50112  *
50113  * [`BlindedPath`]: crate::blinded_path::BlindedPath
50114  */
50115 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50116
50117 /**
50118  * The CLTV delta added for this hop.
50119  * If this is the last hop in [`Path::hops`]:
50120  * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
50121  * * otherwise, this is the CLTV delta expected at the destination
50122  *
50123  * [`BlindedPath`]: crate::blinded_path::BlindedPath
50124  */
50125 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
50126
50127 /**
50128  * Indicates whether this hop is possibly announced in the public network graph.
50129  *
50130  * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
50131  * either know for sure it's announced in the public graph, or if any public channels exist
50132  * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
50133  * the channel to be unannounced.
50134  *
50135  * Will be `true` for objects serialized with LDK version 0.0.116 and before.
50136  */
50137 bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
50138
50139 /**
50140  * Indicates whether this hop is possibly announced in the public network graph.
50141  *
50142  * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
50143  * either know for sure it's announced in the public graph, or if any public channels exist
50144  * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
50145  * the channel to be unannounced.
50146  *
50147  * Will be `true` for objects serialized with LDK version 0.0.116 and before.
50148  */
50149 void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
50150
50151 /**
50152  * Constructs a new RouteHop given each field
50153  */
50154 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);
50155
50156 /**
50157  * Creates a copy of the RouteHop
50158  */
50159 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
50160
50161 /**
50162  * Generates a non-cryptographic 64-bit hash of the RouteHop.
50163  */
50164 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
50165
50166 /**
50167  * Checks if two RouteHops contain equal inner contents.
50168  * This ignores pointers and is_owned flags and looks at the values in fields.
50169  * Two objects with NULL inner values will be considered "equal" here.
50170  */
50171 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
50172
50173 /**
50174  * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
50175  */
50176 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
50177
50178 /**
50179  * Read a RouteHop from a byte array, created by RouteHop_write
50180  */
50181 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
50182
50183 /**
50184  * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
50185  */
50186 void BlindedTail_free(struct LDKBlindedTail this_obj);
50187
50188 /**
50189  * The hops of the [`BlindedPath`] provided by the recipient.
50190  *
50191  * [`BlindedPath`]: crate::blinded_path::BlindedPath
50192  */
50193 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
50194
50195 /**
50196  * The hops of the [`BlindedPath`] provided by the recipient.
50197  *
50198  * [`BlindedPath`]: crate::blinded_path::BlindedPath
50199  */
50200 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
50201
50202 /**
50203  * The blinding point of the [`BlindedPath`] provided by the recipient.
50204  *
50205  * [`BlindedPath`]: crate::blinded_path::BlindedPath
50206  */
50207 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
50208
50209 /**
50210  * The blinding point of the [`BlindedPath`] provided by the recipient.
50211  *
50212  * [`BlindedPath`]: crate::blinded_path::BlindedPath
50213  */
50214 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
50215
50216 /**
50217  * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
50218  * inferring the destination. May be 0.
50219  */
50220 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
50221
50222 /**
50223  * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
50224  * inferring the destination. May be 0.
50225  */
50226 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
50227
50228 /**
50229  * The total amount paid on this [`Path`], excluding the fees.
50230  */
50231 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
50232
50233 /**
50234  * The total amount paid on this [`Path`], excluding the fees.
50235  */
50236 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
50237
50238 /**
50239  * Constructs a new BlindedTail given each field
50240  */
50241 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);
50242
50243 /**
50244  * Creates a copy of the BlindedTail
50245  */
50246 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
50247
50248 /**
50249  * Generates a non-cryptographic 64-bit hash of the BlindedTail.
50250  */
50251 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
50252
50253 /**
50254  * Checks if two BlindedTails contain equal inner contents.
50255  * This ignores pointers and is_owned flags and looks at the values in fields.
50256  * Two objects with NULL inner values will be considered "equal" here.
50257  */
50258 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
50259
50260 /**
50261  * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
50262  */
50263 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
50264
50265 /**
50266  * Read a BlindedTail from a byte array, created by BlindedTail_write
50267  */
50268 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
50269
50270 /**
50271  * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
50272  */
50273 void Path_free(struct LDKPath this_obj);
50274
50275 /**
50276  * The list of unblinded hops in this [`Path`]. Must be at least length one.
50277  */
50278 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
50279
50280 /**
50281  * The list of unblinded hops in this [`Path`]. Must be at least length one.
50282  */
50283 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
50284
50285 /**
50286  * The blinded path at which this path terminates, if we're sending to one, and its metadata.
50287  *
50288  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50289  */
50290 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
50291
50292 /**
50293  * The blinded path at which this path terminates, if we're sending to one, and its metadata.
50294  *
50295  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50296  */
50297 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
50298
50299 /**
50300  * Constructs a new Path given each field
50301  *
50302  * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
50303  */
50304 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
50305
50306 /**
50307  * Creates a copy of the Path
50308  */
50309 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
50310
50311 /**
50312  * Generates a non-cryptographic 64-bit hash of the Path.
50313  */
50314 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
50315
50316 /**
50317  * Checks if two Paths contain equal inner contents.
50318  * This ignores pointers and is_owned flags and looks at the values in fields.
50319  * Two objects with NULL inner values will be considered "equal" here.
50320  */
50321 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
50322
50323 /**
50324  * Gets the fees for a given path, excluding any excess paid to the recipient.
50325  */
50326 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
50327
50328 /**
50329  * Gets the total amount paid on this [`Path`], excluding the fees.
50330  */
50331 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
50332
50333 /**
50334  * Gets the final hop's CLTV expiry delta.
50335  */
50336 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
50337
50338 /**
50339  * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
50340  */
50341 void Route_free(struct LDKRoute this_obj);
50342
50343 /**
50344  * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
50345  * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
50346  * the same.
50347  */
50348 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
50349
50350 /**
50351  * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
50352  * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
50353  * the same.
50354  */
50355 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
50356
50357 /**
50358  * The `route_params` parameter passed to [`find_route`].
50359  *
50360  * This is used by `ChannelManager` to track information which may be required for retries.
50361  *
50362  * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
50363  *
50364  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50365  */
50366 struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
50367
50368 /**
50369  * The `route_params` parameter passed to [`find_route`].
50370  *
50371  * This is used by `ChannelManager` to track information which may be required for retries.
50372  *
50373  * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
50374  *
50375  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
50376  */
50377 void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
50378
50379 /**
50380  * Constructs a new Route given each field
50381  *
50382  * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
50383  */
50384 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
50385
50386 /**
50387  * Creates a copy of the Route
50388  */
50389 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
50390
50391 /**
50392  * Generates a non-cryptographic 64-bit hash of the Route.
50393  */
50394 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
50395
50396 /**
50397  * Checks if two Routes contain equal inner contents.
50398  * This ignores pointers and is_owned flags and looks at the values in fields.
50399  * Two objects with NULL inner values will be considered "equal" here.
50400  */
50401 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
50402
50403 /**
50404  * Returns the total amount of fees paid on this [`Route`].
50405  *
50406  * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
50407  * the recipient, which can happen in excess of the amount passed to [`find_route`] via
50408  * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
50409  *
50410  * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
50411  */
50412 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
50413
50414 /**
50415  * Returns the total amount paid on this [`Route`], excluding the fees.
50416  *
50417  * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
50418  * we had to reach the [`htlc_minimum_msat`] limits.
50419  *
50420  * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
50421  */
50422 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
50423
50424 /**
50425  * Serialize the Route object into a byte array which can be read by Route_read
50426  */
50427 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
50428
50429 /**
50430  * Read a Route from a byte array, created by Route_write
50431  */
50432 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
50433
50434 /**
50435  * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
50436  */
50437 void RouteParameters_free(struct LDKRouteParameters this_obj);
50438
50439 /**
50440  * The parameters of the failed payment path.
50441  */
50442 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
50443
50444 /**
50445  * The parameters of the failed payment path.
50446  */
50447 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
50448
50449 /**
50450  * The amount in msats sent on the failed payment path.
50451  */
50452 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
50453
50454 /**
50455  * The amount in msats sent on the failed payment path.
50456  */
50457 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
50458
50459 /**
50460  * The maximum total fees, in millisatoshi, that may accrue during route finding.
50461  *
50462  * This limit also applies to the total fees that may arise while retrying failed payment
50463  * paths.
50464  *
50465  * Note that values below a few sats may result in some paths being spuriously ignored.
50466  */
50467 struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
50468
50469 /**
50470  * The maximum total fees, in millisatoshi, that may accrue during route finding.
50471  *
50472  * This limit also applies to the total fees that may arise while retrying failed payment
50473  * paths.
50474  *
50475  * Note that values below a few sats may result in some paths being spuriously ignored.
50476  */
50477 void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
50478
50479 /**
50480  * Constructs a new RouteParameters given each field
50481  */
50482 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);
50483
50484 /**
50485  * Creates a copy of the RouteParameters
50486  */
50487 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
50488
50489 /**
50490  * Generates a non-cryptographic 64-bit hash of the RouteParameters.
50491  */
50492 uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
50493
50494 /**
50495  * Checks if two RouteParameterss contain equal inner contents.
50496  * This ignores pointers and is_owned flags and looks at the values in fields.
50497  * Two objects with NULL inner values will be considered "equal" here.
50498  */
50499 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
50500
50501 /**
50502  * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
50503  *
50504  * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
50505  */
50506 MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
50507
50508 /**
50509  * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
50510  */
50511 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
50512
50513 /**
50514  * Read a RouteParameters from a byte array, created by RouteParameters_write
50515  */
50516 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
50517
50518 /**
50519  * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
50520  */
50521 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
50522
50523 /**
50524  * Information about the payee, such as their features and route hints for their channels.
50525  */
50526 struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50527
50528 /**
50529  * Information about the payee, such as their features and route hints for their channels.
50530  */
50531 void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
50532
50533 /**
50534  * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
50535  */
50536 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50537
50538 /**
50539  * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
50540  */
50541 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
50542
50543 /**
50544  * The maximum total CLTV delta we accept for the route.
50545  * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
50546  */
50547 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50548
50549 /**
50550  * The maximum total CLTV delta we accept for the route.
50551  * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
50552  */
50553 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
50554
50555 /**
50556  * The maximum number of paths that may be used by (MPP) payments.
50557  * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
50558  */
50559 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50560
50561 /**
50562  * The maximum number of paths that may be used by (MPP) payments.
50563  * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
50564  */
50565 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
50566
50567 /**
50568  * Selects the maximum share of a channel's total capacity which will be sent over a channel,
50569  * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
50570  * a lower value prefers to send larger MPP parts, potentially saturating channels and
50571  * increasing failure probability for those paths.
50572  *
50573  * Note that this restriction will be relaxed during pathfinding after paths which meet this
50574  * restriction have been found. While paths which meet this criteria will be searched for, it
50575  * is ultimately up to the scorer to select them over other paths.
50576  *
50577  * A value of 0 will allow payments up to and including a channel's total announced usable
50578  * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
50579  *
50580  * Default value: 2
50581  */
50582 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50583
50584 /**
50585  * Selects the maximum share of a channel's total capacity which will be sent over a channel,
50586  * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
50587  * a lower value prefers to send larger MPP parts, potentially saturating channels and
50588  * increasing failure probability for those paths.
50589  *
50590  * Note that this restriction will be relaxed during pathfinding after paths which meet this
50591  * restriction have been found. While paths which meet this criteria will be searched for, it
50592  * is ultimately up to the scorer to select them over other paths.
50593  *
50594  * A value of 0 will allow payments up to and including a channel's total announced usable
50595  * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
50596  *
50597  * Default value: 2
50598  */
50599 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
50600
50601 /**
50602  * A list of SCIDs which this payment was previously attempted over and which caused the
50603  * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
50604  * these SCIDs.
50605  *
50606  * Returns a copy of the field.
50607  */
50608 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50609
50610 /**
50611  * A list of SCIDs which this payment was previously attempted over and which caused the
50612  * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
50613  * these SCIDs.
50614  */
50615 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
50616
50617 /**
50618  * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
50619  * payment was previously attempted over and which caused the payment to fail. Future attempts
50620  * for the same payment shouldn't be relayed through any of these blinded paths.
50621  *
50622  * Returns a copy of the field.
50623  */
50624 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_blinded_path_idxs(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
50625
50626 /**
50627  * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
50628  * payment was previously attempted over and which caused the payment to fail. Future attempts
50629  * for the same payment shouldn't be relayed through any of these blinded paths.
50630  */
50631 void PaymentParameters_set_previously_failed_blinded_path_idxs(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
50632
50633 /**
50634  * Constructs a new PaymentParameters given each field
50635  */
50636 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);
50637
50638 /**
50639  * Creates a copy of the PaymentParameters
50640  */
50641 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
50642
50643 /**
50644  * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
50645  */
50646 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
50647
50648 /**
50649  * Checks if two PaymentParameterss contain equal inner contents.
50650  * This ignores pointers and is_owned flags and looks at the values in fields.
50651  * Two objects with NULL inner values will be considered "equal" here.
50652  */
50653 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
50654
50655 /**
50656  * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
50657  */
50658 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
50659
50660 /**
50661  * Read a PaymentParameters from a byte array, created by PaymentParameters_write
50662  */
50663 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
50664
50665 /**
50666  * Creates a payee with the node id of the given `pubkey`.
50667  *
50668  * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
50669  * provided.
50670  */
50671 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
50672
50673 /**
50674  * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
50675  *
50676  * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
50677  * provided.
50678  *
50679  * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
50680  * whether your router will be allowed to find a multi-part route for this payment. If you
50681  * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
50682  * [`RecipientOnionFields::secret_only`].
50683  *
50684  * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
50685  */
50686 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
50687
50688 /**
50689  * Creates parameters for paying to a blinded payee from the provided invoice. Sets
50690  * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
50691  * [`PaymentParameters::expiry_time`].
50692  */
50693 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
50694
50695 /**
50696  * Creates parameters for paying to a blinded payee from the provided blinded route hints.
50697  */
50698 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints);
50699
50700 /**
50701  * Frees any resources used by the Payee
50702  */
50703 void Payee_free(struct LDKPayee this_ptr);
50704
50705 /**
50706  * Creates a copy of the Payee
50707  */
50708 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
50709
50710 /**
50711  * Utility method to constructs a new Blinded-variant Payee
50712  */
50713 struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
50714
50715 /**
50716  * Utility method to constructs a new Clear-variant Payee
50717  */
50718 struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
50719
50720 /**
50721  * Generates a non-cryptographic 64-bit hash of the Payee.
50722  */
50723 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
50724
50725 /**
50726  * Checks if two Payees contain equal inner contents.
50727  * This ignores pointers and is_owned flags and looks at the values in fields.
50728  */
50729 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
50730
50731 /**
50732  * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
50733  */
50734 void RouteHint_free(struct LDKRouteHint this_obj);
50735
50736 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
50737
50738 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
50739
50740 /**
50741  * Constructs a new RouteHint given each field
50742  */
50743 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
50744
50745 /**
50746  * Creates a copy of the RouteHint
50747  */
50748 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
50749
50750 /**
50751  * Generates a non-cryptographic 64-bit hash of the RouteHint.
50752  */
50753 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
50754
50755 /**
50756  * Checks if two RouteHints contain equal inner contents.
50757  * This ignores pointers and is_owned flags and looks at the values in fields.
50758  * Two objects with NULL inner values will be considered "equal" here.
50759  */
50760 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
50761
50762 /**
50763  * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
50764  */
50765 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
50766
50767 /**
50768  * Read a RouteHint from a byte array, created by RouteHint_write
50769  */
50770 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
50771
50772 /**
50773  * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
50774  */
50775 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
50776
50777 /**
50778  * The node_id of the non-target end of the route
50779  */
50780 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
50781
50782 /**
50783  * The node_id of the non-target end of the route
50784  */
50785 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
50786
50787 /**
50788  * The short_channel_id of this channel
50789  */
50790 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
50791
50792 /**
50793  * The short_channel_id of this channel
50794  */
50795 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
50796
50797 /**
50798  * The fees which must be paid to use this channel
50799  */
50800 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
50801
50802 /**
50803  * The fees which must be paid to use this channel
50804  */
50805 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
50806
50807 /**
50808  * The difference in CLTV values between this node and the next node.
50809  */
50810 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
50811
50812 /**
50813  * The difference in CLTV values between this node and the next node.
50814  */
50815 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
50816
50817 /**
50818  * The minimum value, in msat, which must be relayed to the next hop.
50819  */
50820 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
50821
50822 /**
50823  * The minimum value, in msat, which must be relayed to the next hop.
50824  */
50825 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
50826
50827 /**
50828  * The maximum value in msat available for routing with a single HTLC.
50829  */
50830 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
50831
50832 /**
50833  * The maximum value in msat available for routing with a single HTLC.
50834  */
50835 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
50836
50837 /**
50838  * Constructs a new RouteHintHop given each field
50839  */
50840 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);
50841
50842 /**
50843  * Creates a copy of the RouteHintHop
50844  */
50845 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
50846
50847 /**
50848  * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
50849  */
50850 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
50851
50852 /**
50853  * Checks if two RouteHintHops contain equal inner contents.
50854  * This ignores pointers and is_owned flags and looks at the values in fields.
50855  * Two objects with NULL inner values will be considered "equal" here.
50856  */
50857 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
50858
50859 /**
50860  * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
50861  */
50862 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
50863
50864 /**
50865  * Read a RouteHintHop from a byte array, created by RouteHintHop_write
50866  */
50867 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
50868
50869 /**
50870  * Frees any resources used by the FirstHopCandidate, if is_owned is set and inner is non-NULL.
50871  */
50872 void FirstHopCandidate_free(struct LDKFirstHopCandidate this_obj);
50873
50874 /**
50875  * Creates a copy of the FirstHopCandidate
50876  */
50877 struct LDKFirstHopCandidate FirstHopCandidate_clone(const struct LDKFirstHopCandidate *NONNULL_PTR orig);
50878
50879 /**
50880  * Frees any resources used by the PublicHopCandidate, if is_owned is set and inner is non-NULL.
50881  */
50882 void PublicHopCandidate_free(struct LDKPublicHopCandidate this_obj);
50883
50884 /**
50885  * The short channel ID of the channel, i.e. the identifier by which we refer to this
50886  * channel.
50887  */
50888 uint64_t PublicHopCandidate_get_short_channel_id(const struct LDKPublicHopCandidate *NONNULL_PTR this_ptr);
50889
50890 /**
50891  * The short channel ID of the channel, i.e. the identifier by which we refer to this
50892  * channel.
50893  */
50894 void PublicHopCandidate_set_short_channel_id(struct LDKPublicHopCandidate *NONNULL_PTR this_ptr, uint64_t val);
50895
50896 /**
50897  * Creates a copy of the PublicHopCandidate
50898  */
50899 struct LDKPublicHopCandidate PublicHopCandidate_clone(const struct LDKPublicHopCandidate *NONNULL_PTR orig);
50900
50901 /**
50902  * Frees any resources used by the PrivateHopCandidate, if is_owned is set and inner is non-NULL.
50903  */
50904 void PrivateHopCandidate_free(struct LDKPrivateHopCandidate this_obj);
50905
50906 /**
50907  * Creates a copy of the PrivateHopCandidate
50908  */
50909 struct LDKPrivateHopCandidate PrivateHopCandidate_clone(const struct LDKPrivateHopCandidate *NONNULL_PTR orig);
50910
50911 /**
50912  * Frees any resources used by the BlindedPathCandidate, if is_owned is set and inner is non-NULL.
50913  */
50914 void BlindedPathCandidate_free(struct LDKBlindedPathCandidate this_obj);
50915
50916 /**
50917  * Creates a copy of the BlindedPathCandidate
50918  */
50919 struct LDKBlindedPathCandidate BlindedPathCandidate_clone(const struct LDKBlindedPathCandidate *NONNULL_PTR orig);
50920
50921 /**
50922  * Frees any resources used by the OneHopBlindedPathCandidate, if is_owned is set and inner is non-NULL.
50923  */
50924 void OneHopBlindedPathCandidate_free(struct LDKOneHopBlindedPathCandidate this_obj);
50925
50926 /**
50927  * Creates a copy of the OneHopBlindedPathCandidate
50928  */
50929 struct LDKOneHopBlindedPathCandidate OneHopBlindedPathCandidate_clone(const struct LDKOneHopBlindedPathCandidate *NONNULL_PTR orig);
50930
50931 /**
50932  * Frees any resources used by the CandidateRouteHop
50933  */
50934 void CandidateRouteHop_free(struct LDKCandidateRouteHop this_ptr);
50935
50936 /**
50937  * Creates a copy of the CandidateRouteHop
50938  */
50939 struct LDKCandidateRouteHop CandidateRouteHop_clone(const struct LDKCandidateRouteHop *NONNULL_PTR orig);
50940
50941 /**
50942  * Utility method to constructs a new FirstHop-variant CandidateRouteHop
50943  */
50944 struct LDKCandidateRouteHop CandidateRouteHop_first_hop(struct LDKFirstHopCandidate a);
50945
50946 /**
50947  * Utility method to constructs a new PublicHop-variant CandidateRouteHop
50948  */
50949 struct LDKCandidateRouteHop CandidateRouteHop_public_hop(struct LDKPublicHopCandidate a);
50950
50951 /**
50952  * Utility method to constructs a new PrivateHop-variant CandidateRouteHop
50953  */
50954 struct LDKCandidateRouteHop CandidateRouteHop_private_hop(struct LDKPrivateHopCandidate a);
50955
50956 /**
50957  * Utility method to constructs a new Blinded-variant CandidateRouteHop
50958  */
50959 struct LDKCandidateRouteHop CandidateRouteHop_blinded(struct LDKBlindedPathCandidate a);
50960
50961 /**
50962  * Utility method to constructs a new OneHopBlinded-variant CandidateRouteHop
50963  */
50964 struct LDKCandidateRouteHop CandidateRouteHop_one_hop_blinded(struct LDKOneHopBlindedPathCandidate a);
50965
50966 /**
50967  * Returns the globally unique short channel ID for this hop, if one is known.
50968  *
50969  * This only returns `Some` if the channel is public (either our own, or one we've learned
50970  * from the public network graph), and thus the short channel ID we have for this channel is
50971  * globally unique and identifies this channel in a global namespace.
50972  */
50973 MUST_USE_RES struct LDKCOption_u64Z CandidateRouteHop_globally_unique_short_channel_id(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
50974
50975 /**
50976  * Returns the required difference in HTLC CLTV expiry between the [`Self::source`] and the
50977  * next-hop for an HTLC taking this hop.
50978  *
50979  * This is the time that the node(s) in this hop have to claim the HTLC on-chain if the
50980  * next-hop goes on chain with a payment preimage.
50981  */
50982 MUST_USE_RES uint32_t CandidateRouteHop_cltv_expiry_delta(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
50983
50984 /**
50985  * Returns the minimum amount that can be sent over this hop, in millisatoshis.
50986  */
50987 MUST_USE_RES uint64_t CandidateRouteHop_htlc_minimum_msat(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
50988
50989 /**
50990  * Returns the fees that must be paid to route an HTLC over this channel.
50991  */
50992 MUST_USE_RES struct LDKRoutingFees CandidateRouteHop_fees(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
50993
50994 /**
50995  * Returns the source node id of current hop.
50996  *
50997  * Source node id refers to the node forwarding the HTLC through this hop.
50998  *
50999  * For [`Self::FirstHop`] we return payer's node id.
51000  */
51001 MUST_USE_RES struct LDKNodeId CandidateRouteHop_source(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
51002
51003 /**
51004  * Returns the target node id of this hop, if known.
51005  *
51006  * Target node id refers to the node receiving the HTLC after this hop.
51007  *
51008  * For [`Self::Blinded`] we return `None` because the ultimate destination after the blinded
51009  * path is unknown.
51010  *
51011  * For [`Self::OneHopBlinded`] we return `None` because the target is the same as the source,
51012  * and such a return value would be somewhat nonsensical.
51013  *
51014  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51015  */
51016 MUST_USE_RES struct LDKNodeId CandidateRouteHop_target(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
51017
51018 /**
51019  * Finds a route from us (payer) to the given target node (payee).
51020  *
51021  * If the payee provided features in their invoice, they should be provided via the `payee` field
51022  * in the given [`RouteParameters::payment_params`].
51023  * Without this, MPP will only be used if the payee's features are available in the network graph.
51024  *
51025  * Private routing paths between a public node and the target may be included in the `payee` field
51026  * of [`RouteParameters::payment_params`].
51027  *
51028  * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
51029  * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
51030  * from `network_graph` will be ignored, and only those in `first_hops` will be used.
51031  *
51032  * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
51033  * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
51034  * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
51035  *
51036  * # Panics
51037  *
51038  * Panics if first_hops contains channels without `short_channel_id`s;
51039  * [`ChannelManager::list_usable_channels`] will never include such channels.
51040  *
51041  * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
51042  * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
51043  * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
51044  *
51045  * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
51046  */
51047 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]);
51048
51049 /**
51050  * Construct a route from us (payer) to the target node (payee) via the given hops (which should
51051  * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
51052  *
51053  * Re-uses logic from `find_route`, so the restrictions described there also apply here.
51054  */
51055 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]);
51056
51057 /**
51058  * Calls the free function if one is set
51059  */
51060 void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
51061
51062 /**
51063  * Calls the free function if one is set
51064  */
51065 void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
51066
51067 /**
51068  * Calls the free function if one is set
51069  */
51070 void Score_free(struct LDKScore this_ptr);
51071
51072 /**
51073  * Calls the free function if one is set
51074  */
51075 void LockableScore_free(struct LDKLockableScore this_ptr);
51076
51077 /**
51078  * Calls the free function if one is set
51079  */
51080 void WriteableScore_free(struct LDKWriteableScore this_ptr);
51081
51082 /**
51083  * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
51084  */
51085 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
51086
51087 /**
51088  * Constructs a new LockableScore which calls the relevant methods on this_arg.
51089  * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
51090  */
51091 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
51092
51093 /**
51094  * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
51095  */
51096 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
51097
51098 /**
51099  * Constructs a new WriteableScore which calls the relevant methods on this_arg.
51100  * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
51101  */
51102 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
51103
51104 /**
51105  * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
51106  */
51107 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
51108
51109 /**
51110  * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
51111  */
51112 void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
51113
51114 /**
51115  * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
51116  */
51117 void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
51118
51119 /**
51120  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
51121  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
51122  */
51123 struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
51124
51125 /**
51126  * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
51127  */
51128 struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
51129
51130 /**
51131  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
51132  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
51133  */
51134 struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
51135
51136 /**
51137  * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
51138  */
51139 void ChannelUsage_free(struct LDKChannelUsage this_obj);
51140
51141 /**
51142  * The amount to send through the channel, denominated in millisatoshis.
51143  */
51144 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
51145
51146 /**
51147  * The amount to send through the channel, denominated in millisatoshis.
51148  */
51149 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
51150
51151 /**
51152  * Total amount, denominated in millisatoshis, already allocated to send through the channel
51153  * as part of a multi-path payment.
51154  */
51155 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
51156
51157 /**
51158  * Total amount, denominated in millisatoshis, already allocated to send through the channel
51159  * as part of a multi-path payment.
51160  */
51161 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
51162
51163 /**
51164  * The effective capacity of the channel.
51165  */
51166 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
51167
51168 /**
51169  * The effective capacity of the channel.
51170  */
51171 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
51172
51173 /**
51174  * Constructs a new ChannelUsage given each field
51175  */
51176 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
51177
51178 /**
51179  * Creates a copy of the ChannelUsage
51180  */
51181 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
51182
51183 /**
51184  * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
51185  */
51186 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
51187
51188 /**
51189  * Creates a copy of the FixedPenaltyScorer
51190  */
51191 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
51192
51193 /**
51194  * Creates a new scorer using `penalty_msat`.
51195  */
51196 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
51197
51198 /**
51199  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
51200  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
51201  */
51202 struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
51203
51204 /**
51205  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
51206  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
51207  */
51208 struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
51209
51210 /**
51211  * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
51212  */
51213 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
51214
51215 /**
51216  * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
51217  */
51218 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
51219
51220 /**
51221  * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
51222  */
51223 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
51224
51225 /**
51226  * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
51227  */
51228 void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
51229
51230 /**
51231  * A fixed penalty in msats to apply to each channel.
51232  *
51233  * Default value: 500 msat
51234  */
51235 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51236
51237 /**
51238  * A fixed penalty in msats to apply to each channel.
51239  *
51240  * Default value: 500 msat
51241  */
51242 void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51243
51244 /**
51245  * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
51246  * applied to each channel, in excess of the [`base_penalty_msat`].
51247  *
51248  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
51249  * fees plus penalty) for large payments. The penalty is computed as the product of this
51250  * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
51251  * amount plus the amount of any other HTLCs flowing we sent over the same channel).
51252  *
51253  * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
51254  *
51255  * Default value: 8,192 msat
51256  *
51257  * [`base_penalty_msat`]: Self::base_penalty_msat
51258  */
51259 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51260
51261 /**
51262  * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
51263  * applied to each channel, in excess of the [`base_penalty_msat`].
51264  *
51265  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
51266  * fees plus penalty) for large payments. The penalty is computed as the product of this
51267  * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
51268  * amount plus the amount of any other HTLCs flowing we sent over the same channel).
51269  *
51270  * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
51271  *
51272  * Default value: 8,192 msat
51273  *
51274  * [`base_penalty_msat`]: Self::base_penalty_msat
51275  */
51276 void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51277
51278 /**
51279  * A multiplier used in conjunction with the negative `log10` of the channel's success
51280  * probability for a payment, as determined by our latest estimates of the channel's
51281  * liquidity, to determine the liquidity penalty.
51282  *
51283  * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
51284  * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
51285  * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
51286  * lower bounding the success probability to `0.01`) when the amount falls within the
51287  * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
51288  * result in a `u64::max_value` penalty, however.
51289  *
51290  * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
51291  *
51292  * Default value: 30,000 msat
51293  *
51294  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
51295  */
51296 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51297
51298 /**
51299  * A multiplier used in conjunction with the negative `log10` of the channel's success
51300  * probability for a payment, as determined by our latest estimates of the channel's
51301  * liquidity, to determine the liquidity penalty.
51302  *
51303  * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
51304  * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
51305  * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
51306  * lower bounding the success probability to `0.01`) when the amount falls within the
51307  * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
51308  * result in a `u64::max_value` penalty, however.
51309  *
51310  * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
51311  *
51312  * Default value: 30,000 msat
51313  *
51314  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
51315  */
51316 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51317
51318 /**
51319  * A multiplier used in conjunction with the total amount flowing over a channel and the
51320  * negative `log10` of the channel's success probability for the payment, as determined by our
51321  * latest estimates of the channel's liquidity, to determine the amount penalty.
51322  *
51323  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
51324  * fees plus penalty) for large payments. The penalty is computed as the product of this
51325  * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
51326  * `log10` of the success probability.
51327  *
51328  * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
51329  *
51330  * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
51331  * the amount will result in a penalty of the multiplier. And, as the success probability
51332  * decreases, the negative `log10` weighting will increase dramatically. For higher success
51333  * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
51334  * fall below `1`.
51335  *
51336  * Default value: 192 msat
51337  */
51338 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51339
51340 /**
51341  * A multiplier used in conjunction with the total amount flowing over a channel and the
51342  * negative `log10` of the channel's success probability for the payment, as determined by our
51343  * latest estimates of the channel's liquidity, to determine the amount penalty.
51344  *
51345  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
51346  * fees plus penalty) for large payments. The penalty is computed as the product of this
51347  * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
51348  * `log10` of the success probability.
51349  *
51350  * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
51351  *
51352  * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
51353  * the amount will result in a penalty of the multiplier. And, as the success probability
51354  * decreases, the negative `log10` weighting will increase dramatically. For higher success
51355  * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
51356  * fall below `1`.
51357  *
51358  * Default value: 192 msat
51359  */
51360 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51361
51362 /**
51363  * A multiplier used in conjunction with the negative `log10` of the channel's success
51364  * probability for the payment, as determined based on the history of our estimates of the
51365  * channel's available liquidity, to determine a penalty.
51366  *
51367  * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
51368  * only our latest estimate for the current liquidity available in the channel, it estimates
51369  * success probability based on the estimated liquidity available in the channel through
51370  * history. Specifically, every time we update our liquidity bounds on a given channel, we
51371  * track which of several buckets those bounds fall into, exponentially decaying the
51372  * probability of each bucket as new samples are added.
51373  *
51374  * Default value: 10,000 msat
51375  *
51376  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
51377  */
51378 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51379
51380 /**
51381  * A multiplier used in conjunction with the negative `log10` of the channel's success
51382  * probability for the payment, as determined based on the history of our estimates of the
51383  * channel's available liquidity, to determine a penalty.
51384  *
51385  * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
51386  * only our latest estimate for the current liquidity available in the channel, it estimates
51387  * success probability based on the estimated liquidity available in the channel through
51388  * history. Specifically, every time we update our liquidity bounds on a given channel, we
51389  * track which of several buckets those bounds fall into, exponentially decaying the
51390  * probability of each bucket as new samples are added.
51391  *
51392  * Default value: 10,000 msat
51393  *
51394  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
51395  */
51396 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51397
51398 /**
51399  * A multiplier used in conjunction with the total amount flowing over a channel and the
51400  * negative `log10` of the channel's success probability for the payment, as determined based
51401  * on the history of our estimates of the channel's available liquidity, to determine a
51402  * penalty.
51403  *
51404  * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
51405  * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
51406  * of the amount flowing over this channel, weighted by the negative `log10` of the success
51407  * probability.
51408  *
51409  * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
51410  * of using only our latest estimate for the current liquidity available in the channel, it
51411  * estimates success probability based on the estimated liquidity available in the channel
51412  * through history. Specifically, every time we update our liquidity bounds on a given
51413  * channel, we track which of several buckets those bounds fall into, exponentially decaying
51414  * the probability of each bucket as new samples are added.
51415  *
51416  * Default value: 64 msat
51417  *
51418  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
51419  */
51420 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51421
51422 /**
51423  * A multiplier used in conjunction with the total amount flowing over a channel and the
51424  * negative `log10` of the channel's success probability for the payment, as determined based
51425  * on the history of our estimates of the channel's available liquidity, to determine a
51426  * penalty.
51427  *
51428  * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
51429  * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
51430  * of the amount flowing over this channel, weighted by the negative `log10` of the success
51431  * probability.
51432  *
51433  * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
51434  * of using only our latest estimate for the current liquidity available in the channel, it
51435  * estimates success probability based on the estimated liquidity available in the channel
51436  * through history. Specifically, every time we update our liquidity bounds on a given
51437  * channel, we track which of several buckets those bounds fall into, exponentially decaying
51438  * the probability of each bucket as new samples are added.
51439  *
51440  * Default value: 64 msat
51441  *
51442  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
51443  */
51444 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51445
51446 /**
51447  * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
51448  * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
51449  * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
51450  * as this makes balance discovery attacks harder to execute, thereby creating an incentive
51451  * to restrict `htlc_maximum_msat` and improve privacy.
51452  *
51453  * Default value: 250 msat
51454  */
51455 uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51456
51457 /**
51458  * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
51459  * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
51460  * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
51461  * as this makes balance discovery attacks harder to execute, thereby creating an incentive
51462  * to restrict `htlc_maximum_msat` and improve privacy.
51463  *
51464  * Default value: 250 msat
51465  */
51466 void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51467
51468 /**
51469  * This penalty is applied when the total amount flowing over a channel exceeds our current
51470  * estimate of the channel's available liquidity. The total amount is the amount of the
51471  * current HTLC plus any HTLCs which we've sent over the same channel.
51472  *
51473  * Note that in this case all other penalties, including the
51474  * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
51475  * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
51476  * applicable, are still included in the overall penalty.
51477  *
51478  * If you wish to avoid creating paths with such channels entirely, setting this to a value of
51479  * `u64::max_value()` will guarantee that.
51480  *
51481  * Default value: 1_0000_0000_000 msat (1 Bitcoin)
51482  *
51483  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
51484  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
51485  * [`base_penalty_msat`]: Self::base_penalty_msat
51486  * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
51487  */
51488 uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51489
51490 /**
51491  * This penalty is applied when the total amount flowing over a channel exceeds our current
51492  * estimate of the channel's available liquidity. The total amount is the amount of the
51493  * current HTLC plus any HTLCs which we've sent over the same channel.
51494  *
51495  * Note that in this case all other penalties, including the
51496  * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
51497  * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
51498  * applicable, are still included in the overall penalty.
51499  *
51500  * If you wish to avoid creating paths with such channels entirely, setting this to a value of
51501  * `u64::max_value()` will guarantee that.
51502  *
51503  * Default value: 1_0000_0000_000 msat (1 Bitcoin)
51504  *
51505  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
51506  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
51507  * [`base_penalty_msat`]: Self::base_penalty_msat
51508  * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
51509  */
51510 void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
51511
51512 /**
51513  * In order to calculate most of the scores above, we must first convert a lower and upper
51514  * bound on the available liquidity in a channel into the probability that we think a payment
51515  * will succeed. That probability is derived from a Probability Density Function for where we
51516  * think the liquidity in a channel likely lies, given such bounds.
51517  *
51518  * If this flag is set, that PDF is simply a constant - we assume that the actual available
51519  * liquidity in a channel is just as likely to be at any point between our lower and upper
51520  * bounds.
51521  *
51522  * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
51523  * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
51524  * matches experimental results - most routing nodes do not aggressively rebalance their
51525  * channels and flows in the network are often unbalanced, leaving liquidity usually
51526  * unavailable.
51527  *
51528  * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
51529  * of floating-point multiplications in the hottest routing code, which may lead to routing
51530  * performance degradation on some machines.
51531  *
51532  * Default value: false
51533  */
51534 bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
51535
51536 /**
51537  * In order to calculate most of the scores above, we must first convert a lower and upper
51538  * bound on the available liquidity in a channel into the probability that we think a payment
51539  * will succeed. That probability is derived from a Probability Density Function for where we
51540  * think the liquidity in a channel likely lies, given such bounds.
51541  *
51542  * If this flag is set, that PDF is simply a constant - we assume that the actual available
51543  * liquidity in a channel is just as likely to be at any point between our lower and upper
51544  * bounds.
51545  *
51546  * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
51547  * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
51548  * matches experimental results - most routing nodes do not aggressively rebalance their
51549  * channels and flows in the network are often unbalanced, leaving liquidity usually
51550  * unavailable.
51551  *
51552  * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
51553  * of floating-point multiplications in the hottest routing code, which may lead to routing
51554  * performance degradation on some machines.
51555  *
51556  * Default value: false
51557  */
51558 void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
51559
51560 /**
51561  * Creates a copy of the ProbabilisticScoringFeeParameters
51562  */
51563 struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
51564
51565 /**
51566  * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
51567  */
51568 MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
51569
51570 /**
51571  * Marks the node with the given `node_id` as banned,
51572  * i.e it will be avoided during path finding.
51573  */
51574 void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
51575
51576 /**
51577  * Marks all nodes in the given list as banned, i.e.,
51578  * they will be avoided during path finding.
51579  */
51580 void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
51581
51582 /**
51583  * Removes the node with the given `node_id` from the list of nodes to avoid.
51584  */
51585 void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
51586
51587 /**
51588  * Sets a manual penalty for the given node.
51589  */
51590 void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
51591
51592 /**
51593  * Removes the node with the given `node_id` from the list of manual penalties.
51594  */
51595 void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
51596
51597 /**
51598  * Clears the list of manual penalties that are applied during path finding.
51599  */
51600 void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
51601
51602 /**
51603  * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
51604  */
51605 void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
51606
51607 /**
51608  * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
51609  * tracking can simply live on with increasingly stale data. Instead, when a channel has not
51610  * seen a liquidity estimate update for this amount of time, the historical datapoints are
51611  * decayed by half.
51612  * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
51613  *
51614  * Note that after 16 or more half lives all historical data will be completely gone.
51615  *
51616  * Default value: 14 days
51617  *
51618  * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
51619  */
51620 uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
51621
51622 /**
51623  * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
51624  * tracking can simply live on with increasingly stale data. Instead, when a channel has not
51625  * seen a liquidity estimate update for this amount of time, the historical datapoints are
51626  * decayed by half.
51627  * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
51628  *
51629  * Note that after 16 or more half lives all historical data will be completely gone.
51630  *
51631  * Default value: 14 days
51632  *
51633  * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
51634  */
51635 void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
51636
51637 /**
51638  * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
51639  * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
51640  * the available liquidity is halved and the upper-bound moves half-way to the channel's total
51641  * capacity.
51642  *
51643  * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
51644  * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
51645  * struct documentation for more info on the way the liquidity bounds are used.
51646  *
51647  * For example, if the channel's capacity is 1 million sats, and the current upper and lower
51648  * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
51649  * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
51650  *
51651  * Default value: 6 hours
51652  *
51653  * # Note
51654  *
51655  * When built with the `no-std` feature, time will never elapse. Therefore, the channel
51656  * liquidity knowledge will never decay except when the bounds cross.
51657  */
51658 uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
51659
51660 /**
51661  * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
51662  * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
51663  * the available liquidity is halved and the upper-bound moves half-way to the channel's total
51664  * capacity.
51665  *
51666  * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
51667  * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
51668  * struct documentation for more info on the way the liquidity bounds are used.
51669  *
51670  * For example, if the channel's capacity is 1 million sats, and the current upper and lower
51671  * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
51672  * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
51673  *
51674  * Default value: 6 hours
51675  *
51676  * # Note
51677  *
51678  * When built with the `no-std` feature, time will never elapse. Therefore, the channel
51679  * liquidity knowledge will never decay except when the bounds cross.
51680  */
51681 void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
51682
51683 /**
51684  * Constructs a new ProbabilisticScoringDecayParameters given each field
51685  */
51686 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
51687
51688 /**
51689  * Creates a copy of the ProbabilisticScoringDecayParameters
51690  */
51691 struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
51692
51693 /**
51694  * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
51695  */
51696 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
51697
51698 /**
51699  * Creates a new scorer using the given scoring parameters for sending payments from a node
51700  * through a network graph.
51701  */
51702 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
51703
51704 /**
51705  * Dump the contents of this scorer into the configured logger.
51706  *
51707  * Note that this writes roughly one line per channel for which we have a liquidity estimate,
51708  * which may be a substantial amount of log output.
51709  */
51710 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
51711
51712 /**
51713  * Query the estimated minimum and maximum liquidity available for sending a payment over the
51714  * channel with `scid` towards the given `target` node.
51715  */
51716 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);
51717
51718 /**
51719  * Query the historical estimated minimum and maximum liquidity available for sending a
51720  * payment over the channel with `scid` towards the given `target` node.
51721  *
51722  * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
51723  * the second set describes the upper-bound liquidity history. Each bucket describes the
51724  * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
51725  * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
51726  * more recent data points are weighted more heavily than older datapoints.
51727  *
51728  * Note that the range of each bucket varies by its location to provide more granular results
51729  * at the edges of a channel's capacity, where it is more likely to sit.
51730  *
51731  * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
51732  * is calculated by dividing that bucket's value with the total value of all buckets.
51733  *
51734  * For example, using a lower bucket count for illustrative purposes, a value of
51735  * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
51736  * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
51737  * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
51738  * in the top and bottom bucket, and roughly with similar (recent) frequency.
51739  *
51740  * Because the datapoints are decayed slowly over time, values will eventually return to
51741  * `Some(([0; 32], [0; 32]))` or `None` if no data remains for a channel.
51742  *
51743  * In order to fetch a single success probability from the buckets provided here, as used in
51744  * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
51745  */
51746 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);
51747
51748 /**
51749  * Query the probability of payment success sending the given `amount_msat` over the channel
51750  * with `scid` towards the given `target` node, based on the historical estimated liquidity
51751  * bounds.
51752  *
51753  * These are the same bounds as returned by
51754  * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
51755  * [`Self::estimated_channel_liquidity_range`]).
51756  */
51757 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);
51758
51759 /**
51760  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
51761  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
51762  */
51763 struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
51764
51765 /**
51766  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
51767  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
51768  */
51769 struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
51770
51771 /**
51772  * Constructs a new Score which calls the relevant methods on this_arg.
51773  * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
51774  */
51775 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
51776
51777 /**
51778  * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
51779  */
51780 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
51781
51782 /**
51783  * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
51784  */
51785 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
51786
51787 /**
51788  * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
51789  */
51790 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
51791
51792 /**
51793  * The outpoint which is spendable.
51794  */
51795 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51796
51797 /**
51798  * The outpoint which is spendable.
51799  */
51800 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
51801
51802 /**
51803  * Per commitment point to derive the delayed payment key by key holder.
51804  */
51805 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51806
51807 /**
51808  * Per commitment point to derive the delayed payment key by key holder.
51809  */
51810 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
51811
51812 /**
51813  * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
51814  * the witness_script.
51815  */
51816 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51817
51818 /**
51819  * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
51820  * the witness_script.
51821  */
51822 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
51823
51824 /**
51825  * The output which is referenced by the given outpoint.
51826  */
51827 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51828
51829 /**
51830  * The output which is referenced by the given outpoint.
51831  */
51832 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
51833
51834 /**
51835  * The revocation point specific to the commitment transaction which was broadcast. Used to
51836  * derive the witnessScript for this output.
51837  */
51838 struct LDKRevocationKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51839
51840 /**
51841  * The revocation point specific to the commitment transaction which was broadcast. Used to
51842  * derive the witnessScript for this output.
51843  */
51844 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
51845
51846 /**
51847  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
51848  * This may be useful in re-deriving keys used in the channel to spend the output.
51849  */
51850 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
51851
51852 /**
51853  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
51854  * This may be useful in re-deriving keys used in the channel to spend the output.
51855  */
51856 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
51857
51858 /**
51859  * The value of the channel which this output originated from, possibly indirectly.
51860  */
51861 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51862
51863 /**
51864  * The value of the channel which this output originated from, possibly indirectly.
51865  */
51866 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
51867
51868 /**
51869  * The channel public keys and other parameters needed to generate a spending transaction or
51870  * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
51871  *
51872  * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
51873  *
51874  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51875  */
51876 struct LDKChannelTransactionParameters DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51877
51878 /**
51879  * The channel public keys and other parameters needed to generate a spending transaction or
51880  * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`].
51881  *
51882  * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later.
51883  *
51884  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
51885  */
51886 void DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
51887
51888 /**
51889  * Constructs a new DelayedPaymentOutputDescriptor given each field
51890  *
51891  * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
51892  */
51893 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, struct LDKChannelTransactionParameters channel_transaction_parameters_arg);
51894
51895 /**
51896  * Creates a copy of the DelayedPaymentOutputDescriptor
51897  */
51898 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
51899
51900 /**
51901  * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
51902  */
51903 uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
51904
51905 /**
51906  * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
51907  * This ignores pointers and is_owned flags and looks at the values in fields.
51908  * Two objects with NULL inner values will be considered "equal" here.
51909  */
51910 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
51911
51912 /**
51913  * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
51914  */
51915 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
51916
51917 /**
51918  * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
51919  */
51920 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
51921
51922 /**
51923  * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
51924  */
51925 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
51926
51927 /**
51928  * The outpoint which is spendable.
51929  */
51930 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51931
51932 /**
51933  * The outpoint which is spendable.
51934  */
51935 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
51936
51937 /**
51938  * The output which is referenced by the given outpoint.
51939  */
51940 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51941
51942 /**
51943  * The output which is referenced by the given outpoint.
51944  */
51945 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
51946
51947 /**
51948  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
51949  * This may be useful in re-deriving keys used in the channel to spend the output.
51950  */
51951 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
51952
51953 /**
51954  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
51955  * This may be useful in re-deriving keys used in the channel to spend the output.
51956  */
51957 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
51958
51959 /**
51960  * The value of the channel which this transactions spends.
51961  */
51962 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51963
51964 /**
51965  * The value of the channel which this transactions spends.
51966  */
51967 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
51968
51969 /**
51970  * The necessary channel parameters that need to be provided to the re-derived signer through
51971  * [`ChannelSigner::provide_channel_parameters`].
51972  *
51973  * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
51974  *
51975  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
51976  */
51977 struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
51978
51979 /**
51980  * The necessary channel parameters that need to be provided to the re-derived signer through
51981  * [`ChannelSigner::provide_channel_parameters`].
51982  *
51983  * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
51984  *
51985  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
51986  */
51987 void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
51988
51989 /**
51990  * Constructs a new StaticPaymentOutputDescriptor given each field
51991  *
51992  * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
51993  */
51994 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);
51995
51996 /**
51997  * Creates a copy of the StaticPaymentOutputDescriptor
51998  */
51999 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
52000
52001 /**
52002  * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
52003  */
52004 uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
52005
52006 /**
52007  * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
52008  * This ignores pointers and is_owned flags and looks at the values in fields.
52009  * Two objects with NULL inner values will be considered "equal" here.
52010  */
52011 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
52012
52013 /**
52014  * Returns the `witness_script` of the spendable output.
52015  *
52016  * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
52017  * originated from an anchor outputs channel, as they take the form of a P2WSH script.
52018  */
52019 MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
52020
52021 /**
52022  * The maximum length a well-formed witness spending one of these should have.
52023  * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
52024  * shorter.
52025  */
52026 MUST_USE_RES uint64_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
52027
52028 /**
52029  * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
52030  */
52031 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
52032
52033 /**
52034  * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
52035  */
52036 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
52037
52038 /**
52039  * Frees any resources used by the SpendableOutputDescriptor
52040  */
52041 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
52042
52043 /**
52044  * Creates a copy of the SpendableOutputDescriptor
52045  */
52046 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
52047
52048 /**
52049  * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
52050  */
52051 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output, struct LDKThirtyTwoBytes channel_keys_id);
52052
52053 /**
52054  * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
52055  */
52056 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
52057
52058 /**
52059  * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
52060  */
52061 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
52062
52063 /**
52064  * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
52065  */
52066 uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
52067
52068 /**
52069  * Checks if two SpendableOutputDescriptors contain equal inner contents.
52070  * This ignores pointers and is_owned flags and looks at the values in fields.
52071  */
52072 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
52073
52074 /**
52075  * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
52076  */
52077 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
52078
52079 /**
52080  * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
52081  */
52082 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
52083
52084 /**
52085  * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
52086  * the given outputs, plus an output to the given change destination (if sufficient
52087  * change value remains). The PSBT will have a feerate, at least, of the given value.
52088  *
52089  * The `locktime` argument is used to set the transaction's locktime. If `None`, the
52090  * transaction will have a locktime of 0. It it recommended to set this to the current block
52091  * height to avoid fee sniping, unless you have some specific reason to use a different
52092  * locktime.
52093  *
52094  * Returns the PSBT and expected max transaction weight.
52095  *
52096  * Returns `Err(())` if the output value is greater than the input value minus required fee,
52097  * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
52098  * does not match the one we can spend.
52099  *
52100  * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
52101  */
52102 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);
52103
52104 /**
52105  * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
52106  */
52107 void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
52108
52109 /**
52110  * The value in satoshis of the channel we're attempting to spend the anchor output of.
52111  */
52112 uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
52113
52114 /**
52115  * The value in satoshis of the channel we're attempting to spend the anchor output of.
52116  */
52117 void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
52118
52119 /**
52120  * The unique identifier to re-derive the signer for the associated channel.
52121  */
52122 const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
52123
52124 /**
52125  * The unique identifier to re-derive the signer for the associated channel.
52126  */
52127 void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
52128
52129 /**
52130  * The necessary channel parameters that need to be provided to the re-derived signer through
52131  * [`ChannelSigner::provide_channel_parameters`].
52132  */
52133 struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
52134
52135 /**
52136  * The necessary channel parameters that need to be provided to the re-derived signer through
52137  * [`ChannelSigner::provide_channel_parameters`].
52138  */
52139 void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
52140
52141 /**
52142  * Constructs a new ChannelDerivationParameters given each field
52143  */
52144 MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
52145
52146 /**
52147  * Creates a copy of the ChannelDerivationParameters
52148  */
52149 struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
52150
52151 /**
52152  * Checks if two ChannelDerivationParameterss contain equal inner contents.
52153  * This ignores pointers and is_owned flags and looks at the values in fields.
52154  * Two objects with NULL inner values will be considered "equal" here.
52155  */
52156 bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
52157
52158 /**
52159  * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
52160  */
52161 struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
52162
52163 /**
52164  * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
52165  */
52166 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
52167
52168 /**
52169  * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
52170  */
52171 void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
52172
52173 /**
52174  * The parameters required to derive the signer for the HTLC input.
52175  */
52176 struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52177
52178 /**
52179  * The parameters required to derive the signer for the HTLC input.
52180  */
52181 void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
52182
52183 /**
52184  * The txid of the commitment transaction in which the HTLC output lives.
52185  */
52186 const uint8_t (*HTLCDescriptor_get_commitment_txid(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr))[32];
52187
52188 /**
52189  * The txid of the commitment transaction in which the HTLC output lives.
52190  */
52191 void HTLCDescriptor_set_commitment_txid(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
52192
52193 /**
52194  * The number of the commitment transaction in which the HTLC output lives.
52195  */
52196 uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52197
52198 /**
52199  * The number of the commitment transaction in which the HTLC output lives.
52200  */
52201 void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
52202
52203 /**
52204  * The key tweak corresponding to the number of the commitment transaction in which the HTLC
52205  * output lives. This tweak is applied to all the basepoints for both parties in the channel to
52206  * arrive at unique keys per commitment.
52207  *
52208  * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
52209  */
52210 struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52211
52212 /**
52213  * The key tweak corresponding to the number of the commitment transaction in which the HTLC
52214  * output lives. This tweak is applied to all the basepoints for both parties in the channel to
52215  * arrive at unique keys per commitment.
52216  *
52217  * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
52218  */
52219 void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
52220
52221 /**
52222  * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
52223  * originating from a channel supporting anchor outputs, otherwise it is the channel's
52224  * negotiated feerate at the time the commitment transaction was built.
52225  */
52226 uint32_t HTLCDescriptor_get_feerate_per_kw(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52227
52228 /**
52229  * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
52230  * originating from a channel supporting anchor outputs, otherwise it is the channel's
52231  * negotiated feerate at the time the commitment transaction was built.
52232  */
52233 void HTLCDescriptor_set_feerate_per_kw(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint32_t val);
52234
52235 /**
52236  * The details of the HTLC as it appears in the commitment transaction.
52237  */
52238 struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52239
52240 /**
52241  * The details of the HTLC as it appears in the commitment transaction.
52242  */
52243 void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
52244
52245 /**
52246  * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
52247  * taken.
52248  */
52249 struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52250
52251 /**
52252  * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
52253  * taken.
52254  */
52255 void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
52256
52257 /**
52258  * The counterparty's signature required to spend the HTLC output.
52259  */
52260 struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
52261
52262 /**
52263  * The counterparty's signature required to spend the HTLC output.
52264  */
52265 void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
52266
52267 /**
52268  * Constructs a new HTLCDescriptor given each field
52269  */
52270 MUST_USE_RES struct LDKHTLCDescriptor HTLCDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKThirtyTwoBytes commitment_txid_arg, uint64_t per_commitment_number_arg, struct LDKPublicKey per_commitment_point_arg, uint32_t feerate_per_kw_arg, struct LDKHTLCOutputInCommitment htlc_arg, struct LDKCOption_ThirtyTwoBytesZ preimage_arg, struct LDKECDSASignature counterparty_sig_arg);
52271
52272 /**
52273  * Creates a copy of the HTLCDescriptor
52274  */
52275 struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
52276
52277 /**
52278  * Checks if two HTLCDescriptors contain equal inner contents.
52279  * This ignores pointers and is_owned flags and looks at the values in fields.
52280  * Two objects with NULL inner values will be considered "equal" here.
52281  */
52282 bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
52283
52284 /**
52285  * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
52286  */
52287 struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
52288
52289 /**
52290  * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
52291  */
52292 struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
52293
52294 /**
52295  * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
52296  * being spent by the HTLC input in the HTLC transaction.
52297  */
52298 MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52299
52300 /**
52301  * Returns the UTXO to be spent by the HTLC input, which can be obtained via
52302  * [`Self::unsigned_tx_input`].
52303  */
52304 MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52305
52306 /**
52307  * Returns the unsigned transaction input spending the HTLC output in the commitment
52308  * transaction.
52309  */
52310 MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52311
52312 /**
52313  * Returns the delayed output created as a result of spending the HTLC output in the commitment
52314  * transaction.
52315  */
52316 MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52317
52318 /**
52319  * Returns the witness script of the HTLC output in the commitment transaction.
52320  */
52321 MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
52322
52323 /**
52324  * Returns the fully signed witness required to spend the HTLC output in the commitment
52325  * transaction.
52326  */
52327 MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
52328
52329 /**
52330  * Derives the channel signer required to sign the HTLC input.
52331  */
52332 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
52333
52334 /**
52335  * Calls the free function if one is set
52336  */
52337 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
52338
52339 /**
52340  * Creates a copy of the Recipient
52341  */
52342 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
52343
52344 /**
52345  * Utility method to constructs a new Node-variant Recipient
52346  */
52347 enum LDKRecipient Recipient_node(void);
52348
52349 /**
52350  * Utility method to constructs a new PhantomNode-variant Recipient
52351  */
52352 enum LDKRecipient Recipient_phantom_node(void);
52353
52354 /**
52355  * Calls the free function if one is set
52356  */
52357 void EntropySource_free(struct LDKEntropySource this_ptr);
52358
52359 /**
52360  * Calls the free function if one is set
52361  */
52362 void NodeSigner_free(struct LDKNodeSigner this_ptr);
52363
52364 /**
52365  * Calls the free function if one is set
52366  */
52367 void OutputSpender_free(struct LDKOutputSpender this_ptr);
52368
52369 /**
52370  * Calls the free function if one is set
52371  */
52372 void SignerProvider_free(struct LDKSignerProvider this_ptr);
52373
52374 /**
52375  * Calls the free function if one is set
52376  */
52377 void ChangeDestinationSource_free(struct LDKChangeDestinationSource this_ptr);
52378
52379 /**
52380  * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
52381  */
52382 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
52383
52384 /**
52385  * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
52386  * holder's anchor output in a commitment transaction, if one is present.
52387  */
52388 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52389
52390 /**
52391  * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
52392  * holder's anchor output in a commitment transaction, if one is present.
52393  */
52394 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52395
52396 /**
52397  * Holder secret key for blinded revocation pubkey.
52398  */
52399 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52400
52401 /**
52402  * Holder secret key for blinded revocation pubkey.
52403  */
52404 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52405
52406 /**
52407  * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
52408  */
52409 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52410
52411 /**
52412  * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
52413  */
52414 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52415
52416 /**
52417  * Holder secret key used in an HTLC transaction.
52418  */
52419 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52420
52421 /**
52422  * Holder secret key used in an HTLC transaction.
52423  */
52424 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52425
52426 /**
52427  * Holder HTLC secret key used in commitment transaction HTLC outputs.
52428  */
52429 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52430
52431 /**
52432  * Holder HTLC secret key used in commitment transaction HTLC outputs.
52433  */
52434 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
52435
52436 /**
52437  * Commitment seed.
52438  */
52439 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
52440
52441 /**
52442  * Commitment seed.
52443  */
52444 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
52445
52446 /**
52447  * Creates a copy of the InMemorySigner
52448  */
52449 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
52450
52451 /**
52452  * Creates a new [`InMemorySigner`].
52453  */
52454 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);
52455
52456 /**
52457  * Returns the counterparty's pubkeys.
52458  *
52459  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52460  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52461  *
52462  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52463  */
52464 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52465
52466 /**
52467  * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
52468  * transactions, i.e., the amount of time that we have to wait to recover our funds if we
52469  * broadcast a transaction.
52470  *
52471  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52472  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52473  */
52474 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52475
52476 /**
52477  * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
52478  * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
52479  * if they broadcast a transaction.
52480  *
52481  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52482  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52483  */
52484 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52485
52486 /**
52487  * Returns whether the holder is the initiator.
52488  *
52489  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52490  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52491  */
52492 MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52493
52494 /**
52495  * Funding outpoint
52496  *
52497  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52498  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52499  *
52500  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52501  */
52502 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52503
52504 /**
52505  * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
52506  * building transactions.
52507  *
52508  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52509  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52510  *
52511  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52512  */
52513 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52514
52515 /**
52516  * Returns the channel type features of the channel parameters. Should be helpful for
52517  * determining a channel's category, i. e. legacy/anchors/taproot/etc.
52518  *
52519  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
52520  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
52521  *
52522  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52523  */
52524 MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52525
52526 /**
52527  * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
52528  * by `descriptor`, returning the witness stack for the input.
52529  *
52530  * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
52531  * is not spending the outpoint described by [`descriptor.outpoint`],
52532  * or if an output descriptor `script_pubkey` does not match the one we can spend.
52533  *
52534  * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
52535  */
52536 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);
52537
52538 /**
52539  * Sign the single input of `spend_tx` at index `input_idx` which spends the output
52540  * described by `descriptor`, returning the witness stack for the input.
52541  *
52542  * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
52543  * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
52544  * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
52545  * `script_pubkey` does not match the one we can spend.
52546  *
52547  * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
52548  * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
52549  */
52550 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);
52551
52552 /**
52553  * Constructs a new EntropySource which calls the relevant methods on this_arg.
52554  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
52555  */
52556 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52557
52558 /**
52559  * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
52560  * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
52561  */
52562 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52563
52564 /**
52565  * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
52566  * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
52567  */
52568 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52569
52570 /**
52571  * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
52572  * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
52573  */
52574 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
52575
52576 /**
52577  * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
52578  */
52579 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
52580
52581 /**
52582  * Read a InMemorySigner from a byte array, created by InMemorySigner_write
52583  */
52584 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
52585
52586 /**
52587  * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
52588  */
52589 void KeysManager_free(struct LDKKeysManager this_obj);
52590
52591 /**
52592  * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
52593  * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
52594  * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
52595  * without a doubt, be unique to this instance. ie if you start multiple times with the same
52596  * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
52597  * is to simply use the current time (with very high precision).
52598  *
52599  * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
52600  * obviously, `starting_time` should be unique every time you reload the library - it is only
52601  * used to generate new ephemeral key data (which will be stored by the individual channel if
52602  * necessary).
52603  *
52604  * Note that the seed is required to recover certain on-chain funds independent of
52605  * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
52606  * for any channel, and some on-chain during-closing funds.
52607  *
52608  * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
52609  */
52610 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
52611
52612 /**
52613  * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
52614  */
52615 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
52616
52617 /**
52618  * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
52619  */
52620 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]);
52621
52622 /**
52623  * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
52624  * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
52625  * are no other inputs that need signing.
52626  *
52627  * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
52628  *
52629  * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
52630  * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
52631  */
52632 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);
52633
52634 /**
52635  * Constructs a new EntropySource which calls the relevant methods on this_arg.
52636  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
52637  */
52638 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
52639
52640 /**
52641  * Constructs a new NodeSigner which calls the relevant methods on this_arg.
52642  * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
52643  */
52644 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
52645
52646 /**
52647  * Constructs a new OutputSpender which calls the relevant methods on this_arg.
52648  * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
52649  */
52650 struct LDKOutputSpender KeysManager_as_OutputSpender(const struct LDKKeysManager *NONNULL_PTR this_arg);
52651
52652 /**
52653  * Constructs a new SignerProvider which calls the relevant methods on this_arg.
52654  * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
52655  */
52656 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
52657
52658 /**
52659  * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
52660  */
52661 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
52662
52663 /**
52664  * Constructs a new EntropySource which calls the relevant methods on this_arg.
52665  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
52666  */
52667 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
52668
52669 /**
52670  * Constructs a new NodeSigner which calls the relevant methods on this_arg.
52671  * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
52672  */
52673 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
52674
52675 /**
52676  * Constructs a new OutputSpender which calls the relevant methods on this_arg.
52677  * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is
52678  */
52679 struct LDKOutputSpender PhantomKeysManager_as_OutputSpender(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
52680
52681 /**
52682  * Constructs a new SignerProvider which calls the relevant methods on this_arg.
52683  * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
52684  */
52685 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
52686
52687 /**
52688  * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
52689  * that is shared across all nodes that intend to participate in [phantom node payments]
52690  * together.
52691  *
52692  * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
52693  * `starting_time_nanos`.
52694  *
52695  * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
52696  * same across restarts, or else inbound payments may fail.
52697  *
52698  * [phantom node payments]: PhantomKeysManager
52699  */
52700 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]);
52701
52702 /**
52703  * See [`KeysManager::derive_channel_keys`] for documentation on this method.
52704  */
52705 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]);
52706
52707 /**
52708  * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
52709  */
52710 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
52711
52712 /**
52713  * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
52714  * last-hop onion data, etc.
52715  */
52716 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
52717
52718 /**
52719  * Frees any resources used by the RandomBytes, if is_owned is set and inner is non-NULL.
52720  */
52721 void RandomBytes_free(struct LDKRandomBytes this_obj);
52722
52723 /**
52724  * Creates a new instance using the given seed.
52725  */
52726 MUST_USE_RES struct LDKRandomBytes RandomBytes_new(struct LDKThirtyTwoBytes seed);
52727
52728 /**
52729  * Constructs a new EntropySource which calls the relevant methods on this_arg.
52730  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
52731  */
52732 struct LDKEntropySource RandomBytes_as_EntropySource(const struct LDKRandomBytes *NONNULL_PTR this_arg);
52733
52734 /**
52735  * Calls the free function if one is set
52736  */
52737 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
52738
52739 /**
52740  * Creates a copy of a WriteableEcdsaChannelSigner
52741  */
52742 struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig);
52743
52744 /**
52745  * Calls the free function if one is set
52746  */
52747 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
52748
52749 /**
52750  * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
52751  */
52752 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
52753
52754 /**
52755  * Calls the free function if one is set
52756  */
52757 void MessageRouter_free(struct LDKMessageRouter this_ptr);
52758
52759 /**
52760  * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
52761  */
52762 void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
52763
52764 /**
52765  * Creates a [`DefaultMessageRouter`] using the given [`NetworkGraph`].
52766  */
52767 MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKEntropySource entropy_source);
52768
52769 /**
52770  * Constructs a new MessageRouter which calls the relevant methods on this_arg.
52771  * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
52772  */
52773 struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
52774
52775 /**
52776  * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
52777  */
52778 void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
52779
52780 /**
52781  * Nodes on the path between the sender and the destination.
52782  *
52783  * Returns a copy of the field.
52784  */
52785 struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
52786
52787 /**
52788  * Nodes on the path between the sender and the destination.
52789  */
52790 void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
52791
52792 /**
52793  * The recipient of the message.
52794  */
52795 struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
52796
52797 /**
52798  * The recipient of the message.
52799  */
52800 void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
52801
52802 /**
52803  * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
52804  *
52805  * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
52806  * this to initiate such a connection.
52807  *
52808  * Returns a copy of the field.
52809  */
52810 struct LDKCOption_CVec_SocketAddressZZ OnionMessagePath_get_first_node_addresses(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
52811
52812 /**
52813  * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
52814  *
52815  * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
52816  * this to initiate such a connection.
52817  */
52818 void OnionMessagePath_set_first_node_addresses(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCOption_CVec_SocketAddressZZ val);
52819
52820 /**
52821  * Constructs a new OnionMessagePath given each field
52822  */
52823 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);
52824
52825 /**
52826  * Creates a copy of the OnionMessagePath
52827  */
52828 struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
52829
52830 /**
52831  * Returns the first node in the path.
52832  *
52833  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
52834  */
52835 MUST_USE_RES struct LDKPublicKey OnionMessagePath_first_node(const struct LDKOnionMessagePath *NONNULL_PTR this_arg);
52836
52837 /**
52838  * Frees any resources used by the Destination
52839  */
52840 void Destination_free(struct LDKDestination this_ptr);
52841
52842 /**
52843  * Creates a copy of the Destination
52844  */
52845 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
52846
52847 /**
52848  * Utility method to constructs a new Node-variant Destination
52849  */
52850 struct LDKDestination Destination_node(struct LDKPublicKey a);
52851
52852 /**
52853  * Utility method to constructs a new BlindedPath-variant Destination
52854  */
52855 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
52856
52857 /**
52858  * Generates a non-cryptographic 64-bit hash of the Destination.
52859  */
52860 uint64_t Destination_hash(const struct LDKDestination *NONNULL_PTR o);
52861
52862 /**
52863  * Checks if two Destinations contain equal inner contents.
52864  * This ignores pointers and is_owned flags and looks at the values in fields.
52865  */
52866 bool Destination_eq(const struct LDKDestination *NONNULL_PTR a, const struct LDKDestination *NONNULL_PTR b);
52867
52868 /**
52869  * Attempts to resolve the [`IntroductionNode::DirectedShortChannelId`] of a
52870  * [`Destination::BlindedPath`] to a [`IntroductionNode::NodeId`], if applicable, using the
52871  * provided [`ReadOnlyNetworkGraph`].
52872  */
52873 void Destination_resolve(struct LDKDestination *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
52874
52875 /**
52876  * Frees any resources used by the SendSuccess
52877  */
52878 void SendSuccess_free(struct LDKSendSuccess this_ptr);
52879
52880 /**
52881  * Creates a copy of the SendSuccess
52882  */
52883 struct LDKSendSuccess SendSuccess_clone(const struct LDKSendSuccess *NONNULL_PTR orig);
52884
52885 /**
52886  * Utility method to constructs a new Buffered-variant SendSuccess
52887  */
52888 struct LDKSendSuccess SendSuccess_buffered(void);
52889
52890 /**
52891  * Utility method to constructs a new BufferedAwaitingConnection-variant SendSuccess
52892  */
52893 struct LDKSendSuccess SendSuccess_buffered_awaiting_connection(struct LDKPublicKey a);
52894
52895 /**
52896  * Generates a non-cryptographic 64-bit hash of the SendSuccess.
52897  */
52898 uint64_t SendSuccess_hash(const struct LDKSendSuccess *NONNULL_PTR o);
52899
52900 /**
52901  * Checks if two SendSuccesss contain equal inner contents.
52902  * This ignores pointers and is_owned flags and looks at the values in fields.
52903  */
52904 bool SendSuccess_eq(const struct LDKSendSuccess *NONNULL_PTR a, const struct LDKSendSuccess *NONNULL_PTR b);
52905
52906 /**
52907  * Frees any resources used by the SendError
52908  */
52909 void SendError_free(struct LDKSendError this_ptr);
52910
52911 /**
52912  * Creates a copy of the SendError
52913  */
52914 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
52915
52916 /**
52917  * Utility method to constructs a new Secp256k1-variant SendError
52918  */
52919 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
52920
52921 /**
52922  * Utility method to constructs a new TooBigPacket-variant SendError
52923  */
52924 struct LDKSendError SendError_too_big_packet(void);
52925
52926 /**
52927  * Utility method to constructs a new TooFewBlindedHops-variant SendError
52928  */
52929 struct LDKSendError SendError_too_few_blinded_hops(void);
52930
52931 /**
52932  * Utility method to constructs a new InvalidFirstHop-variant SendError
52933  */
52934 struct LDKSendError SendError_invalid_first_hop(struct LDKPublicKey a);
52935
52936 /**
52937  * Utility method to constructs a new PathNotFound-variant SendError
52938  */
52939 struct LDKSendError SendError_path_not_found(void);
52940
52941 /**
52942  * Utility method to constructs a new InvalidMessage-variant SendError
52943  */
52944 struct LDKSendError SendError_invalid_message(void);
52945
52946 /**
52947  * Utility method to constructs a new BufferFull-variant SendError
52948  */
52949 struct LDKSendError SendError_buffer_full(void);
52950
52951 /**
52952  * Utility method to constructs a new GetNodeIdFailed-variant SendError
52953  */
52954 struct LDKSendError SendError_get_node_id_failed(void);
52955
52956 /**
52957  * Utility method to constructs a new UnresolvedIntroductionNode-variant SendError
52958  */
52959 struct LDKSendError SendError_unresolved_introduction_node(void);
52960
52961 /**
52962  * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
52963  */
52964 struct LDKSendError SendError_blinded_path_advance_failed(void);
52965
52966 /**
52967  * Generates a non-cryptographic 64-bit hash of the SendError.
52968  */
52969 uint64_t SendError_hash(const struct LDKSendError *NONNULL_PTR o);
52970
52971 /**
52972  * Checks if two SendErrors contain equal inner contents.
52973  * This ignores pointers and is_owned flags and looks at the values in fields.
52974  */
52975 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
52976
52977 /**
52978  * Calls the free function if one is set
52979  */
52980 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
52981
52982 /**
52983  * Frees any resources used by the PeeledOnion
52984  */
52985 void PeeledOnion_free(struct LDKPeeledOnion this_ptr);
52986
52987 /**
52988  * Creates a copy of the PeeledOnion
52989  */
52990 struct LDKPeeledOnion PeeledOnion_clone(const struct LDKPeeledOnion *NONNULL_PTR orig);
52991
52992 /**
52993  * Utility method to constructs a new Forward-variant PeeledOnion
52994  */
52995 struct LDKPeeledOnion PeeledOnion_forward(struct LDKNextMessageHop a, struct LDKOnionMessage b);
52996
52997 /**
52998  * Utility method to constructs a new Receive-variant PeeledOnion
52999  */
53000 struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKThirtyTwoBytes b, struct LDKBlindedPath c);
53001
53002 /**
53003  * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
53004  * `path`, first calling [`Destination::resolve`] on `path.destination` with the given
53005  * [`ReadOnlyNetworkGraph`].
53006  *
53007  * Returns the node id of the peer to send the message to, the message itself, and any addresses
53008  * needed to connect to the first node.
53009  *
53010  * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
53011  */
53012 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message_resolving_destination(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path);
53013
53014 /**
53015  * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
53016  * `path`.
53017  *
53018  * Returns the node id of the peer to send the message to, the message itself, and any addresses
53019  * needed to connect to the first node.
53020  *
53021  * Returns [`SendError::UnresolvedIntroductionNode`] if:
53022  * - `destination` contains a blinded path with an [`IntroductionNode::DirectedShortChannelId`],
53023  * - unless it can be resolved by [`NodeIdLookUp::next_node_id`].
53024  * Use [`create_onion_message_resolving_destination`] instead to resolve the introduction node
53025  * first with a [`ReadOnlyNetworkGraph`].
53026  *
53027  * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
53028  */
53029 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path);
53030
53031 /**
53032  * Decode one layer of an incoming [`OnionMessage`].
53033  *
53034  * Returns either the next layer of the onion for forwarding or the decrypted content for the
53035  * receiver.
53036  */
53037 struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
53038
53039 /**
53040  * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
53041  * their respective handlers.
53042  */
53043 MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKNodeIdLookUp node_id_lookup, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKCustomOnionMessageHandler custom_handler);
53044
53045 /**
53046  * Sends an [`OnionMessage`] with the given `contents` to `destination`.
53047  *
53048  * See [`OnionMessenger`] for example usage.
53049  *
53050  * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
53051  */
53052 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);
53053
53054 /**
53055  * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
53056  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
53057  */
53058 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
53059
53060 /**
53061  * Calls the free function if one is set
53062  */
53063 void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
53064
53065 /**
53066  * Frees any resources used by the OffersMessage
53067  */
53068 void OffersMessage_free(struct LDKOffersMessage this_ptr);
53069
53070 /**
53071  * Creates a copy of the OffersMessage
53072  */
53073 struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
53074
53075 /**
53076  * Utility method to constructs a new InvoiceRequest-variant OffersMessage
53077  */
53078 struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
53079
53080 /**
53081  * Utility method to constructs a new Invoice-variant OffersMessage
53082  */
53083 struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
53084
53085 /**
53086  * Utility method to constructs a new InvoiceError-variant OffersMessage
53087  */
53088 struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
53089
53090 /**
53091  * Returns whether `tlv_type` corresponds to a TLV record for Offers.
53092  */
53093 MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
53094
53095 /**
53096  * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
53097  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
53098  */
53099 struct LDKOnionMessageContents OffersMessage_as_OnionMessageContents(const struct LDKOffersMessage *NONNULL_PTR this_arg);
53100
53101 /**
53102  * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
53103  */
53104 struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
53105
53106 /**
53107  * Read a OffersMessage from a byte array, created by OffersMessage_write
53108  */
53109 struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
53110
53111 /**
53112  * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
53113  */
53114 void Packet_free(struct LDKPacket this_obj);
53115
53116 /**
53117  * Bolt 04 version number
53118  */
53119 uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
53120
53121 /**
53122  * Bolt 04 version number
53123  */
53124 void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
53125
53126 /**
53127  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
53128  */
53129 struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
53130
53131 /**
53132  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
53133  */
53134 void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53135
53136 /**
53137  * Encrypted payload for the next hop
53138  *
53139  * Returns a copy of the field.
53140  */
53141 struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
53142
53143 /**
53144  * Encrypted payload for the next hop
53145  */
53146 void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
53147
53148 /**
53149  * HMAC to verify the integrity of hop_data
53150  */
53151 const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
53152
53153 /**
53154  * HMAC to verify the integrity of hop_data
53155  */
53156 void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53157
53158 /**
53159  * Constructs a new Packet given each field
53160  */
53161 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);
53162
53163 /**
53164  * Creates a copy of the Packet
53165  */
53166 struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
53167
53168 /**
53169  * Generates a non-cryptographic 64-bit hash of the Packet.
53170  */
53171 uint64_t Packet_hash(const struct LDKPacket *NONNULL_PTR o);
53172
53173 /**
53174  * Checks if two Packets contain equal inner contents.
53175  * This ignores pointers and is_owned flags and looks at the values in fields.
53176  * Two objects with NULL inner values will be considered "equal" here.
53177  */
53178 bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
53179
53180 /**
53181  * Serialize the Packet object into a byte array which can be read by Packet_read
53182  */
53183 struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR obj);
53184
53185 /**
53186  * Frees any resources used by the ParsedOnionMessageContents
53187  */
53188 void ParsedOnionMessageContents_free(struct LDKParsedOnionMessageContents this_ptr);
53189
53190 /**
53191  * Creates a copy of the ParsedOnionMessageContents
53192  */
53193 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_clone(const struct LDKParsedOnionMessageContents *NONNULL_PTR orig);
53194
53195 /**
53196  * Utility method to constructs a new Offers-variant ParsedOnionMessageContents
53197  */
53198 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_offers(struct LDKOffersMessage a);
53199
53200 /**
53201  * Utility method to constructs a new Custom-variant ParsedOnionMessageContents
53202  */
53203 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_custom(struct LDKOnionMessageContents a);
53204
53205 /**
53206  * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
53207  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
53208  */
53209 struct LDKOnionMessageContents ParsedOnionMessageContents_as_OnionMessageContents(const struct LDKParsedOnionMessageContents *NONNULL_PTR this_arg);
53210
53211 /**
53212  * Serialize the ParsedOnionMessageContents object into a byte array which can be read by ParsedOnionMessageContents_read
53213  */
53214 struct LDKCVec_u8Z ParsedOnionMessageContents_write(const struct LDKParsedOnionMessageContents *NONNULL_PTR obj);
53215
53216 /**
53217  * Creates a copy of a OnionMessageContents
53218  */
53219 struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
53220
53221 /**
53222  * Calls the free function if one is set
53223  */
53224 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
53225
53226 /**
53227  * Frees any resources used by the NextMessageHop
53228  */
53229 void NextMessageHop_free(struct LDKNextMessageHop this_ptr);
53230
53231 /**
53232  * Creates a copy of the NextMessageHop
53233  */
53234 struct LDKNextMessageHop NextMessageHop_clone(const struct LDKNextMessageHop *NONNULL_PTR orig);
53235
53236 /**
53237  * Utility method to constructs a new NodeId-variant NextMessageHop
53238  */
53239 struct LDKNextMessageHop NextMessageHop_node_id(struct LDKPublicKey a);
53240
53241 /**
53242  * Utility method to constructs a new ShortChannelId-variant NextMessageHop
53243  */
53244 struct LDKNextMessageHop NextMessageHop_short_channel_id(uint64_t a);
53245
53246 /**
53247  * Generates a non-cryptographic 64-bit hash of the NextMessageHop.
53248  */
53249 uint64_t NextMessageHop_hash(const struct LDKNextMessageHop *NONNULL_PTR o);
53250
53251 /**
53252  * Checks if two NextMessageHops contain equal inner contents.
53253  * This ignores pointers and is_owned flags and looks at the values in fields.
53254  */
53255 bool NextMessageHop_eq(const struct LDKNextMessageHop *NONNULL_PTR a, const struct LDKNextMessageHop *NONNULL_PTR b);
53256
53257 /**
53258  * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
53259  */
53260 void BlindedPath_free(struct LDKBlindedPath this_obj);
53261
53262 /**
53263  * To send to a blinded path, the sender first finds a route to the unblinded
53264  * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
53265  * message or payment's next hop and forward it along.
53266  *
53267  * [`encrypted_payload`]: BlindedHop::encrypted_payload
53268  */
53269 struct LDKIntroductionNode BlindedPath_get_introduction_node(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
53270
53271 /**
53272  * To send to a blinded path, the sender first finds a route to the unblinded
53273  * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
53274  * message or payment's next hop and forward it along.
53275  *
53276  * [`encrypted_payload`]: BlindedHop::encrypted_payload
53277  */
53278 void BlindedPath_set_introduction_node(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKIntroductionNode val);
53279
53280 /**
53281  * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
53282  * message or payment.
53283  *
53284  * [`encrypted_payload`]: BlindedHop::encrypted_payload
53285  */
53286 struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
53287
53288 /**
53289  * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
53290  * message or payment.
53291  *
53292  * [`encrypted_payload`]: BlindedHop::encrypted_payload
53293  */
53294 void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53295
53296 /**
53297  * The hops composing the blinded path.
53298  */
53299 struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
53300
53301 /**
53302  * The hops composing the blinded path.
53303  */
53304 void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
53305
53306 /**
53307  * Constructs a new BlindedPath given each field
53308  */
53309 MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKIntroductionNode introduction_node_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg);
53310
53311 /**
53312  * Creates a copy of the BlindedPath
53313  */
53314 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
53315
53316 /**
53317  * Generates a non-cryptographic 64-bit hash of the BlindedPath.
53318  */
53319 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
53320
53321 /**
53322  * Checks if two BlindedPaths contain equal inner contents.
53323  * This ignores pointers and is_owned flags and looks at the values in fields.
53324  * Two objects with NULL inner values will be considered "equal" here.
53325  */
53326 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
53327
53328 /**
53329  * Frees any resources used by the IntroductionNode
53330  */
53331 void IntroductionNode_free(struct LDKIntroductionNode this_ptr);
53332
53333 /**
53334  * Creates a copy of the IntroductionNode
53335  */
53336 struct LDKIntroductionNode IntroductionNode_clone(const struct LDKIntroductionNode *NONNULL_PTR orig);
53337
53338 /**
53339  * Utility method to constructs a new NodeId-variant IntroductionNode
53340  */
53341 struct LDKIntroductionNode IntroductionNode_node_id(struct LDKPublicKey a);
53342
53343 /**
53344  * Utility method to constructs a new DirectedShortChannelId-variant IntroductionNode
53345  */
53346 struct LDKIntroductionNode IntroductionNode_directed_short_channel_id(enum LDKDirection a, uint64_t b);
53347
53348 /**
53349  * Generates a non-cryptographic 64-bit hash of the IntroductionNode.
53350  */
53351 uint64_t IntroductionNode_hash(const struct LDKIntroductionNode *NONNULL_PTR o);
53352
53353 /**
53354  * Checks if two IntroductionNodes contain equal inner contents.
53355  * This ignores pointers and is_owned flags and looks at the values in fields.
53356  */
53357 bool IntroductionNode_eq(const struct LDKIntroductionNode *NONNULL_PTR a, const struct LDKIntroductionNode *NONNULL_PTR b);
53358
53359 /**
53360  * Creates a copy of the Direction
53361  */
53362 enum LDKDirection Direction_clone(const enum LDKDirection *NONNULL_PTR orig);
53363
53364 /**
53365  * Utility method to constructs a new NodeOne-variant Direction
53366  */
53367 enum LDKDirection Direction_node_one(void);
53368
53369 /**
53370  * Utility method to constructs a new NodeTwo-variant Direction
53371  */
53372 enum LDKDirection Direction_node_two(void);
53373
53374 /**
53375  * Generates a non-cryptographic 64-bit hash of the Direction.
53376  */
53377 uint64_t Direction_hash(const enum LDKDirection *NONNULL_PTR o);
53378
53379 /**
53380  * Checks if two Directions contain equal inner contents.
53381  * This ignores pointers and is_owned flags and looks at the values in fields.
53382  */
53383 bool Direction_eq(const enum LDKDirection *NONNULL_PTR a, const enum LDKDirection *NONNULL_PTR b);
53384
53385 /**
53386  * Calls the free function if one is set
53387  */
53388 void NodeIdLookUp_free(struct LDKNodeIdLookUp this_ptr);
53389
53390 /**
53391  * Frees any resources used by the EmptyNodeIdLookUp, if is_owned is set and inner is non-NULL.
53392  */
53393 void EmptyNodeIdLookUp_free(struct LDKEmptyNodeIdLookUp this_obj);
53394
53395 /**
53396  * Constructs a new EmptyNodeIdLookUp given each field
53397  */
53398 MUST_USE_RES struct LDKEmptyNodeIdLookUp EmptyNodeIdLookUp_new(void);
53399
53400 /**
53401  * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
53402  * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
53403  */
53404 struct LDKNodeIdLookUp EmptyNodeIdLookUp_as_NodeIdLookUp(const struct LDKEmptyNodeIdLookUp *NONNULL_PTR this_arg);
53405
53406 /**
53407  * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
53408  */
53409 void BlindedHop_free(struct LDKBlindedHop this_obj);
53410
53411 /**
53412  * The blinded node id of this hop in a [`BlindedPath`].
53413  */
53414 struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
53415
53416 /**
53417  * The blinded node id of this hop in a [`BlindedPath`].
53418  */
53419 void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53420
53421 /**
53422  * The encrypted payload intended for this hop in a [`BlindedPath`].
53423  *
53424  * Returns a copy of the field.
53425  */
53426 struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
53427
53428 /**
53429  * The encrypted payload intended for this hop in a [`BlindedPath`].
53430  */
53431 void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
53432
53433 /**
53434  * Constructs a new BlindedHop given each field
53435  */
53436 MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
53437
53438 /**
53439  * Creates a copy of the BlindedHop
53440  */
53441 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
53442
53443 /**
53444  * Generates a non-cryptographic 64-bit hash of the BlindedHop.
53445  */
53446 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
53447
53448 /**
53449  * Checks if two BlindedHops contain equal inner contents.
53450  * This ignores pointers and is_owned flags and looks at the values in fields.
53451  * Two objects with NULL inner values will be considered "equal" here.
53452  */
53453 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
53454
53455 /**
53456  * Create a one-hop blinded path for a message.
53457  */
53458 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, const struct LDKEntropySource *NONNULL_PTR entropy_source);
53459
53460 /**
53461  * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
53462  * pubkey in `node_pks` will be the destination node.
53463  *
53464  * Errors if no hops are provided or if `node_pk`(s) are invalid.
53465  */
53466 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source);
53467
53468 /**
53469  * Create a one-hop blinded path for a payment.
53470  */
53471 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint16_t min_final_cltv_expiry_delta, const struct LDKEntropySource *NONNULL_PTR entropy_source);
53472
53473 /**
53474  * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`.
53475  *
53476  * Errors if:
53477  * * a provided node id is invalid
53478  * * [`BlindedPayInfo`] calculation results in an integer overflow
53479  * * any unknown features are required in the provided [`ForwardTlvs`]
53480  *
53481  * [`ForwardTlvs`]: crate::blinded_path::payment::ForwardTlvs
53482  */
53483 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, uint16_t min_final_cltv_expiry_delta, const struct LDKEntropySource *NONNULL_PTR entropy_source);
53484
53485 /**
53486  * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e.,
53487  * it is found in the network graph).
53488  *
53489  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
53490  */
53491 MUST_USE_RES struct LDKNodeId BlindedPath_public_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph);
53492
53493 /**
53494  * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
53495  */
53496 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
53497
53498 /**
53499  * Read a BlindedPath from a byte array, created by BlindedPath_write
53500  */
53501 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
53502
53503 /**
53504  * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
53505  */
53506 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
53507
53508 /**
53509  * Read a BlindedHop from a byte array, created by BlindedHop_write
53510  */
53511 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
53512
53513 /**
53514  * Frees any resources used by the ForwardNode, if is_owned is set and inner is non-NULL.
53515  */
53516 void ForwardNode_free(struct LDKForwardNode this_obj);
53517
53518 /**
53519  * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
53520  * used for [`BlindedPayInfo`] construction.
53521  */
53522 struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr);
53523
53524 /**
53525  * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
53526  * used for [`BlindedPayInfo`] construction.
53527  */
53528 void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
53529
53530 /**
53531  * This node's pubkey.
53532  */
53533 struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr);
53534
53535 /**
53536  * This node's pubkey.
53537  */
53538 void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
53539
53540 /**
53541  * The maximum value, in msat, that may be accepted by this node.
53542  */
53543 uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr);
53544
53545 /**
53546  * The maximum value, in msat, that may be accepted by this node.
53547  */
53548 void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val);
53549
53550 /**
53551  * Constructs a new ForwardNode given each field
53552  */
53553 MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
53554
53555 /**
53556  * Creates a copy of the ForwardNode
53557  */
53558 struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig);
53559
53560 /**
53561  * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
53562  */
53563 void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
53564
53565 /**
53566  * The short channel id this payment should be forwarded out over.
53567  */
53568 uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
53569
53570 /**
53571  * The short channel id this payment should be forwarded out over.
53572  */
53573 void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
53574
53575 /**
53576  * Payment parameters for relaying over [`Self::short_channel_id`].
53577  */
53578 struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
53579
53580 /**
53581  * Payment parameters for relaying over [`Self::short_channel_id`].
53582  */
53583 void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
53584
53585 /**
53586  * Payment constraints for relaying over [`Self::short_channel_id`].
53587  */
53588 struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
53589
53590 /**
53591  * Payment constraints for relaying over [`Self::short_channel_id`].
53592  */
53593 void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
53594
53595 /**
53596  * Supported and required features when relaying a payment onion containing this object's
53597  * corresponding [`BlindedHop::encrypted_payload`].
53598  *
53599  * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
53600  */
53601 struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
53602
53603 /**
53604  * Supported and required features when relaying a payment onion containing this object's
53605  * corresponding [`BlindedHop::encrypted_payload`].
53606  *
53607  * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
53608  */
53609 void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
53610
53611 /**
53612  * Constructs a new ForwardTlvs given each field
53613  */
53614 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);
53615
53616 /**
53617  * Creates a copy of the ForwardTlvs
53618  */
53619 struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
53620
53621 /**
53622  * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
53623  */
53624 void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
53625
53626 /**
53627  * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
53628  */
53629 const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
53630
53631 /**
53632  * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
53633  */
53634 void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
53635
53636 /**
53637  * Constraints for the receiver of this payment.
53638  */
53639 struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
53640
53641 /**
53642  * Constraints for the receiver of this payment.
53643  */
53644 void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
53645
53646 /**
53647  * Context for the receiver of this payment.
53648  */
53649 struct LDKPaymentContext ReceiveTlvs_get_payment_context(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
53650
53651 /**
53652  * Context for the receiver of this payment.
53653  */
53654 void ReceiveTlvs_set_payment_context(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentContext val);
53655
53656 /**
53657  * Constructs a new ReceiveTlvs given each field
53658  */
53659 MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKPaymentContext payment_context_arg);
53660
53661 /**
53662  * Creates a copy of the ReceiveTlvs
53663  */
53664 struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
53665
53666 /**
53667  * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
53668  */
53669 void PaymentRelay_free(struct LDKPaymentRelay this_obj);
53670
53671 /**
53672  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
53673  */
53674 uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
53675
53676 /**
53677  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
53678  */
53679 void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
53680
53681 /**
53682  * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
53683  * this [`BlindedHop`], (i.e., 10,000 is 1%).
53684  */
53685 uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
53686
53687 /**
53688  * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
53689  * this [`BlindedHop`], (i.e., 10,000 is 1%).
53690  */
53691 void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
53692
53693 /**
53694  * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
53695  */
53696 uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
53697
53698 /**
53699  * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
53700  */
53701 void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
53702
53703 /**
53704  * Constructs a new PaymentRelay given each field
53705  */
53706 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);
53707
53708 /**
53709  * Creates a copy of the PaymentRelay
53710  */
53711 struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
53712
53713 /**
53714  * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
53715  */
53716 void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
53717
53718 /**
53719  * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
53720  */
53721 uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
53722
53723 /**
53724  * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
53725  */
53726 void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
53727
53728 /**
53729  * The minimum value, in msat, that may be accepted by the node corresponding to this
53730  * [`BlindedHop`].
53731  */
53732 uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
53733
53734 /**
53735  * The minimum value, in msat, that may be accepted by the node corresponding to this
53736  * [`BlindedHop`].
53737  */
53738 void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
53739
53740 /**
53741  * Constructs a new PaymentConstraints given each field
53742  */
53743 MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
53744
53745 /**
53746  * Creates a copy of the PaymentConstraints
53747  */
53748 struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
53749
53750 /**
53751  * Frees any resources used by the PaymentContext
53752  */
53753 void PaymentContext_free(struct LDKPaymentContext this_ptr);
53754
53755 /**
53756  * Creates a copy of the PaymentContext
53757  */
53758 struct LDKPaymentContext PaymentContext_clone(const struct LDKPaymentContext *NONNULL_PTR orig);
53759
53760 /**
53761  * Utility method to constructs a new Unknown-variant PaymentContext
53762  */
53763 struct LDKPaymentContext PaymentContext_unknown(struct LDKUnknownPaymentContext a);
53764
53765 /**
53766  * Utility method to constructs a new Bolt12Offer-variant PaymentContext
53767  */
53768 struct LDKPaymentContext PaymentContext_bolt12_offer(struct LDKBolt12OfferContext a);
53769
53770 /**
53771  * Utility method to constructs a new Bolt12Refund-variant PaymentContext
53772  */
53773 struct LDKPaymentContext PaymentContext_bolt12_refund(struct LDKBolt12RefundContext a);
53774
53775 /**
53776  * Checks if two PaymentContexts contain equal inner contents.
53777  * This ignores pointers and is_owned flags and looks at the values in fields.
53778  */
53779 bool PaymentContext_eq(const struct LDKPaymentContext *NONNULL_PTR a, const struct LDKPaymentContext *NONNULL_PTR b);
53780
53781 /**
53782  * Frees any resources used by the UnknownPaymentContext, if is_owned is set and inner is non-NULL.
53783  */
53784 void UnknownPaymentContext_free(struct LDKUnknownPaymentContext this_obj);
53785
53786 /**
53787  * Creates a copy of the UnknownPaymentContext
53788  */
53789 struct LDKUnknownPaymentContext UnknownPaymentContext_clone(const struct LDKUnknownPaymentContext *NONNULL_PTR orig);
53790
53791 /**
53792  * Checks if two UnknownPaymentContexts contain equal inner contents.
53793  * This ignores pointers and is_owned flags and looks at the values in fields.
53794  * Two objects with NULL inner values will be considered "equal" here.
53795  */
53796 bool UnknownPaymentContext_eq(const struct LDKUnknownPaymentContext *NONNULL_PTR a, const struct LDKUnknownPaymentContext *NONNULL_PTR b);
53797
53798 /**
53799  * Frees any resources used by the Bolt12OfferContext, if is_owned is set and inner is non-NULL.
53800  */
53801 void Bolt12OfferContext_free(struct LDKBolt12OfferContext this_obj);
53802
53803 /**
53804  * The identifier of the [`Offer`].
53805  *
53806  * [`Offer`]: crate::offers::offer::Offer
53807  */
53808 struct LDKOfferId Bolt12OfferContext_get_offer_id(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
53809
53810 /**
53811  * The identifier of the [`Offer`].
53812  *
53813  * [`Offer`]: crate::offers::offer::Offer
53814  */
53815 void Bolt12OfferContext_set_offer_id(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKOfferId val);
53816
53817 /**
53818  * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
53819  *
53820  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
53821  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
53822  */
53823 struct LDKInvoiceRequestFields Bolt12OfferContext_get_invoice_request(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr);
53824
53825 /**
53826  * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`].
53827  *
53828  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
53829  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
53830  */
53831 void Bolt12OfferContext_set_invoice_request(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKInvoiceRequestFields val);
53832
53833 /**
53834  * Constructs a new Bolt12OfferContext given each field
53835  */
53836 MUST_USE_RES struct LDKBolt12OfferContext Bolt12OfferContext_new(struct LDKOfferId offer_id_arg, struct LDKInvoiceRequestFields invoice_request_arg);
53837
53838 /**
53839  * Creates a copy of the Bolt12OfferContext
53840  */
53841 struct LDKBolt12OfferContext Bolt12OfferContext_clone(const struct LDKBolt12OfferContext *NONNULL_PTR orig);
53842
53843 /**
53844  * Checks if two Bolt12OfferContexts contain equal inner contents.
53845  * This ignores pointers and is_owned flags and looks at the values in fields.
53846  * Two objects with NULL inner values will be considered "equal" here.
53847  */
53848 bool Bolt12OfferContext_eq(const struct LDKBolt12OfferContext *NONNULL_PTR a, const struct LDKBolt12OfferContext *NONNULL_PTR b);
53849
53850 /**
53851  * Frees any resources used by the Bolt12RefundContext, if is_owned is set and inner is non-NULL.
53852  */
53853 void Bolt12RefundContext_free(struct LDKBolt12RefundContext this_obj);
53854
53855 /**
53856  * Constructs a new Bolt12RefundContext given each field
53857  */
53858 MUST_USE_RES struct LDKBolt12RefundContext Bolt12RefundContext_new(void);
53859
53860 /**
53861  * Creates a copy of the Bolt12RefundContext
53862  */
53863 struct LDKBolt12RefundContext Bolt12RefundContext_clone(const struct LDKBolt12RefundContext *NONNULL_PTR orig);
53864
53865 /**
53866  * Checks if two Bolt12RefundContexts contain equal inner contents.
53867  * This ignores pointers and is_owned flags and looks at the values in fields.
53868  * Two objects with NULL inner values will be considered "equal" here.
53869  */
53870 bool Bolt12RefundContext_eq(const struct LDKBolt12RefundContext *NONNULL_PTR a, const struct LDKBolt12RefundContext *NONNULL_PTR b);
53871
53872 /**
53873  * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
53874  */
53875 struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
53876
53877 /**
53878  * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
53879  */
53880 struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
53881
53882 /**
53883  * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
53884  */
53885 struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
53886
53887 /**
53888  * Read a PaymentRelay from a byte array, created by PaymentRelay_write
53889  */
53890 struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
53891
53892 /**
53893  * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
53894  */
53895 struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
53896
53897 /**
53898  * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
53899  */
53900 struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
53901
53902 /**
53903  * Serialize the PaymentContext object into a byte array which can be read by PaymentContext_read
53904  */
53905 struct LDKCVec_u8Z PaymentContext_write(const struct LDKPaymentContext *NONNULL_PTR obj);
53906
53907 /**
53908  * Read a PaymentContext from a byte array, created by PaymentContext_write
53909  */
53910 struct LDKCResult_PaymentContextDecodeErrorZ PaymentContext_read(struct LDKu8slice ser);
53911
53912 /**
53913  * Serialize the UnknownPaymentContext object into a byte array which can be read by UnknownPaymentContext_read
53914  */
53915 struct LDKCVec_u8Z UnknownPaymentContext_write(const struct LDKUnknownPaymentContext *NONNULL_PTR obj);
53916
53917 /**
53918  * Read a UnknownPaymentContext from a byte array, created by UnknownPaymentContext_write
53919  */
53920 struct LDKCResult_UnknownPaymentContextDecodeErrorZ UnknownPaymentContext_read(struct LDKu8slice ser);
53921
53922 /**
53923  * Serialize the Bolt12OfferContext object into a byte array which can be read by Bolt12OfferContext_read
53924  */
53925 struct LDKCVec_u8Z Bolt12OfferContext_write(const struct LDKBolt12OfferContext *NONNULL_PTR obj);
53926
53927 /**
53928  * Read a Bolt12OfferContext from a byte array, created by Bolt12OfferContext_write
53929  */
53930 struct LDKCResult_Bolt12OfferContextDecodeErrorZ Bolt12OfferContext_read(struct LDKu8slice ser);
53931
53932 /**
53933  * Serialize the Bolt12RefundContext object into a byte array which can be read by Bolt12RefundContext_read
53934  */
53935 struct LDKCVec_u8Z Bolt12RefundContext_write(const struct LDKBolt12RefundContext *NONNULL_PTR obj);
53936
53937 /**
53938  * Read a Bolt12RefundContext from a byte array, created by Bolt12RefundContext_write
53939  */
53940 struct LDKCResult_Bolt12RefundContextDecodeErrorZ Bolt12RefundContext_read(struct LDKu8slice ser);
53941
53942 /**
53943  * Frees any resources used by the PaymentPurpose
53944  */
53945 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
53946
53947 /**
53948  * Creates a copy of the PaymentPurpose
53949  */
53950 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
53951
53952 /**
53953  * Utility method to constructs a new Bolt11InvoicePayment-variant PaymentPurpose
53954  */
53955 struct LDKPaymentPurpose PaymentPurpose_bolt11_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
53956
53957 /**
53958  * Utility method to constructs a new Bolt12OfferPayment-variant PaymentPurpose
53959  */
53960 struct LDKPaymentPurpose PaymentPurpose_bolt12_offer_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12OfferContext payment_context);
53961
53962 /**
53963  * Utility method to constructs a new Bolt12RefundPayment-variant PaymentPurpose
53964  */
53965 struct LDKPaymentPurpose PaymentPurpose_bolt12_refund_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12RefundContext payment_context);
53966
53967 /**
53968  * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
53969  */
53970 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
53971
53972 /**
53973  * Checks if two PaymentPurposes contain equal inner contents.
53974  * This ignores pointers and is_owned flags and looks at the values in fields.
53975  */
53976 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
53977
53978 /**
53979  * Returns the preimage for this payment, if it is known.
53980  */
53981 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ PaymentPurpose_preimage(const struct LDKPaymentPurpose *NONNULL_PTR this_arg);
53982
53983 /**
53984  * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
53985  */
53986 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
53987
53988 /**
53989  * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
53990  */
53991 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
53992
53993 /**
53994  * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
53995  */
53996 void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
53997
53998 /**
53999  * The `channel_id` of the channel over which the HTLC was received.
54000  */
54001 struct LDKChannelId ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54002
54003 /**
54004  * The `channel_id` of the channel over which the HTLC was received.
54005  */
54006 void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
54007
54008 /**
54009  * The `user_channel_id` of the channel over which the HTLC was received. This is the value
54010  * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
54011  * [`ChannelManager::accept_inbound_channel`] for inbound channels if
54012  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
54013  * `user_channel_id` will be randomized for an inbound channel.
54014  *
54015  * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
54016  * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
54017  * was not actually claimed until after upgrading.)
54018  *
54019  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
54020  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
54021  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
54022  */
54023 struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54024
54025 /**
54026  * The `user_channel_id` of the channel over which the HTLC was received. This is the value
54027  * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
54028  * [`ChannelManager::accept_inbound_channel`] for inbound channels if
54029  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
54030  * `user_channel_id` will be randomized for an inbound channel.
54031  *
54032  * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
54033  * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
54034  * was not actually claimed until after upgrading.)
54035  *
54036  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
54037  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
54038  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
54039  */
54040 void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
54041
54042 /**
54043  * The block height at which this HTLC expires.
54044  */
54045 uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54046
54047 /**
54048  * The block height at which this HTLC expires.
54049  */
54050 void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
54051
54052 /**
54053  * The amount (in msats) of this part of an MPP.
54054  */
54055 uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54056
54057 /**
54058  * The amount (in msats) of this part of an MPP.
54059  */
54060 void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
54061
54062 /**
54063  * The extra fee our counterparty skimmed off the top of this HTLC, if any.
54064  *
54065  * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
54066  * 0.0.119.
54067  */
54068 uint64_t ClaimedHTLC_get_counterparty_skimmed_fee_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
54069
54070 /**
54071  * The extra fee our counterparty skimmed off the top of this HTLC, if any.
54072  *
54073  * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
54074  * 0.0.119.
54075  */
54076 void ClaimedHTLC_set_counterparty_skimmed_fee_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
54077
54078 /**
54079  * Constructs a new ClaimedHTLC given each field
54080  */
54081 MUST_USE_RES struct LDKClaimedHTLC ClaimedHTLC_new(struct LDKChannelId 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);
54082
54083 /**
54084  * Creates a copy of the ClaimedHTLC
54085  */
54086 struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
54087
54088 /**
54089  * Checks if two ClaimedHTLCs contain equal inner contents.
54090  * This ignores pointers and is_owned flags and looks at the values in fields.
54091  * Two objects with NULL inner values will be considered "equal" here.
54092  */
54093 bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
54094
54095 /**
54096  * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
54097  */
54098 struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
54099
54100 /**
54101  * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
54102  */
54103 struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
54104
54105 /**
54106  * Frees any resources used by the PathFailure
54107  */
54108 void PathFailure_free(struct LDKPathFailure this_ptr);
54109
54110 /**
54111  * Creates a copy of the PathFailure
54112  */
54113 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
54114
54115 /**
54116  * Utility method to constructs a new InitialSend-variant PathFailure
54117  */
54118 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
54119
54120 /**
54121  * Utility method to constructs a new OnPath-variant PathFailure
54122  */
54123 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
54124
54125 /**
54126  * Checks if two PathFailures contain equal inner contents.
54127  * This ignores pointers and is_owned flags and looks at the values in fields.
54128  */
54129 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
54130
54131 /**
54132  * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
54133  */
54134 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
54135
54136 /**
54137  * Read a PathFailure from a byte array, created by PathFailure_write
54138  */
54139 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
54140
54141 /**
54142  * Frees any resources used by the ClosureReason
54143  */
54144 void ClosureReason_free(struct LDKClosureReason this_ptr);
54145
54146 /**
54147  * Creates a copy of the ClosureReason
54148  */
54149 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
54150
54151 /**
54152  * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
54153  */
54154 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
54155
54156 /**
54157  * Utility method to constructs a new HolderForceClosed-variant ClosureReason
54158  */
54159 struct LDKClosureReason ClosureReason_holder_force_closed(void);
54160
54161 /**
54162  * Utility method to constructs a new LegacyCooperativeClosure-variant ClosureReason
54163  */
54164 struct LDKClosureReason ClosureReason_legacy_cooperative_closure(void);
54165
54166 /**
54167  * Utility method to constructs a new CounterpartyInitiatedCooperativeClosure-variant ClosureReason
54168  */
54169 struct LDKClosureReason ClosureReason_counterparty_initiated_cooperative_closure(void);
54170
54171 /**
54172  * Utility method to constructs a new LocallyInitiatedCooperativeClosure-variant ClosureReason
54173  */
54174 struct LDKClosureReason ClosureReason_locally_initiated_cooperative_closure(void);
54175
54176 /**
54177  * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
54178  */
54179 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
54180
54181 /**
54182  * Utility method to constructs a new FundingTimedOut-variant ClosureReason
54183  */
54184 struct LDKClosureReason ClosureReason_funding_timed_out(void);
54185
54186 /**
54187  * Utility method to constructs a new ProcessingError-variant ClosureReason
54188  */
54189 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
54190
54191 /**
54192  * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
54193  */
54194 struct LDKClosureReason ClosureReason_disconnected_peer(void);
54195
54196 /**
54197  * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
54198  */
54199 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
54200
54201 /**
54202  * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
54203  */
54204 struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
54205
54206 /**
54207  * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
54208  */
54209 struct LDKClosureReason ClosureReason_funding_batch_closure(void);
54210
54211 /**
54212  * Utility method to constructs a new HTLCsTimedOut-variant ClosureReason
54213  */
54214 struct LDKClosureReason ClosureReason_htlcs_timed_out(void);
54215
54216 /**
54217  * Checks if two ClosureReasons contain equal inner contents.
54218  * This ignores pointers and is_owned flags and looks at the values in fields.
54219  */
54220 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
54221
54222 /**
54223  * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
54224  */
54225 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
54226
54227 /**
54228  * Read a ClosureReason from a byte array, created by ClosureReason_write
54229  */
54230 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
54231
54232 /**
54233  * Frees any resources used by the HTLCDestination
54234  */
54235 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
54236
54237 /**
54238  * Creates a copy of the HTLCDestination
54239  */
54240 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
54241
54242 /**
54243  * Utility method to constructs a new NextHopChannel-variant HTLCDestination
54244  */
54245 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKChannelId channel_id);
54246
54247 /**
54248  * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
54249  */
54250 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
54251
54252 /**
54253  * Utility method to constructs a new InvalidForward-variant HTLCDestination
54254  */
54255 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
54256
54257 /**
54258  * Utility method to constructs a new InvalidOnion-variant HTLCDestination
54259  */
54260 struct LDKHTLCDestination HTLCDestination_invalid_onion(void);
54261
54262 /**
54263  * Utility method to constructs a new FailedPayment-variant HTLCDestination
54264  */
54265 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
54266
54267 /**
54268  * Checks if two HTLCDestinations contain equal inner contents.
54269  * This ignores pointers and is_owned flags and looks at the values in fields.
54270  */
54271 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
54272
54273 /**
54274  * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
54275  */
54276 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
54277
54278 /**
54279  * Read a HTLCDestination from a byte array, created by HTLCDestination_write
54280  */
54281 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
54282
54283 /**
54284  * Creates a copy of the PaymentFailureReason
54285  */
54286 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
54287
54288 /**
54289  * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
54290  */
54291 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
54292
54293 /**
54294  * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
54295  */
54296 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
54297
54298 /**
54299  * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
54300  */
54301 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
54302
54303 /**
54304  * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
54305  */
54306 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
54307
54308 /**
54309  * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
54310  */
54311 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
54312
54313 /**
54314  * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
54315  */
54316 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
54317
54318 /**
54319  * Checks if two PaymentFailureReasons contain equal inner contents.
54320  * This ignores pointers and is_owned flags and looks at the values in fields.
54321  */
54322 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
54323
54324 /**
54325  * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
54326  */
54327 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
54328
54329 /**
54330  * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
54331  */
54332 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
54333
54334 /**
54335  * Frees any resources used by the Event
54336  */
54337 void Event_free(struct LDKEvent this_ptr);
54338
54339 /**
54340  * Creates a copy of the Event
54341  */
54342 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
54343
54344 /**
54345  * Utility method to constructs a new FundingGenerationReady-variant Event
54346  */
54347 struct LDKEvent Event_funding_generation_ready(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id);
54348
54349 /**
54350  * Utility method to constructs a new PaymentClaimable-variant Event
54351  */
54352 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 LDKChannelId via_channel_id, struct LDKCOption_U128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline);
54353
54354 /**
54355  * Utility method to constructs a new PaymentClaimed-variant Event
54356  */
54357 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);
54358
54359 /**
54360  * Utility method to constructs a new ConnectionNeeded-variant Event
54361  */
54362 struct LDKEvent Event_connection_needed(struct LDKPublicKey node_id, struct LDKCVec_SocketAddressZ addresses);
54363
54364 /**
54365  * Utility method to constructs a new InvoiceRequestFailed-variant Event
54366  */
54367 struct LDKEvent Event_invoice_request_failed(struct LDKThirtyTwoBytes payment_id);
54368
54369 /**
54370  * Utility method to constructs a new PaymentSent-variant Event
54371  */
54372 struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
54373
54374 /**
54375  * Utility method to constructs a new PaymentFailed-variant Event
54376  */
54377 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
54378
54379 /**
54380  * Utility method to constructs a new PaymentPathSuccessful-variant Event
54381  */
54382 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
54383
54384 /**
54385  * Utility method to constructs a new PaymentPathFailed-variant Event
54386  */
54387 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);
54388
54389 /**
54390  * Utility method to constructs a new ProbeSuccessful-variant Event
54391  */
54392 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
54393
54394 /**
54395  * Utility method to constructs a new ProbeFailed-variant Event
54396  */
54397 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
54398
54399 /**
54400  * Utility method to constructs a new PendingHTLCsForwardable-variant Event
54401  */
54402 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
54403
54404 /**
54405  * Utility method to constructs a new HTLCIntercepted-variant Event
54406  */
54407 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);
54408
54409 /**
54410  * Utility method to constructs a new SpendableOutputs-variant Event
54411  */
54412 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKChannelId channel_id);
54413
54414 /**
54415  * Utility method to constructs a new PaymentForwarded-variant Event
54416  */
54417 struct LDKEvent Event_payment_forwarded(struct LDKChannelId prev_channel_id, struct LDKChannelId next_channel_id, struct LDKCOption_U128Z prev_user_channel_id, struct LDKCOption_U128Z next_user_channel_id, struct LDKCOption_u64Z total_fee_earned_msat, struct LDKCOption_u64Z skimmed_fee_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat);
54418
54419 /**
54420  * Utility method to constructs a new ChannelPending-variant Event
54421  */
54422 struct LDKEvent Event_channel_pending(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKChannelId former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo, struct LDKChannelTypeFeatures channel_type);
54423
54424 /**
54425  * Utility method to constructs a new ChannelReady-variant Event
54426  */
54427 struct LDKEvent Event_channel_ready(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
54428
54429 /**
54430  * Utility method to constructs a new ChannelClosed-variant Event
54431  */
54432 struct LDKEvent Event_channel_closed(struct LDKChannelId 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);
54433
54434 /**
54435  * Utility method to constructs a new DiscardFunding-variant Event
54436  */
54437 struct LDKEvent Event_discard_funding(struct LDKChannelId channel_id, struct LDKTransaction transaction);
54438
54439 /**
54440  * Utility method to constructs a new OpenChannelRequest-variant Event
54441  */
54442 struct LDKEvent Event_open_channel_request(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type);
54443
54444 /**
54445  * Utility method to constructs a new HTLCHandlingFailed-variant Event
54446  */
54447 struct LDKEvent Event_htlchandling_failed(struct LDKChannelId prev_channel_id, struct LDKHTLCDestination failed_next_destination);
54448
54449 /**
54450  * Utility method to constructs a new BumpTransaction-variant Event
54451  */
54452 struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
54453
54454 /**
54455  * Checks if two Events contain equal inner contents.
54456  * This ignores pointers and is_owned flags and looks at the values in fields.
54457  */
54458 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
54459
54460 /**
54461  * Serialize the Event object into a byte array which can be read by Event_read
54462  */
54463 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
54464
54465 /**
54466  * Read a Event from a byte array, created by Event_write
54467  */
54468 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
54469
54470 /**
54471  * Frees any resources used by the MessageSendEvent
54472  */
54473 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
54474
54475 /**
54476  * Creates a copy of the MessageSendEvent
54477  */
54478 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
54479
54480 /**
54481  * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
54482  */
54483 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
54484
54485 /**
54486  * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
54487  */
54488 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
54489
54490 /**
54491  * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
54492  */
54493 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
54494
54495 /**
54496  * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
54497  */
54498 struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
54499
54500 /**
54501  * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
54502  */
54503 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
54504
54505 /**
54506  * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
54507  */
54508 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
54509
54510 /**
54511  * Utility method to constructs a new SendStfu-variant MessageSendEvent
54512  */
54513 struct LDKMessageSendEvent MessageSendEvent_send_stfu(struct LDKPublicKey node_id, struct LDKStfu msg);
54514
54515 /**
54516  * Utility method to constructs a new SendSplice-variant MessageSendEvent
54517  */
54518 struct LDKMessageSendEvent MessageSendEvent_send_splice(struct LDKPublicKey node_id, struct LDKSplice msg);
54519
54520 /**
54521  * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent
54522  */
54523 struct LDKMessageSendEvent MessageSendEvent_send_splice_ack(struct LDKPublicKey node_id, struct LDKSpliceAck msg);
54524
54525 /**
54526  * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent
54527  */
54528 struct LDKMessageSendEvent MessageSendEvent_send_splice_locked(struct LDKPublicKey node_id, struct LDKSpliceLocked msg);
54529
54530 /**
54531  * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
54532  */
54533 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
54534
54535 /**
54536  * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
54537  */
54538 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
54539
54540 /**
54541  * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
54542  */
54543 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
54544
54545 /**
54546  * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
54547  */
54548 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
54549
54550 /**
54551  * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
54552  */
54553 struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
54554
54555 /**
54556  * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
54557  */
54558 struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
54559
54560 /**
54561  * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
54562  */
54563 struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
54564
54565 /**
54566  * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
54567  */
54568 struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
54569
54570 /**
54571  * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
54572  */
54573 struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
54574
54575 /**
54576  * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
54577  */
54578 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
54579
54580 /**
54581  * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
54582  */
54583 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
54584
54585 /**
54586  * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
54587  */
54588 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
54589
54590 /**
54591  * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
54592  */
54593 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
54594
54595 /**
54596  * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
54597  */
54598 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
54599
54600 /**
54601  * Utility method to constructs a new SendShutdown-variant MessageSendEvent
54602  */
54603 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
54604
54605 /**
54606  * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
54607  */
54608 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
54609
54610 /**
54611  * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
54612  */
54613 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
54614
54615 /**
54616  * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
54617  */
54618 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
54619
54620 /**
54621  * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
54622  */
54623 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
54624
54625 /**
54626  * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
54627  */
54628 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
54629
54630 /**
54631  * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
54632  */
54633 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
54634
54635 /**
54636  * Utility method to constructs a new HandleError-variant MessageSendEvent
54637  */
54638 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
54639
54640 /**
54641  * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
54642  */
54643 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
54644
54645 /**
54646  * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
54647  */
54648 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
54649
54650 /**
54651  * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
54652  */
54653 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
54654
54655 /**
54656  * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
54657  */
54658 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
54659
54660 /**
54661  * Calls the free function if one is set
54662  */
54663 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
54664
54665 /**
54666  * Calls the free function if one is set
54667  */
54668 void EventsProvider_free(struct LDKEventsProvider this_ptr);
54669
54670 /**
54671  * Calls the free function if one is set
54672  */
54673 void EventHandler_free(struct LDKEventHandler this_ptr);
54674
54675 /**
54676  * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
54677  */
54678 void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
54679
54680 /**
54681  * The parameters required to derive the signer for the anchor input.
54682  */
54683 struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
54684
54685 /**
54686  * The parameters required to derive the signer for the anchor input.
54687  */
54688 void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
54689
54690 /**
54691  * The transaction input's outpoint corresponding to the commitment transaction's anchor
54692  * output.
54693  */
54694 struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
54695
54696 /**
54697  * The transaction input's outpoint corresponding to the commitment transaction's anchor
54698  * output.
54699  */
54700 void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
54701
54702 /**
54703  * Constructs a new AnchorDescriptor given each field
54704  */
54705 MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
54706
54707 /**
54708  * Creates a copy of the AnchorDescriptor
54709  */
54710 struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
54711
54712 /**
54713  * Checks if two AnchorDescriptors contain equal inner contents.
54714  * This ignores pointers and is_owned flags and looks at the values in fields.
54715  * Two objects with NULL inner values will be considered "equal" here.
54716  */
54717 bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
54718
54719 /**
54720  * Returns the UTXO to be spent by the anchor input, which can be obtained via
54721  * [`Self::unsigned_tx_input`].
54722  */
54723 MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
54724
54725 /**
54726  * Returns the unsigned transaction input spending the anchor output in the commitment
54727  * transaction.
54728  */
54729 MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
54730
54731 /**
54732  * Returns the witness script of the anchor output in the commitment transaction.
54733  */
54734 MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
54735
54736 /**
54737  * Returns the fully signed witness required to spend the anchor output in the commitment
54738  * transaction.
54739  */
54740 MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
54741
54742 /**
54743  * Derives the channel signer required to sign the anchor input.
54744  */
54745 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
54746
54747 /**
54748  * Frees any resources used by the BumpTransactionEvent
54749  */
54750 void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
54751
54752 /**
54753  * Creates a copy of the BumpTransactionEvent
54754  */
54755 struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
54756
54757 /**
54758  * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
54759  */
54760 struct LDKBumpTransactionEvent BumpTransactionEvent_channel_close(struct LDKChannelId channel_id, struct LDKPublicKey counterparty_node_id, 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);
54761
54762 /**
54763  * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
54764  */
54765 struct LDKBumpTransactionEvent BumpTransactionEvent_htlcresolution(struct LDKChannelId channel_id, struct LDKPublicKey counterparty_node_id, struct LDKThirtyTwoBytes claim_id, uint32_t target_feerate_sat_per_1000_weight, struct LDKCVec_HTLCDescriptorZ htlc_descriptors, uint32_t tx_lock_time);
54766
54767 /**
54768  * Checks if two BumpTransactionEvents contain equal inner contents.
54769  * This ignores pointers and is_owned flags and looks at the values in fields.
54770  */
54771 bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
54772
54773 /**
54774  * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
54775  */
54776 void Input_free(struct LDKInput this_obj);
54777
54778 /**
54779  * The unique identifier of the input.
54780  */
54781 struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
54782
54783 /**
54784  * The unique identifier of the input.
54785  */
54786 void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
54787
54788 /**
54789  * The UTXO being spent by the input.
54790  */
54791 struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
54792
54793 /**
54794  * The UTXO being spent by the input.
54795  */
54796 void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
54797
54798 /**
54799  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
54800  * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
54801  * script.
54802  */
54803 uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
54804
54805 /**
54806  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
54807  * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
54808  * script.
54809  */
54810 void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
54811
54812 /**
54813  * Constructs a new Input given each field
54814  */
54815 MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
54816
54817 /**
54818  * Creates a copy of the Input
54819  */
54820 struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
54821
54822 /**
54823  * Generates a non-cryptographic 64-bit hash of the Input.
54824  */
54825 uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
54826
54827 /**
54828  * Checks if two Inputs contain equal inner contents.
54829  * This ignores pointers and is_owned flags and looks at the values in fields.
54830  * Two objects with NULL inner values will be considered "equal" here.
54831  */
54832 bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
54833
54834 /**
54835  * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
54836  */
54837 void Utxo_free(struct LDKUtxo this_obj);
54838
54839 /**
54840  * The unique identifier of the output.
54841  */
54842 struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
54843
54844 /**
54845  * The unique identifier of the output.
54846  */
54847 void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
54848
54849 /**
54850  * The output to spend.
54851  */
54852 struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
54853
54854 /**
54855  * The output to spend.
54856  */
54857 void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
54858
54859 /**
54860  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
54861  * with their lengths included, required to satisfy the output's script. The weight consumed by
54862  * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
54863  */
54864 uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
54865
54866 /**
54867  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
54868  * with their lengths included, required to satisfy the output's script. The weight consumed by
54869  * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
54870  */
54871 void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
54872
54873 /**
54874  * Constructs a new Utxo given each field
54875  */
54876 MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
54877
54878 /**
54879  * Creates a copy of the Utxo
54880  */
54881 struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
54882
54883 /**
54884  * Generates a non-cryptographic 64-bit hash of the Utxo.
54885  */
54886 uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
54887
54888 /**
54889  * Checks if two Utxos contain equal inner contents.
54890  * This ignores pointers and is_owned flags and looks at the values in fields.
54891  * Two objects with NULL inner values will be considered "equal" here.
54892  */
54893 bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
54894
54895 /**
54896  * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
54897  */
54898 MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
54899
54900 /**
54901  * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
54902  */
54903 void CoinSelection_free(struct LDKCoinSelection this_obj);
54904
54905 /**
54906  * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
54907  * requiring additional fees.
54908  */
54909 struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
54910
54911 /**
54912  * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
54913  * requiring additional fees.
54914  */
54915 void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
54916
54917 /**
54918  * An additional output tracking whether any change remained after coin selection. This output
54919  * should always have a value above dust for its given `script_pubkey`. It should not be
54920  * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
54921  * not met. This implies no other party should be able to spend it except us.
54922  */
54923 struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
54924
54925 /**
54926  * An additional output tracking whether any change remained after coin selection. This output
54927  * should always have a value above dust for its given `script_pubkey`. It should not be
54928  * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
54929  * not met. This implies no other party should be able to spend it except us.
54930  */
54931 void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
54932
54933 /**
54934  * Constructs a new CoinSelection given each field
54935  */
54936 MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
54937
54938 /**
54939  * Creates a copy of the CoinSelection
54940  */
54941 struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
54942
54943 /**
54944  * Calls the free function if one is set
54945  */
54946 void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
54947
54948 /**
54949  * Calls the free function if one is set
54950  */
54951 void WalletSource_free(struct LDKWalletSource this_ptr);
54952
54953 /**
54954  * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
54955  */
54956 void Wallet_free(struct LDKWallet this_obj);
54957
54958 /**
54959  * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
54960  * of [`CoinSelectionSource`].
54961  */
54962 MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
54963
54964 /**
54965  * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
54966  * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
54967  */
54968 struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
54969
54970 /**
54971  * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
54972  */
54973 void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
54974
54975 /**
54976  * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
54977  *
54978  * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
54979  */
54980 MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
54981
54982 /**
54983  * Handles all variants of [`BumpTransactionEvent`].
54984  */
54985 void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
54986
54987 /**
54988  * Frees any resources used by the FilesystemStore, if is_owned is set and inner is non-NULL.
54989  */
54990 void FilesystemStore_free(struct LDKFilesystemStore this_obj);
54991
54992 /**
54993  * Constructs a new [`FilesystemStore`].
54994  */
54995 MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir);
54996
54997 /**
54998  * Returns the data directory.
54999  */
55000 MUST_USE_RES struct LDKStr FilesystemStore_get_data_dir(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
55001
55002 /**
55003  * Constructs a new KVStore which calls the relevant methods on this_arg.
55004  * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
55005  */
55006 struct LDKKVStore FilesystemStore_as_KVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
55007
55008 /**
55009  * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
55010  */
55011 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
55012
55013 /**
55014  * Frees any resources used by the GossipSync
55015  */
55016 void GossipSync_free(struct LDKGossipSync this_ptr);
55017
55018 /**
55019  * Utility method to constructs a new P2P-variant GossipSync
55020  */
55021 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
55022
55023 /**
55024  * Utility method to constructs a new Rapid-variant GossipSync
55025  */
55026 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
55027
55028 /**
55029  * Utility method to constructs a new None-variant GossipSync
55030  */
55031 struct LDKGossipSync GossipSync_none(void);
55032
55033 /**
55034  * Start a background thread that takes care of responsibilities enumerated in the [top-level
55035  * documentation].
55036  *
55037  * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
55038  * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
55039  * either [`join`] or [`stop`].
55040  *
55041  * # Data Persistence
55042  *
55043  * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
55044  * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
55045  * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
55046  * provided implementation.
55047  *
55048  * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
55049  * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
55050  * See the `lightning-persister` crate for LDK's provided implementation.
55051  *
55052  * Typically, users should either implement [`Persister::persist_manager`] to never return an
55053  * error or call [`join`] and handle any error that may arise. For the latter case,
55054  * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
55055  *
55056  * # Event Handling
55057  *
55058  * `event_handler` is responsible for handling events that users should be notified of (e.g.,
55059  * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
55060  * functionality implemented by other handlers.
55061  * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
55062  *
55063  * # Rapid Gossip Sync
55064  *
55065  * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
55066  * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
55067  * until the [`RapidGossipSync`] instance completes its first sync.
55068  *
55069  * [top-level documentation]: BackgroundProcessor
55070  * [`join`]: Self::join
55071  * [`stop`]: Self::stop
55072  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
55073  * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
55074  * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
55075  * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
55076  * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
55077  * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
55078  */
55079 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);
55080
55081 /**
55082  * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
55083  * [`ChannelManager`].
55084  *
55085  * # Panics
55086  *
55087  * This function panics if the background thread has panicked such as while persisting or
55088  * handling events.
55089  *
55090  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
55091  */
55092 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
55093
55094 /**
55095  * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
55096  * [`ChannelManager`].
55097  *
55098  * # Panics
55099  *
55100  * This function panics if the background thread has panicked such as while persisting or
55101  * handling events.
55102  *
55103  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
55104  */
55105 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
55106
55107 /**
55108  * Frees any resources used by the Bolt11ParseError
55109  */
55110 void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr);
55111
55112 /**
55113  * Creates a copy of the Bolt11ParseError
55114  */
55115 struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig);
55116
55117 /**
55118  * Utility method to constructs a new Bech32Error-variant Bolt11ParseError
55119  */
55120 struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a);
55121
55122 /**
55123  * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError
55124  */
55125 struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a);
55126
55127 /**
55128  * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError
55129  */
55130 struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a);
55131
55132 /**
55133  * Utility method to constructs a new BadPrefix-variant Bolt11ParseError
55134  */
55135 struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void);
55136
55137 /**
55138  * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError
55139  */
55140 struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void);
55141
55142 /**
55143  * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError
55144  */
55145 struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void);
55146
55147 /**
55148  * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError
55149  */
55150 struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void);
55151
55152 /**
55153  * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError
55154  */
55155 struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void);
55156
55157 /**
55158  * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError
55159  */
55160 struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void);
55161
55162 /**
55163  * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError
55164  */
55165 struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a);
55166
55167 /**
55168  * Utility method to constructs a new PaddingError-variant Bolt11ParseError
55169  */
55170 struct LDKBolt11ParseError Bolt11ParseError_padding_error(void);
55171
55172 /**
55173  * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError
55174  */
55175 struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void);
55176
55177 /**
55178  * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError
55179  */
55180 struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void);
55181
55182 /**
55183  * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError
55184  */
55185 struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void);
55186
55187 /**
55188  * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError
55189  */
55190 struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void);
55191
55192 /**
55193  * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError
55194  */
55195 struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void);
55196
55197 /**
55198  * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError
55199  */
55200 struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a);
55201
55202 /**
55203  * Utility method to constructs a new Skip-variant Bolt11ParseError
55204  */
55205 struct LDKBolt11ParseError Bolt11ParseError_skip(void);
55206
55207 /**
55208  * Checks if two Bolt11ParseErrors contain equal inner contents.
55209  * This ignores pointers and is_owned flags and looks at the values in fields.
55210  */
55211 bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b);
55212
55213 /**
55214  * Frees any resources used by the ParseOrSemanticError
55215  */
55216 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
55217
55218 /**
55219  * Creates a copy of the ParseOrSemanticError
55220  */
55221 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
55222
55223 /**
55224  * Utility method to constructs a new ParseError-variant ParseOrSemanticError
55225  */
55226 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a);
55227
55228 /**
55229  * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
55230  */
55231 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a);
55232
55233 /**
55234  * Checks if two ParseOrSemanticErrors contain equal inner contents.
55235  * This ignores pointers and is_owned flags and looks at the values in fields.
55236  */
55237 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
55238
55239 /**
55240  * Frees any resources used by the Bolt11Invoice, if is_owned is set and inner is non-NULL.
55241  */
55242 void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj);
55243
55244 /**
55245  * Checks if two Bolt11Invoices contain equal inner contents.
55246  * This ignores pointers and is_owned flags and looks at the values in fields.
55247  * Two objects with NULL inner values will be considered "equal" here.
55248  */
55249 bool Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b);
55250
55251 /**
55252  * Creates a copy of the Bolt11Invoice
55253  */
55254 struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig);
55255
55256 /**
55257  * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice.
55258  */
55259 uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o);
55260
55261 /**
55262  * Frees any resources used by the SignedRawBolt11Invoice, if is_owned is set and inner is non-NULL.
55263  */
55264 void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj);
55265
55266 /**
55267  * Checks if two SignedRawBolt11Invoices contain equal inner contents.
55268  * This ignores pointers and is_owned flags and looks at the values in fields.
55269  * Two objects with NULL inner values will be considered "equal" here.
55270  */
55271 bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b);
55272
55273 /**
55274  * Creates a copy of the SignedRawBolt11Invoice
55275  */
55276 struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig);
55277
55278 /**
55279  * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice.
55280  */
55281 uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
55282
55283 /**
55284  * Frees any resources used by the RawBolt11Invoice, if is_owned is set and inner is non-NULL.
55285  */
55286 void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj);
55287
55288 /**
55289  * data part
55290  */
55291 struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr);
55292
55293 /**
55294  * data part
55295  */
55296 void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
55297
55298 /**
55299  * Checks if two RawBolt11Invoices contain equal inner contents.
55300  * This ignores pointers and is_owned flags and looks at the values in fields.
55301  * Two objects with NULL inner values will be considered "equal" here.
55302  */
55303 bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b);
55304
55305 /**
55306  * Creates a copy of the RawBolt11Invoice
55307  */
55308 struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig);
55309
55310 /**
55311  * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
55312  */
55313 uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o);
55314
55315 /**
55316  * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
55317  */
55318 void RawDataPart_free(struct LDKRawDataPart this_obj);
55319
55320 /**
55321  * generation time of the invoice
55322  */
55323 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
55324
55325 /**
55326  * generation time of the invoice
55327  */
55328 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
55329
55330 /**
55331  * Checks if two RawDataParts contain equal inner contents.
55332  * This ignores pointers and is_owned flags and looks at the values in fields.
55333  * Two objects with NULL inner values will be considered "equal" here.
55334  */
55335 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
55336
55337 /**
55338  * Creates a copy of the RawDataPart
55339  */
55340 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
55341
55342 /**
55343  * Generates a non-cryptographic 64-bit hash of the RawDataPart.
55344  */
55345 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
55346
55347 /**
55348  * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
55349  */
55350 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
55351
55352 /**
55353  * Checks if two PositiveTimestamps contain equal inner contents.
55354  * This ignores pointers and is_owned flags and looks at the values in fields.
55355  * Two objects with NULL inner values will be considered "equal" here.
55356  */
55357 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
55358
55359 /**
55360  * Creates a copy of the PositiveTimestamp
55361  */
55362 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
55363
55364 /**
55365  * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
55366  */
55367 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
55368
55369 /**
55370  * Creates a copy of the SiPrefix
55371  */
55372 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
55373
55374 /**
55375  * Utility method to constructs a new Milli-variant SiPrefix
55376  */
55377 enum LDKSiPrefix SiPrefix_milli(void);
55378
55379 /**
55380  * Utility method to constructs a new Micro-variant SiPrefix
55381  */
55382 enum LDKSiPrefix SiPrefix_micro(void);
55383
55384 /**
55385  * Utility method to constructs a new Nano-variant SiPrefix
55386  */
55387 enum LDKSiPrefix SiPrefix_nano(void);
55388
55389 /**
55390  * Utility method to constructs a new Pico-variant SiPrefix
55391  */
55392 enum LDKSiPrefix SiPrefix_pico(void);
55393
55394 /**
55395  * Checks if two SiPrefixs contain equal inner contents.
55396  * This ignores pointers and is_owned flags and looks at the values in fields.
55397  */
55398 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
55399
55400 /**
55401  * Generates a non-cryptographic 64-bit hash of the SiPrefix.
55402  */
55403 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
55404
55405 /**
55406  * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
55407  * This is effectively 10^12 * the prefix multiplier
55408  */
55409 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
55410
55411 /**
55412  * Creates a copy of the Currency
55413  */
55414 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
55415
55416 /**
55417  * Utility method to constructs a new Bitcoin-variant Currency
55418  */
55419 enum LDKCurrency Currency_bitcoin(void);
55420
55421 /**
55422  * Utility method to constructs a new BitcoinTestnet-variant Currency
55423  */
55424 enum LDKCurrency Currency_bitcoin_testnet(void);
55425
55426 /**
55427  * Utility method to constructs a new Regtest-variant Currency
55428  */
55429 enum LDKCurrency Currency_regtest(void);
55430
55431 /**
55432  * Utility method to constructs a new Simnet-variant Currency
55433  */
55434 enum LDKCurrency Currency_simnet(void);
55435
55436 /**
55437  * Utility method to constructs a new Signet-variant Currency
55438  */
55439 enum LDKCurrency Currency_signet(void);
55440
55441 /**
55442  * Generates a non-cryptographic 64-bit hash of the Currency.
55443  */
55444 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
55445
55446 /**
55447  * Checks if two Currencys contain equal inner contents.
55448  * This ignores pointers and is_owned flags and looks at the values in fields.
55449  */
55450 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
55451
55452 /**
55453  * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
55454  */
55455 void Sha256_free(struct LDKSha256 this_obj);
55456
55457 /**
55458  * Creates a copy of the Sha256
55459  */
55460 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
55461
55462 /**
55463  * Generates a non-cryptographic 64-bit hash of the Sha256.
55464  */
55465 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
55466
55467 /**
55468  * Checks if two Sha256s contain equal inner contents.
55469  * This ignores pointers and is_owned flags and looks at the values in fields.
55470  * Two objects with NULL inner values will be considered "equal" here.
55471  */
55472 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
55473
55474 /**
55475  * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
55476  * single sha256 hash.
55477  */
55478 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
55479
55480 /**
55481  * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
55482  */
55483 void Description_free(struct LDKDescription this_obj);
55484
55485 /**
55486  * Creates a copy of the Description
55487  */
55488 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
55489
55490 /**
55491  * Generates a non-cryptographic 64-bit hash of the Description.
55492  */
55493 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
55494
55495 /**
55496  * Checks if two Descriptions contain equal inner contents.
55497  * This ignores pointers and is_owned flags and looks at the values in fields.
55498  * Two objects with NULL inner values will be considered "equal" here.
55499  */
55500 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
55501
55502 /**
55503  * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
55504  */
55505 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
55506
55507 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
55508
55509 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
55510
55511 /**
55512  * Constructs a new PayeePubKey given each field
55513  */
55514 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
55515
55516 /**
55517  * Creates a copy of the PayeePubKey
55518  */
55519 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
55520
55521 /**
55522  * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
55523  */
55524 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
55525
55526 /**
55527  * Checks if two PayeePubKeys contain equal inner contents.
55528  * This ignores pointers and is_owned flags and looks at the values in fields.
55529  * Two objects with NULL inner values will be considered "equal" here.
55530  */
55531 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
55532
55533 /**
55534  * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
55535  */
55536 void ExpiryTime_free(struct LDKExpiryTime this_obj);
55537
55538 /**
55539  * Creates a copy of the ExpiryTime
55540  */
55541 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
55542
55543 /**
55544  * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
55545  */
55546 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
55547
55548 /**
55549  * Checks if two ExpiryTimes contain equal inner contents.
55550  * This ignores pointers and is_owned flags and looks at the values in fields.
55551  * Two objects with NULL inner values will be considered "equal" here.
55552  */
55553 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
55554
55555 /**
55556  * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
55557  */
55558 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
55559
55560 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
55561
55562 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
55563
55564 /**
55565  * Constructs a new MinFinalCltvExpiryDelta given each field
55566  */
55567 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
55568
55569 /**
55570  * Creates a copy of the MinFinalCltvExpiryDelta
55571  */
55572 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
55573
55574 /**
55575  * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
55576  */
55577 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
55578
55579 /**
55580  * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
55581  * This ignores pointers and is_owned flags and looks at the values in fields.
55582  * Two objects with NULL inner values will be considered "equal" here.
55583  */
55584 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
55585
55586 /**
55587  * Frees any resources used by the Fallback
55588  */
55589 void Fallback_free(struct LDKFallback this_ptr);
55590
55591 /**
55592  * Creates a copy of the Fallback
55593  */
55594 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
55595
55596 /**
55597  * Utility method to constructs a new SegWitProgram-variant Fallback
55598  */
55599 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
55600
55601 /**
55602  * Utility method to constructs a new PubKeyHash-variant Fallback
55603  */
55604 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
55605
55606 /**
55607  * Utility method to constructs a new ScriptHash-variant Fallback
55608  */
55609 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
55610
55611 /**
55612  * Generates a non-cryptographic 64-bit hash of the Fallback.
55613  */
55614 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
55615
55616 /**
55617  * Checks if two Fallbacks contain equal inner contents.
55618  * This ignores pointers and is_owned flags and looks at the values in fields.
55619  */
55620 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
55621
55622 /**
55623  * Frees any resources used by the Bolt11InvoiceSignature, if is_owned is set and inner is non-NULL.
55624  */
55625 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
55626
55627 /**
55628  * Creates a copy of the Bolt11InvoiceSignature
55629  */
55630 struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig);
55631
55632 /**
55633  * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
55634  */
55635 uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o);
55636
55637 /**
55638  * Checks if two Bolt11InvoiceSignatures contain equal inner contents.
55639  * This ignores pointers and is_owned flags and looks at the values in fields.
55640  * Two objects with NULL inner values will be considered "equal" here.
55641  */
55642 bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b);
55643
55644 /**
55645  * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
55646  */
55647 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
55648
55649 /**
55650  * Creates a copy of the PrivateRoute
55651  */
55652 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
55653
55654 /**
55655  * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
55656  */
55657 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
55658
55659 /**
55660  * Checks if two PrivateRoutes contain equal inner contents.
55661  * This ignores pointers and is_owned flags and looks at the values in fields.
55662  * Two objects with NULL inner values will be considered "equal" here.
55663  */
55664 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
55665
55666 /**
55667  * Disassembles the `SignedRawBolt11Invoice` into its three parts:
55668  *  1. raw invoice
55669  *  2. hash of the raw invoice
55670  *  3. signature
55671  */
55672 MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg);
55673
55674 /**
55675  * The [`RawBolt11Invoice`] which was signed.
55676  */
55677 MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
55678
55679 /**
55680  * The hash of the [`RawBolt11Invoice`] that was signed.
55681  */
55682 MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32];
55683
55684 /**
55685  * Signature for the invoice.
55686  */
55687 MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
55688
55689 /**
55690  * Recovers the public key used for signing the invoice from the recoverable signature.
55691  */
55692 MUST_USE_RES struct LDKCResult_PayeePubKeySecp256k1ErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
55693
55694 /**
55695  * Checks if the signature is valid for the included payee public key or if none exists if it's
55696  * valid for the recovered signature (which should always be true?).
55697  */
55698 MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
55699
55700 /**
55701  * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
55702  */
55703 MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55704
55705 /**
55706  *
55707  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55708  */
55709 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55710
55711 /**
55712  *
55713  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55714  */
55715 MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55716
55717 /**
55718  *
55719  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55720  */
55721 MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55722
55723 /**
55724  *
55725  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55726  */
55727 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55728
55729 /**
55730  *
55731  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55732  */
55733 MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55734
55735 /**
55736  *
55737  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55738  */
55739 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55740
55741 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55742
55743 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55744
55745 /**
55746  *
55747  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55748  */
55749 MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55750
55751 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55752
55753 /**
55754  * Returns `None` if no amount is set or on overflow.
55755  */
55756 MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55757
55758 MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
55759
55760 /**
55761  * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
55762  *
55763  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
55764  */
55765 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
55766
55767 /**
55768  * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
55769  * the range `0..=MAX_TIMESTAMP`.
55770  *
55771  * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
55772  *
55773  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
55774  */
55775 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
55776
55777 /**
55778  * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
55779  * `0..=MAX_TIMESTAMP`.
55780  *
55781  * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
55782  *
55783  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
55784  */
55785 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
55786
55787 /**
55788  * Returns the Unix timestamp representing the stored time
55789  */
55790 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
55791
55792 /**
55793  * Returns the duration of the stored time since the Unix epoch
55794  */
55795 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
55796
55797 /**
55798  * Returns the [`SystemTime`] representing the stored time
55799  */
55800 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
55801
55802 /**
55803  * The hash of the [`RawBolt11Invoice`] that was signed.
55804  */
55805 MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55806
55807 /**
55808  * Transform the `Bolt11Invoice` into its unchecked version.
55809  */
55810 MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg);
55811
55812 /**
55813  * Check that the invoice is signed correctly and that key recovery works
55814  */
55815 MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55816
55817 /**
55818  * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants.
55819  * ```
55820  * use lightning_invoice::*;
55821  *
55822  * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
55823  * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
55824  * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
55825  * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
55826  * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
55827  * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
55828  * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
55829  * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
55830  * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
55831  * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
55832  * j5r6drg6k6zcqj0fcwg\";
55833  *
55834  * let signed = invoice.parse::<SignedRawBolt11Invoice>().unwrap();
55835  *
55836  * assert!(Bolt11Invoice::from_signed(signed).is_ok());
55837  * ```
55838  */
55839 MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice);
55840
55841 /**
55842  * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time)
55843  */
55844 MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55845
55846 /**
55847  * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch
55848  */
55849 MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55850
55851 /**
55852  * Returns the hash to which we will receive the preimage on completion of the payment
55853  */
55854 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
55855
55856 /**
55857  * Get the payee's public key if one was included in the invoice
55858  *
55859  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55860  */
55861 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55862
55863 /**
55864  * Get the payment secret if one was included in the invoice
55865  */
55866 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
55867
55868 /**
55869  * Get the payment metadata blob if one was included in the invoice
55870  */
55871 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55872
55873 /**
55874  * Get the invoice features if they were included in the invoice
55875  *
55876  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
55877  */
55878 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55879
55880 /**
55881  * Recover the payee's public key (only to be used if none was included in the invoice)
55882  */
55883 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55884
55885 /**
55886  * Recover the payee's public key if one was included in the invoice, otherwise return the
55887  * recovered public key from the signature
55888  */
55889 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_get_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55890
55891 /**
55892  * Returns the Duration since the Unix epoch at which the invoice expires.
55893  * Returning None if overflow occurred.
55894  */
55895 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55896
55897 /**
55898  * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
55899  */
55900 MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55901
55902 /**
55903  * Returns whether the invoice has expired.
55904  */
55905 MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55906
55907 /**
55908  * Returns the Duration remaining until the invoice expires.
55909  */
55910 MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55911
55912 /**
55913  * Returns the Duration remaining until the invoice expires given the current time.
55914  * `time` is the timestamp as a duration since the Unix epoch.
55915  */
55916 MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time);
55917
55918 /**
55919  * Returns whether the expiry time would pass at the given point in time.
55920  * `at_time` is the timestamp as a duration since the Unix epoch.
55921  */
55922 MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time);
55923
55924 /**
55925  * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
55926  * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
55927  */
55928 MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55929
55930 /**
55931  * Returns a list of all fallback addresses as [`Address`]es
55932  */
55933 MUST_USE_RES struct LDKCVec_StrZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55934
55935 /**
55936  * Returns a list of all routes included in the invoice
55937  */
55938 MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55939
55940 /**
55941  * Returns a list of all routes included in the invoice as the underlying hints
55942  */
55943 MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55944
55945 /**
55946  * Returns the currency for which the invoice was issued
55947  */
55948 MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55949
55950 /**
55951  * Returns the amount if specified in the invoice as millisatoshis.
55952  */
55953 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
55954
55955 /**
55956  * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
55957  * returns [`CreationError::DescriptionTooLong`] otherwise
55958  *
55959  * Please note that single characters may use more than one byte due to UTF8 encoding.
55960  */
55961 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
55962
55963 /**
55964  * Returns the underlying description [`UntrustedString`]
55965  */
55966 MUST_USE_RES struct LDKUntrustedString Description_into_inner(struct LDKDescription this_arg);
55967
55968 /**
55969  * Get the string representation of a Description object
55970  */
55971 struct LDKStr Description_to_str(const struct LDKDescription *NONNULL_PTR o);
55972
55973 /**
55974  * Construct an `ExpiryTime` from seconds.
55975  */
55976 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
55977
55978 /**
55979  * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
55980  */
55981 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
55982
55983 /**
55984  * Returns the expiry time in seconds
55985  */
55986 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
55987
55988 /**
55989  * Returns a reference to the underlying [`Duration`] (=expiry time)
55990  */
55991 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
55992
55993 /**
55994  * Creates a new (partial) route from a list of hops
55995  */
55996 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
55997
55998 /**
55999  * Returns the underlying list of hops
56000  */
56001 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
56002
56003 /**
56004  * Creates a copy of the CreationError
56005  */
56006 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
56007
56008 /**
56009  * Utility method to constructs a new DescriptionTooLong-variant CreationError
56010  */
56011 enum LDKCreationError CreationError_description_too_long(void);
56012
56013 /**
56014  * Utility method to constructs a new RouteTooLong-variant CreationError
56015  */
56016 enum LDKCreationError CreationError_route_too_long(void);
56017
56018 /**
56019  * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
56020  */
56021 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
56022
56023 /**
56024  * Utility method to constructs a new InvalidAmount-variant CreationError
56025  */
56026 enum LDKCreationError CreationError_invalid_amount(void);
56027
56028 /**
56029  * Utility method to constructs a new MissingRouteHints-variant CreationError
56030  */
56031 enum LDKCreationError CreationError_missing_route_hints(void);
56032
56033 /**
56034  * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
56035  */
56036 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
56037
56038 /**
56039  * Checks if two CreationErrors contain equal inner contents.
56040  * This ignores pointers and is_owned flags and looks at the values in fields.
56041  */
56042 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
56043
56044 /**
56045  * Get the string representation of a CreationError object
56046  */
56047 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
56048
56049 /**
56050  * Creates a copy of the Bolt11SemanticError
56051  */
56052 enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig);
56053
56054 /**
56055  * Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
56056  */
56057 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void);
56058
56059 /**
56060  * Utility method to constructs a new MultiplePaymentHashes-variant Bolt11SemanticError
56061  */
56062 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void);
56063
56064 /**
56065  * Utility method to constructs a new NoDescription-variant Bolt11SemanticError
56066  */
56067 enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void);
56068
56069 /**
56070  * Utility method to constructs a new MultipleDescriptions-variant Bolt11SemanticError
56071  */
56072 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void);
56073
56074 /**
56075  * Utility method to constructs a new NoPaymentSecret-variant Bolt11SemanticError
56076  */
56077 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void);
56078
56079 /**
56080  * Utility method to constructs a new MultiplePaymentSecrets-variant Bolt11SemanticError
56081  */
56082 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void);
56083
56084 /**
56085  * Utility method to constructs a new InvalidFeatures-variant Bolt11SemanticError
56086  */
56087 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void);
56088
56089 /**
56090  * Utility method to constructs a new InvalidRecoveryId-variant Bolt11SemanticError
56091  */
56092 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void);
56093
56094 /**
56095  * Utility method to constructs a new InvalidSignature-variant Bolt11SemanticError
56096  */
56097 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void);
56098
56099 /**
56100  * Utility method to constructs a new ImpreciseAmount-variant Bolt11SemanticError
56101  */
56102 enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void);
56103
56104 /**
56105  * Checks if two Bolt11SemanticErrors contain equal inner contents.
56106  * This ignores pointers and is_owned flags and looks at the values in fields.
56107  */
56108 bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b);
56109
56110 /**
56111  * Get the string representation of a Bolt11SemanticError object
56112  */
56113 struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o);
56114
56115 /**
56116  * Frees any resources used by the SignOrCreationError
56117  */
56118 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
56119
56120 /**
56121  * Creates a copy of the SignOrCreationError
56122  */
56123 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
56124
56125 /**
56126  * Utility method to constructs a new SignError-variant SignOrCreationError
56127  */
56128 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
56129
56130 /**
56131  * Utility method to constructs a new CreationError-variant SignOrCreationError
56132  */
56133 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
56134
56135 /**
56136  * Checks if two SignOrCreationErrors contain equal inner contents.
56137  * This ignores pointers and is_owned flags and looks at the values in fields.
56138  */
56139 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
56140
56141 /**
56142  * Get the string representation of a SignOrCreationError object
56143  */
56144 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
56145
56146 /**
56147  * Builds the necessary parameters to pay or pre-flight probe the given zero-amount
56148  * [`Bolt11Invoice`] using [`ChannelManager::send_payment`] or
56149  * [`ChannelManager::send_preflight_probes`].
56150  *
56151  * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
56152  * same [`PaymentHash`] has never been paid before.
56153  *
56154  * Will always succeed unless the invoice has an amount specified, in which case
56155  * [`payment_parameters_from_invoice`] should be used.
56156  *
56157  * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
56158  * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
56159  */
56160 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat);
56161
56162 /**
56163  * Builds the necessary parameters to pay or pre-flight probe the given [`Bolt11Invoice`] using
56164  * [`ChannelManager::send_payment`] or [`ChannelManager::send_preflight_probes`].
56165  *
56166  * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
56167  * same [`PaymentHash`] has never been paid before.
56168  *
56169  * Will always succeed unless the invoice has no amount specified, in which case
56170  * [`payment_parameters_from_zero_amount_invoice`] should be used.
56171  *
56172  * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
56173  * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
56174  */
56175 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice);
56176
56177 /**
56178  * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
56179  * See [`PhantomKeysManager`] for more information on phantom node payments.
56180  *
56181  * `phantom_route_hints` parameter:
56182  * * Contains channel info for all nodes participating in the phantom invoice
56183  * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
56184  *   participating node
56185  * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
56186  *   updated when a channel becomes disabled or closes
56187  * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
56188  *   may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
56189  *   down
56190  *
56191  * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
56192  * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
56193  * If `None` is provided for `payment_hash`, then one will be created.
56194  *
56195  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
56196  * in excess of the current time.
56197  *
56198  * `duration_since_epoch` is the current time since epoch in seconds.
56199  *
56200  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
56201  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
56202  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
56203  * confirmations during routing.
56204  *
56205  * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
56206  * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
56207  * requirement).
56208  *
56209  * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
56210  * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
56211  * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
56212  * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
56213  * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
56214  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
56215  *
56216  * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
56217  * available and the current time is supplied by the caller.
56218  */
56219 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);
56220
56221 /**
56222  * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
56223  * See [`PhantomKeysManager`] for more information on phantom node payments.
56224  *
56225  * `phantom_route_hints` parameter:
56226  * * Contains channel info for all nodes participating in the phantom invoice
56227  * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
56228  *   participating node
56229  * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
56230  *   updated when a channel becomes disabled or closes
56231  * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
56232  *   of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
56233  *   in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
56234  *   until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
56235  *   desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
56236  *
56237  * `description_hash` is a SHA-256 hash of the description text
56238  *
56239  * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
56240  * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
56241  * If `None` is provided for `payment_hash`, then one will be created.
56242  *
56243  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
56244  * in excess of the current time.
56245  *
56246  * `duration_since_epoch` is the current time since epoch in seconds.
56247  *
56248  * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
56249  * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
56250  * requirement).
56251  *
56252  * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
56253  * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
56254  * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
56255  * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
56256  * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
56257  *
56258  * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
56259  * available and the current time is supplied by the caller.
56260  */
56261 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);
56262
56263 /**
56264  * Utility to construct an invoice. Generally, unless you want to do something like a custom
56265  * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
56266  * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
56267  * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
56268  * that the payment secret is valid when the invoice is paid.
56269  *
56270  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
56271  * in excess of the current time.
56272  *
56273  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
56274  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
56275  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
56276  * confirmations during routing.
56277  *
56278  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
56279  */
56280 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);
56281
56282 /**
56283  * Utility to construct an invoice. Generally, unless you want to do something like a custom
56284  * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
56285  * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
56286  * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
56287  * that the payment secret is valid when the invoice is paid.
56288  * Use this variant if you want to pass the `description_hash` to the invoice.
56289  *
56290  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
56291  * in excess of the current time.
56292  *
56293  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
56294  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
56295  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
56296  * confirmations during routing.
56297  *
56298  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
56299  */
56300 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);
56301
56302 /**
56303  * See [`create_invoice_from_channelmanager_with_description_hash`]
56304  * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
56305  * available and the current time is supplied by the caller.
56306  */
56307 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);
56308
56309 /**
56310  * See [`create_invoice_from_channelmanager`]
56311  * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
56312  * available and the current time is supplied by the caller.
56313  */
56314 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);
56315
56316 /**
56317  * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
56318  * This version allows for providing a custom [`PaymentHash`] for the invoice.
56319  * This may be useful if you're building an on-chain swap or involving another protocol where
56320  * the payment hash is also involved outside the scope of lightning.
56321  */
56322 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);
56323
56324 /**
56325  * Read a SiPrefix object from a string
56326  */
56327 struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s);
56328
56329 /**
56330  * Read a Bolt11Invoice object from a string
56331  */
56332 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s);
56333
56334 /**
56335  * Read a SignedRawBolt11Invoice object from a string
56336  */
56337 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s);
56338
56339 /**
56340  * Get the string representation of a Bolt11ParseError object
56341  */
56342 struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o);
56343
56344 /**
56345  * Get the string representation of a ParseOrSemanticError object
56346  */
56347 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
56348
56349 /**
56350  * Get the string representation of a Bolt11Invoice object
56351  */
56352 struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o);
56353
56354 /**
56355  * Get the string representation of a SignedRawBolt11Invoice object
56356  */
56357 struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
56358
56359 /**
56360  * Get the string representation of a Currency object
56361  */
56362 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
56363
56364 /**
56365  * Get the string representation of a SiPrefix object
56366  */
56367 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
56368
56369 /**
56370  * Frees any resources used by the GraphSyncError
56371  */
56372 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
56373
56374 /**
56375  * Creates a copy of the GraphSyncError
56376  */
56377 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
56378
56379 /**
56380  * Utility method to constructs a new DecodeError-variant GraphSyncError
56381  */
56382 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
56383
56384 /**
56385  * Utility method to constructs a new LightningError-variant GraphSyncError
56386  */
56387 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
56388
56389 /**
56390  * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
56391  */
56392 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
56393
56394 /**
56395  * Instantiate a new [`RapidGossipSync`] instance.
56396  */
56397 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
56398
56399 /**
56400  * Sync gossip data from a file.
56401  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
56402  *
56403  * `network_graph`: The network graph to apply the updates to
56404  *
56405  * `sync_path`: Path to the file where the gossip update data is located
56406  *
56407  */
56408 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
56409
56410 /**
56411  * Update network graph from binary data.
56412  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
56413  *
56414  * `update_data`: `&[u8]` binary stream that comprises the update data
56415  */
56416 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
56417
56418 /**
56419  * Update network graph from binary data.
56420  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
56421  *
56422  * `update_data`: `&[u8]` binary stream that comprises the update data
56423  * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
56424  */
56425 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);
56426
56427 /**
56428  * Returns whether a rapid gossip sync has completed at least once.
56429  */
56430 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
56431
56432 #endif /* LDK_C_BINDINGS_H */
56433
56434 #include "ldk_ver.h"