Update auto-generated bindings
[ldk-c-bindings] / lightning-c-bindings / include / lightning.h
1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
3
4 /* Generated with cbindgen:0.24.5 */
5
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
7
8 #include <stdarg.h>
9 #include <stdbool.h>
10 #include <stdint.h>
11 #include "ldk_rust_types.h"
12
13 /**
14  * Errors that may occur when converting a [`RawBolt11Invoice`] to a [`Bolt11Invoice`]. They relate to
15  * the requirements sections in BOLT #11
16  */
17 typedef enum LDKBolt11SemanticError {
18    /**
19     * The invoice is missing the mandatory payment hash
20     */
21    LDKBolt11SemanticError_NoPaymentHash,
22    /**
23     * The invoice has multiple payment hashes which isn't allowed
24     */
25    LDKBolt11SemanticError_MultiplePaymentHashes,
26    /**
27     * No description or description hash are part of the invoice
28     */
29    LDKBolt11SemanticError_NoDescription,
30    /**
31     * The invoice contains multiple descriptions and/or description hashes which isn't allowed
32     */
33    LDKBolt11SemanticError_MultipleDescriptions,
34    /**
35     * The invoice is missing the mandatory payment secret, which all modern lightning nodes
36     * should provide.
37     */
38    LDKBolt11SemanticError_NoPaymentSecret,
39    /**
40     * The invoice contains multiple payment secrets
41     */
42    LDKBolt11SemanticError_MultiplePaymentSecrets,
43    /**
44     * The invoice's features are invalid
45     */
46    LDKBolt11SemanticError_InvalidFeatures,
47    /**
48     * The recovery id doesn't fit the signature/pub key
49     */
50    LDKBolt11SemanticError_InvalidRecoveryId,
51    /**
52     * The invoice's signature is invalid
53     */
54    LDKBolt11SemanticError_InvalidSignature,
55    /**
56     * The invoice's amount was not a whole number of millisatoshis
57     */
58    LDKBolt11SemanticError_ImpreciseAmount,
59    /**
60     * Must be last for serialization purposes
61     */
62    LDKBolt11SemanticError_Sentinel,
63 } LDKBolt11SemanticError;
64
65 /**
66  * Error when interpreting a TLV stream as a specific type.
67  */
68 typedef enum LDKBolt12SemanticError {
69    /**
70     * The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
71     */
72    LDKBolt12SemanticError_AlreadyExpired,
73    /**
74     * The provided chain hash does not correspond to a supported chain.
75     */
76    LDKBolt12SemanticError_UnsupportedChain,
77    /**
78     * A chain was provided but was not expected.
79     */
80    LDKBolt12SemanticError_UnexpectedChain,
81    /**
82     * An amount was expected but was missing.
83     */
84    LDKBolt12SemanticError_MissingAmount,
85    /**
86     * The amount exceeded the total bitcoin supply.
87     */
88    LDKBolt12SemanticError_InvalidAmount,
89    /**
90     * An amount was provided but was not sufficient in value.
91     */
92    LDKBolt12SemanticError_InsufficientAmount,
93    /**
94     * An amount was provided but was not expected.
95     */
96    LDKBolt12SemanticError_UnexpectedAmount,
97    /**
98     * A currency was provided that is not supported.
99     */
100    LDKBolt12SemanticError_UnsupportedCurrency,
101    /**
102     * A feature was required but is unknown.
103     */
104    LDKBolt12SemanticError_UnknownRequiredFeatures,
105    /**
106     * Features were provided but were not expected.
107     */
108    LDKBolt12SemanticError_UnexpectedFeatures,
109    /**
110     * A required description was not provided.
111     */
112    LDKBolt12SemanticError_MissingDescription,
113    /**
114     * A signing pubkey was not provided.
115     */
116    LDKBolt12SemanticError_MissingSigningPubkey,
117    /**
118     * A signing pubkey was provided but a different one was expected.
119     */
120    LDKBolt12SemanticError_InvalidSigningPubkey,
121    /**
122     * A signing pubkey was provided but was not expected.
123     */
124    LDKBolt12SemanticError_UnexpectedSigningPubkey,
125    /**
126     * A quantity was expected but was missing.
127     */
128    LDKBolt12SemanticError_MissingQuantity,
129    /**
130     * An unsupported quantity was provided.
131     */
132    LDKBolt12SemanticError_InvalidQuantity,
133    /**
134     * A quantity or quantity bounds was provided but was not expected.
135     */
136    LDKBolt12SemanticError_UnexpectedQuantity,
137    /**
138     * Metadata could not be used to verify the offers message.
139     */
140    LDKBolt12SemanticError_InvalidMetadata,
141    /**
142     * Metadata was provided but was not expected.
143     */
144    LDKBolt12SemanticError_UnexpectedMetadata,
145    /**
146     * Payer metadata was expected but was missing.
147     */
148    LDKBolt12SemanticError_MissingPayerMetadata,
149    /**
150     * A payer id was expected but was missing.
151     */
152    LDKBolt12SemanticError_MissingPayerId,
153    /**
154     * Blinded paths were expected but were missing.
155     */
156    LDKBolt12SemanticError_MissingPaths,
157    /**
158     * The blinded payinfo given does not match the number of blinded path hops.
159     */
160    LDKBolt12SemanticError_InvalidPayInfo,
161    /**
162     * An invoice creation time was expected but was missing.
163     */
164    LDKBolt12SemanticError_MissingCreationTime,
165    /**
166     * An invoice payment hash was expected but was missing.
167     */
168    LDKBolt12SemanticError_MissingPaymentHash,
169    /**
170     * A signature was expected but was missing.
171     */
172    LDKBolt12SemanticError_MissingSignature,
173    /**
174     * Must be last for serialization purposes
175     */
176    LDKBolt12SemanticError_Sentinel,
177 } LDKBolt12SemanticError;
178
179 /**
180  * An enum which can either contain a  or not
181  */
182 typedef enum LDKCOption_NoneZ {
183    /**
184     * When we're in this state, this COption_NoneZ contains a
185     */
186    LDKCOption_NoneZ_Some,
187    /**
188     * When we're in this state, this COption_NoneZ contains nothing
189     */
190    LDKCOption_NoneZ_None,
191    /**
192     * Must be last for serialization purposes
193     */
194    LDKCOption_NoneZ_Sentinel,
195 } LDKCOption_NoneZ;
196
197 /**
198  * An enum representing the status of a channel monitor update persistence.
199  *
200  * These are generally used as the return value for an implementation of [`Persist`] which is used
201  * as the storage layer for a [`ChainMonitor`]. See the docs on [`Persist`] for a high-level
202  * explanation of how to handle different cases.
203  *
204  * While `UnrecoverableError` is provided as a failure variant, it is not truly \"handled\" on the
205  * calling side, and generally results in an immediate panic. For those who prefer to avoid
206  * panics, `InProgress` can be used and you can retry the update operation in the background or
207  * shut down cleanly.
208  *
209  * Note that channels should generally *not* be force-closed after a persistence failure.
210  * Force-closing with the latest [`ChannelMonitorUpdate`] applied may result in a transaction
211  * being broadcast which can only be spent by the latest [`ChannelMonitor`]! Thus, if the
212  * latest [`ChannelMonitor`] is not durably persisted anywhere and exists only in memory, naively
213  * calling [`ChannelManager::force_close_broadcasting_latest_txn`] *may result in loss of funds*!
214  *
215  * [`Persist`]: chainmonitor::Persist
216  * [`ChainMonitor`]: chainmonitor::ChainMonitor
217  * [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn
218  */
219 typedef enum LDKChannelMonitorUpdateStatus {
220    /**
221     * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
222     * have been updated.
223     *
224     * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
225     * be available on restart even if the application crashes.
226     */
227    LDKChannelMonitorUpdateStatus_Completed,
228    /**
229     * Indicates that the update will happen asynchronously in the background or that a transient
230     * failure occurred which is being retried in the background and will eventually complete.
231     *
232     * This will \"freeze\" a channel, preventing us from revoking old states or submitting a new
233     * commitment transaction to the counterparty. Once the update(s) which are `InProgress` have
234     * been completed, a [`MonitorEvent::Completed`] can be used to restore the channel to an
235     * operational state.
236     *
237     * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
238     * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
239     * attempting to claim it on this channel) and those updates must still be persisted.
240     *
241     * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
242     * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
243     * monitor update for the same channel.
244     *
245     * For deployments where a copy of [`ChannelMonitor`]s and other local state are backed up in
246     * a remote location (with local copies persisted immediately), it is anticipated that all
247     * updates will return [`InProgress`] until the remote copies could be updated.
248     *
249     * Note that while fully asynchronous persistence of [`ChannelMonitor`] data is generally
250     * reliable, this feature is considered beta, and a handful of edge-cases remain. Until the
251     * remaining cases are fixed, in rare cases, *using this feature may lead to funds loss*.
252     *
253     * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
254     */
255    LDKChannelMonitorUpdateStatus_InProgress,
256    /**
257     * Indicates that an update has failed and will not complete at any point in the future.
258     *
259     * Currently returning this variant will cause LDK to immediately panic to encourage immediate
260     * shutdown. In the future this may be updated to disconnect peers and refuse to continue
261     * normal operation without a panic.
262     *
263     * Applications which wish to perform an orderly shutdown after failure should consider
264     * returning [`InProgress`] instead and simply shut down without ever marking the update
265     * complete.
266     *
267     * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
268     */
269    LDKChannelMonitorUpdateStatus_UnrecoverableError,
270    /**
271     * Must be last for serialization purposes
272     */
273    LDKChannelMonitorUpdateStatus_Sentinel,
274 } LDKChannelMonitorUpdateStatus;
275
276 /**
277  * Further information on the details of the channel shutdown.
278  * Upon channels being forced closed (i.e. commitment transaction confirmation detected
279  * by `ChainMonitor`), ChannelShutdownState will be set to `ShutdownComplete` or
280  * the channel will be removed shortly.
281  * Also note, that in normal operation, peers could disconnect at any of these states
282  * and require peer re-connection before making progress onto other states
283  */
284 typedef enum LDKChannelShutdownState {
285    /**
286     * Channel has not sent or received a shutdown message.
287     */
288    LDKChannelShutdownState_NotShuttingDown,
289    /**
290     * Local node has sent a shutdown message for this channel.
291     */
292    LDKChannelShutdownState_ShutdownInitiated,
293    /**
294     * Shutdown message exchanges have concluded and the channels are in the midst of
295     * resolving all existing open HTLCs before closing can continue.
296     */
297    LDKChannelShutdownState_ResolvingHTLCs,
298    /**
299     * All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee rates.
300     */
301    LDKChannelShutdownState_NegotiatingClosingFee,
302    /**
303     * We've successfully negotiated a closing_signed dance. At this point `ChannelManager` is about
304     * to drop the channel.
305     */
306    LDKChannelShutdownState_ShutdownComplete,
307    /**
308     * Must be last for serialization purposes
309     */
310    LDKChannelShutdownState_Sentinel,
311 } LDKChannelShutdownState;
312
313 /**
314  * An enum that represents the priority at which we want a transaction to confirm used for feerate
315  * estimation.
316  */
317 typedef enum LDKConfirmationTarget {
318    /**
319     * We'd like a transaction to confirm in the future, but don't want to commit most of the fees
320     * required to do so yet. The remaining fees will come via a Child-Pays-For-Parent (CPFP) fee
321     * bump of the transaction.
322     *
323     * The feerate returned should be the absolute minimum feerate required to enter most node
324     * mempools across the network. Note that if you are not able to obtain this feerate estimate,
325     * you should likely use the furthest-out estimate allowed by your fee estimator.
326     */
327    LDKConfirmationTarget_MempoolMinimum,
328    /**
329     * We are happy with a transaction confirming slowly, at least within a day or so worth of
330     * blocks.
331     */
332    LDKConfirmationTarget_Background,
333    /**
334     * We'd like a transaction to confirm without major delayed, i.e., within the next 12-24 blocks.
335     */
336    LDKConfirmationTarget_Normal,
337    /**
338     * We'd like a transaction to confirm in the next few blocks.
339     */
340    LDKConfirmationTarget_HighPriority,
341    /**
342     * Must be last for serialization purposes
343     */
344    LDKConfirmationTarget_Sentinel,
345 } LDKConfirmationTarget;
346
347 /**
348  * Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
349  */
350 typedef enum LDKCreationError {
351    /**
352     * The supplied description string was longer than 639 __bytes__ (see [`Description::new`])
353     */
354    LDKCreationError_DescriptionTooLong,
355    /**
356     * The specified route has too many hops and can't be encoded
357     */
358    LDKCreationError_RouteTooLong,
359    /**
360     * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
361     */
362    LDKCreationError_TimestampOutOfBounds,
363    /**
364     * The supplied millisatoshi amount was greater than the total bitcoin supply.
365     */
366    LDKCreationError_InvalidAmount,
367    /**
368     * Route hints were required for this invoice and were missing. Applies to
369     * [phantom invoices].
370     *
371     * [phantom invoices]: crate::utils::create_phantom_invoice
372     */
373    LDKCreationError_MissingRouteHints,
374    /**
375     * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
376     *
377     * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
378     */
379    LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
380    /**
381     * Must be last for serialization purposes
382     */
383    LDKCreationError_Sentinel,
384 } LDKCreationError;
385
386 /**
387  * Enum representing the crypto currencies (or networks) supported by this library
388  */
389 typedef enum LDKCurrency {
390    /**
391     * Bitcoin mainnet
392     */
393    LDKCurrency_Bitcoin,
394    /**
395     * Bitcoin testnet
396     */
397    LDKCurrency_BitcoinTestnet,
398    /**
399     * Bitcoin regtest
400     */
401    LDKCurrency_Regtest,
402    /**
403     * Bitcoin simnet
404     */
405    LDKCurrency_Simnet,
406    /**
407     * Bitcoin signet
408     */
409    LDKCurrency_Signet,
410    /**
411     * Must be last for serialization purposes
412     */
413    LDKCurrency_Sentinel,
414 } LDKCurrency;
415
416 /**
417  * Describes the type of HTLC claim as determined by analyzing the witness.
418  */
419 typedef enum LDKHTLCClaim {
420    /**
421     * Claims an offered output on a commitment transaction through the timeout path.
422     */
423    LDKHTLCClaim_OfferedTimeout,
424    /**
425     * Claims an offered output on a commitment transaction through the success path.
426     */
427    LDKHTLCClaim_OfferedPreimage,
428    /**
429     * Claims an accepted output on a commitment transaction through the timeout path.
430     */
431    LDKHTLCClaim_AcceptedTimeout,
432    /**
433     * Claims an accepted output on a commitment transaction through the success path.
434     */
435    LDKHTLCClaim_AcceptedPreimage,
436    /**
437     * Claims an offered/accepted output on a commitment transaction through the revocation path.
438     */
439    LDKHTLCClaim_Revocation,
440    /**
441     * Must be last for serialization purposes
442     */
443    LDKHTLCClaim_Sentinel,
444 } LDKHTLCClaim;
445
446 /**
447  * Represents an IO Error. Note that some information is lost in the conversion from Rust.
448  */
449 typedef enum LDKIOError {
450    LDKIOError_NotFound,
451    LDKIOError_PermissionDenied,
452    LDKIOError_ConnectionRefused,
453    LDKIOError_ConnectionReset,
454    LDKIOError_ConnectionAborted,
455    LDKIOError_NotConnected,
456    LDKIOError_AddrInUse,
457    LDKIOError_AddrNotAvailable,
458    LDKIOError_BrokenPipe,
459    LDKIOError_AlreadyExists,
460    LDKIOError_WouldBlock,
461    LDKIOError_InvalidInput,
462    LDKIOError_InvalidData,
463    LDKIOError_TimedOut,
464    LDKIOError_WriteZero,
465    LDKIOError_Interrupted,
466    LDKIOError_Other,
467    LDKIOError_UnexpectedEof,
468    /**
469     * Must be last for serialization purposes
470     */
471    LDKIOError_Sentinel,
472 } LDKIOError;
473
474 /**
475  * An enum representing the available verbosity levels of the logger.
476  */
477 typedef enum LDKLevel {
478    /**
479     * Designates extremely verbose information, including gossip-induced messages
480     */
481    LDKLevel_Gossip,
482    /**
483     * Designates very low priority, often extremely verbose, information
484     */
485    LDKLevel_Trace,
486    /**
487     * Designates lower priority information
488     */
489    LDKLevel_Debug,
490    /**
491     * Designates useful information
492     */
493    LDKLevel_Info,
494    /**
495     * Designates hazardous situations
496     */
497    LDKLevel_Warn,
498    /**
499     * Designates very serious errors
500     */
501    LDKLevel_Error,
502    /**
503     * Must be last for serialization purposes
504     */
505    LDKLevel_Sentinel,
506 } LDKLevel;
507
508 /**
509  * An enum representing the possible Bitcoin or test networks which we can run on
510  */
511 typedef enum LDKNetwork {
512    /**
513     * The main Bitcoin blockchain.
514     */
515    LDKNetwork_Bitcoin,
516    /**
517     * The testnet3 blockchain.
518     */
519    LDKNetwork_Testnet,
520    /**
521     * A local test blockchain.
522     */
523    LDKNetwork_Regtest,
524    /**
525     * A blockchain on which blocks are signed instead of mined.
526     */
527    LDKNetwork_Signet,
528    /**
529     * Must be last for serialization purposes
530     */
531    LDKNetwork_Sentinel,
532 } LDKNetwork;
533
534 /**
535  * The reason the payment failed. Used in [`Event::PaymentFailed`].
536  */
537 typedef enum LDKPaymentFailureReason {
538    /**
539     * The intended recipient rejected our payment.
540     */
541    LDKPaymentFailureReason_RecipientRejected,
542    /**
543     * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`].
544     *
545     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
546     */
547    LDKPaymentFailureReason_UserAbandoned,
548    /**
549     * We exhausted all of our retry attempts while trying to send the payment, or we
550     * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry
551     * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will
552     * have come before this.
553     *
554     * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout
555     */
556    LDKPaymentFailureReason_RetriesExhausted,
557    /**
558     * The payment expired while retrying, based on the provided
559     * [`PaymentParameters::expiry_time`].
560     *
561     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
562     */
563    LDKPaymentFailureReason_PaymentExpired,
564    /**
565     * We failed to find a route while retrying the payment.
566     */
567    LDKPaymentFailureReason_RouteNotFound,
568    /**
569     * This error should generally never happen. This likely means that there is a problem with
570     * your router.
571     */
572    LDKPaymentFailureReason_UnexpectedError,
573    /**
574     * Must be last for serialization purposes
575     */
576    LDKPaymentFailureReason_Sentinel,
577 } LDKPaymentFailureReason;
578
579 /**
580  * Specifies the recipient of an invoice.
581  *
582  * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
583  * the invoice.
584  */
585 typedef enum LDKRecipient {
586    /**
587     * The invoice should be signed with the local node secret key.
588     */
589    LDKRecipient_Node,
590    /**
591     * The invoice should be signed with the phantom node secret key. This secret key must be the
592     * same for all nodes participating in the [phantom node payment].
593     *
594     * [phantom node payment]: PhantomKeysManager
595     */
596    LDKRecipient_PhantomNode,
597    /**
598     * Must be last for serialization purposes
599     */
600    LDKRecipient_Sentinel,
601 } LDKRecipient;
602
603 /**
604  * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
605  * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
606  *
607  * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
608  * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
609  * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
610  */
611 typedef enum LDKRetryableSendFailure {
612    /**
613     * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
614     * that this error is *not* caused by [`Retry::Timeout`].
615     *
616     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
617     */
618    LDKRetryableSendFailure_PaymentExpired,
619    /**
620     * We were unable to find a route to the destination.
621     */
622    LDKRetryableSendFailure_RouteNotFound,
623    /**
624     * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
625     * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
626     *
627     * [`PaymentId`]: crate::ln::channelmanager::PaymentId
628     * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
629     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
630     */
631    LDKRetryableSendFailure_DuplicatePayment,
632    /**
633     * Must be last for serialization purposes
634     */
635    LDKRetryableSendFailure_Sentinel,
636 } LDKRetryableSendFailure;
637
638 /**
639  * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
640  */
641 typedef enum LDKSecp256k1Error {
642    /**
643     * Signature failed verification
644     */
645    LDKSecp256k1Error_IncorrectSignature,
646    /**
647     * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
648     */
649    LDKSecp256k1Error_InvalidMessage,
650    /**
651     * Bad public key
652     */
653    LDKSecp256k1Error_InvalidPublicKey,
654    /**
655     * Bad signature
656     */
657    LDKSecp256k1Error_InvalidSignature,
658    /**
659     * Bad secret key
660     */
661    LDKSecp256k1Error_InvalidSecretKey,
662    /**
663     * Bad shared secret.
664     */
665    LDKSecp256k1Error_InvalidSharedSecret,
666    /**
667     * Bad recovery id
668     */
669    LDKSecp256k1Error_InvalidRecoveryId,
670    /**
671     * Invalid tweak for add_assign or mul_assign
672     */
673    LDKSecp256k1Error_InvalidTweak,
674    /**
675     * Didn't pass enough memory to context creation with preallocated memory
676     */
677    LDKSecp256k1Error_NotEnoughMemory,
678    /**
679     * Bad set of public keys.
680     */
681    LDKSecp256k1Error_InvalidPublicKeySum,
682    /**
683     * The only valid parity values are 0 or 1.
684     */
685    LDKSecp256k1Error_InvalidParityValue,
686    /**
687     * Must be last for serialization purposes
688     */
689    LDKSecp256k1Error_Sentinel,
690 } LDKSecp256k1Error;
691
692 /**
693  * SI prefixes for the human readable part
694  */
695 typedef enum LDKSiPrefix {
696    /**
697     * 10^-3
698     */
699    LDKSiPrefix_Milli,
700    /**
701     * 10^-6
702     */
703    LDKSiPrefix_Micro,
704    /**
705     * 10^-9
706     */
707    LDKSiPrefix_Nano,
708    /**
709     * 10^-12
710     */
711    LDKSiPrefix_Pico,
712    /**
713     * Must be last for serialization purposes
714     */
715    LDKSiPrefix_Sentinel,
716 } LDKSiPrefix;
717
718 /**
719  * [`SocketAddress`] error variants
720  */
721 typedef enum LDKSocketAddressParseError {
722    /**
723     * Socket address (IPv4/IPv6) parsing error
724     */
725    LDKSocketAddressParseError_SocketAddrParse,
726    /**
727     * Invalid input format
728     */
729    LDKSocketAddressParseError_InvalidInput,
730    /**
731     * Invalid port
732     */
733    LDKSocketAddressParseError_InvalidPort,
734    /**
735     * Invalid onion v3 address
736     */
737    LDKSocketAddressParseError_InvalidOnionV3,
738    /**
739     * Must be last for serialization purposes
740     */
741    LDKSocketAddressParseError_Sentinel,
742 } LDKSocketAddressParseError;
743
744 /**
745  * An error when accessing the chain via [`UtxoLookup`].
746  */
747 typedef enum LDKUtxoLookupError {
748    /**
749     * The requested chain is unknown.
750     */
751    LDKUtxoLookupError_UnknownChain,
752    /**
753     * The requested transaction doesn't exist or hasn't confirmed.
754     */
755    LDKUtxoLookupError_UnknownTx,
756    /**
757     * Must be last for serialization purposes
758     */
759    LDKUtxoLookupError_Sentinel,
760 } LDKUtxoLookupError;
761
762 /**
763  * A Rust str object, ie a reference to a UTF8-valid string.
764  * This is *not* null-terminated so cannot be used directly as a C string!
765  */
766 typedef struct LDKStr {
767    /**
768     * A pointer to the string's bytes, in UTF8 encoding
769     */
770    const uint8_t *chars;
771    /**
772     * The number of bytes (not characters!) pointed to by `chars`
773     */
774    uintptr_t len;
775    /**
776     * Whether the data pointed to by `chars` should be freed or not.
777     */
778    bool chars_is_owned;
779 } LDKStr;
780
781 /**
782  * A 16-byte byte array.
783  */
784 typedef struct LDKSixteenBytes {
785    /**
786     * The sixteen bytes
787     */
788    uint8_t data[16];
789 } LDKSixteenBytes;
790
791 /**
792  * Unsigned, 128-bit integer.
793  *
794  * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
795  * See https://github.com/rust-lang/rust/issues/54341 for more details.
796  */
797 typedef struct LDKU128 {
798    /**
799     * The 128-bit integer, as 16 little-endian bytes
800     */
801    uint8_t le_bytes[16];
802 } LDKU128;
803
804 /**
805  * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
806  */
807 typedef struct LDKBigEndianScalar {
808    /**
809     * The bytes of the scalar value.
810     */
811    uint8_t big_endian_bytes[32];
812 } LDKBigEndianScalar;
813
814 /**
815  * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
816  * look up the corresponding function in rust-lightning's docs.
817  */
818 typedef struct LDKThirtyTwoBytes {
819    /**
820     * The thirty-two bytes
821     */
822    uint8_t data[32];
823 } LDKThirtyTwoBytes;
824
825 /**
826  * Represents an error returned from the bech32 library during validation of some bech32 data
827  */
828 typedef enum LDKBech32Error_Tag {
829    /**
830     * String does not contain the separator character
831     */
832    LDKBech32Error_MissingSeparator,
833    /**
834     * The checksum does not match the rest of the data
835     */
836    LDKBech32Error_InvalidChecksum,
837    /**
838     * The data or human-readable part is too long or too short
839     */
840    LDKBech32Error_InvalidLength,
841    /**
842     * Some part of the string contains an invalid character
843     */
844    LDKBech32Error_InvalidChar,
845    /**
846     * Some part of the data has an invalid value
847     */
848    LDKBech32Error_InvalidData,
849    /**
850     * The bit conversion failed due to a padding issue
851     */
852    LDKBech32Error_InvalidPadding,
853    /**
854     * The whole string must be of one case
855     */
856    LDKBech32Error_MixedCase,
857    /**
858     * Must be last for serialization purposes
859     */
860    LDKBech32Error_Sentinel,
861 } LDKBech32Error_Tag;
862
863 typedef struct LDKBech32Error {
864    LDKBech32Error_Tag tag;
865    union {
866       struct {
867          uint32_t invalid_char;
868       };
869       struct {
870          uint8_t invalid_data;
871       };
872    };
873 } LDKBech32Error;
874
875 /**
876  * A serialized transaction, in (pointer, length) form.
877  *
878  * This type optionally owns its own memory, and thus the semantics around access change based on
879  * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
880  * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
881  * access to the buffer after the scope in which the object was provided to you is invalid. eg,
882  * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
883  * you would be invalid.
884  *
885  * Note that, while it may change in the future, because transactions on the Rust side are stored
886  * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
887  * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
888  * `data_is_owned` either set or unset at your discretion.
889  */
890 typedef struct LDKTransaction {
891    /**
892     * The serialized transaction data.
893     *
894     * This is non-const for your convenience, an object passed to Rust is never written to.
895     */
896    uint8_t *data;
897    /**
898     * The length of the serialized transaction
899     */
900    uintptr_t datalen;
901    /**
902     * Whether the data pointed to by `data` should be freed or not.
903     */
904    bool data_is_owned;
905 } LDKTransaction;
906
907 /**
908  * A serialized witness.
909  */
910 typedef struct LDKWitness {
911    /**
912     * The serialized transaction data.
913     *
914     * This is non-const for your convenience, an object passed to Rust is never written to.
915     */
916    uint8_t *data;
917    /**
918     * The length of the serialized transaction
919     */
920    uintptr_t datalen;
921    /**
922     * Whether the data pointed to by `data` should be freed or not.
923     */
924    bool data_is_owned;
925 } LDKWitness;
926
927 /**
928  * A dynamically-allocated array of u8s of arbitrary size.
929  * This corresponds to std::vector in C++
930  */
931 typedef struct LDKCVec_u8Z {
932    /**
933     * The elements in the array.
934     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
935     */
936    uint8_t *data;
937    /**
938     * The number of elements pointed to by `data`.
939     */
940    uintptr_t datalen;
941 } LDKCVec_u8Z;
942
943 /**
944  * An input to a transaction.
945  *
946  * This contains the witness, the scriptSig and the previous outpoint and represents a single
947  * input to a transaction
948  */
949 typedef struct LDKTxIn {
950    /**
951     * The witness which includes any signatures required to spend a segwit output.
952     */
953    struct LDKWitness witness;
954    /**
955     * The script_sig which includes signatures requires to spend a pre-segwit output (or a
956     * P2SH-wrapped segwit output).
957     */
958    struct LDKCVec_u8Z script_sig;
959    /**
960     * The sequence number of the transaction input
961     */
962    uint32_t sequence;
963    /**
964     * The txid of the transaction being spent.
965     */
966    struct LDKThirtyTwoBytes previous_txid;
967    /**
968     * The output index of the transaction being spent.
969     */
970    uint32_t previous_vout;
971 } LDKTxIn;
972
973 /**
974  * A transaction output including a scriptPubKey and value.
975  * This type *does* own its own memory, so must be free'd appropriately.
976  */
977 typedef struct LDKTxOut {
978    /**
979     * The script_pubkey in this output
980     */
981    struct LDKCVec_u8Z script_pubkey;
982    /**
983     * The value, in satoshis, of this output
984     */
985    uint64_t value;
986 } LDKTxOut;
987
988 /**
989  * An enum which can either contain a u64 or not
990  */
991 typedef enum LDKCOption_u64Z_Tag {
992    /**
993     * When we're in this state, this COption_u64Z contains a u64
994     */
995    LDKCOption_u64Z_Some,
996    /**
997     * When we're in this state, this COption_u64Z contains nothing
998     */
999    LDKCOption_u64Z_None,
1000    /**
1001     * Must be last for serialization purposes
1002     */
1003    LDKCOption_u64Z_Sentinel,
1004 } LDKCOption_u64Z_Tag;
1005
1006 typedef struct LDKCOption_u64Z {
1007    LDKCOption_u64Z_Tag tag;
1008    union {
1009       struct {
1010          uint64_t some;
1011       };
1012    };
1013 } LDKCOption_u64Z;
1014
1015
1016
1017 /**
1018  * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
1019  * identity of the recipient.
1020  */
1021 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1022    /**
1023     * A pointer to the opaque Rust object.
1024     * Nearly everywhere, inner must be non-null, however in places where
1025     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1026     */
1027    LDKnativeBlindedPath *inner;
1028    /**
1029     * Indicates that this is the only struct which contains the same pointer.
1030     * Rust functions which take ownership of an object provided via an argument require
1031     * this to be true and invalidate the object pointed to by inner.
1032     */
1033    bool is_owned;
1034 } LDKBlindedPath;
1035
1036 /**
1037  * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
1038  * This corresponds to std::vector in C++
1039  */
1040 typedef struct LDKCVec_BlindedPathZ {
1041    /**
1042     * The elements in the array.
1043     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1044     */
1045    struct LDKBlindedPath *data;
1046    /**
1047     * The number of elements pointed to by `data`.
1048     */
1049    uintptr_t datalen;
1050 } LDKCVec_BlindedPathZ;
1051
1052
1053
1054 /**
1055  * A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`].
1056  *
1057  * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to
1058  * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a
1059  * bitcoin ATM.
1060  *
1061  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1062  * [`Offer`]: crate::offers::offer::Offer
1063  */
1064 typedef struct MUST_USE_STRUCT LDKRefund {
1065    /**
1066     * A pointer to the opaque Rust object.
1067     * Nearly everywhere, inner must be non-null, however in places where
1068     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1069     */
1070    LDKnativeRefund *inner;
1071    /**
1072     * Indicates that this is the only struct which contains the same pointer.
1073     * Rust functions which take ownership of an object provided via an argument require
1074     * this to be true and invalidate the object pointed to by inner.
1075     */
1076    bool is_owned;
1077 } LDKRefund;
1078
1079
1080
1081 /**
1082  * Error when parsing a bech32 encoded message using [`str::parse`].
1083  */
1084 typedef struct MUST_USE_STRUCT LDKBolt12ParseError {
1085    /**
1086     * A pointer to the opaque Rust object.
1087     * Nearly everywhere, inner must be non-null, however in places where
1088     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1089     */
1090    LDKnativeBolt12ParseError *inner;
1091    /**
1092     * Indicates that this is the only struct which contains the same pointer.
1093     * Rust functions which take ownership of an object provided via an argument require
1094     * this to be true and invalidate the object pointed to by inner.
1095     */
1096    bool is_owned;
1097 } LDKBolt12ParseError;
1098
1099 /**
1100  * The contents of CResult_RefundBolt12ParseErrorZ
1101  */
1102 typedef union LDKCResult_RefundBolt12ParseErrorZPtr {
1103    /**
1104     * A pointer to the contents in the success state.
1105     * Reading from this pointer when `result_ok` is not set is undefined.
1106     */
1107    struct LDKRefund *result;
1108    /**
1109     * A pointer to the contents in the error state.
1110     * Reading from this pointer when `result_ok` is set is undefined.
1111     */
1112    struct LDKBolt12ParseError *err;
1113 } LDKCResult_RefundBolt12ParseErrorZPtr;
1114
1115 /**
1116  * A CResult_RefundBolt12ParseErrorZ represents the result of a fallible operation,
1117  * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
1118  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1119  */
1120 typedef struct LDKCResult_RefundBolt12ParseErrorZ {
1121    /**
1122     * The contents of this CResult_RefundBolt12ParseErrorZ, accessible via either
1123     * `err` or `result` depending on the state of `result_ok`.
1124     */
1125    union LDKCResult_RefundBolt12ParseErrorZPtr contents;
1126    /**
1127     * Whether this CResult_RefundBolt12ParseErrorZ represents a success state.
1128     */
1129    bool result_ok;
1130 } LDKCResult_RefundBolt12ParseErrorZ;
1131
1132 /**
1133  * Strategies available to retry payment path failures.
1134  */
1135 typedef enum LDKRetry_Tag {
1136    /**
1137     * Max number of attempts to retry payment.
1138     *
1139     * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
1140     * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
1141     * were retried along a route from a single call to [`Router::find_route_with_id`].
1142     */
1143    LDKRetry_Attempts,
1144    /**
1145     * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
1146     * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
1147     *
1148     * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
1149     */
1150    LDKRetry_Timeout,
1151    /**
1152     * Must be last for serialization purposes
1153     */
1154    LDKRetry_Sentinel,
1155 } LDKRetry_Tag;
1156
1157 typedef struct MUST_USE_STRUCT LDKRetry {
1158    LDKRetry_Tag tag;
1159    union {
1160       struct {
1161          uint32_t attempts;
1162       };
1163       struct {
1164          uint64_t timeout;
1165       };
1166    };
1167 } LDKRetry;
1168
1169 /**
1170  * An error in decoding a message or struct.
1171  */
1172 typedef enum LDKDecodeError_Tag {
1173    /**
1174     * A version byte specified something we don't know how to handle.
1175     *
1176     * Includes unknown realm byte in an onion hop data packet.
1177     */
1178    LDKDecodeError_UnknownVersion,
1179    /**
1180     * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1181     */
1182    LDKDecodeError_UnknownRequiredFeature,
1183    /**
1184     * Value was invalid.
1185     *
1186     * For example, a byte which was supposed to be a bool was something other than a 0
1187     * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1188     * syntactically incorrect, etc.
1189     */
1190    LDKDecodeError_InvalidValue,
1191    /**
1192     * The buffer to be read was too short.
1193     */
1194    LDKDecodeError_ShortRead,
1195    /**
1196     * A length descriptor in the packet didn't describe the later data correctly.
1197     */
1198    LDKDecodeError_BadLengthDescriptor,
1199    /**
1200     * Error from [`std::io`].
1201     */
1202    LDKDecodeError_Io,
1203    /**
1204     * The message included zlib-compressed values, which we don't support.
1205     */
1206    LDKDecodeError_UnsupportedCompression,
1207    /**
1208     * Must be last for serialization purposes
1209     */
1210    LDKDecodeError_Sentinel,
1211 } LDKDecodeError_Tag;
1212
1213 typedef struct MUST_USE_STRUCT LDKDecodeError {
1214    LDKDecodeError_Tag tag;
1215    union {
1216       struct {
1217          enum LDKIOError io;
1218       };
1219    };
1220 } LDKDecodeError;
1221
1222 /**
1223  * The contents of CResult_RetryDecodeErrorZ
1224  */
1225 typedef union LDKCResult_RetryDecodeErrorZPtr {
1226    /**
1227     * A pointer to the contents in the success state.
1228     * Reading from this pointer when `result_ok` is not set is undefined.
1229     */
1230    struct LDKRetry *result;
1231    /**
1232     * A pointer to the contents in the error state.
1233     * Reading from this pointer when `result_ok` is set is undefined.
1234     */
1235    struct LDKDecodeError *err;
1236 } LDKCResult_RetryDecodeErrorZPtr;
1237
1238 /**
1239  * A CResult_RetryDecodeErrorZ represents the result of a fallible operation,
1240  * containing a crate::lightning::ln::outbound_payment::Retry on success and a crate::lightning::ln::msgs::DecodeError on failure.
1241  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1242  */
1243 typedef struct LDKCResult_RetryDecodeErrorZ {
1244    /**
1245     * The contents of this CResult_RetryDecodeErrorZ, accessible via either
1246     * `err` or `result` depending on the state of `result_ok`.
1247     */
1248    union LDKCResult_RetryDecodeErrorZPtr contents;
1249    /**
1250     * Whether this CResult_RetryDecodeErrorZ represents a success state.
1251     */
1252    bool result_ok;
1253 } LDKCResult_RetryDecodeErrorZ;
1254
1255
1256
1257 /**
1258  * A script pubkey for shutting down a channel as defined by [BOLT #2].
1259  *
1260  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1261  */
1262 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1263    /**
1264     * A pointer to the opaque Rust object.
1265     * Nearly everywhere, inner must be non-null, however in places where
1266     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1267     */
1268    LDKnativeShutdownScript *inner;
1269    /**
1270     * Indicates that this is the only struct which contains the same pointer.
1271     * Rust functions which take ownership of an object provided via an argument require
1272     * this to be true and invalidate the object pointed to by inner.
1273     */
1274    bool is_owned;
1275 } LDKShutdownScript;
1276
1277 /**
1278  * Indicates an error on the client's part (usually some variant of attempting to use too-low or
1279  * too-high values)
1280  */
1281 typedef enum LDKAPIError_Tag {
1282    /**
1283     * Indicates the API was wholly misused (see err for more). Cases where these can be returned
1284     * are documented, but generally indicates some precondition of a function was violated.
1285     */
1286    LDKAPIError_APIMisuseError,
1287    /**
1288     * Due to a high feerate, we were unable to complete the request.
1289     * For example, this may be returned if the feerate implies we cannot open a channel at the
1290     * requested value, but opening a larger channel would succeed.
1291     */
1292    LDKAPIError_FeeRateTooHigh,
1293    /**
1294     * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
1295     * too-many-hops, etc).
1296     */
1297    LDKAPIError_InvalidRoute,
1298    /**
1299     * We were unable to complete the request as the Channel required to do so is unable to
1300     * complete the request (or was not found). This can take many forms, including disconnected
1301     * peer, channel at capacity, channel shutting down, etc.
1302     */
1303    LDKAPIError_ChannelUnavailable,
1304    /**
1305     * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
1306     * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
1307     * monitor update is awaiting async resolution. Once it resolves the attempted action should
1308     * complete automatically.
1309     *
1310     * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
1311     * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
1312     * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
1313     */
1314    LDKAPIError_MonitorUpdateInProgress,
1315    /**
1316     * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
1317     * with the channel counterparty as negotiated in [`InitFeatures`].
1318     *
1319     * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
1320     * a channel or cooperatively close one with this peer (and will have to force-close instead).
1321     *
1322     * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
1323     * [`InitFeatures`]: crate::ln::features::InitFeatures
1324     */
1325    LDKAPIError_IncompatibleShutdownScript,
1326    /**
1327     * Must be last for serialization purposes
1328     */
1329    LDKAPIError_Sentinel,
1330 } LDKAPIError_Tag;
1331
1332 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
1333    /**
1334     * A human-readable error message
1335     */
1336    struct LDKStr err;
1337 } LDKAPIError_LDKAPIMisuseError_Body;
1338
1339 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
1340    /**
1341     * A human-readable error message
1342     */
1343    struct LDKStr err;
1344    /**
1345     * The feerate which was too high.
1346     */
1347    uint32_t feerate;
1348 } LDKAPIError_LDKFeeRateTooHigh_Body;
1349
1350 typedef struct LDKAPIError_LDKInvalidRoute_Body {
1351    /**
1352     * A human-readable error message
1353     */
1354    struct LDKStr err;
1355 } LDKAPIError_LDKInvalidRoute_Body;
1356
1357 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
1358    /**
1359     * A human-readable error message
1360     */
1361    struct LDKStr err;
1362 } LDKAPIError_LDKChannelUnavailable_Body;
1363
1364 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
1365    /**
1366     * The incompatible shutdown script.
1367     */
1368    struct LDKShutdownScript script;
1369 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
1370
1371 typedef struct MUST_USE_STRUCT LDKAPIError {
1372    LDKAPIError_Tag tag;
1373    union {
1374       LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
1375       LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
1376       LDKAPIError_LDKInvalidRoute_Body invalid_route;
1377       LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
1378       LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
1379    };
1380 } LDKAPIError;
1381
1382 /**
1383  * The contents of CResult_NoneAPIErrorZ
1384  */
1385 typedef union LDKCResult_NoneAPIErrorZPtr {
1386    /**
1387     * Note that this value is always NULL, as there are no contents in the OK variant
1388     */
1389    void *result;
1390    /**
1391     * A pointer to the contents in the error state.
1392     * Reading from this pointer when `result_ok` is set is undefined.
1393     */
1394    struct LDKAPIError *err;
1395 } LDKCResult_NoneAPIErrorZPtr;
1396
1397 /**
1398  * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
1399  * containing a () on success and a crate::lightning::util::errors::APIError on failure.
1400  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1401  */
1402 typedef struct LDKCResult_NoneAPIErrorZ {
1403    /**
1404     * The contents of this CResult_NoneAPIErrorZ, accessible via either
1405     * `err` or `result` depending on the state of `result_ok`.
1406     */
1407    union LDKCResult_NoneAPIErrorZPtr contents;
1408    /**
1409     * Whether this CResult_NoneAPIErrorZ represents a success state.
1410     */
1411    bool result_ok;
1412 } LDKCResult_NoneAPIErrorZ;
1413
1414 /**
1415  * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
1416  * This corresponds to std::vector in C++
1417  */
1418 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
1419    /**
1420     * The elements in the array.
1421     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1422     */
1423    struct LDKCResult_NoneAPIErrorZ *data;
1424    /**
1425     * The number of elements pointed to by `data`.
1426     */
1427    uintptr_t datalen;
1428 } LDKCVec_CResult_NoneAPIErrorZZ;
1429
1430 /**
1431  * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
1432  * This corresponds to std::vector in C++
1433  */
1434 typedef struct LDKCVec_APIErrorZ {
1435    /**
1436     * The elements in the array.
1437     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1438     */
1439    struct LDKAPIError *data;
1440    /**
1441     * The number of elements pointed to by `data`.
1442     */
1443    uintptr_t datalen;
1444 } LDKCVec_APIErrorZ;
1445
1446 /**
1447  * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
1448  */
1449 typedef enum LDKCOption_ThirtyTwoBytesZ_Tag {
1450    /**
1451     * When we're in this state, this COption_ThirtyTwoBytesZ contains a crate::c_types::ThirtyTwoBytes
1452     */
1453    LDKCOption_ThirtyTwoBytesZ_Some,
1454    /**
1455     * When we're in this state, this COption_ThirtyTwoBytesZ contains nothing
1456     */
1457    LDKCOption_ThirtyTwoBytesZ_None,
1458    /**
1459     * Must be last for serialization purposes
1460     */
1461    LDKCOption_ThirtyTwoBytesZ_Sentinel,
1462 } LDKCOption_ThirtyTwoBytesZ_Tag;
1463
1464 typedef struct LDKCOption_ThirtyTwoBytesZ {
1465    LDKCOption_ThirtyTwoBytesZ_Tag tag;
1466    union {
1467       struct {
1468          struct LDKThirtyTwoBytes some;
1469       };
1470    };
1471 } LDKCOption_ThirtyTwoBytesZ;
1472
1473 /**
1474  * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
1475  */
1476 typedef enum LDKCOption_CVec_u8ZZ_Tag {
1477    /**
1478     * When we're in this state, this COption_CVec_u8ZZ contains a crate::c_types::derived::CVec_u8Z
1479     */
1480    LDKCOption_CVec_u8ZZ_Some,
1481    /**
1482     * When we're in this state, this COption_CVec_u8ZZ contains nothing
1483     */
1484    LDKCOption_CVec_u8ZZ_None,
1485    /**
1486     * Must be last for serialization purposes
1487     */
1488    LDKCOption_CVec_u8ZZ_Sentinel,
1489 } LDKCOption_CVec_u8ZZ_Tag;
1490
1491 typedef struct LDKCOption_CVec_u8ZZ {
1492    LDKCOption_CVec_u8ZZ_Tag tag;
1493    union {
1494       struct {
1495          struct LDKCVec_u8Z some;
1496       };
1497    };
1498 } LDKCOption_CVec_u8ZZ;
1499
1500
1501
1502 /**
1503  * Information which is provided, encrypted, to the payment recipient when sending HTLCs.
1504  *
1505  * This should generally be constructed with data communicated to us from the recipient (via a
1506  * BOLT11 or BOLT12 invoice).
1507  */
1508 typedef struct MUST_USE_STRUCT LDKRecipientOnionFields {
1509    /**
1510     * A pointer to the opaque Rust object.
1511     * Nearly everywhere, inner must be non-null, however in places where
1512     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1513     */
1514    LDKnativeRecipientOnionFields *inner;
1515    /**
1516     * Indicates that this is the only struct which contains the same pointer.
1517     * Rust functions which take ownership of an object provided via an argument require
1518     * this to be true and invalidate the object pointed to by inner.
1519     */
1520    bool is_owned;
1521 } LDKRecipientOnionFields;
1522
1523 /**
1524  * The contents of CResult_RecipientOnionFieldsDecodeErrorZ
1525  */
1526 typedef union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr {
1527    /**
1528     * A pointer to the contents in the success state.
1529     * Reading from this pointer when `result_ok` is not set is undefined.
1530     */
1531    struct LDKRecipientOnionFields *result;
1532    /**
1533     * A pointer to the contents in the error state.
1534     * Reading from this pointer when `result_ok` is set is undefined.
1535     */
1536    struct LDKDecodeError *err;
1537 } LDKCResult_RecipientOnionFieldsDecodeErrorZPtr;
1538
1539 /**
1540  * A CResult_RecipientOnionFieldsDecodeErrorZ represents the result of a fallible operation,
1541  * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
1542  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1543  */
1544 typedef struct LDKCResult_RecipientOnionFieldsDecodeErrorZ {
1545    /**
1546     * The contents of this CResult_RecipientOnionFieldsDecodeErrorZ, accessible via either
1547     * `err` or `result` depending on the state of `result_ok`.
1548     */
1549    union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr contents;
1550    /**
1551     * Whether this CResult_RecipientOnionFieldsDecodeErrorZ represents a success state.
1552     */
1553    bool result_ok;
1554 } LDKCResult_RecipientOnionFieldsDecodeErrorZ;
1555
1556 /**
1557  * A tuple of 2 elements. See the individual fields for the types contained.
1558  */
1559 typedef struct LDKC2Tuple_u64CVec_u8ZZ {
1560    /**
1561     * The element at position 0
1562     */
1563    uint64_t a;
1564    /**
1565     * The element at position 1
1566     */
1567    struct LDKCVec_u8Z b;
1568 } LDKC2Tuple_u64CVec_u8ZZ;
1569
1570 /**
1571  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u64CVec_u8ZZs of arbitrary size.
1572  * This corresponds to std::vector in C++
1573  */
1574 typedef struct LDKCVec_C2Tuple_u64CVec_u8ZZZ {
1575    /**
1576     * The elements in the array.
1577     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1578     */
1579    struct LDKC2Tuple_u64CVec_u8ZZ *data;
1580    /**
1581     * The number of elements pointed to by `data`.
1582     */
1583    uintptr_t datalen;
1584 } LDKCVec_C2Tuple_u64CVec_u8ZZZ;
1585
1586 /**
1587  * The contents of CResult_RecipientOnionFieldsNoneZ
1588  */
1589 typedef union LDKCResult_RecipientOnionFieldsNoneZPtr {
1590    /**
1591     * A pointer to the contents in the success state.
1592     * Reading from this pointer when `result_ok` is not set is undefined.
1593     */
1594    struct LDKRecipientOnionFields *result;
1595    /**
1596     * Note that this value is always NULL, as there are no contents in the Err variant
1597     */
1598    void *err;
1599 } LDKCResult_RecipientOnionFieldsNoneZPtr;
1600
1601 /**
1602  * A CResult_RecipientOnionFieldsNoneZ represents the result of a fallible operation,
1603  * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a () on failure.
1604  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1605  */
1606 typedef struct LDKCResult_RecipientOnionFieldsNoneZ {
1607    /**
1608     * The contents of this CResult_RecipientOnionFieldsNoneZ, accessible via either
1609     * `err` or `result` depending on the state of `result_ok`.
1610     */
1611    union LDKCResult_RecipientOnionFieldsNoneZPtr contents;
1612    /**
1613     * Whether this CResult_RecipientOnionFieldsNoneZ represents a success state.
1614     */
1615    bool result_ok;
1616 } LDKCResult_RecipientOnionFieldsNoneZ;
1617
1618 /**
1619  * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1620  * This corresponds to std::vector in C++
1621  */
1622 typedef struct LDKCVec_ThirtyTwoBytesZ {
1623    /**
1624     * The elements in the array.
1625     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1626     */
1627    struct LDKThirtyTwoBytes *data;
1628    /**
1629     * The number of elements pointed to by `data`.
1630     */
1631    uintptr_t datalen;
1632 } LDKCVec_ThirtyTwoBytesZ;
1633
1634 /**
1635  * An enum which can either contain a crate::c_types::derived::CVec_ThirtyTwoBytesZ or not
1636  */
1637 typedef enum LDKCOption_CVec_ThirtyTwoBytesZZ_Tag {
1638    /**
1639     * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains a crate::c_types::derived::CVec_ThirtyTwoBytesZ
1640     */
1641    LDKCOption_CVec_ThirtyTwoBytesZZ_Some,
1642    /**
1643     * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains nothing
1644     */
1645    LDKCOption_CVec_ThirtyTwoBytesZZ_None,
1646    /**
1647     * Must be last for serialization purposes
1648     */
1649    LDKCOption_CVec_ThirtyTwoBytesZZ_Sentinel,
1650 } LDKCOption_CVec_ThirtyTwoBytesZZ_Tag;
1651
1652 typedef struct LDKCOption_CVec_ThirtyTwoBytesZZ {
1653    LDKCOption_CVec_ThirtyTwoBytesZZ_Tag tag;
1654    union {
1655       struct {
1656          struct LDKCVec_ThirtyTwoBytesZ some;
1657       };
1658    };
1659 } LDKCOption_CVec_ThirtyTwoBytesZZ;
1660
1661 /**
1662  * The contents of CResult_ThirtyTwoBytesNoneZ
1663  */
1664 typedef union LDKCResult_ThirtyTwoBytesNoneZPtr {
1665    /**
1666     * A pointer to the contents in the success state.
1667     * Reading from this pointer when `result_ok` is not set is undefined.
1668     */
1669    struct LDKThirtyTwoBytes *result;
1670    /**
1671     * Note that this value is always NULL, as there are no contents in the Err variant
1672     */
1673    void *err;
1674 } LDKCResult_ThirtyTwoBytesNoneZPtr;
1675
1676 /**
1677  * A CResult_ThirtyTwoBytesNoneZ represents the result of a fallible operation,
1678  * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
1679  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1680  */
1681 typedef struct LDKCResult_ThirtyTwoBytesNoneZ {
1682    /**
1683     * The contents of this CResult_ThirtyTwoBytesNoneZ, accessible via either
1684     * `err` or `result` depending on the state of `result_ok`.
1685     */
1686    union LDKCResult_ThirtyTwoBytesNoneZPtr contents;
1687    /**
1688     * Whether this CResult_ThirtyTwoBytesNoneZ represents a success state.
1689     */
1690    bool result_ok;
1691 } LDKCResult_ThirtyTwoBytesNoneZ;
1692
1693
1694
1695 /**
1696  * Information needed to route a payment across a [`BlindedPath`].
1697  */
1698 typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
1699    /**
1700     * A pointer to the opaque Rust object.
1701     * Nearly everywhere, inner must be non-null, however in places where
1702     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1703     */
1704    LDKnativeBlindedPayInfo *inner;
1705    /**
1706     * Indicates that this is the only struct which contains the same pointer.
1707     * Rust functions which take ownership of an object provided via an argument require
1708     * this to be true and invalidate the object pointed to by inner.
1709     */
1710    bool is_owned;
1711 } LDKBlindedPayInfo;
1712
1713 /**
1714  * The contents of CResult_BlindedPayInfoDecodeErrorZ
1715  */
1716 typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
1717    /**
1718     * A pointer to the contents in the success state.
1719     * Reading from this pointer when `result_ok` is not set is undefined.
1720     */
1721    struct LDKBlindedPayInfo *result;
1722    /**
1723     * A pointer to the contents in the error state.
1724     * Reading from this pointer when `result_ok` is set is undefined.
1725     */
1726    struct LDKDecodeError *err;
1727 } LDKCResult_BlindedPayInfoDecodeErrorZPtr;
1728
1729 /**
1730  * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
1731  * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
1732  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1733  */
1734 typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
1735    /**
1736     * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
1737     * `err` or `result` depending on the state of `result_ok`.
1738     */
1739    union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
1740    /**
1741     * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
1742     */
1743    bool result_ok;
1744 } LDKCResult_BlindedPayInfoDecodeErrorZ;
1745
1746
1747
1748 /**
1749  * Information about a spendable output to a P2WSH script.
1750  *
1751  * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
1752  */
1753 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1754    /**
1755     * A pointer to the opaque Rust object.
1756     * Nearly everywhere, inner must be non-null, however in places where
1757     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1758     */
1759    LDKnativeDelayedPaymentOutputDescriptor *inner;
1760    /**
1761     * Indicates that this is the only struct which contains the same pointer.
1762     * Rust functions which take ownership of an object provided via an argument require
1763     * this to be true and invalidate the object pointed to by inner.
1764     */
1765    bool is_owned;
1766 } LDKDelayedPaymentOutputDescriptor;
1767
1768 /**
1769  * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
1770  */
1771 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
1772    /**
1773     * A pointer to the contents in the success state.
1774     * Reading from this pointer when `result_ok` is not set is undefined.
1775     */
1776    struct LDKDelayedPaymentOutputDescriptor *result;
1777    /**
1778     * A pointer to the contents in the error state.
1779     * Reading from this pointer when `result_ok` is set is undefined.
1780     */
1781    struct LDKDecodeError *err;
1782 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
1783
1784 /**
1785  * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1786  * containing a crate::lightning::sign::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1787  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1788  */
1789 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
1790    /**
1791     * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
1792     * `err` or `result` depending on the state of `result_ok`.
1793     */
1794    union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
1795    /**
1796     * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
1797     */
1798    bool result_ok;
1799 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
1800
1801
1802
1803 /**
1804  * Information about a spendable output to our \"payment key\".
1805  *
1806  * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
1807  */
1808 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1809    /**
1810     * A pointer to the opaque Rust object.
1811     * Nearly everywhere, inner must be non-null, however in places where
1812     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1813     */
1814    LDKnativeStaticPaymentOutputDescriptor *inner;
1815    /**
1816     * Indicates that this is the only struct which contains the same pointer.
1817     * Rust functions which take ownership of an object provided via an argument require
1818     * this to be true and invalidate the object pointed to by inner.
1819     */
1820    bool is_owned;
1821 } LDKStaticPaymentOutputDescriptor;
1822
1823 /**
1824  * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
1825  */
1826 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
1827    /**
1828     * A pointer to the contents in the success state.
1829     * Reading from this pointer when `result_ok` is not set is undefined.
1830     */
1831    struct LDKStaticPaymentOutputDescriptor *result;
1832    /**
1833     * A pointer to the contents in the error state.
1834     * Reading from this pointer when `result_ok` is set is undefined.
1835     */
1836    struct LDKDecodeError *err;
1837 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
1838
1839 /**
1840  * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1841  * containing a crate::lightning::sign::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1842  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1843  */
1844 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
1845    /**
1846     * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
1847     * `err` or `result` depending on the state of `result_ok`.
1848     */
1849    union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
1850    /**
1851     * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
1852     */
1853    bool result_ok;
1854 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
1855
1856
1857
1858 /**
1859  * A reference to a transaction output.
1860  *
1861  * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1862  * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
1863  */
1864 typedef struct MUST_USE_STRUCT LDKOutPoint {
1865    /**
1866     * A pointer to the opaque Rust object.
1867     * Nearly everywhere, inner must be non-null, however in places where
1868     * the Rust equivalent takes an Option, it may be set to null to indicate None.
1869     */
1870    LDKnativeOutPoint *inner;
1871    /**
1872     * Indicates that this is the only struct which contains the same pointer.
1873     * Rust functions which take ownership of an object provided via an argument require
1874     * this to be true and invalidate the object pointed to by inner.
1875     */
1876    bool is_owned;
1877 } LDKOutPoint;
1878
1879 /**
1880  * Describes the necessary information to spend a spendable output.
1881  *
1882  * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
1883  * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
1884  * to spend on-chain. The information needed to do this is provided in this enum, including the
1885  * outpoint describing which `txid` and output `index` is available, the full output which exists
1886  * at that `txid`/`index`, and any keys or other information required to sign.
1887  *
1888  * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
1889  */
1890 typedef enum LDKSpendableOutputDescriptor_Tag {
1891    /**
1892     * An output to a script which was provided via [`SignerProvider`] directly, either from
1893     * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
1894     * know how to spend it. No secret keys are provided as LDK was never given any key.
1895     * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1896     * on-chain using the payment preimage or after it has timed out.
1897     *
1898     * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
1899     * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
1900     */
1901    LDKSpendableOutputDescriptor_StaticOutput,
1902    /**
1903     * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
1904     * delay.
1905     *
1906     * The witness in the spending input should be:
1907     * ```bitcoin
1908     * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1909     * ```
1910     *
1911     * Note that the `nSequence` field in the spending input must be set to
1912     * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
1913     * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
1914     * the outpoint confirms, see [BIP
1915     * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
1916     * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
1917     * is reached.
1918     *
1919     * These are generally the result of a \"revocable\" output to us, spendable only by us unless
1920     * it is an output from an old state which we broadcast (which should never happen).
1921     *
1922     * To derive the delayed payment key which is used to sign this input, you must pass the
1923     * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
1924     * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
1925     * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The public key can be
1926     * generated without the secret key using [`chan_utils::derive_public_key`] and only the
1927     * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
1928     *
1929     * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
1930     * used in the witness script generation), you must pass the counterparty
1931     * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
1932     * [`ChannelSigner::provide_channel_parameters`]) and the provided
1933     * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
1934     * [`chan_utils::derive_public_revocation_key`].
1935     *
1936     * The witness script which is hashed and included in the output `script_pubkey` may be
1937     * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
1938     * as explained above), our delayed payment pubkey (derived as explained above), and the
1939     * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
1940     * [`chan_utils::get_revokeable_redeemscript`].
1941     */
1942    LDKSpendableOutputDescriptor_DelayedPaymentOutput,
1943    /**
1944     * An output spendable exclusively by our payment key (i.e., the private key that corresponds
1945     * to the `payment_point` in [`ChannelSigner::pubkeys`]). The output type depends on the
1946     * channel type negotiated.
1947     *
1948     * On an anchor outputs channel, the witness in the spending input is:
1949     * ```bitcoin
1950     * <BIP 143 signature> <witness script>
1951     * ```
1952     *
1953     * Otherwise, it is:
1954     * ```bitcoin
1955     * <BIP 143 signature> <payment key>
1956     * ```
1957     *
1958     * These are generally the result of our counterparty having broadcast the current state,
1959     * allowing us to claim the non-HTLC-encumbered outputs immediately, or after one confirmation
1960     * in the case of anchor outputs channels.
1961     */
1962    LDKSpendableOutputDescriptor_StaticPaymentOutput,
1963    /**
1964     * Must be last for serialization purposes
1965     */
1966    LDKSpendableOutputDescriptor_Sentinel,
1967 } LDKSpendableOutputDescriptor_Tag;
1968
1969 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
1970    /**
1971     * The outpoint which is spendable.
1972     */
1973    struct LDKOutPoint outpoint;
1974    /**
1975     * The output which is referenced by the given outpoint.
1976     */
1977    struct LDKTxOut output;
1978 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
1979
1980 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
1981    LDKSpendableOutputDescriptor_Tag tag;
1982    union {
1983       LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
1984       struct {
1985          struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
1986       };
1987       struct {
1988          struct LDKStaticPaymentOutputDescriptor static_payment_output;
1989       };
1990    };
1991 } LDKSpendableOutputDescriptor;
1992
1993 /**
1994  * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
1995  */
1996 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
1997    /**
1998     * A pointer to the contents in the success state.
1999     * Reading from this pointer when `result_ok` is not set is undefined.
2000     */
2001    struct LDKSpendableOutputDescriptor *result;
2002    /**
2003     * A pointer to the contents in the error state.
2004     * Reading from this pointer when `result_ok` is set is undefined.
2005     */
2006    struct LDKDecodeError *err;
2007 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
2008
2009 /**
2010  * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2011  * containing a crate::lightning::sign::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2012  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2013  */
2014 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
2015    /**
2016     * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
2017     * `err` or `result` depending on the state of `result_ok`.
2018     */
2019    union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
2020    /**
2021     * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
2022     */
2023    bool result_ok;
2024 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
2025
2026 /**
2027  * A dynamically-allocated array of crate::lightning::sign::SpendableOutputDescriptors of arbitrary size.
2028  * This corresponds to std::vector in C++
2029  */
2030 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2031    /**
2032     * The elements in the array.
2033     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2034     */
2035    struct LDKSpendableOutputDescriptor *data;
2036    /**
2037     * The number of elements pointed to by `data`.
2038     */
2039    uintptr_t datalen;
2040 } LDKCVec_SpendableOutputDescriptorZ;
2041
2042 /**
2043  * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
2044  * This corresponds to std::vector in C++
2045  */
2046 typedef struct LDKCVec_TxOutZ {
2047    /**
2048     * The elements in the array.
2049     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2050     */
2051    struct LDKTxOut *data;
2052    /**
2053     * The number of elements pointed to by `data`.
2054     */
2055    uintptr_t datalen;
2056 } LDKCVec_TxOutZ;
2057
2058 /**
2059  * An enum which can either contain a u32 or not
2060  */
2061 typedef enum LDKCOption_u32Z_Tag {
2062    /**
2063     * When we're in this state, this COption_u32Z contains a u32
2064     */
2065    LDKCOption_u32Z_Some,
2066    /**
2067     * When we're in this state, this COption_u32Z contains nothing
2068     */
2069    LDKCOption_u32Z_None,
2070    /**
2071     * Must be last for serialization purposes
2072     */
2073    LDKCOption_u32Z_Sentinel,
2074 } LDKCOption_u32Z_Tag;
2075
2076 typedef struct LDKCOption_u32Z {
2077    LDKCOption_u32Z_Tag tag;
2078    union {
2079       struct {
2080          uint32_t some;
2081       };
2082    };
2083 } LDKCOption_u32Z;
2084
2085 /**
2086  * A tuple of 2 elements. See the individual fields for the types contained.
2087  */
2088 typedef struct LDKC2Tuple_CVec_u8ZusizeZ {
2089    /**
2090     * The element at position 0
2091     */
2092    struct LDKCVec_u8Z a;
2093    /**
2094     * The element at position 1
2095     */
2096    uintptr_t b;
2097 } LDKC2Tuple_CVec_u8ZusizeZ;
2098
2099 /**
2100  * The contents of CResult_C2Tuple_CVec_u8ZusizeZNoneZ
2101  */
2102 typedef union LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZPtr {
2103    /**
2104     * A pointer to the contents in the success state.
2105     * Reading from this pointer when `result_ok` is not set is undefined.
2106     */
2107    struct LDKC2Tuple_CVec_u8ZusizeZ *result;
2108    /**
2109     * Note that this value is always NULL, as there are no contents in the Err variant
2110     */
2111    void *err;
2112 } LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZPtr;
2113
2114 /**
2115  * A CResult_C2Tuple_CVec_u8ZusizeZNoneZ represents the result of a fallible operation,
2116  * containing a crate::c_types::derived::C2Tuple_CVec_u8ZusizeZ on success and a () on failure.
2117  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2118  */
2119 typedef struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ {
2120    /**
2121     * The contents of this CResult_C2Tuple_CVec_u8ZusizeZNoneZ, accessible via either
2122     * `err` or `result` depending on the state of `result_ok`.
2123     */
2124    union LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZPtr contents;
2125    /**
2126     * Whether this CResult_C2Tuple_CVec_u8ZusizeZNoneZ represents a success state.
2127     */
2128    bool result_ok;
2129 } LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ;
2130
2131 /**
2132  * The contents of CResult_NoneNoneZ
2133  */
2134 typedef union LDKCResult_NoneNoneZPtr {
2135    /**
2136     * Note that this value is always NULL, as there are no contents in the OK variant
2137     */
2138    void *result;
2139    /**
2140     * Note that this value is always NULL, as there are no contents in the Err variant
2141     */
2142    void *err;
2143 } LDKCResult_NoneNoneZPtr;
2144
2145 /**
2146  * A CResult_NoneNoneZ represents the result of a fallible operation,
2147  * containing a () on success and a () on failure.
2148  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2149  */
2150 typedef struct LDKCResult_NoneNoneZ {
2151    /**
2152     * The contents of this CResult_NoneNoneZ, accessible via either
2153     * `err` or `result` depending on the state of `result_ok`.
2154     */
2155    union LDKCResult_NoneNoneZPtr contents;
2156    /**
2157     * Whether this CResult_NoneNoneZ represents a success state.
2158     */
2159    bool result_ok;
2160 } LDKCResult_NoneNoneZ;
2161
2162 /**
2163  * Represents a secp256k1 ECDSA signature serialized as two 32-byte numbers
2164  */
2165 typedef struct LDKECDSASignature {
2166    /**
2167     * The bytes of the signature in "compact" form
2168     */
2169    uint8_t compact_form[64];
2170 } LDKECDSASignature;
2171
2172 /**
2173  * A dynamically-allocated array of crate::c_types::ECDSASignatures of arbitrary size.
2174  * This corresponds to std::vector in C++
2175  */
2176 typedef struct LDKCVec_ECDSASignatureZ {
2177    /**
2178     * The elements in the array.
2179     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2180     */
2181    struct LDKECDSASignature *data;
2182    /**
2183     * The number of elements pointed to by `data`.
2184     */
2185    uintptr_t datalen;
2186 } LDKCVec_ECDSASignatureZ;
2187
2188 /**
2189  * A tuple of 2 elements. See the individual fields for the types contained.
2190  */
2191 typedef struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ {
2192    /**
2193     * The element at position 0
2194     */
2195    struct LDKECDSASignature a;
2196    /**
2197     * The element at position 1
2198     */
2199    struct LDKCVec_ECDSASignatureZ b;
2200 } LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ;
2201
2202 /**
2203  * The contents of CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ
2204  */
2205 typedef union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr {
2206    /**
2207     * A pointer to the contents in the success state.
2208     * Reading from this pointer when `result_ok` is not set is undefined.
2209     */
2210    struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *result;
2211    /**
2212     * Note that this value is always NULL, as there are no contents in the Err variant
2213     */
2214    void *err;
2215 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr;
2216
2217 /**
2218  * A CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents the result of a fallible operation,
2219  * containing a crate::c_types::derived::C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ on success and a () on failure.
2220  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2221  */
2222 typedef struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ {
2223    /**
2224     * The contents of this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ, accessible via either
2225     * `err` or `result` depending on the state of `result_ok`.
2226     */
2227    union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr contents;
2228    /**
2229     * Whether this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents a success state.
2230     */
2231    bool result_ok;
2232 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ;
2233
2234 /**
2235  * The contents of CResult_ECDSASignatureNoneZ
2236  */
2237 typedef union LDKCResult_ECDSASignatureNoneZPtr {
2238    /**
2239     * A pointer to the contents in the success state.
2240     * Reading from this pointer when `result_ok` is not set is undefined.
2241     */
2242    struct LDKECDSASignature *result;
2243    /**
2244     * Note that this value is always NULL, as there are no contents in the Err variant
2245     */
2246    void *err;
2247 } LDKCResult_ECDSASignatureNoneZPtr;
2248
2249 /**
2250  * A CResult_ECDSASignatureNoneZ represents the result of a fallible operation,
2251  * containing a crate::c_types::ECDSASignature on success and a () on failure.
2252  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2253  */
2254 typedef struct LDKCResult_ECDSASignatureNoneZ {
2255    /**
2256     * The contents of this CResult_ECDSASignatureNoneZ, accessible via either
2257     * `err` or `result` depending on the state of `result_ok`.
2258     */
2259    union LDKCResult_ECDSASignatureNoneZPtr contents;
2260    /**
2261     * Whether this CResult_ECDSASignatureNoneZ represents a success state.
2262     */
2263    bool result_ok;
2264 } LDKCResult_ECDSASignatureNoneZ;
2265
2266 /**
2267  * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
2268  */
2269 typedef struct LDKPublicKey {
2270    /**
2271     * The bytes of the public key
2272     */
2273    uint8_t compressed_form[33];
2274 } LDKPublicKey;
2275
2276 /**
2277  * The contents of CResult_PublicKeyNoneZ
2278  */
2279 typedef union LDKCResult_PublicKeyNoneZPtr {
2280    /**
2281     * A pointer to the contents in the success state.
2282     * Reading from this pointer when `result_ok` is not set is undefined.
2283     */
2284    struct LDKPublicKey *result;
2285    /**
2286     * Note that this value is always NULL, as there are no contents in the Err variant
2287     */
2288    void *err;
2289 } LDKCResult_PublicKeyNoneZPtr;
2290
2291 /**
2292  * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
2293  * containing a crate::c_types::PublicKey on success and a () on failure.
2294  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2295  */
2296 typedef struct LDKCResult_PublicKeyNoneZ {
2297    /**
2298     * The contents of this CResult_PublicKeyNoneZ, accessible via either
2299     * `err` or `result` depending on the state of `result_ok`.
2300     */
2301    union LDKCResult_PublicKeyNoneZPtr contents;
2302    /**
2303     * Whether this CResult_PublicKeyNoneZ represents a success state.
2304     */
2305    bool result_ok;
2306 } LDKCResult_PublicKeyNoneZ;
2307
2308 /**
2309  * An enum which can either contain a crate::c_types::BigEndianScalar or not
2310  */
2311 typedef enum LDKCOption_BigEndianScalarZ_Tag {
2312    /**
2313     * When we're in this state, this COption_BigEndianScalarZ contains a crate::c_types::BigEndianScalar
2314     */
2315    LDKCOption_BigEndianScalarZ_Some,
2316    /**
2317     * When we're in this state, this COption_BigEndianScalarZ contains nothing
2318     */
2319    LDKCOption_BigEndianScalarZ_None,
2320    /**
2321     * Must be last for serialization purposes
2322     */
2323    LDKCOption_BigEndianScalarZ_Sentinel,
2324 } LDKCOption_BigEndianScalarZ_Tag;
2325
2326 typedef struct LDKCOption_BigEndianScalarZ {
2327    LDKCOption_BigEndianScalarZ_Tag tag;
2328    union {
2329       struct {
2330          struct LDKBigEndianScalar some;
2331       };
2332    };
2333 } LDKCOption_BigEndianScalarZ;
2334
2335 /**
2336  * Integer in the range `0..32`
2337  */
2338 typedef struct LDKU5 {
2339    uint8_t _0;
2340 } LDKU5;
2341
2342 /**
2343  * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
2344  * This corresponds to std::vector in C++
2345  */
2346 typedef struct LDKCVec_U5Z {
2347    /**
2348     * The elements in the array.
2349     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2350     */
2351    struct LDKU5 *data;
2352    /**
2353     * The number of elements pointed to by `data`.
2354     */
2355    uintptr_t datalen;
2356 } LDKCVec_U5Z;
2357
2358 /**
2359  * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
2360  * allows recovering the exact public key which created the signature given the message.
2361  */
2362 typedef struct LDKRecoverableSignature {
2363    /**
2364     * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
2365     * recovery.
2366     */
2367    uint8_t serialized_form[68];
2368 } LDKRecoverableSignature;
2369
2370 /**
2371  * The contents of CResult_RecoverableSignatureNoneZ
2372  */
2373 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
2374    /**
2375     * A pointer to the contents in the success state.
2376     * Reading from this pointer when `result_ok` is not set is undefined.
2377     */
2378    struct LDKRecoverableSignature *result;
2379    /**
2380     * Note that this value is always NULL, as there are no contents in the Err variant
2381     */
2382    void *err;
2383 } LDKCResult_RecoverableSignatureNoneZPtr;
2384
2385 /**
2386  * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
2387  * containing a crate::c_types::RecoverableSignature on success and a () on failure.
2388  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2389  */
2390 typedef struct LDKCResult_RecoverableSignatureNoneZ {
2391    /**
2392     * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
2393     * `err` or `result` depending on the state of `result_ok`.
2394     */
2395    union LDKCResult_RecoverableSignatureNoneZPtr contents;
2396    /**
2397     * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
2398     */
2399    bool result_ok;
2400 } LDKCResult_RecoverableSignatureNoneZ;
2401
2402 /**
2403  * Represents a secp256k1 Schnorr signature serialized as two 32-byte numbers
2404  */
2405 typedef struct LDKSchnorrSignature {
2406    /**
2407     * The bytes of the signature as two 32-byte numbers
2408     */
2409    uint8_t compact_form[64];
2410 } LDKSchnorrSignature;
2411
2412 /**
2413  * The contents of CResult_SchnorrSignatureNoneZ
2414  */
2415 typedef union LDKCResult_SchnorrSignatureNoneZPtr {
2416    /**
2417     * A pointer to the contents in the success state.
2418     * Reading from this pointer when `result_ok` is not set is undefined.
2419     */
2420    struct LDKSchnorrSignature *result;
2421    /**
2422     * Note that this value is always NULL, as there are no contents in the Err variant
2423     */
2424    void *err;
2425 } LDKCResult_SchnorrSignatureNoneZPtr;
2426
2427 /**
2428  * A CResult_SchnorrSignatureNoneZ represents the result of a fallible operation,
2429  * containing a crate::c_types::SchnorrSignature on success and a () on failure.
2430  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2431  */
2432 typedef struct LDKCResult_SchnorrSignatureNoneZ {
2433    /**
2434     * The contents of this CResult_SchnorrSignatureNoneZ, accessible via either
2435     * `err` or `result` depending on the state of `result_ok`.
2436     */
2437    union LDKCResult_SchnorrSignatureNoneZPtr contents;
2438    /**
2439     * Whether this CResult_SchnorrSignatureNoneZ represents a success state.
2440     */
2441    bool result_ok;
2442 } LDKCResult_SchnorrSignatureNoneZ;
2443
2444
2445
2446 /**
2447  * This class tracks the per-transaction information needed to build a commitment transaction and will
2448  * actually build it and sign.  It is used for holder transactions that we sign only when needed
2449  * and for transactions we sign for the counterparty.
2450  *
2451  * This class can be used inside a signer implementation to generate a signature given the relevant
2452  * secret key.
2453  */
2454 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
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    LDKnativeCommitmentTransaction *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 } LDKCommitmentTransaction;
2468
2469
2470
2471 /**
2472  * Information needed to build and sign a holder's commitment transaction.
2473  *
2474  * The transaction is only signed once we are ready to broadcast.
2475  */
2476 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
2477    /**
2478     * A pointer to the opaque Rust object.
2479     * Nearly everywhere, inner must be non-null, however in places where
2480     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2481     */
2482    LDKnativeHolderCommitmentTransaction *inner;
2483    /**
2484     * Indicates that this is the only struct which contains the same pointer.
2485     * Rust functions which take ownership of an object provided via an argument require
2486     * this to be true and invalidate the object pointed to by inner.
2487     */
2488    bool is_owned;
2489 } LDKHolderCommitmentTransaction;
2490
2491
2492
2493 /**
2494  * Information about an HTLC as it appears in a commitment transaction
2495  */
2496 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
2497    /**
2498     * A pointer to the opaque Rust object.
2499     * Nearly everywhere, inner must be non-null, however in places where
2500     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2501     */
2502    LDKnativeHTLCOutputInCommitment *inner;
2503    /**
2504     * Indicates that this is the only struct which contains the same pointer.
2505     * Rust functions which take ownership of an object provided via an argument require
2506     * this to be true and invalidate the object pointed to by inner.
2507     */
2508    bool is_owned;
2509 } LDKHTLCOutputInCommitment;
2510
2511
2512
2513 /**
2514  * A descriptor used to sign for a commitment transaction's HTLC output.
2515  */
2516 typedef struct MUST_USE_STRUCT LDKHTLCDescriptor {
2517    /**
2518     * A pointer to the opaque Rust object.
2519     * Nearly everywhere, inner must be non-null, however in places where
2520     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2521     */
2522    LDKnativeHTLCDescriptor *inner;
2523    /**
2524     * Indicates that this is the only struct which contains the same pointer.
2525     * Rust functions which take ownership of an object provided via an argument require
2526     * this to be true and invalidate the object pointed to by inner.
2527     */
2528    bool is_owned;
2529 } LDKHTLCDescriptor;
2530
2531
2532
2533 /**
2534  * This class tracks the per-transaction information needed to build a closing transaction and will
2535  * actually build it and sign.
2536  *
2537  * This class can be used inside a signer implementation to generate a signature given the relevant
2538  * secret key.
2539  */
2540 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
2541    /**
2542     * A pointer to the opaque Rust object.
2543     * Nearly everywhere, inner must be non-null, however in places where
2544     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2545     */
2546    LDKnativeClosingTransaction *inner;
2547    /**
2548     * Indicates that this is the only struct which contains the same pointer.
2549     * Rust functions which take ownership of an object provided via an argument require
2550     * this to be true and invalidate the object pointed to by inner.
2551     */
2552    bool is_owned;
2553 } LDKClosingTransaction;
2554
2555
2556
2557 /**
2558  * The unsigned part of a [`channel_announcement`] message.
2559  *
2560  * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
2561  */
2562 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2563    /**
2564     * A pointer to the opaque Rust object.
2565     * Nearly everywhere, inner must be non-null, however in places where
2566     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2567     */
2568    LDKnativeUnsignedChannelAnnouncement *inner;
2569    /**
2570     * Indicates that this is the only struct which contains the same pointer.
2571     * Rust functions which take ownership of an object provided via an argument require
2572     * this to be true and invalidate the object pointed to by inner.
2573     */
2574    bool is_owned;
2575 } LDKUnsignedChannelAnnouncement;
2576
2577
2578
2579 /**
2580  * One counterparty's public keys which do not change over the life of a channel.
2581  */
2582 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
2583    /**
2584     * A pointer to the opaque Rust object.
2585     * Nearly everywhere, inner must be non-null, however in places where
2586     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2587     */
2588    LDKnativeChannelPublicKeys *inner;
2589    /**
2590     * Indicates that this is the only struct which contains the same pointer.
2591     * Rust functions which take ownership of an object provided via an argument require
2592     * this to be true and invalidate the object pointed to by inner.
2593     */
2594    bool is_owned;
2595 } LDKChannelPublicKeys;
2596
2597
2598
2599 /**
2600  * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
2601  * The fields are organized by holder/counterparty.
2602  *
2603  * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
2604  * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
2605  */
2606 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
2607    /**
2608     * A pointer to the opaque Rust object.
2609     * Nearly everywhere, inner must be non-null, however in places where
2610     * the Rust equivalent takes an Option, it may be set to null to indicate None.
2611     */
2612    LDKnativeChannelTransactionParameters *inner;
2613    /**
2614     * Indicates that this is the only struct which contains the same pointer.
2615     * Rust functions which take ownership of an object provided via an argument require
2616     * this to be true and invalidate the object pointed to by inner.
2617     */
2618    bool is_owned;
2619 } LDKChannelTransactionParameters;
2620
2621 /**
2622  * A trait to handle Lightning channel key material without concretizing the channel type or
2623  * the signature mechanism.
2624  */
2625 typedef struct LDKChannelSigner {
2626    /**
2627     * An opaque pointer which is passed to your function implementations as an argument.
2628     * This has no meaning in the LDK, and can be NULL or any other value.
2629     */
2630    void *this_arg;
2631    /**
2632     * Gets the per-commitment point for a specific commitment number
2633     *
2634     * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2635     */
2636    struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2637    /**
2638     * Gets the commitment secret for a specific commitment number as part of the revocation process
2639     *
2640     * An external signer implementation should error here if the commitment was already signed
2641     * and should refuse to sign it in the future.
2642     *
2643     * May be called more than once for the same index.
2644     *
2645     * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2646     */
2647    struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2648    /**
2649     * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
2650     *
2651     * This is required in order for the signer to make sure that releasing a commitment
2652     * secret won't leave us without a broadcastable holder transaction.
2653     * Policy checks should be implemented in this function, including checking the amount
2654     * sent to us and checking the HTLCs.
2655     *
2656     * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
2657     * A validating signer should ensure that an HTLC output is removed only when the matching
2658     * preimage is provided, or when the value to holder is restored.
2659     *
2660     * Note that all the relevant preimages will be provided, but there may also be additional
2661     * irrelevant or duplicate preimages.
2662     */
2663    struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_ThirtyTwoBytesZ preimages);
2664    /**
2665     * Returns the holder's channel public keys and basepoints.
2666     */
2667    struct LDKChannelPublicKeys pubkeys;
2668    /**
2669     * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2670     * Note that this takes a pointer to this object, not the this_ptr like other methods do
2671     * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2672     */
2673    void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
2674    /**
2675     * Returns an arbitrary identifier describing the set of keys which are provided back to you in
2676     * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
2677     * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
2678     */
2679    struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2680    /**
2681     * Set the counterparty static channel data, including basepoints,
2682     * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
2683     *
2684     * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
2685     * instance, LDK will call this method exactly once - either immediately after construction
2686     * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
2687     * information has been generated.
2688     *
2689     * channel_parameters.is_populated() MUST be true.
2690     */
2691    void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2692    /**
2693     * Frees any resources associated with this object given its this_arg pointer.
2694     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2695     */
2696    void (*free)(void *this_arg);
2697 } LDKChannelSigner;
2698
2699 /**
2700  * A trait to sign Lightning channel transactions as described in
2701  * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
2702  *
2703  * Signing services could be implemented on a hardware wallet and should implement signing
2704  * policies in order to be secure. Please refer to the [VLS Policy
2705  * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
2706  * for an example of such policies.
2707  */
2708 typedef struct LDKEcdsaChannelSigner {
2709    /**
2710     * An opaque pointer which is passed to your function implementations as an argument.
2711     * This has no meaning in the LDK, and can be NULL or any other value.
2712     */
2713    void *this_arg;
2714    /**
2715     * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2716     *
2717     * Note that if signing fails or is rejected, the channel will be force-closed.
2718     *
2719     * Policy checks should be implemented in this function, including checking the amount
2720     * sent to us and checking the HTLCs.
2721     *
2722     * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
2723     * A validating signer should ensure that an HTLC output is removed only when the matching
2724     * preimage is provided, or when the value to holder is restored.
2725     *
2726     * Note that all the relevant preimages will be provided, but there may also be additional
2727     * irrelevant or duplicate preimages.
2728     */
2729    struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_ThirtyTwoBytesZ preimages);
2730    /**
2731     * Validate the counterparty's revocation.
2732     *
2733     * This is required in order for the signer to make sure that the state has moved
2734     * forward and it is safe to sign the next counterparty commitment.
2735     */
2736    struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
2737    /**
2738     * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions.
2739     *
2740     * This will be called
2741     * - with a non-revoked `commitment_tx`.
2742     * - with the latest `commitment_tx` when we initiate a force-close.
2743     * - with the previous `commitment_tx`, just to get claiming HTLC
2744     *   signatures, if we are reacting to a [`ChannelMonitor`]
2745     *   [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
2746     *   that decided to broadcast before it had been updated to the latest `commitment_tx`.
2747     *
2748     * This may be called multiple times for the same transaction.
2749     *
2750     * An external signer implementation should check that the commitment has not been revoked.
2751     *
2752     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
2753     */
2754    struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2755    /**
2756     * Create a signature for the given input in a transaction spending an HTLC transaction output
2757     * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
2758     *
2759     * A justice transaction may claim multiple outputs at the same time if timelocks are
2760     * similar, but only a signature for the input at index `input` should be signed for here.
2761     * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2762     * to an upcoming timelock expiration.
2763     *
2764     * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2765     *
2766     * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2767     * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2768     * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
2769     * so).
2770     */
2771    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]);
2772    /**
2773     * Create a signature for the given input in a transaction spending a commitment transaction
2774     * HTLC output when our counterparty broadcasts an old state.
2775     *
2776     * A justice transaction may claim multiple outputs at the same time if timelocks are
2777     * similar, but only a signature for the input at index `input` should be signed for here.
2778     * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2779     * to an upcoming timelock expiration.
2780     *
2781     * `amount` is the value of the output spent by this input, committed to in the BIP 143
2782     * signature.
2783     *
2784     * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2785     * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2786     * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2787     * so).
2788     *
2789     * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
2790     * (which is committed to in the BIP 143 signatures).
2791     */
2792    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);
2793    /**
2794     * Computes the signature for a commitment transaction's HTLC output used as an input within
2795     * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
2796     * must be be computed using [`EcdsaSighashType::All`]. Note that this should only be used to
2797     * sign HTLC transactions from channels supporting anchor outputs after all additional
2798     * inputs/outputs have been added to the transaction.
2799     *
2800     * [`EcdsaSighashType::All`]: bitcoin::blockdata::transaction::EcdsaSighashType::All
2801     */
2802    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);
2803    /**
2804     * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2805     * transaction, either offered or received.
2806     *
2807     * Such a transaction may claim multiples offered outputs at same time if we know the
2808     * preimage for each when we create it, but only the input at index `input` should be
2809     * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2810     * needed with regards to an upcoming timelock expiration.
2811     *
2812     * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
2813     * outputs.
2814     *
2815     * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
2816     *
2817     * `per_commitment_point` is the dynamic point corresponding to the channel state
2818     * detected onchain. It has been generated by our counterparty and is used to derive
2819     * channel state keys, which are then included in the witness script and committed to in the
2820     * BIP 143 signature.
2821     */
2822    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);
2823    /**
2824     * Create a signature for a (proposed) closing transaction.
2825     *
2826     * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2827     * chosen to forgo their output as dust.
2828     */
2829    struct LDKCResult_ECDSASignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
2830    /**
2831     * Computes the signature for a commitment transaction's anchor output used as an
2832     * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
2833     */
2834    struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
2835    /**
2836     * Signs a channel announcement message with our funding key proving it comes from one of the
2837     * channel participants.
2838     *
2839     * Channel announcements also require a signature from each node's network key. Our node
2840     * signature is computed through [`NodeSigner::sign_gossip_message`].
2841     *
2842     * Note that if this fails or is rejected, the channel will not be publicly announced and
2843     * our counterparty may (though likely will not) close the channel on us for violating the
2844     * protocol.
2845     */
2846    struct LDKCResult_ECDSASignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
2847    /**
2848     * Implementation of ChannelSigner for this object.
2849     */
2850    struct LDKChannelSigner ChannelSigner;
2851    /**
2852     * Frees any resources associated with this object given its this_arg pointer.
2853     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2854     */
2855    void (*free)(void *this_arg);
2856 } LDKEcdsaChannelSigner;
2857
2858 /**
2859  * A writeable signer.
2860  *
2861  * There will always be two instances of a signer per channel, one occupied by the
2862  * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
2863  *
2864  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2865  * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
2866  */
2867 typedef struct LDKWriteableEcdsaChannelSigner {
2868    /**
2869     * An opaque pointer which is passed to your function implementations as an argument.
2870     * This has no meaning in the LDK, and can be NULL or any other value.
2871     */
2872    void *this_arg;
2873    /**
2874     * Implementation of EcdsaChannelSigner for this object.
2875     */
2876    struct LDKEcdsaChannelSigner EcdsaChannelSigner;
2877    /**
2878     * Serialize the object into a byte array
2879     */
2880    struct LDKCVec_u8Z (*write)(const void *this_arg);
2881    /**
2882     * Called, if set, after this WriteableEcdsaChannelSigner has been cloned into a duplicate object.
2883     * The new WriteableEcdsaChannelSigner is provided, and should be mutated as needed to perform a
2884     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
2885     */
2886    void (*cloned)(struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR new_WriteableEcdsaChannelSigner);
2887    /**
2888     * Frees any resources associated with this object given its this_arg pointer.
2889     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2890     */
2891    void (*free)(void *this_arg);
2892 } LDKWriteableEcdsaChannelSigner;
2893
2894 /**
2895  * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
2896  */
2897 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
2898    /**
2899     * A pointer to the contents in the success state.
2900     * Reading from this pointer when `result_ok` is not set is undefined.
2901     */
2902    struct LDKWriteableEcdsaChannelSigner *result;
2903    /**
2904     * A pointer to the contents in the error state.
2905     * Reading from this pointer when `result_ok` is set is undefined.
2906     */
2907    struct LDKDecodeError *err;
2908 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
2909
2910 /**
2911  * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
2912  * containing a crate::lightning::sign::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
2913  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2914  */
2915 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
2916    /**
2917     * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
2918     * `err` or `result` depending on the state of `result_ok`.
2919     */
2920    union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
2921    /**
2922     * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
2923     */
2924    bool result_ok;
2925 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
2926
2927 /**
2928  * The contents of CResult_CVec_u8ZNoneZ
2929  */
2930 typedef union LDKCResult_CVec_u8ZNoneZPtr {
2931    /**
2932     * A pointer to the contents in the success state.
2933     * Reading from this pointer when `result_ok` is not set is undefined.
2934     */
2935    struct LDKCVec_u8Z *result;
2936    /**
2937     * Note that this value is always NULL, as there are no contents in the Err variant
2938     */
2939    void *err;
2940 } LDKCResult_CVec_u8ZNoneZPtr;
2941
2942 /**
2943  * A CResult_CVec_u8ZNoneZ represents the result of a fallible operation,
2944  * containing a crate::c_types::derived::CVec_u8Z on success and a () on failure.
2945  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2946  */
2947 typedef struct LDKCResult_CVec_u8ZNoneZ {
2948    /**
2949     * The contents of this CResult_CVec_u8ZNoneZ, accessible via either
2950     * `err` or `result` depending on the state of `result_ok`.
2951     */
2952    union LDKCResult_CVec_u8ZNoneZPtr contents;
2953    /**
2954     * Whether this CResult_CVec_u8ZNoneZ represents a success state.
2955     */
2956    bool result_ok;
2957 } LDKCResult_CVec_u8ZNoneZ;
2958
2959 /**
2960  * The contents of CResult_ShutdownScriptNoneZ
2961  */
2962 typedef union LDKCResult_ShutdownScriptNoneZPtr {
2963    /**
2964     * A pointer to the contents in the success state.
2965     * Reading from this pointer when `result_ok` is not set is undefined.
2966     */
2967    struct LDKShutdownScript *result;
2968    /**
2969     * Note that this value is always NULL, as there are no contents in the Err variant
2970     */
2971    void *err;
2972 } LDKCResult_ShutdownScriptNoneZPtr;
2973
2974 /**
2975  * A CResult_ShutdownScriptNoneZ represents the result of a fallible operation,
2976  * containing a crate::lightning::ln::script::ShutdownScript on success and a () on failure.
2977  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2978  */
2979 typedef struct LDKCResult_ShutdownScriptNoneZ {
2980    /**
2981     * The contents of this CResult_ShutdownScriptNoneZ, accessible via either
2982     * `err` or `result` depending on the state of `result_ok`.
2983     */
2984    union LDKCResult_ShutdownScriptNoneZPtr contents;
2985    /**
2986     * Whether this CResult_ShutdownScriptNoneZ represents a success state.
2987     */
2988    bool result_ok;
2989 } LDKCResult_ShutdownScriptNoneZ;
2990
2991 /**
2992  * An enum which can either contain a u16 or not
2993  */
2994 typedef enum LDKCOption_u16Z_Tag {
2995    /**
2996     * When we're in this state, this COption_u16Z contains a u16
2997     */
2998    LDKCOption_u16Z_Some,
2999    /**
3000     * When we're in this state, this COption_u16Z contains nothing
3001     */
3002    LDKCOption_u16Z_None,
3003    /**
3004     * Must be last for serialization purposes
3005     */
3006    LDKCOption_u16Z_Sentinel,
3007 } LDKCOption_u16Z_Tag;
3008
3009 typedef struct LDKCOption_u16Z {
3010    LDKCOption_u16Z_Tag tag;
3011    union {
3012       struct {
3013          uint16_t some;
3014       };
3015    };
3016 } LDKCOption_u16Z;
3017
3018 /**
3019  * An enum which can either contain a bool or not
3020  */
3021 typedef enum LDKCOption_boolZ_Tag {
3022    /**
3023     * When we're in this state, this COption_boolZ contains a bool
3024     */
3025    LDKCOption_boolZ_Some,
3026    /**
3027     * When we're in this state, this COption_boolZ contains nothing
3028     */
3029    LDKCOption_boolZ_None,
3030    /**
3031     * Must be last for serialization purposes
3032     */
3033    LDKCOption_boolZ_Sentinel,
3034 } LDKCOption_boolZ_Tag;
3035
3036 typedef struct LDKCOption_boolZ {
3037    LDKCOption_boolZ_Tag tag;
3038    union {
3039       struct {
3040          bool some;
3041       };
3042    };
3043 } LDKCOption_boolZ;
3044
3045 /**
3046  * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
3047  * This corresponds to std::vector in C++
3048  */
3049 typedef struct LDKCVec_CVec_u8ZZ {
3050    /**
3051     * The elements in the array.
3052     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3053     */
3054    struct LDKCVec_u8Z *data;
3055    /**
3056     * The number of elements pointed to by `data`.
3057     */
3058    uintptr_t datalen;
3059 } LDKCVec_CVec_u8ZZ;
3060
3061 /**
3062  * The contents of CResult_CVec_CVec_u8ZZNoneZ
3063  */
3064 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
3065    /**
3066     * A pointer to the contents in the success state.
3067     * Reading from this pointer when `result_ok` is not set is undefined.
3068     */
3069    struct LDKCVec_CVec_u8ZZ *result;
3070    /**
3071     * Note that this value is always NULL, as there are no contents in the Err variant
3072     */
3073    void *err;
3074 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
3075
3076 /**
3077  * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
3078  * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
3079  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3080  */
3081 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
3082    /**
3083     * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
3084     * `err` or `result` depending on the state of `result_ok`.
3085     */
3086    union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
3087    /**
3088     * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
3089     */
3090    bool result_ok;
3091 } LDKCResult_CVec_CVec_u8ZZNoneZ;
3092
3093
3094
3095 /**
3096  * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
3097  *
3098  * This implementation performs no policy checks and is insufficient by itself as
3099  * a secure external signer.
3100  */
3101 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3102    /**
3103     * A pointer to the opaque Rust object.
3104     * Nearly everywhere, inner must be non-null, however in places where
3105     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3106     */
3107    LDKnativeInMemorySigner *inner;
3108    /**
3109     * Indicates that this is the only struct which contains the same pointer.
3110     * Rust functions which take ownership of an object provided via an argument require
3111     * this to be true and invalidate the object pointed to by inner.
3112     */
3113    bool is_owned;
3114 } LDKInMemorySigner;
3115
3116 /**
3117  * The contents of CResult_InMemorySignerDecodeErrorZ
3118  */
3119 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3120    /**
3121     * A pointer to the contents in the success state.
3122     * Reading from this pointer when `result_ok` is not set is undefined.
3123     */
3124    struct LDKInMemorySigner *result;
3125    /**
3126     * A pointer to the contents in the error state.
3127     * Reading from this pointer when `result_ok` is set is undefined.
3128     */
3129    struct LDKDecodeError *err;
3130 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3131
3132 /**
3133  * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3134  * containing a crate::lightning::sign::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3135  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3136  */
3137 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3138    /**
3139     * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3140     * `err` or `result` depending on the state of `result_ok`.
3141     */
3142    union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3143    /**
3144     * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3145     */
3146    bool result_ok;
3147 } LDKCResult_InMemorySignerDecodeErrorZ;
3148
3149 /**
3150  * The contents of CResult_TransactionNoneZ
3151  */
3152 typedef union LDKCResult_TransactionNoneZPtr {
3153    /**
3154     * A pointer to the contents in the success state.
3155     * Reading from this pointer when `result_ok` is not set is undefined.
3156     */
3157    struct LDKTransaction *result;
3158    /**
3159     * Note that this value is always NULL, as there are no contents in the Err variant
3160     */
3161    void *err;
3162 } LDKCResult_TransactionNoneZPtr;
3163
3164 /**
3165  * A CResult_TransactionNoneZ represents the result of a fallible operation,
3166  * containing a crate::c_types::Transaction on success and a () on failure.
3167  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3168  */
3169 typedef struct LDKCResult_TransactionNoneZ {
3170    /**
3171     * The contents of this CResult_TransactionNoneZ, accessible via either
3172     * `err` or `result` depending on the state of `result_ok`.
3173     */
3174    union LDKCResult_TransactionNoneZPtr contents;
3175    /**
3176     * Whether this CResult_TransactionNoneZ represents a success state.
3177     */
3178    bool result_ok;
3179 } LDKCResult_TransactionNoneZ;
3180
3181
3182
3183 /**
3184  * Represents the compressed public key of a node
3185  */
3186 typedef struct MUST_USE_STRUCT LDKNodeId {
3187    /**
3188     * A pointer to the opaque Rust object.
3189     * Nearly everywhere, inner must be non-null, however in places where
3190     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3191     */
3192    LDKnativeNodeId *inner;
3193    /**
3194     * Indicates that this is the only struct which contains the same pointer.
3195     * Rust functions which take ownership of an object provided via an argument require
3196     * this to be true and invalidate the object pointed to by inner.
3197     */
3198    bool is_owned;
3199 } LDKNodeId;
3200
3201
3202
3203 /**
3204  * Proposed use of a channel passed as a parameter to [`ScoreLookUp::channel_penalty_msat`].
3205  */
3206 typedef struct MUST_USE_STRUCT LDKChannelUsage {
3207    /**
3208     * A pointer to the opaque Rust object.
3209     * Nearly everywhere, inner must be non-null, however in places where
3210     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3211     */
3212    LDKnativeChannelUsage *inner;
3213    /**
3214     * Indicates that this is the only struct which contains the same pointer.
3215     * Rust functions which take ownership of an object provided via an argument require
3216     * this to be true and invalidate the object pointed to by inner.
3217     */
3218    bool is_owned;
3219 } LDKChannelUsage;
3220
3221
3222
3223 /**
3224  * Parameters for configuring [`ProbabilisticScorer`].
3225  *
3226  * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
3227  * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
3228  *
3229  * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
3230  * parameters here.
3231  */
3232 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringFeeParameters {
3233    /**
3234     * A pointer to the opaque Rust object.
3235     * Nearly everywhere, inner must be non-null, however in places where
3236     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3237     */
3238    LDKnativeProbabilisticScoringFeeParameters *inner;
3239    /**
3240     * Indicates that this is the only struct which contains the same pointer.
3241     * Rust functions which take ownership of an object provided via an argument require
3242     * this to be true and invalidate the object pointed to by inner.
3243     */
3244    bool is_owned;
3245 } LDKProbabilisticScoringFeeParameters;
3246
3247 /**
3248  * An interface used to score payment channels for path finding.
3249  *
3250  * `ScoreLookUp` is used to determine the penalty for a given channel.
3251  *
3252  * Scoring is in terms of fees willing to be paid in order to avoid routing through a channel.
3253  */
3254 typedef struct LDKScoreLookUp {
3255    /**
3256     * An opaque pointer which is passed to your function implementations as an argument.
3257     * This has no meaning in the LDK, and can be NULL or any other value.
3258     */
3259    void *this_arg;
3260    /**
3261     * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
3262     * given channel in the direction from `source` to `target`.
3263     *
3264     * The channel's capacity (less any other MPP parts that are also being considered for use in
3265     * the same payment) is given by `capacity_msat`. It may be determined from various sources
3266     * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
3267     * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
3268     * Thus, implementations should be overflow-safe.
3269     */
3270    uint64_t (*channel_penalty_msat)(const void *this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, struct LDKChannelUsage usage, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params);
3271    /**
3272     * Frees any resources associated with this object given its this_arg pointer.
3273     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3274     */
3275    void (*free)(void *this_arg);
3276 } LDKScoreLookUp;
3277
3278
3279
3280 /**
3281  * A path in a [`Route`] to the payment recipient. Must always be at least length one.
3282  * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19.
3283  */
3284 typedef struct MUST_USE_STRUCT LDKPath {
3285    /**
3286     * A pointer to the opaque Rust object.
3287     * Nearly everywhere, inner must be non-null, however in places where
3288     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3289     */
3290    LDKnativePath *inner;
3291    /**
3292     * Indicates that this is the only struct which contains the same pointer.
3293     * Rust functions which take ownership of an object provided via an argument require
3294     * this to be true and invalidate the object pointed to by inner.
3295     */
3296    bool is_owned;
3297 } LDKPath;
3298
3299 /**
3300  * `ScoreUpdate` is used to update the scorer's internal state after a payment attempt.
3301  */
3302 typedef struct LDKScoreUpdate {
3303    /**
3304     * An opaque pointer which is passed to your function implementations as an argument.
3305     * This has no meaning in the LDK, and can be NULL or any other value.
3306     */
3307    void *this_arg;
3308    /**
3309     * Handles updating channel penalties after failing to route through a channel.
3310     */
3311    void (*payment_path_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id);
3312    /**
3313     * Handles updating channel penalties after successfully routing along a path.
3314     */
3315    void (*payment_path_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path);
3316    /**
3317     * Handles updating channel penalties after a probe over the given path failed.
3318     */
3319    void (*probe_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id);
3320    /**
3321     * Handles updating channel penalties after a probe over the given path succeeded.
3322     */
3323    void (*probe_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path);
3324    /**
3325     * Frees any resources associated with this object given its this_arg pointer.
3326     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3327     */
3328    void (*free)(void *this_arg);
3329 } LDKScoreUpdate;
3330
3331 /**
3332  * A scorer that is accessed under a lock.
3333  *
3334  * Needed so that calls to [`ScoreLookUp::channel_penalty_msat`] in [`find_route`] can be made while
3335  * having shared ownership of a scorer but without requiring internal locking in [`ScoreUpdate`]
3336  * implementations. Internal locking would be detrimental to route finding performance and could
3337  * result in [`ScoreLookUp::channel_penalty_msat`] returning a different value for the same channel.
3338  *
3339  * [`find_route`]: crate::routing::router::find_route
3340  */
3341 typedef struct LDKLockableScore {
3342    /**
3343     * An opaque pointer which is passed to your function implementations as an argument.
3344     * This has no meaning in the LDK, and can be NULL or any other value.
3345     */
3346    void *this_arg;
3347    /**
3348     * Returns read locked scorer.
3349     */
3350    struct LDKScoreLookUp (*read_lock)(const void *this_arg);
3351    /**
3352     * Returns write locked scorer.
3353     */
3354    struct LDKScoreUpdate (*write_lock)(const void *this_arg);
3355    /**
3356     * Frees any resources associated with this object given its this_arg pointer.
3357     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3358     */
3359    void (*free)(void *this_arg);
3360 } LDKLockableScore;
3361
3362 /**
3363  * Refers to a scorer that is accessible under lock and also writeable to disk
3364  *
3365  * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
3366  * use the Persister to persist it.
3367  */
3368 typedef struct LDKWriteableScore {
3369    /**
3370     * An opaque pointer which is passed to your function implementations as an argument.
3371     * This has no meaning in the LDK, and can be NULL or any other value.
3372     */
3373    void *this_arg;
3374    /**
3375     * Implementation of LockableScore for this object.
3376     */
3377    struct LDKLockableScore LockableScore;
3378    /**
3379     * Serialize the object into a byte array
3380     */
3381    struct LDKCVec_u8Z (*write)(const void *this_arg);
3382    /**
3383     * Frees any resources associated with this object given its this_arg pointer.
3384     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3385     */
3386    void (*free)(void *this_arg);
3387 } LDKWriteableScore;
3388
3389 /**
3390  * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
3391  */
3392 typedef enum LDKCOption_WriteableScoreZ_Tag {
3393    /**
3394     * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
3395     */
3396    LDKCOption_WriteableScoreZ_Some,
3397    /**
3398     * When we're in this state, this COption_WriteableScoreZ contains nothing
3399     */
3400    LDKCOption_WriteableScoreZ_None,
3401    /**
3402     * Must be last for serialization purposes
3403     */
3404    LDKCOption_WriteableScoreZ_Sentinel,
3405 } LDKCOption_WriteableScoreZ_Tag;
3406
3407 typedef struct LDKCOption_WriteableScoreZ {
3408    LDKCOption_WriteableScoreZ_Tag tag;
3409    union {
3410       struct {
3411          struct LDKWriteableScore some;
3412       };
3413    };
3414 } LDKCOption_WriteableScoreZ;
3415
3416 /**
3417  * The contents of CResult_NoneIOErrorZ
3418  */
3419 typedef union LDKCResult_NoneIOErrorZPtr {
3420    /**
3421     * Note that this value is always NULL, as there are no contents in the OK variant
3422     */
3423    void *result;
3424    /**
3425     * A pointer to the contents in the error state.
3426     * Reading from this pointer when `result_ok` is set is undefined.
3427     */
3428    enum LDKIOError *err;
3429 } LDKCResult_NoneIOErrorZPtr;
3430
3431 /**
3432  * A CResult_NoneIOErrorZ represents the result of a fallible operation,
3433  * containing a () on success and a crate::c_types::IOError on failure.
3434  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3435  */
3436 typedef struct LDKCResult_NoneIOErrorZ {
3437    /**
3438     * The contents of this CResult_NoneIOErrorZ, accessible via either
3439     * `err` or `result` depending on the state of `result_ok`.
3440     */
3441    union LDKCResult_NoneIOErrorZPtr contents;
3442    /**
3443     * Whether this CResult_NoneIOErrorZ represents a success state.
3444     */
3445    bool result_ok;
3446 } LDKCResult_NoneIOErrorZ;
3447
3448
3449
3450 /**
3451  * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
3452  */
3453 typedef struct MUST_USE_STRUCT LDKChannelDetails {
3454    /**
3455     * A pointer to the opaque Rust object.
3456     * Nearly everywhere, inner must be non-null, however in places where
3457     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3458     */
3459    LDKnativeChannelDetails *inner;
3460    /**
3461     * Indicates that this is the only struct which contains the same pointer.
3462     * Rust functions which take ownership of an object provided via an argument require
3463     * this to be true and invalidate the object pointed to by inner.
3464     */
3465    bool is_owned;
3466 } LDKChannelDetails;
3467
3468 /**
3469  * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
3470  * This corresponds to std::vector in C++
3471  */
3472 typedef struct LDKCVec_ChannelDetailsZ {
3473    /**
3474     * The elements in the array.
3475     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3476     */
3477    struct LDKChannelDetails *data;
3478    /**
3479     * The number of elements pointed to by `data`.
3480     */
3481    uintptr_t datalen;
3482 } LDKCVec_ChannelDetailsZ;
3483
3484
3485
3486 /**
3487  * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3488  * it can take multiple paths. Each path is composed of one or more hops through the network.
3489  */
3490 typedef struct MUST_USE_STRUCT LDKRoute {
3491    /**
3492     * A pointer to the opaque Rust object.
3493     * Nearly everywhere, inner must be non-null, however in places where
3494     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3495     */
3496    LDKnativeRoute *inner;
3497    /**
3498     * Indicates that this is the only struct which contains the same pointer.
3499     * Rust functions which take ownership of an object provided via an argument require
3500     * this to be true and invalidate the object pointed to by inner.
3501     */
3502    bool is_owned;
3503 } LDKRoute;
3504
3505
3506
3507 /**
3508  * An Err type for failure to process messages.
3509  */
3510 typedef struct MUST_USE_STRUCT LDKLightningError {
3511    /**
3512     * A pointer to the opaque Rust object.
3513     * Nearly everywhere, inner must be non-null, however in places where
3514     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3515     */
3516    LDKnativeLightningError *inner;
3517    /**
3518     * Indicates that this is the only struct which contains the same pointer.
3519     * Rust functions which take ownership of an object provided via an argument require
3520     * this to be true and invalidate the object pointed to by inner.
3521     */
3522    bool is_owned;
3523 } LDKLightningError;
3524
3525 /**
3526  * The contents of CResult_RouteLightningErrorZ
3527  */
3528 typedef union LDKCResult_RouteLightningErrorZPtr {
3529    /**
3530     * A pointer to the contents in the success state.
3531     * Reading from this pointer when `result_ok` is not set is undefined.
3532     */
3533    struct LDKRoute *result;
3534    /**
3535     * A pointer to the contents in the error state.
3536     * Reading from this pointer when `result_ok` is set is undefined.
3537     */
3538    struct LDKLightningError *err;
3539 } LDKCResult_RouteLightningErrorZPtr;
3540
3541 /**
3542  * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
3543  * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
3544  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3545  */
3546 typedef struct LDKCResult_RouteLightningErrorZ {
3547    /**
3548     * The contents of this CResult_RouteLightningErrorZ, accessible via either
3549     * `err` or `result` depending on the state of `result_ok`.
3550     */
3551    union LDKCResult_RouteLightningErrorZPtr contents;
3552    /**
3553     * Whether this CResult_RouteLightningErrorZ represents a success state.
3554     */
3555    bool result_ok;
3556 } LDKCResult_RouteLightningErrorZ;
3557
3558
3559
3560 /**
3561  * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
3562  * in-use channel liquidity.
3563  */
3564 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
3565    /**
3566     * A pointer to the opaque Rust object.
3567     * Nearly everywhere, inner must be non-null, however in places where
3568     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3569     */
3570    LDKnativeInFlightHtlcs *inner;
3571    /**
3572     * Indicates that this is the only struct which contains the same pointer.
3573     * Rust functions which take ownership of an object provided via an argument require
3574     * this to be true and invalidate the object pointed to by inner.
3575     */
3576    bool is_owned;
3577 } LDKInFlightHtlcs;
3578
3579 /**
3580  * The contents of CResult_InFlightHtlcsDecodeErrorZ
3581  */
3582 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
3583    /**
3584     * A pointer to the contents in the success state.
3585     * Reading from this pointer when `result_ok` is not set is undefined.
3586     */
3587    struct LDKInFlightHtlcs *result;
3588    /**
3589     * A pointer to the contents in the error state.
3590     * Reading from this pointer when `result_ok` is set is undefined.
3591     */
3592    struct LDKDecodeError *err;
3593 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
3594
3595 /**
3596  * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
3597  * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
3598  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3599  */
3600 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
3601    /**
3602     * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
3603     * `err` or `result` depending on the state of `result_ok`.
3604     */
3605    union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
3606    /**
3607     * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
3608     */
3609    bool result_ok;
3610 } LDKCResult_InFlightHtlcsDecodeErrorZ;
3611
3612
3613
3614 /**
3615  * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
3616  * that leads to it.
3617  */
3618 typedef struct MUST_USE_STRUCT LDKRouteHop {
3619    /**
3620     * A pointer to the opaque Rust object.
3621     * Nearly everywhere, inner must be non-null, however in places where
3622     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3623     */
3624    LDKnativeRouteHop *inner;
3625    /**
3626     * Indicates that this is the only struct which contains the same pointer.
3627     * Rust functions which take ownership of an object provided via an argument require
3628     * this to be true and invalidate the object pointed to by inner.
3629     */
3630    bool is_owned;
3631 } LDKRouteHop;
3632
3633 /**
3634  * The contents of CResult_RouteHopDecodeErrorZ
3635  */
3636 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
3637    /**
3638     * A pointer to the contents in the success state.
3639     * Reading from this pointer when `result_ok` is not set is undefined.
3640     */
3641    struct LDKRouteHop *result;
3642    /**
3643     * A pointer to the contents in the error state.
3644     * Reading from this pointer when `result_ok` is set is undefined.
3645     */
3646    struct LDKDecodeError *err;
3647 } LDKCResult_RouteHopDecodeErrorZPtr;
3648
3649 /**
3650  * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
3651  * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
3652  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3653  */
3654 typedef struct LDKCResult_RouteHopDecodeErrorZ {
3655    /**
3656     * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
3657     * `err` or `result` depending on the state of `result_ok`.
3658     */
3659    union LDKCResult_RouteHopDecodeErrorZPtr contents;
3660    /**
3661     * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
3662     */
3663    bool result_ok;
3664 } LDKCResult_RouteHopDecodeErrorZ;
3665
3666
3667
3668 /**
3669  * An encrypted payload and node id corresponding to a hop in a payment or onion message path, to
3670  * be encoded in the sender's onion packet. These hops cannot be identified by outside observers
3671  * and thus can be used to hide the identity of the recipient.
3672  */
3673 typedef struct MUST_USE_STRUCT LDKBlindedHop {
3674    /**
3675     * A pointer to the opaque Rust object.
3676     * Nearly everywhere, inner must be non-null, however in places where
3677     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3678     */
3679    LDKnativeBlindedHop *inner;
3680    /**
3681     * Indicates that this is the only struct which contains the same pointer.
3682     * Rust functions which take ownership of an object provided via an argument require
3683     * this to be true and invalidate the object pointed to by inner.
3684     */
3685    bool is_owned;
3686 } LDKBlindedHop;
3687
3688 /**
3689  * A dynamically-allocated array of crate::lightning::blinded_path::BlindedHops of arbitrary size.
3690  * This corresponds to std::vector in C++
3691  */
3692 typedef struct LDKCVec_BlindedHopZ {
3693    /**
3694     * The elements in the array.
3695     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3696     */
3697    struct LDKBlindedHop *data;
3698    /**
3699     * The number of elements pointed to by `data`.
3700     */
3701    uintptr_t datalen;
3702 } LDKCVec_BlindedHopZ;
3703
3704
3705
3706 /**
3707  * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
3708  * their [`Bolt12Invoice`].
3709  *
3710  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
3711  */
3712 typedef struct MUST_USE_STRUCT LDKBlindedTail {
3713    /**
3714     * A pointer to the opaque Rust object.
3715     * Nearly everywhere, inner must be non-null, however in places where
3716     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3717     */
3718    LDKnativeBlindedTail *inner;
3719    /**
3720     * Indicates that this is the only struct which contains the same pointer.
3721     * Rust functions which take ownership of an object provided via an argument require
3722     * this to be true and invalidate the object pointed to by inner.
3723     */
3724    bool is_owned;
3725 } LDKBlindedTail;
3726
3727 /**
3728  * The contents of CResult_BlindedTailDecodeErrorZ
3729  */
3730 typedef union LDKCResult_BlindedTailDecodeErrorZPtr {
3731    /**
3732     * A pointer to the contents in the success state.
3733     * Reading from this pointer when `result_ok` is not set is undefined.
3734     */
3735    struct LDKBlindedTail *result;
3736    /**
3737     * A pointer to the contents in the error state.
3738     * Reading from this pointer when `result_ok` is set is undefined.
3739     */
3740    struct LDKDecodeError *err;
3741 } LDKCResult_BlindedTailDecodeErrorZPtr;
3742
3743 /**
3744  * A CResult_BlindedTailDecodeErrorZ represents the result of a fallible operation,
3745  * containing a crate::lightning::routing::router::BlindedTail on success and a crate::lightning::ln::msgs::DecodeError on failure.
3746  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3747  */
3748 typedef struct LDKCResult_BlindedTailDecodeErrorZ {
3749    /**
3750     * The contents of this CResult_BlindedTailDecodeErrorZ, accessible via either
3751     * `err` or `result` depending on the state of `result_ok`.
3752     */
3753    union LDKCResult_BlindedTailDecodeErrorZPtr contents;
3754    /**
3755     * Whether this CResult_BlindedTailDecodeErrorZ represents a success state.
3756     */
3757    bool result_ok;
3758 } LDKCResult_BlindedTailDecodeErrorZ;
3759
3760 /**
3761  * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
3762  * This corresponds to std::vector in C++
3763  */
3764 typedef struct LDKCVec_RouteHopZ {
3765    /**
3766     * The elements in the array.
3767     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3768     */
3769    struct LDKRouteHop *data;
3770    /**
3771     * The number of elements pointed to by `data`.
3772     */
3773    uintptr_t datalen;
3774 } LDKCVec_RouteHopZ;
3775
3776 /**
3777  * A dynamically-allocated array of crate::lightning::routing::router::Paths of arbitrary size.
3778  * This corresponds to std::vector in C++
3779  */
3780 typedef struct LDKCVec_PathZ {
3781    /**
3782     * The elements in the array.
3783     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3784     */
3785    struct LDKPath *data;
3786    /**
3787     * The number of elements pointed to by `data`.
3788     */
3789    uintptr_t datalen;
3790 } LDKCVec_PathZ;
3791
3792 /**
3793  * The contents of CResult_RouteDecodeErrorZ
3794  */
3795 typedef union LDKCResult_RouteDecodeErrorZPtr {
3796    /**
3797     * A pointer to the contents in the success state.
3798     * Reading from this pointer when `result_ok` is not set is undefined.
3799     */
3800    struct LDKRoute *result;
3801    /**
3802     * A pointer to the contents in the error state.
3803     * Reading from this pointer when `result_ok` is set is undefined.
3804     */
3805    struct LDKDecodeError *err;
3806 } LDKCResult_RouteDecodeErrorZPtr;
3807
3808 /**
3809  * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
3810  * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
3811  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3812  */
3813 typedef struct LDKCResult_RouteDecodeErrorZ {
3814    /**
3815     * The contents of this CResult_RouteDecodeErrorZ, accessible via either
3816     * `err` or `result` depending on the state of `result_ok`.
3817     */
3818    union LDKCResult_RouteDecodeErrorZPtr contents;
3819    /**
3820     * Whether this CResult_RouteDecodeErrorZ represents a success state.
3821     */
3822    bool result_ok;
3823 } LDKCResult_RouteDecodeErrorZ;
3824
3825
3826
3827 /**
3828  * Parameters needed to find a [`Route`].
3829  *
3830  * Passed to [`find_route`] and [`build_route_from_hops`].
3831  */
3832 typedef struct MUST_USE_STRUCT LDKRouteParameters {
3833    /**
3834     * A pointer to the opaque Rust object.
3835     * Nearly everywhere, inner must be non-null, however in places where
3836     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3837     */
3838    LDKnativeRouteParameters *inner;
3839    /**
3840     * Indicates that this is the only struct which contains the same pointer.
3841     * Rust functions which take ownership of an object provided via an argument require
3842     * this to be true and invalidate the object pointed to by inner.
3843     */
3844    bool is_owned;
3845 } LDKRouteParameters;
3846
3847 /**
3848  * The contents of CResult_RouteParametersDecodeErrorZ
3849  */
3850 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
3851    /**
3852     * A pointer to the contents in the success state.
3853     * Reading from this pointer when `result_ok` is not set is undefined.
3854     */
3855    struct LDKRouteParameters *result;
3856    /**
3857     * A pointer to the contents in the error state.
3858     * Reading from this pointer when `result_ok` is set is undefined.
3859     */
3860    struct LDKDecodeError *err;
3861 } LDKCResult_RouteParametersDecodeErrorZPtr;
3862
3863 /**
3864  * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
3865  * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
3866  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3867  */
3868 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
3869    /**
3870     * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
3871     * `err` or `result` depending on the state of `result_ok`.
3872     */
3873    union LDKCResult_RouteParametersDecodeErrorZPtr contents;
3874    /**
3875     * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
3876     */
3877    bool result_ok;
3878 } LDKCResult_RouteParametersDecodeErrorZ;
3879
3880 /**
3881  * A dynamically-allocated array of u64s of arbitrary size.
3882  * This corresponds to std::vector in C++
3883  */
3884 typedef struct LDKCVec_u64Z {
3885    /**
3886     * The elements in the array.
3887     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3888     */
3889    uint64_t *data;
3890    /**
3891     * The number of elements pointed to by `data`.
3892     */
3893    uintptr_t datalen;
3894 } LDKCVec_u64Z;
3895
3896
3897
3898 /**
3899  * Information used to route a payment.
3900  */
3901 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
3902    /**
3903     * A pointer to the opaque Rust object.
3904     * Nearly everywhere, inner must be non-null, however in places where
3905     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3906     */
3907    LDKnativePaymentParameters *inner;
3908    /**
3909     * Indicates that this is the only struct which contains the same pointer.
3910     * Rust functions which take ownership of an object provided via an argument require
3911     * this to be true and invalidate the object pointed to by inner.
3912     */
3913    bool is_owned;
3914 } LDKPaymentParameters;
3915
3916 /**
3917  * The contents of CResult_PaymentParametersDecodeErrorZ
3918  */
3919 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
3920    /**
3921     * A pointer to the contents in the success state.
3922     * Reading from this pointer when `result_ok` is not set is undefined.
3923     */
3924    struct LDKPaymentParameters *result;
3925    /**
3926     * A pointer to the contents in the error state.
3927     * Reading from this pointer when `result_ok` is set is undefined.
3928     */
3929    struct LDKDecodeError *err;
3930 } LDKCResult_PaymentParametersDecodeErrorZPtr;
3931
3932 /**
3933  * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
3934  * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
3935  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3936  */
3937 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
3938    /**
3939     * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
3940     * `err` or `result` depending on the state of `result_ok`.
3941     */
3942    union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
3943    /**
3944     * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
3945     */
3946    bool result_ok;
3947 } LDKCResult_PaymentParametersDecodeErrorZ;
3948
3949 /**
3950  * A tuple of 2 elements. See the individual fields for the types contained.
3951  */
3952 typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
3953    /**
3954     * The element at position 0
3955     */
3956    struct LDKBlindedPayInfo a;
3957    /**
3958     * The element at position 1
3959     */
3960    struct LDKBlindedPath b;
3961 } LDKC2Tuple_BlindedPayInfoBlindedPathZ;
3962
3963 /**
3964  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
3965  * This corresponds to std::vector in C++
3966  */
3967 typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
3968    /**
3969     * The elements in the array.
3970     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3971     */
3972    struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
3973    /**
3974     * The number of elements pointed to by `data`.
3975     */
3976    uintptr_t datalen;
3977 } LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
3978
3979
3980
3981 /**
3982  * A list of hops along a payment path terminating with a channel to the recipient.
3983  */
3984 typedef struct MUST_USE_STRUCT LDKRouteHint {
3985    /**
3986     * A pointer to the opaque Rust object.
3987     * Nearly everywhere, inner must be non-null, however in places where
3988     * the Rust equivalent takes an Option, it may be set to null to indicate None.
3989     */
3990    LDKnativeRouteHint *inner;
3991    /**
3992     * Indicates that this is the only struct which contains the same pointer.
3993     * Rust functions which take ownership of an object provided via an argument require
3994     * this to be true and invalidate the object pointed to by inner.
3995     */
3996    bool is_owned;
3997 } LDKRouteHint;
3998
3999 /**
4000  * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
4001  * This corresponds to std::vector in C++
4002  */
4003 typedef struct LDKCVec_RouteHintZ {
4004    /**
4005     * The elements in the array.
4006     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4007     */
4008    struct LDKRouteHint *data;
4009    /**
4010     * The number of elements pointed to by `data`.
4011     */
4012    uintptr_t datalen;
4013 } LDKCVec_RouteHintZ;
4014
4015
4016
4017 /**
4018  * A channel descriptor for a hop along a payment path.
4019  */
4020 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
4021    /**
4022     * A pointer to the opaque Rust object.
4023     * Nearly everywhere, inner must be non-null, however in places where
4024     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4025     */
4026    LDKnativeRouteHintHop *inner;
4027    /**
4028     * Indicates that this is the only struct which contains the same pointer.
4029     * Rust functions which take ownership of an object provided via an argument require
4030     * this to be true and invalidate the object pointed to by inner.
4031     */
4032    bool is_owned;
4033 } LDKRouteHintHop;
4034
4035 /**
4036  * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
4037  * This corresponds to std::vector in C++
4038  */
4039 typedef struct LDKCVec_RouteHintHopZ {
4040    /**
4041     * The elements in the array.
4042     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4043     */
4044    struct LDKRouteHintHop *data;
4045    /**
4046     * The number of elements pointed to by `data`.
4047     */
4048    uintptr_t datalen;
4049 } LDKCVec_RouteHintHopZ;
4050
4051 /**
4052  * The contents of CResult_RouteHintDecodeErrorZ
4053  */
4054 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
4055    /**
4056     * A pointer to the contents in the success state.
4057     * Reading from this pointer when `result_ok` is not set is undefined.
4058     */
4059    struct LDKRouteHint *result;
4060    /**
4061     * A pointer to the contents in the error state.
4062     * Reading from this pointer when `result_ok` is set is undefined.
4063     */
4064    struct LDKDecodeError *err;
4065 } LDKCResult_RouteHintDecodeErrorZPtr;
4066
4067 /**
4068  * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
4069  * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
4070  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4071  */
4072 typedef struct LDKCResult_RouteHintDecodeErrorZ {
4073    /**
4074     * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
4075     * `err` or `result` depending on the state of `result_ok`.
4076     */
4077    union LDKCResult_RouteHintDecodeErrorZPtr contents;
4078    /**
4079     * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
4080     */
4081    bool result_ok;
4082 } LDKCResult_RouteHintDecodeErrorZ;
4083
4084 /**
4085  * The contents of CResult_RouteHintHopDecodeErrorZ
4086  */
4087 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
4088    /**
4089     * A pointer to the contents in the success state.
4090     * Reading from this pointer when `result_ok` is not set is undefined.
4091     */
4092    struct LDKRouteHintHop *result;
4093    /**
4094     * A pointer to the contents in the error state.
4095     * Reading from this pointer when `result_ok` is set is undefined.
4096     */
4097    struct LDKDecodeError *err;
4098 } LDKCResult_RouteHintHopDecodeErrorZPtr;
4099
4100 /**
4101  * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
4102  * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
4103  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4104  */
4105 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
4106    /**
4107     * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
4108     * `err` or `result` depending on the state of `result_ok`.
4109     */
4110    union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
4111    /**
4112     * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
4113     */
4114    bool result_ok;
4115 } LDKCResult_RouteHintHopDecodeErrorZ;
4116
4117 /**
4118  * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
4119  * This corresponds to std::vector in C++
4120  */
4121 typedef struct LDKCVec_PublicKeyZ {
4122    /**
4123     * The elements in the array.
4124     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4125     */
4126    struct LDKPublicKey *data;
4127    /**
4128     * The number of elements pointed to by `data`.
4129     */
4130    uintptr_t datalen;
4131 } LDKCVec_PublicKeyZ;
4132
4133
4134
4135 /**
4136  * [`ScoreLookUp`] implementation that uses a fixed penalty.
4137  */
4138 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4139    /**
4140     * A pointer to the opaque Rust object.
4141     * Nearly everywhere, inner must be non-null, however in places where
4142     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4143     */
4144    LDKnativeFixedPenaltyScorer *inner;
4145    /**
4146     * Indicates that this is the only struct which contains the same pointer.
4147     * Rust functions which take ownership of an object provided via an argument require
4148     * this to be true and invalidate the object pointed to by inner.
4149     */
4150    bool is_owned;
4151 } LDKFixedPenaltyScorer;
4152
4153 /**
4154  * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4155  */
4156 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4157    /**
4158     * A pointer to the contents in the success state.
4159     * Reading from this pointer when `result_ok` is not set is undefined.
4160     */
4161    struct LDKFixedPenaltyScorer *result;
4162    /**
4163     * A pointer to the contents in the error state.
4164     * Reading from this pointer when `result_ok` is set is undefined.
4165     */
4166    struct LDKDecodeError *err;
4167 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4168
4169 /**
4170  * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4171  * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4172  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4173  */
4174 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4175    /**
4176     * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4177     * `err` or `result` depending on the state of `result_ok`.
4178     */
4179    union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4180    /**
4181     * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4182     */
4183    bool result_ok;
4184 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4185
4186 /**
4187  * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
4188  * This corresponds to std::vector in C++
4189  */
4190 typedef struct LDKCVec_NodeIdZ {
4191    /**
4192     * The elements in the array.
4193     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4194     */
4195    struct LDKNodeId *data;
4196    /**
4197     * The number of elements pointed to by `data`.
4198     */
4199    uintptr_t datalen;
4200 } LDKCVec_NodeIdZ;
4201
4202 /**
4203  * A tuple of 2 elements. See the individual fields for the types contained.
4204  */
4205 typedef struct LDKC2Tuple_u64u64Z {
4206    /**
4207     * The element at position 0
4208     */
4209    uint64_t a;
4210    /**
4211     * The element at position 1
4212     */
4213    uint64_t b;
4214 } LDKC2Tuple_u64u64Z;
4215
4216 /**
4217  * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
4218  */
4219 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
4220    /**
4221     * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
4222     */
4223    LDKCOption_C2Tuple_u64u64ZZ_Some,
4224    /**
4225     * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
4226     */
4227    LDKCOption_C2Tuple_u64u64ZZ_None,
4228    /**
4229     * Must be last for serialization purposes
4230     */
4231    LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
4232 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
4233
4234 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
4235    LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
4236    union {
4237       struct {
4238          struct LDKC2Tuple_u64u64Z some;
4239       };
4240    };
4241 } LDKCOption_C2Tuple_u64u64ZZ;
4242
4243 /**
4244  * 32 u16s
4245  */
4246 typedef struct LDKThirtyTwoU16s {
4247    /**
4248     * The thirty-two 16-bit integers
4249     */
4250    uint16_t data[32];
4251 } LDKThirtyTwoU16s;
4252
4253 /**
4254  * A tuple of 2 elements. See the individual fields for the types contained.
4255  */
4256 typedef struct LDKC2Tuple_Z {
4257    /**
4258     * The element at position 0
4259     */
4260    struct LDKThirtyTwoU16s a;
4261    /**
4262     * The element at position 1
4263     */
4264    struct LDKThirtyTwoU16s b;
4265 } LDKC2Tuple_Z;
4266
4267 /**
4268  * A tuple of 2 elements. See the individual fields for the types contained.
4269  */
4270 typedef struct LDKC2Tuple__u1632_u1632Z {
4271    /**
4272     * The element at position 0
4273     */
4274    struct LDKThirtyTwoU16s a;
4275    /**
4276     * The element at position 1
4277     */
4278    struct LDKThirtyTwoU16s b;
4279 } LDKC2Tuple__u1632_u1632Z;
4280
4281 /**
4282  * An enum which can either contain a crate::c_types::derived::C2Tuple__u1632_u1632Z or not
4283  */
4284 typedef enum LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag {
4285    /**
4286     * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains a crate::c_types::derived::C2Tuple__u1632_u1632Z
4287     */
4288    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some,
4289    /**
4290     * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains nothing
4291     */
4292    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_None,
4293    /**
4294     * Must be last for serialization purposes
4295     */
4296    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Sentinel,
4297 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag;
4298
4299 typedef struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
4300    LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag tag;
4301    union {
4302       struct {
4303          struct LDKC2Tuple__u1632_u1632Z some;
4304       };
4305    };
4306 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ;
4307
4308 /**
4309  * An enum which can either contain a f64 or not
4310  */
4311 typedef enum LDKCOption_f64Z_Tag {
4312    /**
4313     * When we're in this state, this COption_f64Z contains a f64
4314     */
4315    LDKCOption_f64Z_Some,
4316    /**
4317     * When we're in this state, this COption_f64Z contains nothing
4318     */
4319    LDKCOption_f64Z_None,
4320    /**
4321     * Must be last for serialization purposes
4322     */
4323    LDKCOption_f64Z_Sentinel,
4324 } LDKCOption_f64Z_Tag;
4325
4326 typedef struct LDKCOption_f64Z {
4327    LDKCOption_f64Z_Tag tag;
4328    union {
4329       struct {
4330          double some;
4331       };
4332    };
4333 } LDKCOption_f64Z;
4334
4335
4336
4337 /**
4338  * A Record, unit of logging output with Metadata to enable filtering
4339  * Module_path, file, line to inform on log's source
4340  */
4341 typedef struct MUST_USE_STRUCT LDKRecord {
4342    /**
4343     * A pointer to the opaque Rust object.
4344     * Nearly everywhere, inner must be non-null, however in places where
4345     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4346     */
4347    LDKnativeRecord *inner;
4348    /**
4349     * Indicates that this is the only struct which contains the same pointer.
4350     * Rust functions which take ownership of an object provided via an argument require
4351     * this to be true and invalidate the object pointed to by inner.
4352     */
4353    bool is_owned;
4354 } LDKRecord;
4355
4356 /**
4357  * A trait encapsulating the operations required of a logger
4358  */
4359 typedef struct LDKLogger {
4360    /**
4361     * An opaque pointer which is passed to your function implementations as an argument.
4362     * This has no meaning in the LDK, and can be NULL or any other value.
4363     */
4364    void *this_arg;
4365    /**
4366     * Logs the `Record`
4367     */
4368    void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
4369    /**
4370     * Frees any resources associated with this object given its this_arg pointer.
4371     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4372     */
4373    void (*free)(void *this_arg);
4374 } LDKLogger;
4375
4376
4377
4378 /**
4379  * Represents the network as nodes and channels between them
4380  */
4381 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4382    /**
4383     * A pointer to the opaque Rust object.
4384     * Nearly everywhere, inner must be non-null, however in places where
4385     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4386     */
4387    LDKnativeNetworkGraph *inner;
4388    /**
4389     * Indicates that this is the only struct which contains the same pointer.
4390     * Rust functions which take ownership of an object provided via an argument require
4391     * this to be true and invalidate the object pointed to by inner.
4392     */
4393    bool is_owned;
4394 } LDKNetworkGraph;
4395
4396
4397
4398 /**
4399  * [`ScoreLookUp`] implementation using channel success probability distributions.
4400  *
4401  * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
4402  * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
4403  * When a payment is forwarded through a channel (but fails later in the route), we learn the
4404  * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
4405  *
4406  * These bounds are then used to determine a success probability using the formula from
4407  * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4408  * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
4409  *6762, 1070
4410  * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
4411  * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
4412  * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
4413  * terms of the entire path's success probability. This allows the router to directly compare
4414  * penalties for different paths. See the documentation of those parameters for the exact formulas.
4415  *
4416  * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
4417  *
4418  * Further, we track the history of our upper and lower liquidity bounds for each channel,
4419  * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
4420  * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
4421  * formula, but using the history of a channel rather than our latest estimates for the liquidity
4422  * bounds.
4423  *
4424  * # Note
4425  *
4426  * Mixing the `no-std` feature between serialization and deserialization results in undefined
4427  * behavior.
4428  *
4429  * [1]: https://arxiv.org/abs/2107.05322
4430  * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat
4431  * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat
4432  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
4433  * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat
4434  * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat
4435  */
4436 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4437    /**
4438     * A pointer to the opaque Rust object.
4439     * Nearly everywhere, inner must be non-null, however in places where
4440     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4441     */
4442    LDKnativeProbabilisticScorer *inner;
4443    /**
4444     * Indicates that this is the only struct which contains the same pointer.
4445     * Rust functions which take ownership of an object provided via an argument require
4446     * this to be true and invalidate the object pointed to by inner.
4447     */
4448    bool is_owned;
4449 } LDKProbabilisticScorer;
4450
4451 /**
4452  * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4453  */
4454 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4455    /**
4456     * A pointer to the contents in the success state.
4457     * Reading from this pointer when `result_ok` is not set is undefined.
4458     */
4459    struct LDKProbabilisticScorer *result;
4460    /**
4461     * A pointer to the contents in the error state.
4462     * Reading from this pointer when `result_ok` is set is undefined.
4463     */
4464    struct LDKDecodeError *err;
4465 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4466
4467 /**
4468  * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4469  * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4470  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4471  */
4472 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4473    /**
4474     * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4475     * `err` or `result` depending on the state of `result_ok`.
4476     */
4477    union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4478    /**
4479     * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4480     */
4481    bool result_ok;
4482 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4483
4484 /**
4485  * A tuple of 2 elements. See the individual fields for the types contained.
4486  */
4487 typedef struct LDKC2Tuple_usizeTransactionZ {
4488    /**
4489     * The element at position 0
4490     */
4491    uintptr_t a;
4492    /**
4493     * The element at position 1
4494     */
4495    struct LDKTransaction b;
4496 } LDKC2Tuple_usizeTransactionZ;
4497
4498 /**
4499  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4500  * This corresponds to std::vector in C++
4501  */
4502 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
4503    /**
4504     * The elements in the array.
4505     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4506     */
4507    struct LDKC2Tuple_usizeTransactionZ *data;
4508    /**
4509     * The number of elements pointed to by `data`.
4510     */
4511    uintptr_t datalen;
4512 } LDKCVec_C2Tuple_usizeTransactionZZ;
4513
4514 /**
4515  * A tuple of 2 elements. See the individual fields for the types contained.
4516  */
4517 typedef struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ {
4518    /**
4519     * The element at position 0
4520     */
4521    struct LDKThirtyTwoBytes a;
4522    /**
4523     * The element at position 1
4524     */
4525    struct LDKCOption_ThirtyTwoBytesZ b;
4526 } LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ;
4527
4528 /**
4529  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZs of arbitrary size.
4530  * This corresponds to std::vector in C++
4531  */
4532 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ {
4533    /**
4534     * The elements in the array.
4535     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4536     */
4537    struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ *data;
4538    /**
4539     * The number of elements pointed to by `data`.
4540     */
4541    uintptr_t datalen;
4542 } LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ;
4543
4544 /**
4545  * The contents of CResult_ChannelMonitorUpdateStatusNoneZ
4546  */
4547 typedef union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr {
4548    /**
4549     * A pointer to the contents in the success state.
4550     * Reading from this pointer when `result_ok` is not set is undefined.
4551     */
4552    enum LDKChannelMonitorUpdateStatus *result;
4553    /**
4554     * Note that this value is always NULL, as there are no contents in the Err variant
4555     */
4556    void *err;
4557 } LDKCResult_ChannelMonitorUpdateStatusNoneZPtr;
4558
4559 /**
4560  * A CResult_ChannelMonitorUpdateStatusNoneZ represents the result of a fallible operation,
4561  * containing a crate::lightning::chain::ChannelMonitorUpdateStatus on success and a () on failure.
4562  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4563  */
4564 typedef struct LDKCResult_ChannelMonitorUpdateStatusNoneZ {
4565    /**
4566     * The contents of this CResult_ChannelMonitorUpdateStatusNoneZ, accessible via either
4567     * `err` or `result` depending on the state of `result_ok`.
4568     */
4569    union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr contents;
4570    /**
4571     * Whether this CResult_ChannelMonitorUpdateStatusNoneZ represents a success state.
4572     */
4573    bool result_ok;
4574 } LDKCResult_ChannelMonitorUpdateStatusNoneZ;
4575
4576
4577
4578 /**
4579  * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
4580  * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
4581  * preimage claim backward will lead to loss of funds.
4582  */
4583 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
4584    /**
4585     * A pointer to the opaque Rust object.
4586     * Nearly everywhere, inner must be non-null, however in places where
4587     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4588     */
4589    LDKnativeHTLCUpdate *inner;
4590    /**
4591     * Indicates that this is the only struct which contains the same pointer.
4592     * Rust functions which take ownership of an object provided via an argument require
4593     * this to be true and invalidate the object pointed to by inner.
4594     */
4595    bool is_owned;
4596 } LDKHTLCUpdate;
4597
4598 /**
4599  * An event to be processed by the ChannelManager.
4600  */
4601 typedef enum LDKMonitorEvent_Tag {
4602    /**
4603     * A monitor event containing an HTLCUpdate.
4604     */
4605    LDKMonitorEvent_HTLCEvent,
4606    /**
4607     * A monitor event that the Channel's commitment transaction was confirmed.
4608     */
4609    LDKMonitorEvent_HolderForceClosed,
4610    /**
4611     * Indicates a [`ChannelMonitor`] update has completed. See
4612     * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
4613     *
4614     * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
4615     */
4616    LDKMonitorEvent_Completed,
4617    /**
4618     * Must be last for serialization purposes
4619     */
4620    LDKMonitorEvent_Sentinel,
4621 } LDKMonitorEvent_Tag;
4622
4623 typedef struct LDKMonitorEvent_LDKCompleted_Body {
4624    /**
4625     * The funding outpoint of the [`ChannelMonitor`] that was updated
4626     */
4627    struct LDKOutPoint funding_txo;
4628    /**
4629     * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
4630     * [`ChannelMonitor::get_latest_update_id`].
4631     *
4632     * Note that this should only be set to a given update's ID if all previous updates for the
4633     * same [`ChannelMonitor`] have been applied and persisted.
4634     */
4635    uint64_t monitor_update_id;
4636 } LDKMonitorEvent_LDKCompleted_Body;
4637
4638 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
4639    LDKMonitorEvent_Tag tag;
4640    union {
4641       struct {
4642          struct LDKHTLCUpdate htlc_event;
4643       };
4644       struct {
4645          struct LDKOutPoint holder_force_closed;
4646       };
4647       LDKMonitorEvent_LDKCompleted_Body completed;
4648    };
4649 } LDKMonitorEvent;
4650
4651 /**
4652  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
4653  * This corresponds to std::vector in C++
4654  */
4655 typedef struct LDKCVec_MonitorEventZ {
4656    /**
4657     * The elements in the array.
4658     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4659     */
4660    struct LDKMonitorEvent *data;
4661    /**
4662     * The number of elements pointed to by `data`.
4663     */
4664    uintptr_t datalen;
4665 } LDKCVec_MonitorEventZ;
4666
4667 /**
4668  * A tuple of 3 elements. See the individual fields for the types contained.
4669  */
4670 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
4671    /**
4672     * The element at position 0
4673     */
4674    struct LDKOutPoint a;
4675    /**
4676     * The element at position 1
4677     */
4678    struct LDKCVec_MonitorEventZ b;
4679    /**
4680     * The element at position 2
4681     */
4682    struct LDKPublicKey c;
4683 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
4684
4685 /**
4686  * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
4687  * This corresponds to std::vector in C++
4688  */
4689 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
4690    /**
4691     * The elements in the array.
4692     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4693     */
4694    struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
4695    /**
4696     * The number of elements pointed to by `data`.
4697     */
4698    uintptr_t datalen;
4699 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
4700
4701
4702
4703 /**
4704  * Features used within an `init` message.
4705  */
4706 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4707    /**
4708     * A pointer to the opaque Rust object.
4709     * Nearly everywhere, inner must be non-null, however in places where
4710     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4711     */
4712    LDKnativeInitFeatures *inner;
4713    /**
4714     * Indicates that this is the only struct which contains the same pointer.
4715     * Rust functions which take ownership of an object provided via an argument require
4716     * this to be true and invalidate the object pointed to by inner.
4717     */
4718    bool is_owned;
4719 } LDKInitFeatures;
4720
4721 /**
4722  * The contents of CResult_InitFeaturesDecodeErrorZ
4723  */
4724 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4725    /**
4726     * A pointer to the contents in the success state.
4727     * Reading from this pointer when `result_ok` is not set is undefined.
4728     */
4729    struct LDKInitFeatures *result;
4730    /**
4731     * A pointer to the contents in the error state.
4732     * Reading from this pointer when `result_ok` is set is undefined.
4733     */
4734    struct LDKDecodeError *err;
4735 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4736
4737 /**
4738  * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4739  * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4740  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4741  */
4742 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4743    /**
4744     * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4745     * `err` or `result` depending on the state of `result_ok`.
4746     */
4747    union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4748    /**
4749     * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4750     */
4751    bool result_ok;
4752 } LDKCResult_InitFeaturesDecodeErrorZ;
4753
4754
4755
4756 /**
4757  * Features used within a `channel_announcement` message.
4758  */
4759 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4760    /**
4761     * A pointer to the opaque Rust object.
4762     * Nearly everywhere, inner must be non-null, however in places where
4763     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4764     */
4765    LDKnativeChannelFeatures *inner;
4766    /**
4767     * Indicates that this is the only struct which contains the same pointer.
4768     * Rust functions which take ownership of an object provided via an argument require
4769     * this to be true and invalidate the object pointed to by inner.
4770     */
4771    bool is_owned;
4772 } LDKChannelFeatures;
4773
4774 /**
4775  * The contents of CResult_ChannelFeaturesDecodeErrorZ
4776  */
4777 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4778    /**
4779     * A pointer to the contents in the success state.
4780     * Reading from this pointer when `result_ok` is not set is undefined.
4781     */
4782    struct LDKChannelFeatures *result;
4783    /**
4784     * A pointer to the contents in the error state.
4785     * Reading from this pointer when `result_ok` is set is undefined.
4786     */
4787    struct LDKDecodeError *err;
4788 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4789
4790 /**
4791  * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4792  * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4793  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4794  */
4795 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4796    /**
4797     * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4798     * `err` or `result` depending on the state of `result_ok`.
4799     */
4800    union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4801    /**
4802     * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4803     */
4804    bool result_ok;
4805 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4806
4807
4808
4809 /**
4810  * Features used within a `node_announcement` message.
4811  */
4812 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4813    /**
4814     * A pointer to the opaque Rust object.
4815     * Nearly everywhere, inner must be non-null, however in places where
4816     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4817     */
4818    LDKnativeNodeFeatures *inner;
4819    /**
4820     * Indicates that this is the only struct which contains the same pointer.
4821     * Rust functions which take ownership of an object provided via an argument require
4822     * this to be true and invalidate the object pointed to by inner.
4823     */
4824    bool is_owned;
4825 } LDKNodeFeatures;
4826
4827 /**
4828  * The contents of CResult_NodeFeaturesDecodeErrorZ
4829  */
4830 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4831    /**
4832     * A pointer to the contents in the success state.
4833     * Reading from this pointer when `result_ok` is not set is undefined.
4834     */
4835    struct LDKNodeFeatures *result;
4836    /**
4837     * A pointer to the contents in the error state.
4838     * Reading from this pointer when `result_ok` is set is undefined.
4839     */
4840    struct LDKDecodeError *err;
4841 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4842
4843 /**
4844  * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4845  * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4846  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4847  */
4848 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4849    /**
4850     * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4851     * `err` or `result` depending on the state of `result_ok`.
4852     */
4853    union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4854    /**
4855     * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4856     */
4857    bool result_ok;
4858 } LDKCResult_NodeFeaturesDecodeErrorZ;
4859
4860
4861
4862 /**
4863  * Features used within an invoice.
4864  */
4865 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceFeatures {
4866    /**
4867     * A pointer to the opaque Rust object.
4868     * Nearly everywhere, inner must be non-null, however in places where
4869     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4870     */
4871    LDKnativeBolt11InvoiceFeatures *inner;
4872    /**
4873     * Indicates that this is the only struct which contains the same pointer.
4874     * Rust functions which take ownership of an object provided via an argument require
4875     * this to be true and invalidate the object pointed to by inner.
4876     */
4877    bool is_owned;
4878 } LDKBolt11InvoiceFeatures;
4879
4880 /**
4881  * The contents of CResult_Bolt11InvoiceFeaturesDecodeErrorZ
4882  */
4883 typedef union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr {
4884    /**
4885     * A pointer to the contents in the success state.
4886     * Reading from this pointer when `result_ok` is not set is undefined.
4887     */
4888    struct LDKBolt11InvoiceFeatures *result;
4889    /**
4890     * A pointer to the contents in the error state.
4891     * Reading from this pointer when `result_ok` is set is undefined.
4892     */
4893    struct LDKDecodeError *err;
4894 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr;
4895
4896 /**
4897  * A CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4898  * containing a crate::lightning::ln::features::Bolt11InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4899  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4900  */
4901 typedef struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ {
4902    /**
4903     * The contents of this CResult_Bolt11InvoiceFeaturesDecodeErrorZ, accessible via either
4904     * `err` or `result` depending on the state of `result_ok`.
4905     */
4906    union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr contents;
4907    /**
4908     * Whether this CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents a success state.
4909     */
4910    bool result_ok;
4911 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ;
4912
4913
4914
4915 /**
4916  * Features used within an `invoice`.
4917  */
4918 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
4919    /**
4920     * A pointer to the opaque Rust object.
4921     * Nearly everywhere, inner must be non-null, however in places where
4922     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4923     */
4924    LDKnativeBolt12InvoiceFeatures *inner;
4925    /**
4926     * Indicates that this is the only struct which contains the same pointer.
4927     * Rust functions which take ownership of an object provided via an argument require
4928     * this to be true and invalidate the object pointed to by inner.
4929     */
4930    bool is_owned;
4931 } LDKBolt12InvoiceFeatures;
4932
4933 /**
4934  * The contents of CResult_Bolt12InvoiceFeaturesDecodeErrorZ
4935  */
4936 typedef union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr {
4937    /**
4938     * A pointer to the contents in the success state.
4939     * Reading from this pointer when `result_ok` is not set is undefined.
4940     */
4941    struct LDKBolt12InvoiceFeatures *result;
4942    /**
4943     * A pointer to the contents in the error state.
4944     * Reading from this pointer when `result_ok` is set is undefined.
4945     */
4946    struct LDKDecodeError *err;
4947 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr;
4948
4949 /**
4950  * A CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4951  * containing a crate::lightning::ln::features::Bolt12InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4952  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4953  */
4954 typedef struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ {
4955    /**
4956     * The contents of this CResult_Bolt12InvoiceFeaturesDecodeErrorZ, accessible via either
4957     * `err` or `result` depending on the state of `result_ok`.
4958     */
4959    union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr contents;
4960    /**
4961     * Whether this CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents a success state.
4962     */
4963    bool result_ok;
4964 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ;
4965
4966
4967
4968 /**
4969  * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
4970  */
4971 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
4972    /**
4973     * A pointer to the opaque Rust object.
4974     * Nearly everywhere, inner must be non-null, however in places where
4975     * the Rust equivalent takes an Option, it may be set to null to indicate None.
4976     */
4977    LDKnativeBlindedHopFeatures *inner;
4978    /**
4979     * Indicates that this is the only struct which contains the same pointer.
4980     * Rust functions which take ownership of an object provided via an argument require
4981     * this to be true and invalidate the object pointed to by inner.
4982     */
4983    bool is_owned;
4984 } LDKBlindedHopFeatures;
4985
4986 /**
4987  * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
4988  */
4989 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
4990    /**
4991     * A pointer to the contents in the success state.
4992     * Reading from this pointer when `result_ok` is not set is undefined.
4993     */
4994    struct LDKBlindedHopFeatures *result;
4995    /**
4996     * A pointer to the contents in the error state.
4997     * Reading from this pointer when `result_ok` is set is undefined.
4998     */
4999    struct LDKDecodeError *err;
5000 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
5001
5002 /**
5003  * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
5004  * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5005  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5006  */
5007 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
5008    /**
5009     * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
5010     * `err` or `result` depending on the state of `result_ok`.
5011     */
5012    union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
5013    /**
5014     * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
5015     */
5016    bool result_ok;
5017 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
5018
5019
5020
5021 /**
5022  * Features used within the channel_type field in an OpenChannel message.
5023  *
5024  * A channel is always of some known \"type\", describing the transaction formats used and the exact
5025  * semantics of our interaction with our peer.
5026  *
5027  * Note that because a channel is a specific type which is proposed by the opener and accepted by
5028  * the counterparty, only required features are allowed here.
5029  *
5030  * This is serialized differently from other feature types - it is not prefixed by a length, and
5031  * thus must only appear inside a TLV where its length is known in advance.
5032  */
5033 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
5034    /**
5035     * A pointer to the opaque Rust object.
5036     * Nearly everywhere, inner must be non-null, however in places where
5037     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5038     */
5039    LDKnativeChannelTypeFeatures *inner;
5040    /**
5041     * Indicates that this is the only struct which contains the same pointer.
5042     * Rust functions which take ownership of an object provided via an argument require
5043     * this to be true and invalidate the object pointed to by inner.
5044     */
5045    bool is_owned;
5046 } LDKChannelTypeFeatures;
5047
5048 /**
5049  * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
5050  */
5051 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
5052    /**
5053     * A pointer to the contents in the success state.
5054     * Reading from this pointer when `result_ok` is not set is undefined.
5055     */
5056    struct LDKChannelTypeFeatures *result;
5057    /**
5058     * A pointer to the contents in the error state.
5059     * Reading from this pointer when `result_ok` is set is undefined.
5060     */
5061    struct LDKDecodeError *err;
5062 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
5063
5064 /**
5065  * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
5066  * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5067  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5068  */
5069 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
5070    /**
5071     * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
5072     * `err` or `result` depending on the state of `result_ok`.
5073     */
5074    union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
5075    /**
5076     * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
5077     */
5078    bool result_ok;
5079 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
5080
5081
5082
5083 /**
5084  * An `Offer` is a potentially long-lived proposal for payment of a good or service.
5085  *
5086  * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
5087  * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient
5088  * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
5089  *
5090  * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
5091  * latter.
5092  *
5093  * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
5094  *
5095  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
5096  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
5097  */
5098 typedef struct MUST_USE_STRUCT LDKOffer {
5099    /**
5100     * A pointer to the opaque Rust object.
5101     * Nearly everywhere, inner must be non-null, however in places where
5102     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5103     */
5104    LDKnativeOffer *inner;
5105    /**
5106     * Indicates that this is the only struct which contains the same pointer.
5107     * Rust functions which take ownership of an object provided via an argument require
5108     * this to be true and invalidate the object pointed to by inner.
5109     */
5110    bool is_owned;
5111 } LDKOffer;
5112
5113 /**
5114  * The contents of CResult_OfferBolt12ParseErrorZ
5115  */
5116 typedef union LDKCResult_OfferBolt12ParseErrorZPtr {
5117    /**
5118     * A pointer to the contents in the success state.
5119     * Reading from this pointer when `result_ok` is not set is undefined.
5120     */
5121    struct LDKOffer *result;
5122    /**
5123     * A pointer to the contents in the error state.
5124     * Reading from this pointer when `result_ok` is set is undefined.
5125     */
5126    struct LDKBolt12ParseError *err;
5127 } LDKCResult_OfferBolt12ParseErrorZPtr;
5128
5129 /**
5130  * A CResult_OfferBolt12ParseErrorZ represents the result of a fallible operation,
5131  * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
5132  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5133  */
5134 typedef struct LDKCResult_OfferBolt12ParseErrorZ {
5135    /**
5136     * The contents of this CResult_OfferBolt12ParseErrorZ, accessible via either
5137     * `err` or `result` depending on the state of `result_ok`.
5138     */
5139    union LDKCResult_OfferBolt12ParseErrorZPtr contents;
5140    /**
5141     * Whether this CResult_OfferBolt12ParseErrorZ represents a success state.
5142     */
5143    bool result_ok;
5144 } LDKCResult_OfferBolt12ParseErrorZ;
5145
5146 /**
5147  * The contents of CResult_PublicKeySecp256k1ErrorZ
5148  */
5149 typedef union LDKCResult_PublicKeySecp256k1ErrorZPtr {
5150    /**
5151     * A pointer to the contents in the success state.
5152     * Reading from this pointer when `result_ok` is not set is undefined.
5153     */
5154    struct LDKPublicKey *result;
5155    /**
5156     * A pointer to the contents in the error state.
5157     * Reading from this pointer when `result_ok` is set is undefined.
5158     */
5159    enum LDKSecp256k1Error *err;
5160 } LDKCResult_PublicKeySecp256k1ErrorZPtr;
5161
5162 /**
5163  * A CResult_PublicKeySecp256k1ErrorZ represents the result of a fallible operation,
5164  * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
5165  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5166  */
5167 typedef struct LDKCResult_PublicKeySecp256k1ErrorZ {
5168    /**
5169     * The contents of this CResult_PublicKeySecp256k1ErrorZ, accessible via either
5170     * `err` or `result` depending on the state of `result_ok`.
5171     */
5172    union LDKCResult_PublicKeySecp256k1ErrorZPtr contents;
5173    /**
5174     * Whether this CResult_PublicKeySecp256k1ErrorZ represents a success state.
5175     */
5176    bool result_ok;
5177 } LDKCResult_PublicKeySecp256k1ErrorZ;
5178
5179 /**
5180  * The contents of CResult_NodeIdDecodeErrorZ
5181  */
5182 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
5183    /**
5184     * A pointer to the contents in the success state.
5185     * Reading from this pointer when `result_ok` is not set is undefined.
5186     */
5187    struct LDKNodeId *result;
5188    /**
5189     * A pointer to the contents in the error state.
5190     * Reading from this pointer when `result_ok` is set is undefined.
5191     */
5192    struct LDKDecodeError *err;
5193 } LDKCResult_NodeIdDecodeErrorZPtr;
5194
5195 /**
5196  * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
5197  * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
5198  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5199  */
5200 typedef struct LDKCResult_NodeIdDecodeErrorZ {
5201    /**
5202     * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
5203     * `err` or `result` depending on the state of `result_ok`.
5204     */
5205    union LDKCResult_NodeIdDecodeErrorZPtr contents;
5206    /**
5207     * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
5208     */
5209    bool result_ok;
5210 } LDKCResult_NodeIdDecodeErrorZ;
5211
5212
5213
5214 /**
5215  * A [`channel_update`] message to be sent to or received from a peer.
5216  *
5217  * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
5218  */
5219 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
5220    /**
5221     * A pointer to the opaque Rust object.
5222     * Nearly everywhere, inner must be non-null, however in places where
5223     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5224     */
5225    LDKnativeChannelUpdate *inner;
5226    /**
5227     * Indicates that this is the only struct which contains the same pointer.
5228     * Rust functions which take ownership of an object provided via an argument require
5229     * this to be true and invalidate the object pointed to by inner.
5230     */
5231    bool is_owned;
5232 } LDKChannelUpdate;
5233
5234 /**
5235  * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
5236  * return packet by a node along the route. See [BOLT #4] for details.
5237  *
5238  * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
5239  */
5240 typedef enum LDKNetworkUpdate_Tag {
5241    /**
5242     * An error indicating a `channel_update` messages should be applied via
5243     * [`NetworkGraph::update_channel`].
5244     */
5245    LDKNetworkUpdate_ChannelUpdateMessage,
5246    /**
5247     * An error indicating that a channel failed to route a payment, which should be applied via
5248     * [`NetworkGraph::channel_failed_permanent`] if permanent.
5249     */
5250    LDKNetworkUpdate_ChannelFailure,
5251    /**
5252     * An error indicating that a node failed to route a payment, which should be applied via
5253     * [`NetworkGraph::node_failed_permanent`] if permanent.
5254     */
5255    LDKNetworkUpdate_NodeFailure,
5256    /**
5257     * Must be last for serialization purposes
5258     */
5259    LDKNetworkUpdate_Sentinel,
5260 } LDKNetworkUpdate_Tag;
5261
5262 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
5263    /**
5264     * The update to apply via [`NetworkGraph::update_channel`].
5265     */
5266    struct LDKChannelUpdate msg;
5267 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
5268
5269 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
5270    /**
5271     * The short channel id of the closed channel.
5272     */
5273    uint64_t short_channel_id;
5274    /**
5275     * Whether the channel should be permanently removed or temporarily disabled until a new
5276     * `channel_update` message is received.
5277     */
5278    bool is_permanent;
5279 } LDKNetworkUpdate_LDKChannelFailure_Body;
5280
5281 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
5282    /**
5283     * The node id of the failed node.
5284     */
5285    struct LDKPublicKey node_id;
5286    /**
5287     * Whether the node should be permanently removed from consideration or can be restored
5288     * when a new `channel_update` message is received.
5289     */
5290    bool is_permanent;
5291 } LDKNetworkUpdate_LDKNodeFailure_Body;
5292
5293 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
5294    LDKNetworkUpdate_Tag tag;
5295    union {
5296       LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
5297       LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
5298       LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
5299    };
5300 } LDKNetworkUpdate;
5301
5302 /**
5303  * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
5304  */
5305 typedef enum LDKCOption_NetworkUpdateZ_Tag {
5306    /**
5307     * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
5308     */
5309    LDKCOption_NetworkUpdateZ_Some,
5310    /**
5311     * When we're in this state, this COption_NetworkUpdateZ contains nothing
5312     */
5313    LDKCOption_NetworkUpdateZ_None,
5314    /**
5315     * Must be last for serialization purposes
5316     */
5317    LDKCOption_NetworkUpdateZ_Sentinel,
5318 } LDKCOption_NetworkUpdateZ_Tag;
5319
5320 typedef struct LDKCOption_NetworkUpdateZ {
5321    LDKCOption_NetworkUpdateZ_Tag tag;
5322    union {
5323       struct {
5324          struct LDKNetworkUpdate some;
5325       };
5326    };
5327 } LDKCOption_NetworkUpdateZ;
5328
5329 /**
5330  * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
5331  */
5332 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
5333    /**
5334     * A pointer to the contents in the success state.
5335     * Reading from this pointer when `result_ok` is not set is undefined.
5336     */
5337    struct LDKCOption_NetworkUpdateZ *result;
5338    /**
5339     * A pointer to the contents in the error state.
5340     * Reading from this pointer when `result_ok` is set is undefined.
5341     */
5342    struct LDKDecodeError *err;
5343 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5344
5345 /**
5346  * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5347  * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5348  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5349  */
5350 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5351    /**
5352     * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5353     * `err` or `result` depending on the state of `result_ok`.
5354     */
5355    union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5356    /**
5357     * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5358     */
5359    bool result_ok;
5360 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5361
5362 /**
5363  * The contents of CResult_TxOutUtxoLookupErrorZ
5364  */
5365 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
5366    /**
5367     * A pointer to the contents in the success state.
5368     * Reading from this pointer when `result_ok` is not set is undefined.
5369     */
5370    struct LDKTxOut *result;
5371    /**
5372     * A pointer to the contents in the error state.
5373     * Reading from this pointer when `result_ok` is set is undefined.
5374     */
5375    enum LDKUtxoLookupError *err;
5376 } LDKCResult_TxOutUtxoLookupErrorZPtr;
5377
5378 /**
5379  * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
5380  * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
5381  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5382  */
5383 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
5384    /**
5385     * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
5386     * `err` or `result` depending on the state of `result_ok`.
5387     */
5388    union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
5389    /**
5390     * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
5391     */
5392    bool result_ok;
5393 } LDKCResult_TxOutUtxoLookupErrorZ;
5394
5395
5396
5397 /**
5398  * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
5399  *
5400  * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
5401  */
5402 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
5403    /**
5404     * A pointer to the opaque Rust object.
5405     * Nearly everywhere, inner must be non-null, however in places where
5406     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5407     */
5408    LDKnativeUtxoFuture *inner;
5409    /**
5410     * Indicates that this is the only struct which contains the same pointer.
5411     * Rust functions which take ownership of an object provided via an argument require
5412     * this to be true and invalidate the object pointed to by inner.
5413     */
5414    bool is_owned;
5415 } LDKUtxoFuture;
5416
5417 /**
5418  * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
5419  * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
5420  * variant.
5421  */
5422 typedef enum LDKUtxoResult_Tag {
5423    /**
5424     * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
5425     * requested or a [`UtxoLookupError`].
5426     */
5427    LDKUtxoResult_Sync,
5428    /**
5429     * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
5430     * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
5431     *
5432     * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
5433     * but only fairly loosely. Because a pending checks block all message processing, leaving
5434     * checks pending for an extended time may cause DoS of other functions. It is recommended you
5435     * keep a tight timeout on lookups, on the order of a few seconds.
5436     */
5437    LDKUtxoResult_Async,
5438    /**
5439     * Must be last for serialization purposes
5440     */
5441    LDKUtxoResult_Sentinel,
5442 } LDKUtxoResult_Tag;
5443
5444 typedef struct MUST_USE_STRUCT LDKUtxoResult {
5445    LDKUtxoResult_Tag tag;
5446    union {
5447       struct {
5448          struct LDKCResult_TxOutUtxoLookupErrorZ sync;
5449       };
5450       struct {
5451          struct LDKUtxoFuture async;
5452       };
5453    };
5454 } LDKUtxoResult;
5455
5456 /**
5457  * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
5458  */
5459 typedef struct LDKUtxoLookup {
5460    /**
5461     * An opaque pointer which is passed to your function implementations as an argument.
5462     * This has no meaning in the LDK, and can be NULL or any other value.
5463     */
5464    void *this_arg;
5465    /**
5466     * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5467     * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
5468     * is unknown.
5469     *
5470     * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5471     */
5472    struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
5473    /**
5474     * Frees any resources associated with this object given its this_arg pointer.
5475     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5476     */
5477    void (*free)(void *this_arg);
5478 } LDKUtxoLookup;
5479
5480 /**
5481  * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
5482  */
5483 typedef enum LDKCOption_UtxoLookupZ_Tag {
5484    /**
5485     * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
5486     */
5487    LDKCOption_UtxoLookupZ_Some,
5488    /**
5489     * When we're in this state, this COption_UtxoLookupZ contains nothing
5490     */
5491    LDKCOption_UtxoLookupZ_None,
5492    /**
5493     * Must be last for serialization purposes
5494     */
5495    LDKCOption_UtxoLookupZ_Sentinel,
5496 } LDKCOption_UtxoLookupZ_Tag;
5497
5498 typedef struct LDKCOption_UtxoLookupZ {
5499    LDKCOption_UtxoLookupZ_Tag tag;
5500    union {
5501       struct {
5502          struct LDKUtxoLookup some;
5503       };
5504    };
5505 } LDKCOption_UtxoLookupZ;
5506
5507 /**
5508  * The contents of CResult_NoneLightningErrorZ
5509  */
5510 typedef union LDKCResult_NoneLightningErrorZPtr {
5511    /**
5512     * Note that this value is always NULL, as there are no contents in the OK variant
5513     */
5514    void *result;
5515    /**
5516     * A pointer to the contents in the error state.
5517     * Reading from this pointer when `result_ok` is set is undefined.
5518     */
5519    struct LDKLightningError *err;
5520 } LDKCResult_NoneLightningErrorZPtr;
5521
5522 /**
5523  * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5524  * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5525  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5526  */
5527 typedef struct LDKCResult_NoneLightningErrorZ {
5528    /**
5529     * The contents of this CResult_NoneLightningErrorZ, accessible via either
5530     * `err` or `result` depending on the state of `result_ok`.
5531     */
5532    union LDKCResult_NoneLightningErrorZPtr contents;
5533    /**
5534     * Whether this CResult_NoneLightningErrorZ represents a success state.
5535     */
5536    bool result_ok;
5537 } LDKCResult_NoneLightningErrorZ;
5538
5539 /**
5540  * The contents of CResult_boolLightningErrorZ
5541  */
5542 typedef union LDKCResult_boolLightningErrorZPtr {
5543    /**
5544     * A pointer to the contents in the success state.
5545     * Reading from this pointer when `result_ok` is not set is undefined.
5546     */
5547    bool *result;
5548    /**
5549     * A pointer to the contents in the error state.
5550     * Reading from this pointer when `result_ok` is set is undefined.
5551     */
5552    struct LDKLightningError *err;
5553 } LDKCResult_boolLightningErrorZPtr;
5554
5555 /**
5556  * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5557  * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5558  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5559  */
5560 typedef struct LDKCResult_boolLightningErrorZ {
5561    /**
5562     * The contents of this CResult_boolLightningErrorZ, accessible via either
5563     * `err` or `result` depending on the state of `result_ok`.
5564     */
5565    union LDKCResult_boolLightningErrorZPtr contents;
5566    /**
5567     * Whether this CResult_boolLightningErrorZ represents a success state.
5568     */
5569    bool result_ok;
5570 } LDKCResult_boolLightningErrorZ;
5571
5572
5573
5574 /**
5575  * A [`channel_announcement`] message to be sent to or received from a peer.
5576  *
5577  * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
5578  */
5579 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
5580    /**
5581     * A pointer to the opaque Rust object.
5582     * Nearly everywhere, inner must be non-null, however in places where
5583     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5584     */
5585    LDKnativeChannelAnnouncement *inner;
5586    /**
5587     * Indicates that this is the only struct which contains the same pointer.
5588     * Rust functions which take ownership of an object provided via an argument require
5589     * this to be true and invalidate the object pointed to by inner.
5590     */
5591    bool is_owned;
5592 } LDKChannelAnnouncement;
5593
5594 /**
5595  * A tuple of 3 elements. See the individual fields for the types contained.
5596  */
5597 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5598    /**
5599     * The element at position 0
5600     */
5601    struct LDKChannelAnnouncement a;
5602    /**
5603     * The element at position 1
5604     */
5605    struct LDKChannelUpdate b;
5606    /**
5607     * The element at position 2
5608     */
5609    struct LDKChannelUpdate c;
5610 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5611
5612 /**
5613  * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
5614  */
5615 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
5616    /**
5617     * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
5618     */
5619    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
5620    /**
5621     * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
5622     */
5623    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
5624    /**
5625     * Must be last for serialization purposes
5626     */
5627    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
5628 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
5629
5630 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5631    LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
5632    union {
5633       struct {
5634          struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
5635       };
5636    };
5637 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5638
5639
5640
5641 /**
5642  * An [`accept_channel`] message to be sent to or received from a peer.
5643  *
5644  * Used in V1 channel establishment
5645  *
5646  * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
5647  */
5648 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
5649    /**
5650     * A pointer to the opaque Rust object.
5651     * Nearly everywhere, inner must be non-null, however in places where
5652     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5653     */
5654    LDKnativeAcceptChannel *inner;
5655    /**
5656     * Indicates that this is the only struct which contains the same pointer.
5657     * Rust functions which take ownership of an object provided via an argument require
5658     * this to be true and invalidate the object pointed to by inner.
5659     */
5660    bool is_owned;
5661 } LDKAcceptChannel;
5662
5663
5664
5665 /**
5666  * An accept_channel2 message to be sent by or received from the channel accepter.
5667  *
5668  * Used in V2 channel establishment
5669  *
5670  */
5671 typedef struct MUST_USE_STRUCT LDKAcceptChannelV2 {
5672    /**
5673     * A pointer to the opaque Rust object.
5674     * Nearly everywhere, inner must be non-null, however in places where
5675     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5676     */
5677    LDKnativeAcceptChannelV2 *inner;
5678    /**
5679     * Indicates that this is the only struct which contains the same pointer.
5680     * Rust functions which take ownership of an object provided via an argument require
5681     * this to be true and invalidate the object pointed to by inner.
5682     */
5683    bool is_owned;
5684 } LDKAcceptChannelV2;
5685
5686
5687
5688 /**
5689  * An [`open_channel`] message to be sent to or received from a peer.
5690  *
5691  * Used in V1 channel establishment
5692  *
5693  * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
5694  */
5695 typedef struct MUST_USE_STRUCT LDKOpenChannel {
5696    /**
5697     * A pointer to the opaque Rust object.
5698     * Nearly everywhere, inner must be non-null, however in places where
5699     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5700     */
5701    LDKnativeOpenChannel *inner;
5702    /**
5703     * Indicates that this is the only struct which contains the same pointer.
5704     * Rust functions which take ownership of an object provided via an argument require
5705     * this to be true and invalidate the object pointed to by inner.
5706     */
5707    bool is_owned;
5708 } LDKOpenChannel;
5709
5710
5711
5712 /**
5713  * An open_channel2 message to be sent by or received from the channel initiator.
5714  *
5715  * Used in V2 channel establishment
5716  *
5717  */
5718 typedef struct MUST_USE_STRUCT LDKOpenChannelV2 {
5719    /**
5720     * A pointer to the opaque Rust object.
5721     * Nearly everywhere, inner must be non-null, however in places where
5722     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5723     */
5724    LDKnativeOpenChannelV2 *inner;
5725    /**
5726     * Indicates that this is the only struct which contains the same pointer.
5727     * Rust functions which take ownership of an object provided via an argument require
5728     * this to be true and invalidate the object pointed to by inner.
5729     */
5730    bool is_owned;
5731 } LDKOpenChannelV2;
5732
5733
5734
5735 /**
5736  * A [`funding_created`] message to be sent to or received from a peer.
5737  *
5738  * Used in V1 channel establishment
5739  *
5740  * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
5741  */
5742 typedef struct MUST_USE_STRUCT LDKFundingCreated {
5743    /**
5744     * A pointer to the opaque Rust object.
5745     * Nearly everywhere, inner must be non-null, however in places where
5746     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5747     */
5748    LDKnativeFundingCreated *inner;
5749    /**
5750     * Indicates that this is the only struct which contains the same pointer.
5751     * Rust functions which take ownership of an object provided via an argument require
5752     * this to be true and invalidate the object pointed to by inner.
5753     */
5754    bool is_owned;
5755 } LDKFundingCreated;
5756
5757
5758
5759 /**
5760  * A [`funding_signed`] message to be sent to or received from a peer.
5761  *
5762  * Used in V1 channel establishment
5763  *
5764  * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
5765  */
5766 typedef struct MUST_USE_STRUCT LDKFundingSigned {
5767    /**
5768     * A pointer to the opaque Rust object.
5769     * Nearly everywhere, inner must be non-null, however in places where
5770     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5771     */
5772    LDKnativeFundingSigned *inner;
5773    /**
5774     * Indicates that this is the only struct which contains the same pointer.
5775     * Rust functions which take ownership of an object provided via an argument require
5776     * this to be true and invalidate the object pointed to by inner.
5777     */
5778    bool is_owned;
5779 } LDKFundingSigned;
5780
5781
5782
5783 /**
5784  * A tx_add_input message for adding an input during interactive transaction construction
5785  *
5786  */
5787 typedef struct MUST_USE_STRUCT LDKTxAddInput {
5788    /**
5789     * A pointer to the opaque Rust object.
5790     * Nearly everywhere, inner must be non-null, however in places where
5791     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5792     */
5793    LDKnativeTxAddInput *inner;
5794    /**
5795     * Indicates that this is the only struct which contains the same pointer.
5796     * Rust functions which take ownership of an object provided via an argument require
5797     * this to be true and invalidate the object pointed to by inner.
5798     */
5799    bool is_owned;
5800 } LDKTxAddInput;
5801
5802
5803
5804 /**
5805  * A tx_add_output message for adding an output during interactive transaction construction.
5806  *
5807  */
5808 typedef struct MUST_USE_STRUCT LDKTxAddOutput {
5809    /**
5810     * A pointer to the opaque Rust object.
5811     * Nearly everywhere, inner must be non-null, however in places where
5812     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5813     */
5814    LDKnativeTxAddOutput *inner;
5815    /**
5816     * Indicates that this is the only struct which contains the same pointer.
5817     * Rust functions which take ownership of an object provided via an argument require
5818     * this to be true and invalidate the object pointed to by inner.
5819     */
5820    bool is_owned;
5821 } LDKTxAddOutput;
5822
5823
5824
5825 /**
5826  * A tx_remove_input message for removing an input during interactive transaction construction.
5827  *
5828  */
5829 typedef struct MUST_USE_STRUCT LDKTxRemoveInput {
5830    /**
5831     * A pointer to the opaque Rust object.
5832     * Nearly everywhere, inner must be non-null, however in places where
5833     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5834     */
5835    LDKnativeTxRemoveInput *inner;
5836    /**
5837     * Indicates that this is the only struct which contains the same pointer.
5838     * Rust functions which take ownership of an object provided via an argument require
5839     * this to be true and invalidate the object pointed to by inner.
5840     */
5841    bool is_owned;
5842 } LDKTxRemoveInput;
5843
5844
5845
5846 /**
5847  * A tx_remove_output message for removing an output during interactive transaction construction.
5848  *
5849  */
5850 typedef struct MUST_USE_STRUCT LDKTxRemoveOutput {
5851    /**
5852     * A pointer to the opaque Rust object.
5853     * Nearly everywhere, inner must be non-null, however in places where
5854     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5855     */
5856    LDKnativeTxRemoveOutput *inner;
5857    /**
5858     * Indicates that this is the only struct which contains the same pointer.
5859     * Rust functions which take ownership of an object provided via an argument require
5860     * this to be true and invalidate the object pointed to by inner.
5861     */
5862    bool is_owned;
5863 } LDKTxRemoveOutput;
5864
5865
5866
5867 /**
5868  * A tx_complete message signalling the conclusion of a peer's transaction contributions during
5869  * interactive transaction construction.
5870  *
5871  */
5872 typedef struct MUST_USE_STRUCT LDKTxComplete {
5873    /**
5874     * A pointer to the opaque Rust object.
5875     * Nearly everywhere, inner must be non-null, however in places where
5876     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5877     */
5878    LDKnativeTxComplete *inner;
5879    /**
5880     * Indicates that this is the only struct which contains the same pointer.
5881     * Rust functions which take ownership of an object provided via an argument require
5882     * this to be true and invalidate the object pointed to by inner.
5883     */
5884    bool is_owned;
5885 } LDKTxComplete;
5886
5887
5888
5889 /**
5890  * A tx_signatures message containing the sender's signatures for a transaction constructed with
5891  * interactive transaction construction.
5892  *
5893  */
5894 typedef struct MUST_USE_STRUCT LDKTxSignatures {
5895    /**
5896     * A pointer to the opaque Rust object.
5897     * Nearly everywhere, inner must be non-null, however in places where
5898     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5899     */
5900    LDKnativeTxSignatures *inner;
5901    /**
5902     * Indicates that this is the only struct which contains the same pointer.
5903     * Rust functions which take ownership of an object provided via an argument require
5904     * this to be true and invalidate the object pointed to by inner.
5905     */
5906    bool is_owned;
5907 } LDKTxSignatures;
5908
5909
5910
5911 /**
5912  * A tx_init_rbf message which initiates a replacement of the transaction after it's been
5913  * completed.
5914  *
5915  */
5916 typedef struct MUST_USE_STRUCT LDKTxInitRbf {
5917    /**
5918     * A pointer to the opaque Rust object.
5919     * Nearly everywhere, inner must be non-null, however in places where
5920     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5921     */
5922    LDKnativeTxInitRbf *inner;
5923    /**
5924     * Indicates that this is the only struct which contains the same pointer.
5925     * Rust functions which take ownership of an object provided via an argument require
5926     * this to be true and invalidate the object pointed to by inner.
5927     */
5928    bool is_owned;
5929 } LDKTxInitRbf;
5930
5931
5932
5933 /**
5934  * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
5935  * completed.
5936  *
5937  */
5938 typedef struct MUST_USE_STRUCT LDKTxAckRbf {
5939    /**
5940     * A pointer to the opaque Rust object.
5941     * Nearly everywhere, inner must be non-null, however in places where
5942     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5943     */
5944    LDKnativeTxAckRbf *inner;
5945    /**
5946     * Indicates that this is the only struct which contains the same pointer.
5947     * Rust functions which take ownership of an object provided via an argument require
5948     * this to be true and invalidate the object pointed to by inner.
5949     */
5950    bool is_owned;
5951 } LDKTxAckRbf;
5952
5953
5954
5955 /**
5956  * A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
5957  *
5958  */
5959 typedef struct MUST_USE_STRUCT LDKTxAbort {
5960    /**
5961     * A pointer to the opaque Rust object.
5962     * Nearly everywhere, inner must be non-null, however in places where
5963     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5964     */
5965    LDKnativeTxAbort *inner;
5966    /**
5967     * Indicates that this is the only struct which contains the same pointer.
5968     * Rust functions which take ownership of an object provided via an argument require
5969     * this to be true and invalidate the object pointed to by inner.
5970     */
5971    bool is_owned;
5972 } LDKTxAbort;
5973
5974
5975
5976 /**
5977  * A [`channel_ready`] message to be sent to or received from a peer.
5978  *
5979  * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
5980  */
5981 typedef struct MUST_USE_STRUCT LDKChannelReady {
5982    /**
5983     * A pointer to the opaque Rust object.
5984     * Nearly everywhere, inner must be non-null, however in places where
5985     * the Rust equivalent takes an Option, it may be set to null to indicate None.
5986     */
5987    LDKnativeChannelReady *inner;
5988    /**
5989     * Indicates that this is the only struct which contains the same pointer.
5990     * Rust functions which take ownership of an object provided via an argument require
5991     * this to be true and invalidate the object pointed to by inner.
5992     */
5993    bool is_owned;
5994 } LDKChannelReady;
5995
5996
5997
5998 /**
5999  * An [`announcement_signatures`] message to be sent to or received from a peer.
6000  *
6001  * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
6002  */
6003 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
6004    /**
6005     * A pointer to the opaque Rust object.
6006     * Nearly everywhere, inner must be non-null, however in places where
6007     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6008     */
6009    LDKnativeAnnouncementSignatures *inner;
6010    /**
6011     * Indicates that this is the only struct which contains the same pointer.
6012     * Rust functions which take ownership of an object provided via an argument require
6013     * this to be true and invalidate the object pointed to by inner.
6014     */
6015    bool is_owned;
6016 } LDKAnnouncementSignatures;
6017
6018
6019
6020 /**
6021  * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
6022  * transaction updates if they were pending.
6023  */
6024 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
6025    /**
6026     * A pointer to the opaque Rust object.
6027     * Nearly everywhere, inner must be non-null, however in places where
6028     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6029     */
6030    LDKnativeCommitmentUpdate *inner;
6031    /**
6032     * Indicates that this is the only struct which contains the same pointer.
6033     * Rust functions which take ownership of an object provided via an argument require
6034     * this to be true and invalidate the object pointed to by inner.
6035     */
6036    bool is_owned;
6037 } LDKCommitmentUpdate;
6038
6039
6040
6041 /**
6042  * A [`revoke_and_ack`] message to be sent to or received from a peer.
6043  *
6044  * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
6045  */
6046 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
6047    /**
6048     * A pointer to the opaque Rust object.
6049     * Nearly everywhere, inner must be non-null, however in places where
6050     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6051     */
6052    LDKnativeRevokeAndACK *inner;
6053    /**
6054     * Indicates that this is the only struct which contains the same pointer.
6055     * Rust functions which take ownership of an object provided via an argument require
6056     * this to be true and invalidate the object pointed to by inner.
6057     */
6058    bool is_owned;
6059 } LDKRevokeAndACK;
6060
6061
6062
6063 /**
6064  * A [`closing_signed`] message to be sent to or received from a peer.
6065  *
6066  * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
6067  */
6068 typedef struct MUST_USE_STRUCT LDKClosingSigned {
6069    /**
6070     * A pointer to the opaque Rust object.
6071     * Nearly everywhere, inner must be non-null, however in places where
6072     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6073     */
6074    LDKnativeClosingSigned *inner;
6075    /**
6076     * Indicates that this is the only struct which contains the same pointer.
6077     * Rust functions which take ownership of an object provided via an argument require
6078     * this to be true and invalidate the object pointed to by inner.
6079     */
6080    bool is_owned;
6081 } LDKClosingSigned;
6082
6083
6084
6085 /**
6086  * A [`shutdown`] message to be sent to or received from a peer.
6087  *
6088  * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
6089  */
6090 typedef struct MUST_USE_STRUCT LDKShutdown {
6091    /**
6092     * A pointer to the opaque Rust object.
6093     * Nearly everywhere, inner must be non-null, however in places where
6094     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6095     */
6096    LDKnativeShutdown *inner;
6097    /**
6098     * Indicates that this is the only struct which contains the same pointer.
6099     * Rust functions which take ownership of an object provided via an argument require
6100     * this to be true and invalidate the object pointed to by inner.
6101     */
6102    bool is_owned;
6103 } LDKShutdown;
6104
6105
6106
6107 /**
6108  * A [`channel_reestablish`] message to be sent to or received from a peer.
6109  *
6110  * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
6111  */
6112 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
6113    /**
6114     * A pointer to the opaque Rust object.
6115     * Nearly everywhere, inner must be non-null, however in places where
6116     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6117     */
6118    LDKnativeChannelReestablish *inner;
6119    /**
6120     * Indicates that this is the only struct which contains the same pointer.
6121     * Rust functions which take ownership of an object provided via an argument require
6122     * this to be true and invalidate the object pointed to by inner.
6123     */
6124    bool is_owned;
6125 } LDKChannelReestablish;
6126
6127
6128
6129 /**
6130  * A [`node_announcement`] message to be sent to or received from a peer.
6131  *
6132  * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
6133  */
6134 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
6135    /**
6136     * A pointer to the opaque Rust object.
6137     * Nearly everywhere, inner must be non-null, however in places where
6138     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6139     */
6140    LDKnativeNodeAnnouncement *inner;
6141    /**
6142     * Indicates that this is the only struct which contains the same pointer.
6143     * Rust functions which take ownership of an object provided via an argument require
6144     * this to be true and invalidate the object pointed to by inner.
6145     */
6146    bool is_owned;
6147 } LDKNodeAnnouncement;
6148
6149
6150
6151 /**
6152  * An [`error`] message to be sent to or received from a peer.
6153  *
6154  * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
6155  */
6156 typedef struct MUST_USE_STRUCT LDKErrorMessage {
6157    /**
6158     * A pointer to the opaque Rust object.
6159     * Nearly everywhere, inner must be non-null, however in places where
6160     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6161     */
6162    LDKnativeErrorMessage *inner;
6163    /**
6164     * Indicates that this is the only struct which contains the same pointer.
6165     * Rust functions which take ownership of an object provided via an argument require
6166     * this to be true and invalidate the object pointed to by inner.
6167     */
6168    bool is_owned;
6169 } LDKErrorMessage;
6170
6171
6172
6173 /**
6174  * A [`warning`] message to be sent to or received from a peer.
6175  *
6176  * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
6177  */
6178 typedef struct MUST_USE_STRUCT LDKWarningMessage {
6179    /**
6180     * A pointer to the opaque Rust object.
6181     * Nearly everywhere, inner must be non-null, however in places where
6182     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6183     */
6184    LDKnativeWarningMessage *inner;
6185    /**
6186     * Indicates that this is the only struct which contains the same pointer.
6187     * Rust functions which take ownership of an object provided via an argument require
6188     * this to be true and invalidate the object pointed to by inner.
6189     */
6190    bool is_owned;
6191 } LDKWarningMessage;
6192
6193 /**
6194  * Used to put an error message in a [`LightningError`].
6195  */
6196 typedef enum LDKErrorAction_Tag {
6197    /**
6198     * The peer took some action which made us think they were useless. Disconnect them.
6199     */
6200    LDKErrorAction_DisconnectPeer,
6201    /**
6202     * The peer did something incorrect. Tell them without closing any channels and disconnect them.
6203     */
6204    LDKErrorAction_DisconnectPeerWithWarning,
6205    /**
6206     * The peer did something harmless that we weren't able to process, just log and ignore
6207     */
6208    LDKErrorAction_IgnoreError,
6209    /**
6210     * The peer did something harmless that we weren't able to meaningfully process.
6211     * If the error is logged, log it at the given level.
6212     */
6213    LDKErrorAction_IgnoreAndLog,
6214    /**
6215     * The peer provided us with a gossip message which we'd already seen. In most cases this
6216     * should be ignored, but it may result in the message being forwarded if it is a duplicate of
6217     * our own channel announcements.
6218     */
6219    LDKErrorAction_IgnoreDuplicateGossip,
6220    /**
6221     * The peer did something incorrect. Tell them.
6222     */
6223    LDKErrorAction_SendErrorMessage,
6224    /**
6225     * The peer did something incorrect. Tell them without closing any channels.
6226     */
6227    LDKErrorAction_SendWarningMessage,
6228    /**
6229     * Must be last for serialization purposes
6230     */
6231    LDKErrorAction_Sentinel,
6232 } LDKErrorAction_Tag;
6233
6234 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
6235    /**
6236     * An error message which we should make an effort to send before we disconnect.
6237     *
6238     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6239     */
6240    struct LDKErrorMessage msg;
6241 } LDKErrorAction_LDKDisconnectPeer_Body;
6242
6243 typedef struct LDKErrorAction_LDKDisconnectPeerWithWarning_Body {
6244    /**
6245     * A warning message which we should make an effort to send before we disconnect.
6246     */
6247    struct LDKWarningMessage msg;
6248 } LDKErrorAction_LDKDisconnectPeerWithWarning_Body;
6249
6250 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
6251    /**
6252     * The message to send.
6253     */
6254    struct LDKErrorMessage msg;
6255 } LDKErrorAction_LDKSendErrorMessage_Body;
6256
6257 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
6258    /**
6259     * The message to send.
6260     */
6261    struct LDKWarningMessage msg;
6262    /**
6263     * The peer may have done something harmless that we weren't able to meaningfully process,
6264     * though we should still tell them about it.
6265     * If this event is logged, log it at the given level.
6266     */
6267    enum LDKLevel log_level;
6268 } LDKErrorAction_LDKSendWarningMessage_Body;
6269
6270 typedef struct MUST_USE_STRUCT LDKErrorAction {
6271    LDKErrorAction_Tag tag;
6272    union {
6273       LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
6274       LDKErrorAction_LDKDisconnectPeerWithWarning_Body disconnect_peer_with_warning;
6275       struct {
6276          enum LDKLevel ignore_and_log;
6277       };
6278       LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
6279       LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
6280    };
6281 } LDKErrorAction;
6282
6283
6284
6285 /**
6286  * A [`query_channel_range`] message is used to query a peer for channel
6287  * UTXOs in a range of blocks. The recipient of a query makes a best
6288  * effort to reply to the query using one or more [`ReplyChannelRange`]
6289  * messages.
6290  *
6291  * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6292  */
6293 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
6294    /**
6295     * A pointer to the opaque Rust object.
6296     * Nearly everywhere, inner must be non-null, however in places where
6297     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6298     */
6299    LDKnativeQueryChannelRange *inner;
6300    /**
6301     * Indicates that this is the only struct which contains the same pointer.
6302     * Rust functions which take ownership of an object provided via an argument require
6303     * this to be true and invalidate the object pointed to by inner.
6304     */
6305    bool is_owned;
6306 } LDKQueryChannelRange;
6307
6308
6309
6310 /**
6311  * A [`query_short_channel_ids`] message is used to query a peer for
6312  * routing gossip messages related to one or more `short_channel_id`s.
6313  *
6314  * The query recipient will reply with the latest, if available,
6315  * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
6316  * it maintains for the requested `short_channel_id`s followed by a
6317  * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
6318  * this query are encoded. We only support `encoding_type=0` uncompressed
6319  * serialization and do not support `encoding_type=1` zlib serialization.
6320  *
6321  * [`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
6322  */
6323 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
6324    /**
6325     * A pointer to the opaque Rust object.
6326     * Nearly everywhere, inner must be non-null, however in places where
6327     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6328     */
6329    LDKnativeQueryShortChannelIds *inner;
6330    /**
6331     * Indicates that this is the only struct which contains the same pointer.
6332     * Rust functions which take ownership of an object provided via an argument require
6333     * this to be true and invalidate the object pointed to by inner.
6334     */
6335    bool is_owned;
6336 } LDKQueryShortChannelIds;
6337
6338
6339
6340 /**
6341  * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
6342  * message.
6343  *
6344  * Multiple `reply_channel_range` messages can be sent in reply
6345  * to a single [`QueryChannelRange`] message. The query recipient makes a
6346  * best effort to respond based on their local network view which may
6347  * not be a perfect view of the network. The `short_channel_id`s in the
6348  * reply are encoded. We only support `encoding_type=0` uncompressed
6349  * serialization and do not support `encoding_type=1` zlib serialization.
6350  *
6351  * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6352  */
6353 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
6354    /**
6355     * A pointer to the opaque Rust object.
6356     * Nearly everywhere, inner must be non-null, however in places where
6357     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6358     */
6359    LDKnativeReplyChannelRange *inner;
6360    /**
6361     * Indicates that this is the only struct which contains the same pointer.
6362     * Rust functions which take ownership of an object provided via an argument require
6363     * this to be true and invalidate the object pointed to by inner.
6364     */
6365    bool is_owned;
6366 } LDKReplyChannelRange;
6367
6368
6369
6370 /**
6371  * A [`gossip_timestamp_filter`] message is used by a node to request
6372  * gossip relay for messages in the requested time range when the
6373  * `gossip_queries` feature has been negotiated.
6374  *
6375  * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
6376  */
6377 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6378    /**
6379     * A pointer to the opaque Rust object.
6380     * Nearly everywhere, inner must be non-null, however in places where
6381     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6382     */
6383    LDKnativeGossipTimestampFilter *inner;
6384    /**
6385     * Indicates that this is the only struct which contains the same pointer.
6386     * Rust functions which take ownership of an object provided via an argument require
6387     * this to be true and invalidate the object pointed to by inner.
6388     */
6389    bool is_owned;
6390 } LDKGossipTimestampFilter;
6391
6392 /**
6393  * An event generated by ChannelManager which indicates a message should be sent to a peer (or
6394  * broadcast to most peers).
6395  * These events are handled by PeerManager::process_events if you are using a PeerManager.
6396  */
6397 typedef enum LDKMessageSendEvent_Tag {
6398    /**
6399     * Used to indicate that we've accepted a channel open and should send the accept_channel
6400     * message provided to the given peer.
6401     */
6402    LDKMessageSendEvent_SendAcceptChannel,
6403    /**
6404     * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
6405     * message provided to the given peer.
6406     */
6407    LDKMessageSendEvent_SendAcceptChannelV2,
6408    /**
6409     * Used to indicate that we've initiated a channel open and should send the open_channel
6410     * message provided to the given peer.
6411     */
6412    LDKMessageSendEvent_SendOpenChannel,
6413    /**
6414     * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
6415     * message provided to the given peer.
6416     */
6417    LDKMessageSendEvent_SendOpenChannelV2,
6418    /**
6419     * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
6420     */
6421    LDKMessageSendEvent_SendFundingCreated,
6422    /**
6423     * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
6424     */
6425    LDKMessageSendEvent_SendFundingSigned,
6426    /**
6427     * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
6428     */
6429    LDKMessageSendEvent_SendTxAddInput,
6430    /**
6431     * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
6432     */
6433    LDKMessageSendEvent_SendTxAddOutput,
6434    /**
6435     * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
6436     */
6437    LDKMessageSendEvent_SendTxRemoveInput,
6438    /**
6439     * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
6440     */
6441    LDKMessageSendEvent_SendTxRemoveOutput,
6442    /**
6443     * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
6444     */
6445    LDKMessageSendEvent_SendTxComplete,
6446    /**
6447     * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
6448     */
6449    LDKMessageSendEvent_SendTxSignatures,
6450    /**
6451     * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
6452     */
6453    LDKMessageSendEvent_SendTxInitRbf,
6454    /**
6455     * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
6456     */
6457    LDKMessageSendEvent_SendTxAckRbf,
6458    /**
6459     * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
6460     */
6461    LDKMessageSendEvent_SendTxAbort,
6462    /**
6463     * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
6464     */
6465    LDKMessageSendEvent_SendChannelReady,
6466    /**
6467     * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
6468     */
6469    LDKMessageSendEvent_SendAnnouncementSignatures,
6470    /**
6471     * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
6472     * message should be sent to the peer with the given node_id.
6473     */
6474    LDKMessageSendEvent_UpdateHTLCs,
6475    /**
6476     * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
6477     */
6478    LDKMessageSendEvent_SendRevokeAndACK,
6479    /**
6480     * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
6481     */
6482    LDKMessageSendEvent_SendClosingSigned,
6483    /**
6484     * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
6485     */
6486    LDKMessageSendEvent_SendShutdown,
6487    /**
6488     * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
6489     */
6490    LDKMessageSendEvent_SendChannelReestablish,
6491    /**
6492     * Used to send a channel_announcement and channel_update to a specific peer, likely on
6493     * initial connection to ensure our peers know about our channels.
6494     */
6495    LDKMessageSendEvent_SendChannelAnnouncement,
6496    /**
6497     * Used to indicate that a channel_announcement and channel_update should be broadcast to all
6498     * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
6499     *
6500     * Note that after doing so, you very likely (unless you did so very recently) want to
6501     * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
6502     * ensures that any nodes which see our channel_announcement also have a relevant
6503     * node_announcement, including relevant feature flags which may be important for routing
6504     * through or to us.
6505     *
6506     * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
6507     */
6508    LDKMessageSendEvent_BroadcastChannelAnnouncement,
6509    /**
6510     * Used to indicate that a channel_update should be broadcast to all peers.
6511     */
6512    LDKMessageSendEvent_BroadcastChannelUpdate,
6513    /**
6514     * Used to indicate that a node_announcement should be broadcast to all peers.
6515     */
6516    LDKMessageSendEvent_BroadcastNodeAnnouncement,
6517    /**
6518     * Used to indicate that a channel_update should be sent to a single peer.
6519     * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
6520     * private channel and we shouldn't be informing all of our peers of channel parameters.
6521     */
6522    LDKMessageSendEvent_SendChannelUpdate,
6523    /**
6524     * Broadcast an error downstream to be handled
6525     */
6526    LDKMessageSendEvent_HandleError,
6527    /**
6528     * Query a peer for channels with funding transaction UTXOs in a block range.
6529     */
6530    LDKMessageSendEvent_SendChannelRangeQuery,
6531    /**
6532     * Request routing gossip messages from a peer for a list of channels identified by
6533     * their short_channel_ids.
6534     */
6535    LDKMessageSendEvent_SendShortIdsQuery,
6536    /**
6537     * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
6538     * emitted during processing of the query.
6539     */
6540    LDKMessageSendEvent_SendReplyChannelRange,
6541    /**
6542     * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
6543     * enable receiving gossip messages from the peer.
6544     */
6545    LDKMessageSendEvent_SendGossipTimestampFilter,
6546    /**
6547     * Must be last for serialization purposes
6548     */
6549    LDKMessageSendEvent_Sentinel,
6550 } LDKMessageSendEvent_Tag;
6551
6552 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
6553    /**
6554     * The node_id of the node which should receive this message
6555     */
6556    struct LDKPublicKey node_id;
6557    /**
6558     * The message which should be sent.
6559     */
6560    struct LDKAcceptChannel msg;
6561 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
6562
6563 typedef struct LDKMessageSendEvent_LDKSendAcceptChannelV2_Body {
6564    /**
6565     * The node_id of the node which should receive this message
6566     */
6567    struct LDKPublicKey node_id;
6568    /**
6569     * The message which should be sent.
6570     */
6571    struct LDKAcceptChannelV2 msg;
6572 } LDKMessageSendEvent_LDKSendAcceptChannelV2_Body;
6573
6574 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
6575    /**
6576     * The node_id of the node which should receive this message
6577     */
6578    struct LDKPublicKey node_id;
6579    /**
6580     * The message which should be sent.
6581     */
6582    struct LDKOpenChannel msg;
6583 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
6584
6585 typedef struct LDKMessageSendEvent_LDKSendOpenChannelV2_Body {
6586    /**
6587     * The node_id of the node which should receive this message
6588     */
6589    struct LDKPublicKey node_id;
6590    /**
6591     * The message which should be sent.
6592     */
6593    struct LDKOpenChannelV2 msg;
6594 } LDKMessageSendEvent_LDKSendOpenChannelV2_Body;
6595
6596 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
6597    /**
6598     * The node_id of the node which should receive this message
6599     */
6600    struct LDKPublicKey node_id;
6601    /**
6602     * The message which should be sent.
6603     */
6604    struct LDKFundingCreated msg;
6605 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
6606
6607 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
6608    /**
6609     * The node_id of the node which should receive this message
6610     */
6611    struct LDKPublicKey node_id;
6612    /**
6613     * The message which should be sent.
6614     */
6615    struct LDKFundingSigned msg;
6616 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
6617
6618 typedef struct LDKMessageSendEvent_LDKSendTxAddInput_Body {
6619    /**
6620     * The node_id of the node which should receive this message
6621     */
6622    struct LDKPublicKey node_id;
6623    /**
6624     * The message which should be sent.
6625     */
6626    struct LDKTxAddInput msg;
6627 } LDKMessageSendEvent_LDKSendTxAddInput_Body;
6628
6629 typedef struct LDKMessageSendEvent_LDKSendTxAddOutput_Body {
6630    /**
6631     * The node_id of the node which should receive this message
6632     */
6633    struct LDKPublicKey node_id;
6634    /**
6635     * The message which should be sent.
6636     */
6637    struct LDKTxAddOutput msg;
6638 } LDKMessageSendEvent_LDKSendTxAddOutput_Body;
6639
6640 typedef struct LDKMessageSendEvent_LDKSendTxRemoveInput_Body {
6641    /**
6642     * The node_id of the node which should receive this message
6643     */
6644    struct LDKPublicKey node_id;
6645    /**
6646     * The message which should be sent.
6647     */
6648    struct LDKTxRemoveInput msg;
6649 } LDKMessageSendEvent_LDKSendTxRemoveInput_Body;
6650
6651 typedef struct LDKMessageSendEvent_LDKSendTxRemoveOutput_Body {
6652    /**
6653     * The node_id of the node which should receive this message
6654     */
6655    struct LDKPublicKey node_id;
6656    /**
6657     * The message which should be sent.
6658     */
6659    struct LDKTxRemoveOutput msg;
6660 } LDKMessageSendEvent_LDKSendTxRemoveOutput_Body;
6661
6662 typedef struct LDKMessageSendEvent_LDKSendTxComplete_Body {
6663    /**
6664     * The node_id of the node which should receive this message
6665     */
6666    struct LDKPublicKey node_id;
6667    /**
6668     * The message which should be sent.
6669     */
6670    struct LDKTxComplete msg;
6671 } LDKMessageSendEvent_LDKSendTxComplete_Body;
6672
6673 typedef struct LDKMessageSendEvent_LDKSendTxSignatures_Body {
6674    /**
6675     * The node_id of the node which should receive this message
6676     */
6677    struct LDKPublicKey node_id;
6678    /**
6679     * The message which should be sent.
6680     */
6681    struct LDKTxSignatures msg;
6682 } LDKMessageSendEvent_LDKSendTxSignatures_Body;
6683
6684 typedef struct LDKMessageSendEvent_LDKSendTxInitRbf_Body {
6685    /**
6686     * The node_id of the node which should receive this message
6687     */
6688    struct LDKPublicKey node_id;
6689    /**
6690     * The message which should be sent.
6691     */
6692    struct LDKTxInitRbf msg;
6693 } LDKMessageSendEvent_LDKSendTxInitRbf_Body;
6694
6695 typedef struct LDKMessageSendEvent_LDKSendTxAckRbf_Body {
6696    /**
6697     * The node_id of the node which should receive this message
6698     */
6699    struct LDKPublicKey node_id;
6700    /**
6701     * The message which should be sent.
6702     */
6703    struct LDKTxAckRbf msg;
6704 } LDKMessageSendEvent_LDKSendTxAckRbf_Body;
6705
6706 typedef struct LDKMessageSendEvent_LDKSendTxAbort_Body {
6707    /**
6708     * The node_id of the node which should receive this message
6709     */
6710    struct LDKPublicKey node_id;
6711    /**
6712     * The message which should be sent.
6713     */
6714    struct LDKTxAbort msg;
6715 } LDKMessageSendEvent_LDKSendTxAbort_Body;
6716
6717 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
6718    /**
6719     * The node_id of the node which should receive these message(s)
6720     */
6721    struct LDKPublicKey node_id;
6722    /**
6723     * The channel_ready message which should be sent.
6724     */
6725    struct LDKChannelReady msg;
6726 } LDKMessageSendEvent_LDKSendChannelReady_Body;
6727
6728 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
6729    /**
6730     * The node_id of the node which should receive these message(s)
6731     */
6732    struct LDKPublicKey node_id;
6733    /**
6734     * The announcement_signatures message which should be sent.
6735     */
6736    struct LDKAnnouncementSignatures msg;
6737 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
6738
6739 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
6740    /**
6741     * The node_id of the node which should receive these message(s)
6742     */
6743    struct LDKPublicKey node_id;
6744    /**
6745     * The update messages which should be sent. ALL messages in the struct should be sent!
6746     */
6747    struct LDKCommitmentUpdate updates;
6748 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
6749
6750 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
6751    /**
6752     * The node_id of the node which should receive this message
6753     */
6754    struct LDKPublicKey node_id;
6755    /**
6756     * The message which should be sent.
6757     */
6758    struct LDKRevokeAndACK msg;
6759 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
6760
6761 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
6762    /**
6763     * The node_id of the node which should receive this message
6764     */
6765    struct LDKPublicKey node_id;
6766    /**
6767     * The message which should be sent.
6768     */
6769    struct LDKClosingSigned msg;
6770 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
6771
6772 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
6773    /**
6774     * The node_id of the node which should receive this message
6775     */
6776    struct LDKPublicKey node_id;
6777    /**
6778     * The message which should be sent.
6779     */
6780    struct LDKShutdown msg;
6781 } LDKMessageSendEvent_LDKSendShutdown_Body;
6782
6783 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
6784    /**
6785     * The node_id of the node which should receive this message
6786     */
6787    struct LDKPublicKey node_id;
6788    /**
6789     * The message which should be sent.
6790     */
6791    struct LDKChannelReestablish msg;
6792 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
6793
6794 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
6795    /**
6796     * The node_id of the node which should receive this message
6797     */
6798    struct LDKPublicKey node_id;
6799    /**
6800     * The channel_announcement which should be sent.
6801     */
6802    struct LDKChannelAnnouncement msg;
6803    /**
6804     * The followup channel_update which should be sent.
6805     */
6806    struct LDKChannelUpdate update_msg;
6807 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
6808
6809 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
6810    /**
6811     * The channel_announcement which should be sent.
6812     */
6813    struct LDKChannelAnnouncement msg;
6814    /**
6815     * The followup channel_update which should be sent.
6816     *
6817     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6818     */
6819    struct LDKChannelUpdate update_msg;
6820 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
6821
6822 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
6823    /**
6824     * The channel_update which should be sent.
6825     */
6826    struct LDKChannelUpdate msg;
6827 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
6828
6829 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
6830    /**
6831     * The node_announcement which should be sent.
6832     */
6833    struct LDKNodeAnnouncement msg;
6834 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
6835
6836 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
6837    /**
6838     * The node_id of the node which should receive this message
6839     */
6840    struct LDKPublicKey node_id;
6841    /**
6842     * The channel_update which should be sent.
6843     */
6844    struct LDKChannelUpdate msg;
6845 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
6846
6847 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
6848    /**
6849     * The node_id of the node which should receive this message
6850     */
6851    struct LDKPublicKey node_id;
6852    /**
6853     * The action which should be taken.
6854     */
6855    struct LDKErrorAction action;
6856 } LDKMessageSendEvent_LDKHandleError_Body;
6857
6858 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
6859    /**
6860     * The node_id of this message recipient
6861     */
6862    struct LDKPublicKey node_id;
6863    /**
6864     * The query_channel_range which should be sent.
6865     */
6866    struct LDKQueryChannelRange msg;
6867 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
6868
6869 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
6870    /**
6871     * The node_id of this message recipient
6872     */
6873    struct LDKPublicKey node_id;
6874    /**
6875     * The query_short_channel_ids which should be sent.
6876     */
6877    struct LDKQueryShortChannelIds msg;
6878 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
6879
6880 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
6881    /**
6882     * The node_id of this message recipient
6883     */
6884    struct LDKPublicKey node_id;
6885    /**
6886     * The reply_channel_range which should be sent.
6887     */
6888    struct LDKReplyChannelRange msg;
6889 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
6890
6891 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
6892    /**
6893     * The node_id of this message recipient
6894     */
6895    struct LDKPublicKey node_id;
6896    /**
6897     * The gossip_timestamp_filter which should be sent.
6898     */
6899    struct LDKGossipTimestampFilter msg;
6900 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
6901
6902 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
6903    LDKMessageSendEvent_Tag tag;
6904    union {
6905       LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
6906       LDKMessageSendEvent_LDKSendAcceptChannelV2_Body send_accept_channel_v2;
6907       LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
6908       LDKMessageSendEvent_LDKSendOpenChannelV2_Body send_open_channel_v2;
6909       LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
6910       LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
6911       LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
6912       LDKMessageSendEvent_LDKSendTxAddOutput_Body send_tx_add_output;
6913       LDKMessageSendEvent_LDKSendTxRemoveInput_Body send_tx_remove_input;
6914       LDKMessageSendEvent_LDKSendTxRemoveOutput_Body send_tx_remove_output;
6915       LDKMessageSendEvent_LDKSendTxComplete_Body send_tx_complete;
6916       LDKMessageSendEvent_LDKSendTxSignatures_Body send_tx_signatures;
6917       LDKMessageSendEvent_LDKSendTxInitRbf_Body send_tx_init_rbf;
6918       LDKMessageSendEvent_LDKSendTxAckRbf_Body send_tx_ack_rbf;
6919       LDKMessageSendEvent_LDKSendTxAbort_Body send_tx_abort;
6920       LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
6921       LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
6922       LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
6923       LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
6924       LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
6925       LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
6926       LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
6927       LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
6928       LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
6929       LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
6930       LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
6931       LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
6932       LDKMessageSendEvent_LDKHandleError_Body handle_error;
6933       LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
6934       LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
6935       LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
6936       LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
6937    };
6938 } LDKMessageSendEvent;
6939
6940 /**
6941  * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
6942  * This corresponds to std::vector in C++
6943  */
6944 typedef struct LDKCVec_MessageSendEventZ {
6945    /**
6946     * The elements in the array.
6947     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6948     */
6949    struct LDKMessageSendEvent *data;
6950    /**
6951     * The number of elements pointed to by `data`.
6952     */
6953    uintptr_t datalen;
6954 } LDKCVec_MessageSendEventZ;
6955
6956
6957
6958 /**
6959  * Details about one direction of a channel as received within a [`ChannelUpdate`].
6960  */
6961 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
6962    /**
6963     * A pointer to the opaque Rust object.
6964     * Nearly everywhere, inner must be non-null, however in places where
6965     * the Rust equivalent takes an Option, it may be set to null to indicate None.
6966     */
6967    LDKnativeChannelUpdateInfo *inner;
6968    /**
6969     * Indicates that this is the only struct which contains the same pointer.
6970     * Rust functions which take ownership of an object provided via an argument require
6971     * this to be true and invalidate the object pointed to by inner.
6972     */
6973    bool is_owned;
6974 } LDKChannelUpdateInfo;
6975
6976 /**
6977  * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
6978  */
6979 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
6980    /**
6981     * A pointer to the contents in the success state.
6982     * Reading from this pointer when `result_ok` is not set is undefined.
6983     */
6984    struct LDKChannelUpdateInfo *result;
6985    /**
6986     * A pointer to the contents in the error state.
6987     * Reading from this pointer when `result_ok` is set is undefined.
6988     */
6989    struct LDKDecodeError *err;
6990 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
6991
6992 /**
6993  * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
6994  * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6995  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6996  */
6997 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
6998    /**
6999     * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
7000     * `err` or `result` depending on the state of `result_ok`.
7001     */
7002    union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
7003    /**
7004     * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
7005     */
7006    bool result_ok;
7007 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
7008
7009
7010
7011 /**
7012  * Details about a channel (both directions).
7013  * Received within a channel announcement.
7014  */
7015 typedef struct MUST_USE_STRUCT LDKChannelInfo {
7016    /**
7017     * A pointer to the opaque Rust object.
7018     * Nearly everywhere, inner must be non-null, however in places where
7019     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7020     */
7021    LDKnativeChannelInfo *inner;
7022    /**
7023     * Indicates that this is the only struct which contains the same pointer.
7024     * Rust functions which take ownership of an object provided via an argument require
7025     * this to be true and invalidate the object pointed to by inner.
7026     */
7027    bool is_owned;
7028 } LDKChannelInfo;
7029
7030 /**
7031  * The contents of CResult_ChannelInfoDecodeErrorZ
7032  */
7033 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
7034    /**
7035     * A pointer to the contents in the success state.
7036     * Reading from this pointer when `result_ok` is not set is undefined.
7037     */
7038    struct LDKChannelInfo *result;
7039    /**
7040     * A pointer to the contents in the error state.
7041     * Reading from this pointer when `result_ok` is set is undefined.
7042     */
7043    struct LDKDecodeError *err;
7044 } LDKCResult_ChannelInfoDecodeErrorZPtr;
7045
7046 /**
7047  * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
7048  * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7049  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7050  */
7051 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
7052    /**
7053     * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
7054     * `err` or `result` depending on the state of `result_ok`.
7055     */
7056    union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
7057    /**
7058     * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
7059     */
7060    bool result_ok;
7061 } LDKCResult_ChannelInfoDecodeErrorZ;
7062
7063
7064
7065 /**
7066  * Fees for routing via a given channel or a node
7067  */
7068 typedef struct MUST_USE_STRUCT LDKRoutingFees {
7069    /**
7070     * A pointer to the opaque Rust object.
7071     * Nearly everywhere, inner must be non-null, however in places where
7072     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7073     */
7074    LDKnativeRoutingFees *inner;
7075    /**
7076     * Indicates that this is the only struct which contains the same pointer.
7077     * Rust functions which take ownership of an object provided via an argument require
7078     * this to be true and invalidate the object pointed to by inner.
7079     */
7080    bool is_owned;
7081 } LDKRoutingFees;
7082
7083 /**
7084  * The contents of CResult_RoutingFeesDecodeErrorZ
7085  */
7086 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
7087    /**
7088     * A pointer to the contents in the success state.
7089     * Reading from this pointer when `result_ok` is not set is undefined.
7090     */
7091    struct LDKRoutingFees *result;
7092    /**
7093     * A pointer to the contents in the error state.
7094     * Reading from this pointer when `result_ok` is set is undefined.
7095     */
7096    struct LDKDecodeError *err;
7097 } LDKCResult_RoutingFeesDecodeErrorZPtr;
7098
7099 /**
7100  * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
7101  * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
7102  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7103  */
7104 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
7105    /**
7106     * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
7107     * `err` or `result` depending on the state of `result_ok`.
7108     */
7109    union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
7110    /**
7111     * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
7112     */
7113    bool result_ok;
7114 } LDKCResult_RoutingFeesDecodeErrorZ;
7115
7116 /**
7117  * A 4-byte byte array.
7118  */
7119 typedef struct LDKFourBytes {
7120    /**
7121     * The four bytes
7122     */
7123    uint8_t data[4];
7124 } LDKFourBytes;
7125
7126 /**
7127  * A 12-byte byte array.
7128  */
7129 typedef struct LDKTwelveBytes {
7130    /**
7131     * The twelve bytes
7132     */
7133    uint8_t data[12];
7134 } LDKTwelveBytes;
7135
7136
7137
7138 /**
7139  * Represents a hostname for serialization purposes.
7140  * Only the character set and length will be validated.
7141  * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
7142  * Its length is guaranteed to be representable by a single byte.
7143  * This serialization is used by [`BOLT 7`] hostnames.
7144  *
7145  * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
7146  */
7147 typedef struct MUST_USE_STRUCT LDKHostname {
7148    /**
7149     * A pointer to the opaque Rust object.
7150     * Nearly everywhere, inner must be non-null, however in places where
7151     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7152     */
7153    LDKnativeHostname *inner;
7154    /**
7155     * Indicates that this is the only struct which contains the same pointer.
7156     * Rust functions which take ownership of an object provided via an argument require
7157     * this to be true and invalidate the object pointed to by inner.
7158     */
7159    bool is_owned;
7160 } LDKHostname;
7161
7162 /**
7163  * An address which can be used to connect to a remote peer.
7164  */
7165 typedef enum LDKSocketAddress_Tag {
7166    /**
7167     * An IPv4 address and port on which the peer is listening.
7168     */
7169    LDKSocketAddress_TcpIpV4,
7170    /**
7171     * An IPv6 address and port on which the peer is listening.
7172     */
7173    LDKSocketAddress_TcpIpV6,
7174    /**
7175     * An old-style Tor onion address/port on which the peer is listening.
7176     *
7177     * This field is deprecated and the Tor network generally no longer supports V2 Onion
7178     * addresses. Thus, the details are not parsed here.
7179     */
7180    LDKSocketAddress_OnionV2,
7181    /**
7182     * A new-style Tor onion address/port on which the peer is listening.
7183     *
7184     * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
7185     * wrap as base32 and append \".onion\".
7186     */
7187    LDKSocketAddress_OnionV3,
7188    /**
7189     * A hostname/port on which the peer is listening.
7190     */
7191    LDKSocketAddress_Hostname,
7192    /**
7193     * Must be last for serialization purposes
7194     */
7195    LDKSocketAddress_Sentinel,
7196 } LDKSocketAddress_Tag;
7197
7198 typedef struct LDKSocketAddress_LDKTcpIpV4_Body {
7199    /**
7200     * The 4-byte IPv4 address
7201     */
7202    struct LDKFourBytes addr;
7203    /**
7204     * The port on which the node is listening
7205     */
7206    uint16_t port;
7207 } LDKSocketAddress_LDKTcpIpV4_Body;
7208
7209 typedef struct LDKSocketAddress_LDKTcpIpV6_Body {
7210    /**
7211     * The 16-byte IPv6 address
7212     */
7213    struct LDKSixteenBytes addr;
7214    /**
7215     * The port on which the node is listening
7216     */
7217    uint16_t port;
7218 } LDKSocketAddress_LDKTcpIpV6_Body;
7219
7220 typedef struct LDKSocketAddress_LDKOnionV3_Body {
7221    /**
7222     * The ed25519 long-term public key of the peer
7223     */
7224    struct LDKThirtyTwoBytes ed25519_pubkey;
7225    /**
7226     * The checksum of the pubkey and version, as included in the onion address
7227     */
7228    uint16_t checksum;
7229    /**
7230     * The version byte, as defined by the Tor Onion v3 spec.
7231     */
7232    uint8_t version;
7233    /**
7234     * The port on which the node is listening
7235     */
7236    uint16_t port;
7237 } LDKSocketAddress_LDKOnionV3_Body;
7238
7239 typedef struct LDKSocketAddress_LDKHostname_Body {
7240    /**
7241     * The hostname on which the node is listening.
7242     */
7243    struct LDKHostname hostname;
7244    /**
7245     * The port on which the node is listening.
7246     */
7247    uint16_t port;
7248 } LDKSocketAddress_LDKHostname_Body;
7249
7250 typedef struct MUST_USE_STRUCT LDKSocketAddress {
7251    LDKSocketAddress_Tag tag;
7252    union {
7253       LDKSocketAddress_LDKTcpIpV4_Body tcp_ip_v4;
7254       LDKSocketAddress_LDKTcpIpV6_Body tcp_ip_v6;
7255       struct {
7256          struct LDKTwelveBytes onion_v2;
7257       };
7258       LDKSocketAddress_LDKOnionV3_Body onion_v3;
7259       LDKSocketAddress_LDKHostname_Body hostname;
7260    };
7261 } LDKSocketAddress;
7262
7263 /**
7264  * A dynamically-allocated array of crate::lightning::ln::msgs::SocketAddresss of arbitrary size.
7265  * This corresponds to std::vector in C++
7266  */
7267 typedef struct LDKCVec_SocketAddressZ {
7268    /**
7269     * The elements in the array.
7270     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7271     */
7272    struct LDKSocketAddress *data;
7273    /**
7274     * The number of elements pointed to by `data`.
7275     */
7276    uintptr_t datalen;
7277 } LDKCVec_SocketAddressZ;
7278
7279
7280
7281 /**
7282  * Information received in the latest node_announcement from this node.
7283  */
7284 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
7285    /**
7286     * A pointer to the opaque Rust object.
7287     * Nearly everywhere, inner must be non-null, however in places where
7288     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7289     */
7290    LDKnativeNodeAnnouncementInfo *inner;
7291    /**
7292     * Indicates that this is the only struct which contains the same pointer.
7293     * Rust functions which take ownership of an object provided via an argument require
7294     * this to be true and invalidate the object pointed to by inner.
7295     */
7296    bool is_owned;
7297 } LDKNodeAnnouncementInfo;
7298
7299 /**
7300  * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
7301  */
7302 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
7303    /**
7304     * A pointer to the contents in the success state.
7305     * Reading from this pointer when `result_ok` is not set is undefined.
7306     */
7307    struct LDKNodeAnnouncementInfo *result;
7308    /**
7309     * A pointer to the contents in the error state.
7310     * Reading from this pointer when `result_ok` is set is undefined.
7311     */
7312    struct LDKDecodeError *err;
7313 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
7314
7315 /**
7316  * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
7317  * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7318  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7319  */
7320 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
7321    /**
7322     * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
7323     * `err` or `result` depending on the state of `result_ok`.
7324     */
7325    union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
7326    /**
7327     * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
7328     */
7329    bool result_ok;
7330 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
7331
7332
7333
7334 /**
7335  * A user-defined name for a node, which may be used when displaying the node in a graph.
7336  *
7337  * Since node aliases are provided by third parties, they are a potential avenue for injection
7338  * attacks. Care must be taken when processing.
7339  */
7340 typedef struct MUST_USE_STRUCT LDKNodeAlias {
7341    /**
7342     * A pointer to the opaque Rust object.
7343     * Nearly everywhere, inner must be non-null, however in places where
7344     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7345     */
7346    LDKnativeNodeAlias *inner;
7347    /**
7348     * Indicates that this is the only struct which contains the same pointer.
7349     * Rust functions which take ownership of an object provided via an argument require
7350     * this to be true and invalidate the object pointed to by inner.
7351     */
7352    bool is_owned;
7353 } LDKNodeAlias;
7354
7355 /**
7356  * The contents of CResult_NodeAliasDecodeErrorZ
7357  */
7358 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
7359    /**
7360     * A pointer to the contents in the success state.
7361     * Reading from this pointer when `result_ok` is not set is undefined.
7362     */
7363    struct LDKNodeAlias *result;
7364    /**
7365     * A pointer to the contents in the error state.
7366     * Reading from this pointer when `result_ok` is set is undefined.
7367     */
7368    struct LDKDecodeError *err;
7369 } LDKCResult_NodeAliasDecodeErrorZPtr;
7370
7371 /**
7372  * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
7373  * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
7374  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7375  */
7376 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
7377    /**
7378     * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
7379     * `err` or `result` depending on the state of `result_ok`.
7380     */
7381    union LDKCResult_NodeAliasDecodeErrorZPtr contents;
7382    /**
7383     * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
7384     */
7385    bool result_ok;
7386 } LDKCResult_NodeAliasDecodeErrorZ;
7387
7388
7389
7390 /**
7391  * Details about a node in the network, known from the network announcement.
7392  */
7393 typedef struct MUST_USE_STRUCT LDKNodeInfo {
7394    /**
7395     * A pointer to the opaque Rust object.
7396     * Nearly everywhere, inner must be non-null, however in places where
7397     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7398     */
7399    LDKnativeNodeInfo *inner;
7400    /**
7401     * Indicates that this is the only struct which contains the same pointer.
7402     * Rust functions which take ownership of an object provided via an argument require
7403     * this to be true and invalidate the object pointed to by inner.
7404     */
7405    bool is_owned;
7406 } LDKNodeInfo;
7407
7408 /**
7409  * The contents of CResult_NodeInfoDecodeErrorZ
7410  */
7411 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
7412    /**
7413     * A pointer to the contents in the success state.
7414     * Reading from this pointer when `result_ok` is not set is undefined.
7415     */
7416    struct LDKNodeInfo *result;
7417    /**
7418     * A pointer to the contents in the error state.
7419     * Reading from this pointer when `result_ok` is set is undefined.
7420     */
7421    struct LDKDecodeError *err;
7422 } LDKCResult_NodeInfoDecodeErrorZPtr;
7423
7424 /**
7425  * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
7426  * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7427  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7428  */
7429 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
7430    /**
7431     * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
7432     * `err` or `result` depending on the state of `result_ok`.
7433     */
7434    union LDKCResult_NodeInfoDecodeErrorZPtr contents;
7435    /**
7436     * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
7437     */
7438    bool result_ok;
7439 } LDKCResult_NodeInfoDecodeErrorZ;
7440
7441 /**
7442  * The contents of CResult_NetworkGraphDecodeErrorZ
7443  */
7444 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
7445    /**
7446     * A pointer to the contents in the success state.
7447     * Reading from this pointer when `result_ok` is not set is undefined.
7448     */
7449    struct LDKNetworkGraph *result;
7450    /**
7451     * A pointer to the contents in the error state.
7452     * Reading from this pointer when `result_ok` is set is undefined.
7453     */
7454    struct LDKDecodeError *err;
7455 } LDKCResult_NetworkGraphDecodeErrorZPtr;
7456
7457 /**
7458  * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
7459  * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
7460  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7461  */
7462 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
7463    /**
7464     * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
7465     * `err` or `result` depending on the state of `result_ok`.
7466     */
7467    union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
7468    /**
7469     * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
7470     */
7471    bool result_ok;
7472 } LDKCResult_NetworkGraphDecodeErrorZ;
7473
7474 /**
7475  * An enum which can either contain a crate::c_types::derived::CVec_SocketAddressZ or not
7476  */
7477 typedef enum LDKCOption_CVec_SocketAddressZZ_Tag {
7478    /**
7479     * When we're in this state, this COption_CVec_SocketAddressZZ contains a crate::c_types::derived::CVec_SocketAddressZ
7480     */
7481    LDKCOption_CVec_SocketAddressZZ_Some,
7482    /**
7483     * When we're in this state, this COption_CVec_SocketAddressZZ contains nothing
7484     */
7485    LDKCOption_CVec_SocketAddressZZ_None,
7486    /**
7487     * Must be last for serialization purposes
7488     */
7489    LDKCOption_CVec_SocketAddressZZ_Sentinel,
7490 } LDKCOption_CVec_SocketAddressZZ_Tag;
7491
7492 typedef struct LDKCOption_CVec_SocketAddressZZ {
7493    LDKCOption_CVec_SocketAddressZZ_Tag tag;
7494    union {
7495       struct {
7496          struct LDKCVec_SocketAddressZ some;
7497       };
7498    };
7499 } LDKCOption_CVec_SocketAddressZZ;
7500
7501
7502
7503 /**
7504  * The parameters required to derive a channel signer via [`SignerProvider`].
7505  */
7506 typedef struct MUST_USE_STRUCT LDKChannelDerivationParameters {
7507    /**
7508     * A pointer to the opaque Rust object.
7509     * Nearly everywhere, inner must be non-null, however in places where
7510     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7511     */
7512    LDKnativeChannelDerivationParameters *inner;
7513    /**
7514     * Indicates that this is the only struct which contains the same pointer.
7515     * Rust functions which take ownership of an object provided via an argument require
7516     * this to be true and invalidate the object pointed to by inner.
7517     */
7518    bool is_owned;
7519 } LDKChannelDerivationParameters;
7520
7521 /**
7522  * The contents of CResult_ChannelDerivationParametersDecodeErrorZ
7523  */
7524 typedef union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr {
7525    /**
7526     * A pointer to the contents in the success state.
7527     * Reading from this pointer when `result_ok` is not set is undefined.
7528     */
7529    struct LDKChannelDerivationParameters *result;
7530    /**
7531     * A pointer to the contents in the error state.
7532     * Reading from this pointer when `result_ok` is set is undefined.
7533     */
7534    struct LDKDecodeError *err;
7535 } LDKCResult_ChannelDerivationParametersDecodeErrorZPtr;
7536
7537 /**
7538  * A CResult_ChannelDerivationParametersDecodeErrorZ represents the result of a fallible operation,
7539  * containing a crate::lightning::events::bump_transaction::ChannelDerivationParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
7540  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7541  */
7542 typedef struct LDKCResult_ChannelDerivationParametersDecodeErrorZ {
7543    /**
7544     * The contents of this CResult_ChannelDerivationParametersDecodeErrorZ, accessible via either
7545     * `err` or `result` depending on the state of `result_ok`.
7546     */
7547    union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr contents;
7548    /**
7549     * Whether this CResult_ChannelDerivationParametersDecodeErrorZ represents a success state.
7550     */
7551    bool result_ok;
7552 } LDKCResult_ChannelDerivationParametersDecodeErrorZ;
7553
7554 /**
7555  * The contents of CResult_HTLCDescriptorDecodeErrorZ
7556  */
7557 typedef union LDKCResult_HTLCDescriptorDecodeErrorZPtr {
7558    /**
7559     * A pointer to the contents in the success state.
7560     * Reading from this pointer when `result_ok` is not set is undefined.
7561     */
7562    struct LDKHTLCDescriptor *result;
7563    /**
7564     * A pointer to the contents in the error state.
7565     * Reading from this pointer when `result_ok` is set is undefined.
7566     */
7567    struct LDKDecodeError *err;
7568 } LDKCResult_HTLCDescriptorDecodeErrorZPtr;
7569
7570 /**
7571  * A CResult_HTLCDescriptorDecodeErrorZ represents the result of a fallible operation,
7572  * containing a crate::lightning::events::bump_transaction::HTLCDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
7573  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7574  */
7575 typedef struct LDKCResult_HTLCDescriptorDecodeErrorZ {
7576    /**
7577     * The contents of this CResult_HTLCDescriptorDecodeErrorZ, accessible via either
7578     * `err` or `result` depending on the state of `result_ok`.
7579     */
7580    union LDKCResult_HTLCDescriptorDecodeErrorZPtr contents;
7581    /**
7582     * Whether this CResult_HTLCDescriptorDecodeErrorZ represents a success state.
7583     */
7584    bool result_ok;
7585 } LDKCResult_HTLCDescriptorDecodeErrorZ;
7586
7587 /**
7588  * A dynamically-allocated array of crate::lightning::ln::chan_utils::HTLCOutputInCommitments of arbitrary size.
7589  * This corresponds to std::vector in C++
7590  */
7591 typedef struct LDKCVec_HTLCOutputInCommitmentZ {
7592    /**
7593     * The elements in the array.
7594     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7595     */
7596    struct LDKHTLCOutputInCommitment *data;
7597    /**
7598     * The number of elements pointed to by `data`.
7599     */
7600    uintptr_t datalen;
7601 } LDKCVec_HTLCOutputInCommitmentZ;
7602
7603 /**
7604  * A dynamically-allocated array of crate::lightning::events::bump_transaction::HTLCDescriptors of arbitrary size.
7605  * This corresponds to std::vector in C++
7606  */
7607 typedef struct LDKCVec_HTLCDescriptorZ {
7608    /**
7609     * The elements in the array.
7610     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7611     */
7612    struct LDKHTLCDescriptor *data;
7613    /**
7614     * The number of elements pointed to by `data`.
7615     */
7616    uintptr_t datalen;
7617 } LDKCVec_HTLCDescriptorZ;
7618
7619
7620
7621 /**
7622  * An unspent transaction output that is available to spend resulting from a successful
7623  * [`CoinSelection`] attempt.
7624  */
7625 typedef struct MUST_USE_STRUCT LDKUtxo {
7626    /**
7627     * A pointer to the opaque Rust object.
7628     * Nearly everywhere, inner must be non-null, however in places where
7629     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7630     */
7631    LDKnativeUtxo *inner;
7632    /**
7633     * Indicates that this is the only struct which contains the same pointer.
7634     * Rust functions which take ownership of an object provided via an argument require
7635     * this to be true and invalidate the object pointed to by inner.
7636     */
7637    bool is_owned;
7638 } LDKUtxo;
7639
7640 /**
7641  * A dynamically-allocated array of crate::lightning::events::bump_transaction::Utxos of arbitrary size.
7642  * This corresponds to std::vector in C++
7643  */
7644 typedef struct LDKCVec_UtxoZ {
7645    /**
7646     * The elements in the array.
7647     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7648     */
7649    struct LDKUtxo *data;
7650    /**
7651     * The number of elements pointed to by `data`.
7652     */
7653    uintptr_t datalen;
7654 } LDKCVec_UtxoZ;
7655
7656 /**
7657  * An enum which can either contain a crate::c_types::TxOut or not
7658  */
7659 typedef enum LDKCOption_TxOutZ_Tag {
7660    /**
7661     * When we're in this state, this COption_TxOutZ contains a crate::c_types::TxOut
7662     */
7663    LDKCOption_TxOutZ_Some,
7664    /**
7665     * When we're in this state, this COption_TxOutZ contains nothing
7666     */
7667    LDKCOption_TxOutZ_None,
7668    /**
7669     * Must be last for serialization purposes
7670     */
7671    LDKCOption_TxOutZ_Sentinel,
7672 } LDKCOption_TxOutZ_Tag;
7673
7674 typedef struct LDKCOption_TxOutZ {
7675    LDKCOption_TxOutZ_Tag tag;
7676    union {
7677       struct {
7678          struct LDKTxOut some;
7679       };
7680    };
7681 } LDKCOption_TxOutZ;
7682
7683
7684
7685 /**
7686  * An input that must be included in a transaction when performing coin selection through
7687  * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
7688  * must have an empty [`TxIn::script_sig`] when spent.
7689  */
7690 typedef struct MUST_USE_STRUCT LDKInput {
7691    /**
7692     * A pointer to the opaque Rust object.
7693     * Nearly everywhere, inner must be non-null, however in places where
7694     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7695     */
7696    LDKnativeInput *inner;
7697    /**
7698     * Indicates that this is the only struct which contains the same pointer.
7699     * Rust functions which take ownership of an object provided via an argument require
7700     * this to be true and invalidate the object pointed to by inner.
7701     */
7702    bool is_owned;
7703 } LDKInput;
7704
7705 /**
7706  * A dynamically-allocated array of crate::lightning::events::bump_transaction::Inputs of arbitrary size.
7707  * This corresponds to std::vector in C++
7708  */
7709 typedef struct LDKCVec_InputZ {
7710    /**
7711     * The elements in the array.
7712     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7713     */
7714    struct LDKInput *data;
7715    /**
7716     * The number of elements pointed to by `data`.
7717     */
7718    uintptr_t datalen;
7719 } LDKCVec_InputZ;
7720
7721
7722
7723 /**
7724  * The result of a successful coin selection attempt for a transaction requiring additional UTXOs
7725  * to cover its fees.
7726  */
7727 typedef struct MUST_USE_STRUCT LDKCoinSelection {
7728    /**
7729     * A pointer to the opaque Rust object.
7730     * Nearly everywhere, inner must be non-null, however in places where
7731     * the Rust equivalent takes an Option, it may be set to null to indicate None.
7732     */
7733    LDKnativeCoinSelection *inner;
7734    /**
7735     * Indicates that this is the only struct which contains the same pointer.
7736     * Rust functions which take ownership of an object provided via an argument require
7737     * this to be true and invalidate the object pointed to by inner.
7738     */
7739    bool is_owned;
7740 } LDKCoinSelection;
7741
7742 /**
7743  * The contents of CResult_CoinSelectionNoneZ
7744  */
7745 typedef union LDKCResult_CoinSelectionNoneZPtr {
7746    /**
7747     * A pointer to the contents in the success state.
7748     * Reading from this pointer when `result_ok` is not set is undefined.
7749     */
7750    struct LDKCoinSelection *result;
7751    /**
7752     * Note that this value is always NULL, as there are no contents in the Err variant
7753     */
7754    void *err;
7755 } LDKCResult_CoinSelectionNoneZPtr;
7756
7757 /**
7758  * A CResult_CoinSelectionNoneZ represents the result of a fallible operation,
7759  * containing a crate::lightning::events::bump_transaction::CoinSelection on success and a () on failure.
7760  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7761  */
7762 typedef struct LDKCResult_CoinSelectionNoneZ {
7763    /**
7764     * The contents of this CResult_CoinSelectionNoneZ, accessible via either
7765     * `err` or `result` depending on the state of `result_ok`.
7766     */
7767    union LDKCResult_CoinSelectionNoneZPtr contents;
7768    /**
7769     * Whether this CResult_CoinSelectionNoneZ represents a success state.
7770     */
7771    bool result_ok;
7772 } LDKCResult_CoinSelectionNoneZ;
7773
7774 /**
7775  * The contents of CResult_CVec_UtxoZNoneZ
7776  */
7777 typedef union LDKCResult_CVec_UtxoZNoneZPtr {
7778    /**
7779     * A pointer to the contents in the success state.
7780     * Reading from this pointer when `result_ok` is not set is undefined.
7781     */
7782    struct LDKCVec_UtxoZ *result;
7783    /**
7784     * Note that this value is always NULL, as there are no contents in the Err variant
7785     */
7786    void *err;
7787 } LDKCResult_CVec_UtxoZNoneZPtr;
7788
7789 /**
7790  * A CResult_CVec_UtxoZNoneZ represents the result of a fallible operation,
7791  * containing a crate::c_types::derived::CVec_UtxoZ on success and a () on failure.
7792  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7793  */
7794 typedef struct LDKCResult_CVec_UtxoZNoneZ {
7795    /**
7796     * The contents of this CResult_CVec_UtxoZNoneZ, accessible via either
7797     * `err` or `result` depending on the state of `result_ok`.
7798     */
7799    union LDKCResult_CVec_UtxoZNoneZPtr contents;
7800    /**
7801     * Whether this CResult_CVec_UtxoZNoneZ represents a success state.
7802     */
7803    bool result_ok;
7804 } LDKCResult_CVec_UtxoZNoneZ;
7805
7806 /**
7807  * A tuple of 2 elements. See the individual fields for the types contained.
7808  */
7809 typedef struct LDKC2Tuple_u64u16Z {
7810    /**
7811     * The element at position 0
7812     */
7813    uint64_t a;
7814    /**
7815     * The element at position 1
7816     */
7817    uint16_t b;
7818 } LDKC2Tuple_u64u16Z;
7819
7820 /**
7821  * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u16Z or not
7822  */
7823 typedef enum LDKCOption_C2Tuple_u64u16ZZ_Tag {
7824    /**
7825     * When we're in this state, this COption_C2Tuple_u64u16ZZ contains a crate::c_types::derived::C2Tuple_u64u16Z
7826     */
7827    LDKCOption_C2Tuple_u64u16ZZ_Some,
7828    /**
7829     * When we're in this state, this COption_C2Tuple_u64u16ZZ contains nothing
7830     */
7831    LDKCOption_C2Tuple_u64u16ZZ_None,
7832    /**
7833     * Must be last for serialization purposes
7834     */
7835    LDKCOption_C2Tuple_u64u16ZZ_Sentinel,
7836 } LDKCOption_C2Tuple_u64u16ZZ_Tag;
7837
7838 typedef struct LDKCOption_C2Tuple_u64u16ZZ {
7839    LDKCOption_C2Tuple_u64u16ZZ_Tag tag;
7840    union {
7841       struct {
7842          struct LDKC2Tuple_u64u16Z some;
7843       };
7844    };
7845 } LDKCOption_C2Tuple_u64u16ZZ;
7846
7847 /**
7848  * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not
7849  */
7850 typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
7851    /**
7852     * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channelmanager::ChannelShutdownState
7853     */
7854    LDKCOption_ChannelShutdownStateZ_Some,
7855    /**
7856     * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
7857     */
7858    LDKCOption_ChannelShutdownStateZ_None,
7859    /**
7860     * Must be last for serialization purposes
7861     */
7862    LDKCOption_ChannelShutdownStateZ_Sentinel,
7863 } LDKCOption_ChannelShutdownStateZ_Tag;
7864
7865 typedef struct LDKCOption_ChannelShutdownStateZ {
7866    LDKCOption_ChannelShutdownStateZ_Tag tag;
7867    union {
7868       struct {
7869          enum LDKChannelShutdownState some;
7870       };
7871    };
7872 } LDKCOption_ChannelShutdownStateZ;
7873
7874 /**
7875  * The contents of CResult_ThirtyTwoBytesAPIErrorZ
7876  */
7877 typedef union LDKCResult_ThirtyTwoBytesAPIErrorZPtr {
7878    /**
7879     * A pointer to the contents in the success state.
7880     * Reading from this pointer when `result_ok` is not set is undefined.
7881     */
7882    struct LDKThirtyTwoBytes *result;
7883    /**
7884     * A pointer to the contents in the error state.
7885     * Reading from this pointer when `result_ok` is set is undefined.
7886     */
7887    struct LDKAPIError *err;
7888 } LDKCResult_ThirtyTwoBytesAPIErrorZPtr;
7889
7890 /**
7891  * A CResult_ThirtyTwoBytesAPIErrorZ represents the result of a fallible operation,
7892  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7893  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7894  */
7895 typedef struct LDKCResult_ThirtyTwoBytesAPIErrorZ {
7896    /**
7897     * The contents of this CResult_ThirtyTwoBytesAPIErrorZ, accessible via either
7898     * `err` or `result` depending on the state of `result_ok`.
7899     */
7900    union LDKCResult_ThirtyTwoBytesAPIErrorZPtr contents;
7901    /**
7902     * Whether this CResult_ThirtyTwoBytesAPIErrorZ represents a success state.
7903     */
7904    bool result_ok;
7905 } LDKCResult_ThirtyTwoBytesAPIErrorZ;
7906
7907 /**
7908  * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
7909  * These include payments that have yet to find a successful path, or have unresolved HTLCs.
7910  */
7911 typedef enum LDKRecentPaymentDetails_Tag {
7912    /**
7913     * When an invoice was requested and thus a payment has not yet been sent.
7914     */
7915    LDKRecentPaymentDetails_AwaitingInvoice,
7916    /**
7917     * When a payment is still being sent and awaiting successful delivery.
7918     */
7919    LDKRecentPaymentDetails_Pending,
7920    /**
7921     * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
7922     * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
7923     * payment is removed from tracking.
7924     */
7925    LDKRecentPaymentDetails_Fulfilled,
7926    /**
7927     * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
7928     * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
7929     * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
7930     */
7931    LDKRecentPaymentDetails_Abandoned,
7932    /**
7933     * Must be last for serialization purposes
7934     */
7935    LDKRecentPaymentDetails_Sentinel,
7936 } LDKRecentPaymentDetails_Tag;
7937
7938 typedef struct LDKRecentPaymentDetails_LDKAwaitingInvoice_Body {
7939    /**
7940     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
7941     * a payment and ensure idempotency in LDK.
7942     */
7943    struct LDKThirtyTwoBytes payment_id;
7944 } LDKRecentPaymentDetails_LDKAwaitingInvoice_Body;
7945
7946 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
7947    /**
7948     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
7949     * a payment and ensure idempotency in LDK.
7950     */
7951    struct LDKThirtyTwoBytes payment_id;
7952    /**
7953     * Hash of the payment that is currently being sent but has yet to be fulfilled or
7954     * abandoned.
7955     */
7956    struct LDKThirtyTwoBytes payment_hash;
7957    /**
7958     * Total amount (in msat, excluding fees) across all paths for this payment,
7959     * not just the amount currently inflight.
7960     */
7961    uint64_t total_msat;
7962 } LDKRecentPaymentDetails_LDKPending_Body;
7963
7964 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
7965    /**
7966     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
7967     * a payment and ensure idempotency in LDK.
7968     */
7969    struct LDKThirtyTwoBytes payment_id;
7970    /**
7971     * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
7972     * made before LDK version 0.0.104.
7973     */
7974    struct LDKCOption_ThirtyTwoBytesZ payment_hash;
7975 } LDKRecentPaymentDetails_LDKFulfilled_Body;
7976
7977 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
7978    /**
7979     * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
7980     * a payment and ensure idempotency in LDK.
7981     */
7982    struct LDKThirtyTwoBytes payment_id;
7983    /**
7984     * Hash of the payment that we have given up trying to send.
7985     */
7986    struct LDKThirtyTwoBytes payment_hash;
7987 } LDKRecentPaymentDetails_LDKAbandoned_Body;
7988
7989 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
7990    LDKRecentPaymentDetails_Tag tag;
7991    union {
7992       LDKRecentPaymentDetails_LDKAwaitingInvoice_Body awaiting_invoice;
7993       LDKRecentPaymentDetails_LDKPending_Body pending;
7994       LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
7995       LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
7996    };
7997 } LDKRecentPaymentDetails;
7998
7999 /**
8000  * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
8001  * This corresponds to std::vector in C++
8002  */
8003 typedef struct LDKCVec_RecentPaymentDetailsZ {
8004    /**
8005     * The elements in the array.
8006     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8007     */
8008    struct LDKRecentPaymentDetails *data;
8009    /**
8010     * The number of elements pointed to by `data`.
8011     */
8012    uintptr_t datalen;
8013 } LDKCVec_RecentPaymentDetailsZ;
8014
8015 /**
8016  * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
8017  * of several states. This enum is returned as the Err() type describing which state the payment
8018  * is in, see the description of individual enum states for more.
8019  *
8020  * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
8021  */
8022 typedef enum LDKPaymentSendFailure_Tag {
8023    /**
8024     * A parameter which was passed to send_payment was invalid, preventing us from attempting to
8025     * send the payment at all.
8026     *
8027     * You can freely resend the payment in full (with the parameter error fixed).
8028     *
8029     * Because the payment failed outright, no payment tracking is done and no
8030     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8031     *
8032     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8033     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8034     */
8035    LDKPaymentSendFailure_ParameterError,
8036    /**
8037     * A parameter in a single path which was passed to send_payment was invalid, preventing us
8038     * from attempting to send the payment at all.
8039     *
8040     * You can freely resend the payment in full (with the parameter error fixed).
8041     *
8042     * Because the payment failed outright, no payment tracking is done and no
8043     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8044     *
8045     * The results here are ordered the same as the paths in the route object which was passed to
8046     * send_payment.
8047     *
8048     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8049     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8050     */
8051    LDKPaymentSendFailure_PathParameterError,
8052    /**
8053     * All paths which were attempted failed to send, with no channel state change taking place.
8054     * You can freely resend the payment in full (though you probably want to do so over different
8055     * paths than the ones selected).
8056     *
8057     * Because the payment failed outright, no payment tracking is done and no
8058     * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8059     *
8060     * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8061     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8062     */
8063    LDKPaymentSendFailure_AllFailedResendSafe,
8064    /**
8065     * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
8066     * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
8067     *
8068     * [`PaymentId`]: crate::ln::channelmanager::PaymentId
8069     * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
8070     * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8071     */
8072    LDKPaymentSendFailure_DuplicatePayment,
8073    /**
8074     * Some paths that were attempted failed to send, though some paths may have succeeded. At least
8075     * some paths have irrevocably committed to the HTLC.
8076     *
8077     * The results here are ordered the same as the paths in the route object that was passed to
8078     * send_payment.
8079     *
8080     * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
8081     * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
8082     *
8083     * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
8084     */
8085    LDKPaymentSendFailure_PartialFailure,
8086    /**
8087     * Must be last for serialization purposes
8088     */
8089    LDKPaymentSendFailure_Sentinel,
8090 } LDKPaymentSendFailure_Tag;
8091
8092 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
8093    /**
8094     * The errors themselves, in the same order as the paths from the route.
8095     */
8096    struct LDKCVec_CResult_NoneAPIErrorZZ results;
8097    /**
8098     * If some paths failed without irrevocably committing to the new HTLC(s), this will
8099     * contain a [`RouteParameters`] object for the failing paths.
8100     *
8101     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8102     */
8103    struct LDKRouteParameters failed_paths_retry;
8104    /**
8105     * The payment id for the payment, which is now at least partially pending.
8106     */
8107    struct LDKThirtyTwoBytes payment_id;
8108 } LDKPaymentSendFailure_LDKPartialFailure_Body;
8109
8110 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
8111    LDKPaymentSendFailure_Tag tag;
8112    union {
8113       struct {
8114          struct LDKAPIError parameter_error;
8115       };
8116       struct {
8117          struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
8118       };
8119       struct {
8120          struct LDKCVec_APIErrorZ all_failed_resend_safe;
8121       };
8122       LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
8123    };
8124 } LDKPaymentSendFailure;
8125
8126 /**
8127  * The contents of CResult_NonePaymentSendFailureZ
8128  */
8129 typedef union LDKCResult_NonePaymentSendFailureZPtr {
8130    /**
8131     * Note that this value is always NULL, as there are no contents in the OK variant
8132     */
8133    void *result;
8134    /**
8135     * A pointer to the contents in the error state.
8136     * Reading from this pointer when `result_ok` is set is undefined.
8137     */
8138    struct LDKPaymentSendFailure *err;
8139 } LDKCResult_NonePaymentSendFailureZPtr;
8140
8141 /**
8142  * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
8143  * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8144  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8145  */
8146 typedef struct LDKCResult_NonePaymentSendFailureZ {
8147    /**
8148     * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
8149     * `err` or `result` depending on the state of `result_ok`.
8150     */
8151    union LDKCResult_NonePaymentSendFailureZPtr contents;
8152    /**
8153     * Whether this CResult_NonePaymentSendFailureZ represents a success state.
8154     */
8155    bool result_ok;
8156 } LDKCResult_NonePaymentSendFailureZ;
8157
8158 /**
8159  * The contents of CResult_NoneRetryableSendFailureZ
8160  */
8161 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
8162    /**
8163     * Note that this value is always NULL, as there are no contents in the OK variant
8164     */
8165    void *result;
8166    /**
8167     * A pointer to the contents in the error state.
8168     * Reading from this pointer when `result_ok` is set is undefined.
8169     */
8170    enum LDKRetryableSendFailure *err;
8171 } LDKCResult_NoneRetryableSendFailureZPtr;
8172
8173 /**
8174  * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
8175  * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8176  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8177  */
8178 typedef struct LDKCResult_NoneRetryableSendFailureZ {
8179    /**
8180     * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
8181     * `err` or `result` depending on the state of `result_ok`.
8182     */
8183    union LDKCResult_NoneRetryableSendFailureZPtr contents;
8184    /**
8185     * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
8186     */
8187    bool result_ok;
8188 } LDKCResult_NoneRetryableSendFailureZ;
8189
8190 /**
8191  * The contents of CResult_ThirtyTwoBytesPaymentSendFailureZ
8192  */
8193 typedef union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr {
8194    /**
8195     * A pointer to the contents in the success state.
8196     * Reading from this pointer when `result_ok` is not set is undefined.
8197     */
8198    struct LDKThirtyTwoBytes *result;
8199    /**
8200     * A pointer to the contents in the error state.
8201     * Reading from this pointer when `result_ok` is set is undefined.
8202     */
8203    struct LDKPaymentSendFailure *err;
8204 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr;
8205
8206 /**
8207  * A CResult_ThirtyTwoBytesPaymentSendFailureZ represents the result of a fallible operation,
8208  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8209  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8210  */
8211 typedef struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ {
8212    /**
8213     * The contents of this CResult_ThirtyTwoBytesPaymentSendFailureZ, accessible via either
8214     * `err` or `result` depending on the state of `result_ok`.
8215     */
8216    union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr contents;
8217    /**
8218     * Whether this CResult_ThirtyTwoBytesPaymentSendFailureZ represents a success state.
8219     */
8220    bool result_ok;
8221 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZ;
8222
8223 /**
8224  * The contents of CResult_ThirtyTwoBytesRetryableSendFailureZ
8225  */
8226 typedef union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr {
8227    /**
8228     * A pointer to the contents in the success state.
8229     * Reading from this pointer when `result_ok` is not set is undefined.
8230     */
8231    struct LDKThirtyTwoBytes *result;
8232    /**
8233     * A pointer to the contents in the error state.
8234     * Reading from this pointer when `result_ok` is set is undefined.
8235     */
8236    enum LDKRetryableSendFailure *err;
8237 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr;
8238
8239 /**
8240  * A CResult_ThirtyTwoBytesRetryableSendFailureZ represents the result of a fallible operation,
8241  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8242  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8243  */
8244 typedef struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ {
8245    /**
8246     * The contents of this CResult_ThirtyTwoBytesRetryableSendFailureZ, accessible via either
8247     * `err` or `result` depending on the state of `result_ok`.
8248     */
8249    union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr contents;
8250    /**
8251     * Whether this CResult_ThirtyTwoBytesRetryableSendFailureZ represents a success state.
8252     */
8253    bool result_ok;
8254 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZ;
8255
8256 /**
8257  * A tuple of 2 elements. See the individual fields for the types contained.
8258  */
8259 typedef struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ {
8260    /**
8261     * The element at position 0
8262     */
8263    struct LDKThirtyTwoBytes a;
8264    /**
8265     * The element at position 1
8266     */
8267    struct LDKThirtyTwoBytes b;
8268 } LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ;
8269
8270 /**
8271  * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ
8272  */
8273 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr {
8274    /**
8275     * A pointer to the contents in the success state.
8276     * Reading from this pointer when `result_ok` is not set is undefined.
8277     */
8278    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
8279    /**
8280     * A pointer to the contents in the error state.
8281     * Reading from this pointer when `result_ok` is set is undefined.
8282     */
8283    struct LDKPaymentSendFailure *err;
8284 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr;
8285
8286 /**
8287  * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents the result of a fallible operation,
8288  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8289  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8290  */
8291 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ {
8292    /**
8293     * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ, accessible via either
8294     * `err` or `result` depending on the state of `result_ok`.
8295     */
8296    union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr contents;
8297    /**
8298     * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents a success state.
8299     */
8300    bool result_ok;
8301 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ;
8302
8303 /**
8304  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZs of arbitrary size.
8305  * This corresponds to std::vector in C++
8306  */
8307 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ {
8308    /**
8309     * The elements in the array.
8310     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8311     */
8312    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *data;
8313    /**
8314     * The number of elements pointed to by `data`.
8315     */
8316    uintptr_t datalen;
8317 } LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ;
8318
8319 /**
8320  * Indicates that we failed to send a payment probe. Further errors may be surfaced later via
8321  * [`Event::ProbeFailed`].
8322  *
8323  * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
8324  */
8325 typedef enum LDKProbeSendFailure_Tag {
8326    /**
8327     * We were unable to find a route to the destination.
8328     */
8329    LDKProbeSendFailure_RouteNotFound,
8330    /**
8331     * We failed to send the payment probes.
8332     */
8333    LDKProbeSendFailure_SendingFailed,
8334    /**
8335     * Must be last for serialization purposes
8336     */
8337    LDKProbeSendFailure_Sentinel,
8338 } LDKProbeSendFailure_Tag;
8339
8340 typedef struct MUST_USE_STRUCT LDKProbeSendFailure {
8341    LDKProbeSendFailure_Tag tag;
8342    union {
8343       struct {
8344          struct LDKPaymentSendFailure sending_failed;
8345       };
8346    };
8347 } LDKProbeSendFailure;
8348
8349 /**
8350  * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ
8351  */
8352 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr {
8353    /**
8354     * A pointer to the contents in the success state.
8355     * Reading from this pointer when `result_ok` is not set is undefined.
8356     */
8357    struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
8358    /**
8359     * A pointer to the contents in the error state.
8360     * Reading from this pointer when `result_ok` is set is undefined.
8361     */
8362    struct LDKProbeSendFailure *err;
8363 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr;
8364
8365 /**
8366  * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents the result of a fallible operation,
8367  * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning::ln::outbound_payment::ProbeSendFailure on failure.
8368  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8369  */
8370 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
8371    /**
8372     * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ, accessible via either
8373     * `err` or `result` depending on the state of `result_ok`.
8374     */
8375    union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr contents;
8376    /**
8377     * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents a success state.
8378     */
8379    bool result_ok;
8380 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ;
8381
8382 /**
8383  * A tuple of 2 elements. See the individual fields for the types contained.
8384  */
8385 typedef struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ {
8386    /**
8387     * The element at position 0
8388     */
8389    struct LDKThirtyTwoBytes a;
8390    /**
8391     * The element at position 1
8392     */
8393    struct LDKPublicKey b;
8394 } LDKC2Tuple_ThirtyTwoBytesPublicKeyZ;
8395
8396 /**
8397  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesPublicKeyZs of arbitrary size.
8398  * This corresponds to std::vector in C++
8399  */
8400 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ {
8401    /**
8402     * The elements in the array.
8403     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8404     */
8405    struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *data;
8406    /**
8407     * The number of elements pointed to by `data`.
8408     */
8409    uintptr_t datalen;
8410 } LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ;
8411
8412 /**
8413  * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ
8414  */
8415 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr {
8416    /**
8417     * A pointer to the contents in the success state.
8418     * Reading from this pointer when `result_ok` is not set is undefined.
8419     */
8420    struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
8421    /**
8422     * Note that this value is always NULL, as there are no contents in the Err variant
8423     */
8424    void *err;
8425 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr;
8426
8427 /**
8428  * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents the result of a fallible operation,
8429  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a () on failure.
8430  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8431  */
8432 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ {
8433    /**
8434     * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ, accessible via either
8435     * `err` or `result` depending on the state of `result_ok`.
8436     */
8437    union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr contents;
8438    /**
8439     * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents a success state.
8440     */
8441    bool result_ok;
8442 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ;
8443
8444
8445
8446 /**
8447  * Information needed for constructing an invoice route hint for this channel.
8448  */
8449 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
8450    /**
8451     * A pointer to the opaque Rust object.
8452     * Nearly everywhere, inner must be non-null, however in places where
8453     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8454     */
8455    LDKnativeCounterpartyForwardingInfo *inner;
8456    /**
8457     * Indicates that this is the only struct which contains the same pointer.
8458     * Rust functions which take ownership of an object provided via an argument require
8459     * this to be true and invalidate the object pointed to by inner.
8460     */
8461    bool is_owned;
8462 } LDKCounterpartyForwardingInfo;
8463
8464 /**
8465  * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
8466  */
8467 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
8468    /**
8469     * A pointer to the contents in the success state.
8470     * Reading from this pointer when `result_ok` is not set is undefined.
8471     */
8472    struct LDKCounterpartyForwardingInfo *result;
8473    /**
8474     * A pointer to the contents in the error state.
8475     * Reading from this pointer when `result_ok` is set is undefined.
8476     */
8477    struct LDKDecodeError *err;
8478 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
8479
8480 /**
8481  * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
8482  * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8483  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8484  */
8485 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
8486    /**
8487     * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
8488     * `err` or `result` depending on the state of `result_ok`.
8489     */
8490    union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
8491    /**
8492     * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
8493     */
8494    bool result_ok;
8495 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
8496
8497
8498
8499 /**
8500  * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
8501  * to better separate parameters.
8502  */
8503 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
8504    /**
8505     * A pointer to the opaque Rust object.
8506     * Nearly everywhere, inner must be non-null, however in places where
8507     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8508     */
8509    LDKnativeChannelCounterparty *inner;
8510    /**
8511     * Indicates that this is the only struct which contains the same pointer.
8512     * Rust functions which take ownership of an object provided via an argument require
8513     * this to be true and invalidate the object pointed to by inner.
8514     */
8515    bool is_owned;
8516 } LDKChannelCounterparty;
8517
8518 /**
8519  * The contents of CResult_ChannelCounterpartyDecodeErrorZ
8520  */
8521 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
8522    /**
8523     * A pointer to the contents in the success state.
8524     * Reading from this pointer when `result_ok` is not set is undefined.
8525     */
8526    struct LDKChannelCounterparty *result;
8527    /**
8528     * A pointer to the contents in the error state.
8529     * Reading from this pointer when `result_ok` is set is undefined.
8530     */
8531    struct LDKDecodeError *err;
8532 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
8533
8534 /**
8535  * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
8536  * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
8537  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8538  */
8539 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
8540    /**
8541     * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
8542     * `err` or `result` depending on the state of `result_ok`.
8543     */
8544    union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
8545    /**
8546     * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
8547     */
8548    bool result_ok;
8549 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
8550
8551 /**
8552  * The contents of CResult_ChannelDetailsDecodeErrorZ
8553  */
8554 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
8555    /**
8556     * A pointer to the contents in the success state.
8557     * Reading from this pointer when `result_ok` is not set is undefined.
8558     */
8559    struct LDKChannelDetails *result;
8560    /**
8561     * A pointer to the contents in the error state.
8562     * Reading from this pointer when `result_ok` is set is undefined.
8563     */
8564    struct LDKDecodeError *err;
8565 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
8566
8567 /**
8568  * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
8569  * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
8570  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8571  */
8572 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
8573    /**
8574     * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
8575     * `err` or `result` depending on the state of `result_ok`.
8576     */
8577    union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
8578    /**
8579     * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
8580     */
8581    bool result_ok;
8582 } LDKCResult_ChannelDetailsDecodeErrorZ;
8583
8584
8585
8586 /**
8587  * Route hints used in constructing invoices for [phantom node payents].
8588  *
8589  * [phantom node payments]: crate::sign::PhantomKeysManager
8590  */
8591 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
8592    /**
8593     * A pointer to the opaque Rust object.
8594     * Nearly everywhere, inner must be non-null, however in places where
8595     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8596     */
8597    LDKnativePhantomRouteHints *inner;
8598    /**
8599     * Indicates that this is the only struct which contains the same pointer.
8600     * Rust functions which take ownership of an object provided via an argument require
8601     * this to be true and invalidate the object pointed to by inner.
8602     */
8603    bool is_owned;
8604 } LDKPhantomRouteHints;
8605
8606 /**
8607  * The contents of CResult_PhantomRouteHintsDecodeErrorZ
8608  */
8609 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
8610    /**
8611     * A pointer to the contents in the success state.
8612     * Reading from this pointer when `result_ok` is not set is undefined.
8613     */
8614    struct LDKPhantomRouteHints *result;
8615    /**
8616     * A pointer to the contents in the error state.
8617     * Reading from this pointer when `result_ok` is set is undefined.
8618     */
8619    struct LDKDecodeError *err;
8620 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
8621
8622 /**
8623  * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
8624  * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
8625  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8626  */
8627 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
8628    /**
8629     * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
8630     * `err` or `result` depending on the state of `result_ok`.
8631     */
8632    union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
8633    /**
8634     * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
8635     */
8636    bool result_ok;
8637 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
8638
8639 /**
8640  * The contents of CResult_ChannelShutdownStateDecodeErrorZ
8641  */
8642 typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
8643    /**
8644     * A pointer to the contents in the success state.
8645     * Reading from this pointer when `result_ok` is not set is undefined.
8646     */
8647    enum LDKChannelShutdownState *result;
8648    /**
8649     * A pointer to the contents in the error state.
8650     * Reading from this pointer when `result_ok` is set is undefined.
8651     */
8652    struct LDKDecodeError *err;
8653 } LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
8654
8655 /**
8656  * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
8657  * containing a crate::lightning::ln::channelmanager::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
8658  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8659  */
8660 typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
8661    /**
8662     * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
8663     * `err` or `result` depending on the state of `result_ok`.
8664     */
8665    union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
8666    /**
8667     * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
8668     */
8669    bool result_ok;
8670 } LDKCResult_ChannelShutdownStateDecodeErrorZ;
8671
8672
8673
8674 /**
8675  * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
8676  * on-chain transactions to ensure no loss of funds occurs.
8677  *
8678  * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
8679  * information and are actively monitoring the chain.
8680  *
8681  * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
8682  * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
8683  * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
8684  * returned block hash and the the current chain and then reconnecting blocks to get to the
8685  * best chain) upon deserializing the object!
8686  */
8687 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
8688    /**
8689     * A pointer to the opaque Rust object.
8690     * Nearly everywhere, inner must be non-null, however in places where
8691     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8692     */
8693    LDKnativeChannelMonitor *inner;
8694    /**
8695     * Indicates that this is the only struct which contains the same pointer.
8696     * Rust functions which take ownership of an object provided via an argument require
8697     * this to be true and invalidate the object pointed to by inner.
8698     */
8699    bool is_owned;
8700 } LDKChannelMonitor;
8701
8702 /**
8703  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
8704  * This corresponds to std::vector in C++
8705  */
8706 typedef struct LDKCVec_ChannelMonitorZ {
8707    /**
8708     * The elements in the array.
8709     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8710     */
8711    struct LDKChannelMonitor *data;
8712    /**
8713     * The number of elements pointed to by `data`.
8714     */
8715    uintptr_t datalen;
8716 } LDKCVec_ChannelMonitorZ;
8717
8718
8719
8720 /**
8721  * An update generated by the underlying channel itself which contains some new information the
8722  * [`ChannelMonitor`] should be made aware of.
8723  *
8724  * Because this represents only a small number of updates to the underlying state, it is generally
8725  * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
8726  * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
8727  * transaction), a single update may reach upwards of 1 MiB in serialized size.
8728  */
8729 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
8730    /**
8731     * A pointer to the opaque Rust object.
8732     * Nearly everywhere, inner must be non-null, however in places where
8733     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8734     */
8735    LDKnativeChannelMonitorUpdate *inner;
8736    /**
8737     * Indicates that this is the only struct which contains the same pointer.
8738     * Rust functions which take ownership of an object provided via an argument require
8739     * this to be true and invalidate the object pointed to by inner.
8740     */
8741    bool is_owned;
8742 } LDKChannelMonitorUpdate;
8743
8744 /**
8745  * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
8746  * blocks are connected and disconnected.
8747  *
8748  * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
8749  * responsible for maintaining a set of monitors such that they can be updated as channel state
8750  * changes. On each update, *all copies* of a [`ChannelMonitor`] must be updated and the update
8751  * persisted to disk to ensure that the latest [`ChannelMonitor`] state can be reloaded if the
8752  * application crashes.
8753  *
8754  * See method documentation and [`ChannelMonitorUpdateStatus`] for specific requirements.
8755  */
8756 typedef struct LDKWatch {
8757    /**
8758     * An opaque pointer which is passed to your function implementations as an argument.
8759     * This has no meaning in the LDK, and can be NULL or any other value.
8760     */
8761    void *this_arg;
8762    /**
8763     * Watches a channel identified by `funding_txo` using `monitor`.
8764     *
8765     * Implementations are responsible for watching the chain for the funding transaction along
8766     * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
8767     * calling [`block_connected`] and [`block_disconnected`] on the monitor.
8768     *
8769     * A return of `Err(())` indicates that the channel should immediately be force-closed without
8770     * broadcasting the funding transaction.
8771     *
8772     * If the given `funding_txo` has previously been registered via `watch_channel`, `Err(())`
8773     * must be returned.
8774     *
8775     * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
8776     * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
8777     * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
8778     */
8779    struct LDKCResult_ChannelMonitorUpdateStatusNoneZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
8780    /**
8781     * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
8782     *
8783     * Implementations must call [`ChannelMonitor::update_monitor`] with the given update. This
8784     * may fail (returning an `Err(())`), in which case this should return
8785     * [`ChannelMonitorUpdateStatus::InProgress`] (and the update should never complete). This
8786     * generally implies the channel has been closed (either by the funding outpoint being spent
8787     * on-chain or the [`ChannelMonitor`] having decided to do so and broadcasted a transaction),
8788     * and the [`ChannelManager`] state will be updated once it sees the funding spend on-chain.
8789     *
8790     * In general, persistence failures should be retried after returning
8791     * [`ChannelMonitorUpdateStatus::InProgress`] and eventually complete. If a failure truly
8792     * cannot be retried, the node should shut down immediately after returning
8793     * [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
8794     *
8795     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8796     */
8797    enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
8798    /**
8799     * Returns any monitor events since the last call. Subsequent calls must only return new
8800     * events.
8801     *
8802     * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
8803     * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
8804     * to disk.
8805     *
8806     * For details on asynchronous [`ChannelMonitor`] updating and returning
8807     * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
8808     */
8809    struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
8810    /**
8811     * Frees any resources associated with this object given its this_arg pointer.
8812     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8813     */
8814    void (*free)(void *this_arg);
8815 } LDKWatch;
8816
8817 /**
8818  * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
8819  * This corresponds to std::vector in C++
8820  */
8821 typedef struct LDKCVec_TransactionZ {
8822    /**
8823     * The elements in the array.
8824     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8825     */
8826    struct LDKTransaction *data;
8827    /**
8828     * The number of elements pointed to by `data`.
8829     */
8830    uintptr_t datalen;
8831 } LDKCVec_TransactionZ;
8832
8833 /**
8834  * An interface to send a transaction to the Bitcoin network.
8835  */
8836 typedef struct LDKBroadcasterInterface {
8837    /**
8838     * An opaque pointer which is passed to your function implementations as an argument.
8839     * This has no meaning in the LDK, and can be NULL or any other value.
8840     */
8841    void *this_arg;
8842    /**
8843     * Sends a list of transactions out to (hopefully) be mined.
8844     * This only needs to handle the actual broadcasting of transactions, LDK will automatically
8845     * rebroadcast transactions that haven't made it into a block.
8846     *
8847     * In some cases LDK may attempt to broadcast a transaction which double-spends another
8848     * and this isn't a bug and can be safely ignored.
8849     *
8850     * If more than one transaction is given, these transactions should be considered to be a
8851     * package and broadcast together. Some of the transactions may or may not depend on each other,
8852     * be sure to manage both cases correctly.
8853     *
8854     * Bitcoin transaction packages are defined in BIP 331 and here:
8855     * https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md
8856     */
8857    void (*broadcast_transactions)(const void *this_arg, struct LDKCVec_TransactionZ txs);
8858    /**
8859     * Frees any resources associated with this object given its this_arg pointer.
8860     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8861     */
8862    void (*free)(void *this_arg);
8863 } LDKBroadcasterInterface;
8864
8865 /**
8866  * A trait that describes a source of entropy.
8867  */
8868 typedef struct LDKEntropySource {
8869    /**
8870     * An opaque pointer which is passed to your function implementations as an argument.
8871     * This has no meaning in the LDK, and can be NULL or any other value.
8872     */
8873    void *this_arg;
8874    /**
8875     * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
8876     * different value each time it is called.
8877     */
8878    struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
8879    /**
8880     * Frees any resources associated with this object given its this_arg pointer.
8881     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8882     */
8883    void (*free)(void *this_arg);
8884 } LDKEntropySource;
8885
8886 /**
8887  * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
8888  * own the memory pointed to by data.
8889  */
8890 typedef struct LDKu8slice {
8891    /**
8892     * A pointer to the byte buffer
8893     */
8894    const uint8_t *data;
8895    /**
8896     * The number of bytes pointed to by `data`.
8897     */
8898    uintptr_t datalen;
8899 } LDKu8slice;
8900
8901
8902
8903 /**
8904  * A semantically valid [`InvoiceRequest`] that hasn't been signed.
8905  *
8906  * # Serialization
8907  *
8908  * This is serialized as a TLV stream, which includes TLV records from the originating message. As
8909  * such, it may include unknown, odd TLV records.
8910  */
8911 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
8912    /**
8913     * A pointer to the opaque Rust object.
8914     * Nearly everywhere, inner must be non-null, however in places where
8915     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8916     */
8917    LDKnativeUnsignedInvoiceRequest *inner;
8918    /**
8919     * Indicates that this is the only struct which contains the same pointer.
8920     * Rust functions which take ownership of an object provided via an argument require
8921     * this to be true and invalidate the object pointed to by inner.
8922     */
8923    bool is_owned;
8924 } LDKUnsignedInvoiceRequest;
8925
8926
8927
8928 /**
8929  * A semantically valid [`Bolt12Invoice`] that hasn't been signed.
8930  *
8931  * # Serialization
8932  *
8933  * This is serialized as a TLV stream, which includes TLV records from the originating message. As
8934  * such, it may include unknown, odd TLV records.
8935  */
8936 typedef struct MUST_USE_STRUCT LDKUnsignedBolt12Invoice {
8937    /**
8938     * A pointer to the opaque Rust object.
8939     * Nearly everywhere, inner must be non-null, however in places where
8940     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8941     */
8942    LDKnativeUnsignedBolt12Invoice *inner;
8943    /**
8944     * Indicates that this is the only struct which contains the same pointer.
8945     * Rust functions which take ownership of an object provided via an argument require
8946     * this to be true and invalidate the object pointed to by inner.
8947     */
8948    bool is_owned;
8949 } LDKUnsignedBolt12Invoice;
8950
8951
8952
8953 /**
8954  * The unsigned part of a [`channel_update`] message.
8955  *
8956  * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
8957  */
8958 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
8959    /**
8960     * A pointer to the opaque Rust object.
8961     * Nearly everywhere, inner must be non-null, however in places where
8962     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8963     */
8964    LDKnativeUnsignedChannelUpdate *inner;
8965    /**
8966     * Indicates that this is the only struct which contains the same pointer.
8967     * Rust functions which take ownership of an object provided via an argument require
8968     * this to be true and invalidate the object pointed to by inner.
8969     */
8970    bool is_owned;
8971 } LDKUnsignedChannelUpdate;
8972
8973
8974
8975 /**
8976  * The unsigned part of a [`node_announcement`] message.
8977  *
8978  * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
8979  */
8980 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
8981    /**
8982     * A pointer to the opaque Rust object.
8983     * Nearly everywhere, inner must be non-null, however in places where
8984     * the Rust equivalent takes an Option, it may be set to null to indicate None.
8985     */
8986    LDKnativeUnsignedNodeAnnouncement *inner;
8987    /**
8988     * Indicates that this is the only struct which contains the same pointer.
8989     * Rust functions which take ownership of an object provided via an argument require
8990     * this to be true and invalidate the object pointed to by inner.
8991     */
8992    bool is_owned;
8993 } LDKUnsignedNodeAnnouncement;
8994
8995 /**
8996  * Represents the set of gossip messages that require a signature from a node's identity key.
8997  */
8998 typedef enum LDKUnsignedGossipMessage_Tag {
8999    /**
9000     * An unsigned channel announcement.
9001     */
9002    LDKUnsignedGossipMessage_ChannelAnnouncement,
9003    /**
9004     * An unsigned channel update.
9005     */
9006    LDKUnsignedGossipMessage_ChannelUpdate,
9007    /**
9008     * An unsigned node announcement.
9009     */
9010    LDKUnsignedGossipMessage_NodeAnnouncement,
9011    /**
9012     * Must be last for serialization purposes
9013     */
9014    LDKUnsignedGossipMessage_Sentinel,
9015 } LDKUnsignedGossipMessage_Tag;
9016
9017 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
9018    LDKUnsignedGossipMessage_Tag tag;
9019    union {
9020       struct {
9021          struct LDKUnsignedChannelAnnouncement channel_announcement;
9022       };
9023       struct {
9024          struct LDKUnsignedChannelUpdate channel_update;
9025       };
9026       struct {
9027          struct LDKUnsignedNodeAnnouncement node_announcement;
9028       };
9029    };
9030 } LDKUnsignedGossipMessage;
9031
9032 /**
9033  * A trait that can handle cryptographic operations at the scope level of a node.
9034  */
9035 typedef struct LDKNodeSigner {
9036    /**
9037     * An opaque pointer which is passed to your function implementations as an argument.
9038     * This has no meaning in the LDK, and can be NULL or any other value.
9039     */
9040    void *this_arg;
9041    /**
9042     * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
9043     *
9044     * If the implementor of this trait supports [phantom node payments], then every node that is
9045     * intended to be included in the phantom invoice route hints must return the same value from
9046     * this method.
9047     *
9048     * This method must return the same value each time it is called.
9049     *
9050     * [phantom node payments]: PhantomKeysManager
9051     */
9052    struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
9053    /**
9054     * Get node id based on the provided [`Recipient`].
9055     *
9056     * This method must return the same value each time it is called with a given [`Recipient`]
9057     * parameter.
9058     *
9059     * Errors if the [`Recipient`] variant is not supported by the implementation.
9060     */
9061    struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
9062    /**
9063     * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
9064     * one is provided. Note that this tweak can be applied to `other_key` instead of our node
9065     * secret, though this is less efficient.
9066     *
9067     * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
9068     * should be resolved to allow LDK to resume forwarding HTLCs.
9069     *
9070     * Errors if the [`Recipient`] variant is not supported by the implementation.
9071     */
9072    struct LDKCResult_ThirtyTwoBytesNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak);
9073    /**
9074     * Sign an invoice.
9075     *
9076     * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
9077     * this trait to parse the invoice and make sure they're signing what they expect, rather than
9078     * blindly signing the hash.
9079     *
9080     * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
9081     *
9082     * The secret key used to sign the invoice is dependent on the [`Recipient`].
9083     *
9084     * Errors if the [`Recipient`] variant is not supported by the implementation.
9085     */
9086    struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
9087    /**
9088     * Signs the [`TaggedHash`] of a BOLT 12 invoice request.
9089     *
9090     * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where
9091     * `invoice_request` is the callee.
9092     *
9093     * Implementors may check that the `invoice_request` is expected rather than blindly signing
9094     * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with
9095     * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with
9096     * [`UnsignedInvoiceRequest::payer_id`].
9097     *
9098     * [`TaggedHash`]: crate::offers::merkle::TaggedHash
9099     */
9100    struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request);
9101    /**
9102     * Signs the [`TaggedHash`] of a BOLT 12 invoice.
9103     *
9104     * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
9105     * callee.
9106     *
9107     * Implementors may check that the `invoice` is expected rather than blindly signing the tagged
9108     * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing
9109     * key or an ephemeral key to preserve privacy, whichever is associated with
9110     * [`UnsignedBolt12Invoice::signing_pubkey`].
9111     *
9112     * [`TaggedHash`]: crate::offers::merkle::TaggedHash
9113     */
9114    struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice);
9115    /**
9116     * Sign a gossip message.
9117     *
9118     * Note that if this fails, LDK may panic and the message will not be broadcast to the network
9119     * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
9120     * message to be broadcast, as otherwise it may prevent one from receiving funds over the
9121     * corresponding channel.
9122     */
9123    struct LDKCResult_ECDSASignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
9124    /**
9125     * Frees any resources associated with this object given its this_arg pointer.
9126     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9127     */
9128    void (*free)(void *this_arg);
9129 } LDKNodeSigner;
9130
9131 /**
9132  * A trait that can return signer instances for individual channels.
9133  */
9134 typedef struct LDKSignerProvider {
9135    /**
9136     * An opaque pointer which is passed to your function implementations as an argument.
9137     * This has no meaning in the LDK, and can be NULL or any other value.
9138     */
9139    void *this_arg;
9140    /**
9141     * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::Signer`] through
9142     * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
9143     * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
9144     * `channel_keys_id`.
9145     *
9146     * This method must return a different value each time it is called.
9147     */
9148    struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
9149    /**
9150     * Derives the private key material backing a `Signer`.
9151     *
9152     * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
9153     * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
9154     * re-derived from its `channel_keys_id`, which can be obtained through its trait method
9155     * [`ChannelSigner::channel_keys_id`].
9156     */
9157    struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
9158    /**
9159     * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
9160     * This is only called during deserialization of other objects which contain
9161     * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
9162     * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
9163     * contain no versioning scheme. You may wish to include your own version prefix and ensure
9164     * you've read all of the provided bytes to ensure no corruption occurred.
9165     *
9166     * This method is slowly being phased out -- it will only be called when reading objects
9167     * written by LDK versions prior to 0.0.113.
9168     *
9169     * [`Signer`]: Self::Signer
9170     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
9171     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
9172     */
9173    struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
9174    /**
9175     * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
9176     *
9177     * If this function returns an error, this will result in a channel failing to open.
9178     *
9179     * This method should return a different value each time it is called, to avoid linking
9180     * on-chain funds across channels as controlled to the same user.
9181     */
9182    struct LDKCResult_CVec_u8ZNoneZ (*get_destination_script)(const void *this_arg);
9183    /**
9184     * Get a script pubkey which we will send funds to when closing a channel.
9185     *
9186     * If this function returns an error, this will result in a channel failing to open or close.
9187     * In the event of a failure when the counterparty is initiating a close, this can result in a
9188     * channel force close.
9189     *
9190     * This method should return a different value each time it is called, to avoid linking
9191     * on-chain funds across channels as controlled to the same user.
9192     */
9193    struct LDKCResult_ShutdownScriptNoneZ (*get_shutdown_scriptpubkey)(const void *this_arg);
9194    /**
9195     * Frees any resources associated with this object given its this_arg pointer.
9196     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9197     */
9198    void (*free)(void *this_arg);
9199 } LDKSignerProvider;
9200
9201 /**
9202  * A trait which should be implemented to provide feerate information on a number of time
9203  * horizons.
9204  *
9205  * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of
9206  * third-parties hosting them. Note that this enables them to affect the propagation of your
9207  * pre-signed transactions at any time and therefore endangers the safety of channels funds. It
9208  * should be considered carefully as a deployment.
9209  *
9210  * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
9211  * called from inside the library in response to chain events, P2P events, or timer events).
9212  */
9213 typedef struct LDKFeeEstimator {
9214    /**
9215     * An opaque pointer which is passed to your function implementations as an argument.
9216     * This has no meaning in the LDK, and can be NULL or any other value.
9217     */
9218    void *this_arg;
9219    /**
9220     * Gets estimated satoshis of fee required per 1000 Weight-Units.
9221     *
9222     * LDK will wrap this method and ensure that the value returned is no smaller than 253
9223     * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
9224     *
9225     * The following unit conversions can be used to convert to sats/KW:
9226     *  * satoshis-per-byte * 250
9227     *  * satoshis-per-kbyte / 4
9228     */
9229    uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
9230    /**
9231     * Frees any resources associated with this object given its this_arg pointer.
9232     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9233     */
9234    void (*free)(void *this_arg);
9235 } LDKFeeEstimator;
9236
9237 /**
9238  * A trait defining behavior for routing a payment.
9239  */
9240 typedef struct LDKRouter {
9241    /**
9242     * An opaque pointer which is passed to your function implementations as an argument.
9243     * This has no meaning in the LDK, and can be NULL or any other value.
9244     */
9245    void *this_arg;
9246    /**
9247     * Finds a [`Route`] for a payment between the given `payer` and a payee.
9248     *
9249     * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
9250     * and [`RouteParameters::final_value_msat`], respectively.
9251     *
9252     * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
9253     */
9254    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);
9255    /**
9256     * Finds a [`Route`] for a payment between the given `payer` and a payee.
9257     *
9258     * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
9259     * and [`RouteParameters::final_value_msat`], respectively.
9260     *
9261     * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific
9262     * payment.
9263     *
9264     * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
9265     */
9266    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);
9267    /**
9268     * Frees any resources associated with this object given its this_arg pointer.
9269     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9270     */
9271    void (*free)(void *this_arg);
9272 } LDKRouter;
9273
9274
9275
9276 /**
9277  * Manager which keeps track of a number of channels and sends messages to the appropriate
9278  * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
9279  *
9280  * Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through
9281  * to individual Channels.
9282  *
9283  * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
9284  * all peers during write/read (though does not modify this instance, only the instance being
9285  * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
9286  * called [`funding_transaction_generated`] for outbound channels) being closed.
9287  *
9288  * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
9289  * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST durably write each
9290  * [`ChannelMonitorUpdate`] before returning from
9291  * [`chain::Watch::watch_channel`]/[`update_channel`] or before completing async writes. With
9292  * `ChannelManager`s, writing updates happens out-of-band (and will prevent any other
9293  * `ChannelManager` operations from occurring during the serialization process). If the
9294  * deserialized version is out-of-date compared to the [`ChannelMonitor`] passed by reference to
9295  * [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
9296  * will be lost (modulo on-chain transaction fees).
9297  *
9298  * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
9299  * tells you the last block hash which was connected. You should get the best block tip before using the manager.
9300  * See [`chain::Listen`] and [`chain::Confirm`] for more details.
9301  *
9302  * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
9303  * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
9304  * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
9305  * offline for a full minute. In order to track this, you must call
9306  * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
9307  *
9308  * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
9309  * inbound channels without confirmed funding transactions. This may result in nodes which we do
9310  * not have a channel with being unable to connect to us or open new channels with us if we have
9311  * many peers with unfunded channels.
9312  *
9313  * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
9314  * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
9315  * never limited. Please ensure you limit the count of such channels yourself.
9316  *
9317  * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
9318  * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
9319  * essentially you should default to using a [`SimpleRefChannelManager`], and use a
9320  * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
9321  * you're using lightning-net-tokio.
9322  *
9323  * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
9324  * [`funding_created`]: msgs::FundingCreated
9325  * [`funding_transaction_generated`]: Self::funding_transaction_generated
9326  * [`BlockHash`]: bitcoin::hash_types::BlockHash
9327  * [`update_channel`]: chain::Watch::update_channel
9328  * [`ChannelUpdate`]: msgs::ChannelUpdate
9329  * [`timer_tick_occurred`]: Self::timer_tick_occurred
9330  * [`read`]: ReadableArgs::read
9331  */
9332 typedef struct MUST_USE_STRUCT LDKChannelManager {
9333    /**
9334     * A pointer to the opaque Rust object.
9335     * Nearly everywhere, inner must be non-null, however in places where
9336     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9337     */
9338    LDKnativeChannelManager *inner;
9339    /**
9340     * Indicates that this is the only struct which contains the same pointer.
9341     * Rust functions which take ownership of an object provided via an argument require
9342     * this to be true and invalidate the object pointed to by inner.
9343     */
9344    bool is_owned;
9345 } LDKChannelManager;
9346
9347 /**
9348  * A tuple of 2 elements. See the individual fields for the types contained.
9349  */
9350 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ {
9351    /**
9352     * The element at position 0
9353     */
9354    struct LDKThirtyTwoBytes a;
9355    /**
9356     * The element at position 1
9357     */
9358    struct LDKChannelManager b;
9359 } LDKC2Tuple_ThirtyTwoBytesChannelManagerZ;
9360
9361 /**
9362  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ
9363  */
9364 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr {
9365    /**
9366     * A pointer to the contents in the success state.
9367     * Reading from this pointer when `result_ok` is not set is undefined.
9368     */
9369    struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *result;
9370    /**
9371     * A pointer to the contents in the error state.
9372     * Reading from this pointer when `result_ok` is set is undefined.
9373     */
9374    struct LDKDecodeError *err;
9375 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr;
9376
9377 /**
9378  * A CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents the result of a fallible operation,
9379  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9380  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9381  */
9382 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
9383    /**
9384     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ, accessible via either
9385     * `err` or `result` depending on the state of `result_ok`.
9386     */
9387    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr contents;
9388    /**
9389     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents a success state.
9390     */
9391    bool result_ok;
9392 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ;
9393
9394 /**
9395  * Options for how to set the max dust HTLC exposure allowed on a channel. See
9396  * [`ChannelConfig::max_dust_htlc_exposure`] for details.
9397  */
9398 typedef enum LDKMaxDustHTLCExposure_Tag {
9399    /**
9400     * This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low
9401     * may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this
9402     * limit is very important to prevent stealing of large amounts of dust HTLCs by miners
9403     * through [fee griefing
9404     * attacks](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-May/002714.html).
9405     *
9406     * Note that if the feerate increases significantly, without a manual increase
9407     * to this maximum the channel may be unable to send/receive HTLCs between the maximum dust
9408     * exposure and the new minimum value for HTLCs to be economically viable to claim.
9409     */
9410    LDKMaxDustHTLCExposure_FixedLimitMsat,
9411    /**
9412     * This sets a multiplier on the estimated high priority feerate (sats/KW, as obtained from
9413     * [`FeeEstimator`]) to determine the maximum allowed dust exposure. If this variant is used
9414     * then the maximum dust exposure in millisatoshis is calculated as:
9415     * `high_priority_feerate_per_kw * value`. For example, with our default value
9416     * `FeeRateMultiplier(5000)`:
9417     *
9418     * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
9419     * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
9420     * be 253 * 5000 = 1,265,000 msats.
9421     * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
9422     * 7500 * 5000 = 37,500,000 msats.
9423     *
9424     * This allows the maximum dust exposure to automatically scale with fee rate changes.
9425     *
9426     * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
9427     * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
9428     * causing you to accept more dust HTLCs than you would otherwise.
9429     *
9430     * This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included
9431     * on HTLC outputs means your channel may be subject to more dust exposure in the event of
9432     * increases in fee rate.
9433     *
9434     * # Backwards Compatibility
9435     * This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
9436     * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
9437     *
9438     * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
9439     */
9440    LDKMaxDustHTLCExposure_FeeRateMultiplier,
9441    /**
9442     * Must be last for serialization purposes
9443     */
9444    LDKMaxDustHTLCExposure_Sentinel,
9445 } LDKMaxDustHTLCExposure_Tag;
9446
9447 typedef struct MUST_USE_STRUCT LDKMaxDustHTLCExposure {
9448    LDKMaxDustHTLCExposure_Tag tag;
9449    union {
9450       struct {
9451          uint64_t fixed_limit_msat;
9452       };
9453       struct {
9454          uint64_t fee_rate_multiplier;
9455       };
9456    };
9457 } LDKMaxDustHTLCExposure;
9458
9459 /**
9460  * The contents of CResult_MaxDustHTLCExposureDecodeErrorZ
9461  */
9462 typedef union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr {
9463    /**
9464     * A pointer to the contents in the success state.
9465     * Reading from this pointer when `result_ok` is not set is undefined.
9466     */
9467    struct LDKMaxDustHTLCExposure *result;
9468    /**
9469     * A pointer to the contents in the error state.
9470     * Reading from this pointer when `result_ok` is set is undefined.
9471     */
9472    struct LDKDecodeError *err;
9473 } LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr;
9474
9475 /**
9476  * A CResult_MaxDustHTLCExposureDecodeErrorZ represents the result of a fallible operation,
9477  * containing a crate::lightning::util::config::MaxDustHTLCExposure on success and a crate::lightning::ln::msgs::DecodeError on failure.
9478  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9479  */
9480 typedef struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ {
9481    /**
9482     * The contents of this CResult_MaxDustHTLCExposureDecodeErrorZ, accessible via either
9483     * `err` or `result` depending on the state of `result_ok`.
9484     */
9485    union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr contents;
9486    /**
9487     * Whether this CResult_MaxDustHTLCExposureDecodeErrorZ represents a success state.
9488     */
9489    bool result_ok;
9490 } LDKCResult_MaxDustHTLCExposureDecodeErrorZ;
9491
9492
9493
9494 /**
9495  * Options which apply on a per-channel basis and may change at runtime or based on negotiation
9496  * with our counterparty.
9497  */
9498 typedef struct MUST_USE_STRUCT LDKChannelConfig {
9499    /**
9500     * A pointer to the opaque Rust object.
9501     * Nearly everywhere, inner must be non-null, however in places where
9502     * the Rust equivalent takes an Option, it may be set to null to indicate None.
9503     */
9504    LDKnativeChannelConfig *inner;
9505    /**
9506     * Indicates that this is the only struct which contains the same pointer.
9507     * Rust functions which take ownership of an object provided via an argument require
9508     * this to be true and invalidate the object pointed to by inner.
9509     */
9510    bool is_owned;
9511 } LDKChannelConfig;
9512
9513 /**
9514  * The contents of CResult_ChannelConfigDecodeErrorZ
9515  */
9516 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
9517    /**
9518     * A pointer to the contents in the success state.
9519     * Reading from this pointer when `result_ok` is not set is undefined.
9520     */
9521    struct LDKChannelConfig *result;
9522    /**
9523     * A pointer to the contents in the error state.
9524     * Reading from this pointer when `result_ok` is set is undefined.
9525     */
9526    struct LDKDecodeError *err;
9527 } LDKCResult_ChannelConfigDecodeErrorZPtr;
9528
9529 /**
9530  * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
9531  * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
9532  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9533  */
9534 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
9535    /**
9536     * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
9537     * `err` or `result` depending on the state of `result_ok`.
9538     */
9539    union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
9540    /**
9541     * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
9542     */
9543    bool result_ok;
9544 } LDKCResult_ChannelConfigDecodeErrorZ;
9545
9546 /**
9547  * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not
9548  */
9549 typedef enum LDKCOption_MaxDustHTLCExposureZ_Tag {
9550    /**
9551     * When we're in this state, this COption_MaxDustHTLCExposureZ contains a crate::lightning::util::config::MaxDustHTLCExposure
9552     */
9553    LDKCOption_MaxDustHTLCExposureZ_Some,
9554    /**
9555     * When we're in this state, this COption_MaxDustHTLCExposureZ contains nothing
9556     */
9557    LDKCOption_MaxDustHTLCExposureZ_None,
9558    /**
9559     * Must be last for serialization purposes
9560     */
9561    LDKCOption_MaxDustHTLCExposureZ_Sentinel,
9562 } LDKCOption_MaxDustHTLCExposureZ_Tag;
9563
9564 typedef struct LDKCOption_MaxDustHTLCExposureZ {
9565    LDKCOption_MaxDustHTLCExposureZ_Tag tag;
9566    union {
9567       struct {
9568          struct LDKMaxDustHTLCExposure some;
9569       };
9570    };
9571 } LDKCOption_MaxDustHTLCExposureZ;
9572
9573 /**
9574  * An enum which can either contain a crate::lightning::util::errors::APIError or not
9575  */
9576 typedef enum LDKCOption_APIErrorZ_Tag {
9577    /**
9578     * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
9579     */
9580    LDKCOption_APIErrorZ_Some,
9581    /**
9582     * When we're in this state, this COption_APIErrorZ contains nothing
9583     */
9584    LDKCOption_APIErrorZ_None,
9585    /**
9586     * Must be last for serialization purposes
9587     */
9588    LDKCOption_APIErrorZ_Sentinel,
9589 } LDKCOption_APIErrorZ_Tag;
9590
9591 typedef struct LDKCOption_APIErrorZ {
9592    LDKCOption_APIErrorZ_Tag tag;
9593    union {
9594       struct {
9595          struct LDKAPIError some;
9596       };
9597    };
9598 } LDKCOption_APIErrorZ;
9599
9600 /**
9601  * The contents of CResult_COption_APIErrorZDecodeErrorZ
9602  */
9603 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
9604    /**
9605     * A pointer to the contents in the success state.
9606     * Reading from this pointer when `result_ok` is not set is undefined.
9607     */
9608    struct LDKCOption_APIErrorZ *result;
9609    /**
9610     * A pointer to the contents in the error state.
9611     * Reading from this pointer when `result_ok` is set is undefined.
9612     */
9613    struct LDKDecodeError *err;
9614 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
9615
9616 /**
9617  * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
9618  * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9619  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9620  */
9621 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
9622    /**
9623     * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
9624     * `err` or `result` depending on the state of `result_ok`.
9625     */
9626    union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
9627    /**
9628     * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
9629     */
9630    bool result_ok;
9631 } LDKCResult_COption_APIErrorZDecodeErrorZ;
9632
9633 /**
9634  * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
9635  */
9636 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
9637    /**
9638     * A pointer to the contents in the success state.
9639     * Reading from this pointer when `result_ok` is not set is undefined.
9640     */
9641    struct LDKChannelMonitorUpdate *result;
9642    /**
9643     * A pointer to the contents in the error state.
9644     * Reading from this pointer when `result_ok` is set is undefined.
9645     */
9646    struct LDKDecodeError *err;
9647 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
9648
9649 /**
9650  * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
9651  * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9652  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9653  */
9654 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
9655    /**
9656     * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
9657     * `err` or `result` depending on the state of `result_ok`.
9658     */
9659    union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
9660    /**
9661     * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
9662     */
9663    bool result_ok;
9664 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
9665
9666 /**
9667  * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
9668  */
9669 typedef enum LDKCOption_MonitorEventZ_Tag {
9670    /**
9671     * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
9672     */
9673    LDKCOption_MonitorEventZ_Some,
9674    /**
9675     * When we're in this state, this COption_MonitorEventZ contains nothing
9676     */
9677    LDKCOption_MonitorEventZ_None,
9678    /**
9679     * Must be last for serialization purposes
9680     */
9681    LDKCOption_MonitorEventZ_Sentinel,
9682 } LDKCOption_MonitorEventZ_Tag;
9683
9684 typedef struct LDKCOption_MonitorEventZ {
9685    LDKCOption_MonitorEventZ_Tag tag;
9686    union {
9687       struct {
9688          struct LDKMonitorEvent some;
9689       };
9690    };
9691 } LDKCOption_MonitorEventZ;
9692
9693 /**
9694  * The contents of CResult_COption_MonitorEventZDecodeErrorZ
9695  */
9696 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
9697    /**
9698     * A pointer to the contents in the success state.
9699     * Reading from this pointer when `result_ok` is not set is undefined.
9700     */
9701    struct LDKCOption_MonitorEventZ *result;
9702    /**
9703     * A pointer to the contents in the error state.
9704     * Reading from this pointer when `result_ok` is set is undefined.
9705     */
9706    struct LDKDecodeError *err;
9707 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
9708
9709 /**
9710  * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
9711  * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9712  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9713  */
9714 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
9715    /**
9716     * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
9717     * `err` or `result` depending on the state of `result_ok`.
9718     */
9719    union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
9720    /**
9721     * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
9722     */
9723    bool result_ok;
9724 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
9725
9726 /**
9727  * The contents of CResult_HTLCUpdateDecodeErrorZ
9728  */
9729 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
9730    /**
9731     * A pointer to the contents in the success state.
9732     * Reading from this pointer when `result_ok` is not set is undefined.
9733     */
9734    struct LDKHTLCUpdate *result;
9735    /**
9736     * A pointer to the contents in the error state.
9737     * Reading from this pointer when `result_ok` is set is undefined.
9738     */
9739    struct LDKDecodeError *err;
9740 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
9741
9742 /**
9743  * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
9744  * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9745  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9746  */
9747 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
9748    /**
9749     * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
9750     * `err` or `result` depending on the state of `result_ok`.
9751     */
9752    union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
9753    /**
9754     * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
9755     */
9756    bool result_ok;
9757 } LDKCResult_HTLCUpdateDecodeErrorZ;
9758
9759 /**
9760  * A tuple of 2 elements. See the individual fields for the types contained.
9761  */
9762 typedef struct LDKC2Tuple_OutPointCVec_u8ZZ {
9763    /**
9764     * The element at position 0
9765     */
9766    struct LDKOutPoint a;
9767    /**
9768     * The element at position 1
9769     */
9770    struct LDKCVec_u8Z b;
9771 } LDKC2Tuple_OutPointCVec_u8ZZ;
9772
9773 /**
9774  * A tuple of 2 elements. See the individual fields for the types contained.
9775  */
9776 typedef struct LDKC2Tuple_u32CVec_u8ZZ {
9777    /**
9778     * The element at position 0
9779     */
9780    uint32_t a;
9781    /**
9782     * The element at position 1
9783     */
9784    struct LDKCVec_u8Z b;
9785 } LDKC2Tuple_u32CVec_u8ZZ;
9786
9787 /**
9788  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32CVec_u8ZZs of arbitrary size.
9789  * This corresponds to std::vector in C++
9790  */
9791 typedef struct LDKCVec_C2Tuple_u32CVec_u8ZZZ {
9792    /**
9793     * The elements in the array.
9794     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9795     */
9796    struct LDKC2Tuple_u32CVec_u8ZZ *data;
9797    /**
9798     * The number of elements pointed to by `data`.
9799     */
9800    uintptr_t datalen;
9801 } LDKCVec_C2Tuple_u32CVec_u8ZZZ;
9802
9803 /**
9804  * A tuple of 2 elements. See the individual fields for the types contained.
9805  */
9806 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ {
9807    /**
9808     * The element at position 0
9809     */
9810    struct LDKThirtyTwoBytes a;
9811    /**
9812     * The element at position 1
9813     */
9814    struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b;
9815 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ;
9816
9817 /**
9818  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZs of arbitrary size.
9819  * This corresponds to std::vector in C++
9820  */
9821 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ {
9822    /**
9823     * The elements in the array.
9824     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9825     */
9826    struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *data;
9827    /**
9828     * The number of elements pointed to by `data`.
9829     */
9830    uintptr_t datalen;
9831 } LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ;
9832
9833 /**
9834  * A dynamically-allocated array of crate::lightning::ln::chan_utils::CommitmentTransactions of arbitrary size.
9835  * This corresponds to std::vector in C++
9836  */
9837 typedef struct LDKCVec_CommitmentTransactionZ {
9838    /**
9839     * The elements in the array.
9840     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9841     */
9842    struct LDKCommitmentTransaction *data;
9843    /**
9844     * The number of elements pointed to by `data`.
9845     */
9846    uintptr_t datalen;
9847 } LDKCVec_CommitmentTransactionZ;
9848
9849 /**
9850  * A tuple of 2 elements. See the individual fields for the types contained.
9851  */
9852 typedef struct LDKC2Tuple_u32TxOutZ {
9853    /**
9854     * The element at position 0
9855     */
9856    uint32_t a;
9857    /**
9858     * The element at position 1
9859     */
9860    struct LDKTxOut b;
9861 } LDKC2Tuple_u32TxOutZ;
9862
9863 /**
9864  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
9865  * This corresponds to std::vector in C++
9866  */
9867 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
9868    /**
9869     * The elements in the array.
9870     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9871     */
9872    struct LDKC2Tuple_u32TxOutZ *data;
9873    /**
9874     * The number of elements pointed to by `data`.
9875     */
9876    uintptr_t datalen;
9877 } LDKCVec_C2Tuple_u32TxOutZZ;
9878
9879 /**
9880  * A tuple of 2 elements. See the individual fields for the types contained.
9881  */
9882 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ {
9883    /**
9884     * The element at position 0
9885     */
9886    struct LDKThirtyTwoBytes a;
9887    /**
9888     * The element at position 1
9889     */
9890    struct LDKCVec_C2Tuple_u32TxOutZZ b;
9891 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ;
9892
9893 /**
9894  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
9895  * This corresponds to std::vector in C++
9896  */
9897 typedef struct LDKCVec_TransactionOutputsZ {
9898    /**
9899     * The elements in the array.
9900     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9901     */
9902    struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *data;
9903    /**
9904     * The number of elements pointed to by `data`.
9905     */
9906    uintptr_t datalen;
9907 } LDKCVec_TransactionOutputsZ;
9908
9909 /**
9910  * Details about the balance(s) available for spending once the channel appears on chain.
9911  *
9912  * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
9913  * be provided.
9914  */
9915 typedef enum LDKBalance_Tag {
9916    /**
9917     * The channel is not yet closed (or the commitment or closing transaction has not yet
9918     * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
9919     * force-closed now.
9920     */
9921    LDKBalance_ClaimableOnChannelClose,
9922    /**
9923     * The channel has been closed, and the given balance is ours but awaiting confirmations until
9924     * we consider it spendable.
9925     */
9926    LDKBalance_ClaimableAwaitingConfirmations,
9927    /**
9928     * The channel has been closed, and the given balance should be ours but awaiting spending
9929     * transaction confirmation. If the spending transaction does not confirm in time, it is
9930     * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
9931     *
9932     * Once the spending transaction confirms, before it has reached enough confirmations to be
9933     * considered safe from chain reorganizations, the balance will instead be provided via
9934     * [`Balance::ClaimableAwaitingConfirmations`].
9935     */
9936    LDKBalance_ContentiousClaimable,
9937    /**
9938     * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
9939     * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
9940     * likely to be claimed by our counterparty before we do.
9941     */
9942    LDKBalance_MaybeTimeoutClaimableHTLC,
9943    /**
9944     * HTLCs which we received from our counterparty which are claimable with a preimage which we
9945     * do not currently have. This will only be claimable if we receive the preimage from the node
9946     * to which we forwarded this HTLC before the timeout.
9947     */
9948    LDKBalance_MaybePreimageClaimableHTLC,
9949    /**
9950     * The channel has been closed, and our counterparty broadcasted a revoked commitment
9951     * transaction.
9952     *
9953     * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
9954     * following amount.
9955     */
9956    LDKBalance_CounterpartyRevokedOutputClaimable,
9957    /**
9958     * Must be last for serialization purposes
9959     */
9960    LDKBalance_Sentinel,
9961 } LDKBalance_Tag;
9962
9963 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
9964    /**
9965     * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9966     * required to do so.
9967     */
9968    uint64_t amount_satoshis;
9969 } LDKBalance_LDKClaimableOnChannelClose_Body;
9970
9971 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
9972    /**
9973     * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
9974     * were spent in broadcasting the transaction.
9975     */
9976    uint64_t amount_satoshis;
9977    /**
9978     * The height at which an [`Event::SpendableOutputs`] event will be generated for this
9979     * amount.
9980     */
9981    uint32_t confirmation_height;
9982 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
9983
9984 typedef struct LDKBalance_LDKContentiousClaimable_Body {
9985    /**
9986     * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9987     * required to do so.
9988     */
9989    uint64_t amount_satoshis;
9990    /**
9991     * The height at which the counterparty may be able to claim the balance if we have not
9992     * done so.
9993     */
9994    uint32_t timeout_height;
9995    /**
9996     * The payment hash that locks this HTLC.
9997     */
9998    struct LDKThirtyTwoBytes payment_hash;
9999    /**
10000     * The preimage that can be used to claim this HTLC.
10001     */
10002    struct LDKThirtyTwoBytes payment_preimage;
10003 } LDKBalance_LDKContentiousClaimable_Body;
10004
10005 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
10006    /**
10007     * The amount potentially available to claim, in satoshis, excluding the on-chain fees
10008     * which will be required to do so.
10009     */
10010    uint64_t amount_satoshis;
10011    /**
10012     * The height at which we will be able to claim the balance if our counterparty has not
10013     * done so.
10014     */
10015    uint32_t claimable_height;
10016    /**
10017     * The payment hash whose preimage our counterparty needs to claim this HTLC.
10018     */
10019    struct LDKThirtyTwoBytes payment_hash;
10020 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
10021
10022 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
10023    /**
10024     * The amount potentially available to claim, in satoshis, excluding the on-chain fees
10025     * which will be required to do so.
10026     */
10027    uint64_t amount_satoshis;
10028    /**
10029     * The height at which our counterparty will be able to claim the balance if we have not
10030     * yet received the preimage and claimed it ourselves.
10031     */
10032    uint32_t expiry_height;
10033    /**
10034     * The payment hash whose preimage we need to claim this HTLC.
10035     */
10036    struct LDKThirtyTwoBytes payment_hash;
10037 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
10038
10039 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
10040    /**
10041     * The amount, in satoshis, of the output which we can claim.
10042     *
10043     * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
10044     * were already spent.
10045     */
10046    uint64_t amount_satoshis;
10047 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
10048
10049 typedef struct MUST_USE_STRUCT LDKBalance {
10050    LDKBalance_Tag tag;
10051    union {
10052       LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
10053       LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
10054       LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
10055       LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
10056       LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
10057       LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
10058    };
10059 } LDKBalance;
10060
10061 /**
10062  * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
10063  * This corresponds to std::vector in C++
10064  */
10065 typedef struct LDKCVec_BalanceZ {
10066    /**
10067     * The elements in the array.
10068     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10069     */
10070    struct LDKBalance *data;
10071    /**
10072     * The number of elements pointed to by `data`.
10073     */
10074    uintptr_t datalen;
10075 } LDKCVec_BalanceZ;
10076
10077 /**
10078  * A tuple of 2 elements. See the individual fields for the types contained.
10079  */
10080 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ {
10081    /**
10082     * The element at position 0
10083     */
10084    struct LDKThirtyTwoBytes a;
10085    /**
10086     * The element at position 1
10087     */
10088    struct LDKChannelMonitor b;
10089 } LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ;
10090
10091 /**
10092  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ
10093  */
10094 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr {
10095    /**
10096     * A pointer to the contents in the success state.
10097     * Reading from this pointer when `result_ok` is not set is undefined.
10098     */
10099    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
10100    /**
10101     * A pointer to the contents in the error state.
10102     * Reading from this pointer when `result_ok` is set is undefined.
10103     */
10104    struct LDKDecodeError *err;
10105 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr;
10106
10107 /**
10108  * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
10109  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10110  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10111  */
10112 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ {
10113    /**
10114     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ, accessible via either
10115     * `err` or `result` depending on the state of `result_ok`.
10116     */
10117    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr contents;
10118    /**
10119     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents a success state.
10120     */
10121    bool result_ok;
10122 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ;
10123
10124 /**
10125  * Defines a type identifier for sending messages over the wire.
10126  *
10127  * Messages implementing this trait specify a type and must be [`Writeable`].
10128  */
10129 typedef struct LDKType {
10130    /**
10131     * An opaque pointer which is passed to your function implementations as an argument.
10132     * This has no meaning in the LDK, and can be NULL or any other value.
10133     */
10134    void *this_arg;
10135    /**
10136     * Returns the type identifying the message payload.
10137     */
10138    uint16_t (*type_id)(const void *this_arg);
10139    /**
10140     * Return a human-readable "debug" string describing this object
10141     */
10142    struct LDKStr (*debug_str)(const void *this_arg);
10143    /**
10144     * Serialize the object into a byte array
10145     */
10146    struct LDKCVec_u8Z (*write)(const void *this_arg);
10147    /**
10148     * Called, if set, after this Type has been cloned into a duplicate object.
10149     * The new Type is provided, and should be mutated as needed to perform a
10150     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
10151     */
10152    void (*cloned)(struct LDKType *NONNULL_PTR new_Type);
10153    /**
10154     * Frees any resources associated with this object given its this_arg pointer.
10155     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10156     */
10157    void (*free)(void *this_arg);
10158 } LDKType;
10159
10160 /**
10161  * A tuple of 2 elements. See the individual fields for the types contained.
10162  */
10163 typedef struct LDKC2Tuple_PublicKeyTypeZ {
10164    /**
10165     * The element at position 0
10166     */
10167    struct LDKPublicKey a;
10168    /**
10169     * The element at position 1
10170     */
10171    struct LDKType b;
10172 } LDKC2Tuple_PublicKeyTypeZ;
10173
10174 /**
10175  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
10176  * This corresponds to std::vector in C++
10177  */
10178 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
10179    /**
10180     * The elements in the array.
10181     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10182     */
10183    struct LDKC2Tuple_PublicKeyTypeZ *data;
10184    /**
10185     * The number of elements pointed to by `data`.
10186     */
10187    uintptr_t datalen;
10188 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
10189
10190
10191
10192 /**
10193  * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
10194  *
10195  * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
10196  * specifies these such that its recipient can send an invoice for payment.
10197  *
10198  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10199  * [`Offer`]: crate::offers::offer::Offer
10200  */
10201 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
10202    /**
10203     * A pointer to the opaque Rust object.
10204     * Nearly everywhere, inner must be non-null, however in places where
10205     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10206     */
10207    LDKnativeInvoiceRequest *inner;
10208    /**
10209     * Indicates that this is the only struct which contains the same pointer.
10210     * Rust functions which take ownership of an object provided via an argument require
10211     * this to be true and invalidate the object pointed to by inner.
10212     */
10213    bool is_owned;
10214 } LDKInvoiceRequest;
10215
10216
10217
10218 /**
10219  * A `Bolt12Invoice` is a payment request, typically corresponding to an [`Offer`] or a [`Refund`].
10220  *
10221  * An invoice may be sent in response to an [`InvoiceRequest`] in the case of an offer or sent
10222  * directly after scanning a refund. It includes all the information needed to pay a recipient.
10223  *
10224  * [`Offer`]: crate::offers::offer::Offer
10225  * [`Refund`]: crate::offers::refund::Refund
10226  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
10227  */
10228 typedef struct MUST_USE_STRUCT LDKBolt12Invoice {
10229    /**
10230     * A pointer to the opaque Rust object.
10231     * Nearly everywhere, inner must be non-null, however in places where
10232     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10233     */
10234    LDKnativeBolt12Invoice *inner;
10235    /**
10236     * Indicates that this is the only struct which contains the same pointer.
10237     * Rust functions which take ownership of an object provided via an argument require
10238     * this to be true and invalidate the object pointed to by inner.
10239     */
10240    bool is_owned;
10241 } LDKBolt12Invoice;
10242
10243
10244
10245 /**
10246  * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
10247  *
10248  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
10249  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
10250  */
10251 typedef struct MUST_USE_STRUCT LDKInvoiceError {
10252    /**
10253     * A pointer to the opaque Rust object.
10254     * Nearly everywhere, inner must be non-null, however in places where
10255     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10256     */
10257    LDKnativeInvoiceError *inner;
10258    /**
10259     * Indicates that this is the only struct which contains the same pointer.
10260     * Rust functions which take ownership of an object provided via an argument require
10261     * this to be true and invalidate the object pointed to by inner.
10262     */
10263    bool is_owned;
10264 } LDKInvoiceError;
10265
10266 /**
10267  * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`].
10268  *
10269  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
10270  */
10271 typedef enum LDKOffersMessage_Tag {
10272    /**
10273     * A request for a [`Bolt12Invoice`] for a particular [`Offer`].
10274     *
10275     * [`Offer`]: crate::offers::offer::Offer
10276     */
10277    LDKOffersMessage_InvoiceRequest,
10278    /**
10279     * A [`Bolt12Invoice`] sent in response to an [`InvoiceRequest`] or a [`Refund`].
10280     *
10281     * [`Refund`]: crate::offers::refund::Refund
10282     */
10283    LDKOffersMessage_Invoice,
10284    /**
10285     * An error from handling an [`OffersMessage`].
10286     */
10287    LDKOffersMessage_InvoiceError,
10288    /**
10289     * Must be last for serialization purposes
10290     */
10291    LDKOffersMessage_Sentinel,
10292 } LDKOffersMessage_Tag;
10293
10294 typedef struct MUST_USE_STRUCT LDKOffersMessage {
10295    LDKOffersMessage_Tag tag;
10296    union {
10297       struct {
10298          struct LDKInvoiceRequest invoice_request;
10299       };
10300       struct {
10301          struct LDKBolt12Invoice invoice;
10302       };
10303       struct {
10304          struct LDKInvoiceError invoice_error;
10305       };
10306    };
10307 } LDKOffersMessage;
10308
10309 /**
10310  * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
10311  */
10312 typedef enum LDKCOption_OffersMessageZ_Tag {
10313    /**
10314     * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
10315     */
10316    LDKCOption_OffersMessageZ_Some,
10317    /**
10318     * When we're in this state, this COption_OffersMessageZ contains nothing
10319     */
10320    LDKCOption_OffersMessageZ_None,
10321    /**
10322     * Must be last for serialization purposes
10323     */
10324    LDKCOption_OffersMessageZ_Sentinel,
10325 } LDKCOption_OffersMessageZ_Tag;
10326
10327 typedef struct LDKCOption_OffersMessageZ {
10328    LDKCOption_OffersMessageZ_Tag tag;
10329    union {
10330       struct {
10331          struct LDKOffersMessage some;
10332       };
10333    };
10334 } LDKCOption_OffersMessageZ;
10335
10336 /**
10337  * The contents of a custom onion message.
10338  */
10339 typedef struct LDKCustomOnionMessageContents {
10340    /**
10341     * An opaque pointer which is passed to your function implementations as an argument.
10342     * This has no meaning in the LDK, and can be NULL or any other value.
10343     */
10344    void *this_arg;
10345    /**
10346     * Returns the TLV type identifying the message contents. MUST be >= 64.
10347     */
10348    uint64_t (*tlv_type)(const void *this_arg);
10349    /**
10350     * Serialize the object into a byte array
10351     */
10352    struct LDKCVec_u8Z (*write)(const void *this_arg);
10353    /**
10354     * Called, if set, after this CustomOnionMessageContents has been cloned into a duplicate object.
10355     * The new CustomOnionMessageContents is provided, and should be mutated as needed to perform a
10356     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
10357     */
10358    void (*cloned)(struct LDKCustomOnionMessageContents *NONNULL_PTR new_CustomOnionMessageContents);
10359    /**
10360     * Frees any resources associated with this object given its this_arg pointer.
10361     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10362     */
10363    void (*free)(void *this_arg);
10364 } LDKCustomOnionMessageContents;
10365
10366 /**
10367  * An enum which can either contain a crate::lightning::onion_message::packet::CustomOnionMessageContents or not
10368  */
10369 typedef enum LDKCOption_CustomOnionMessageContentsZ_Tag {
10370    /**
10371     * When we're in this state, this COption_CustomOnionMessageContentsZ contains a crate::lightning::onion_message::packet::CustomOnionMessageContents
10372     */
10373    LDKCOption_CustomOnionMessageContentsZ_Some,
10374    /**
10375     * When we're in this state, this COption_CustomOnionMessageContentsZ contains nothing
10376     */
10377    LDKCOption_CustomOnionMessageContentsZ_None,
10378    /**
10379     * Must be last for serialization purposes
10380     */
10381    LDKCOption_CustomOnionMessageContentsZ_Sentinel,
10382 } LDKCOption_CustomOnionMessageContentsZ_Tag;
10383
10384 typedef struct LDKCOption_CustomOnionMessageContentsZ {
10385    LDKCOption_CustomOnionMessageContentsZ_Tag tag;
10386    union {
10387       struct {
10388          struct LDKCustomOnionMessageContents some;
10389       };
10390    };
10391 } LDKCOption_CustomOnionMessageContentsZ;
10392
10393 /**
10394  * The contents of CResult_COption_CustomOnionMessageContentsZDecodeErrorZ
10395  */
10396 typedef union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr {
10397    /**
10398     * A pointer to the contents in the success state.
10399     * Reading from this pointer when `result_ok` is not set is undefined.
10400     */
10401    struct LDKCOption_CustomOnionMessageContentsZ *result;
10402    /**
10403     * A pointer to the contents in the error state.
10404     * Reading from this pointer when `result_ok` is set is undefined.
10405     */
10406    struct LDKDecodeError *err;
10407 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr;
10408
10409 /**
10410  * A CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
10411  * containing a crate::c_types::derived::COption_CustomOnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10412  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10413  */
10414 typedef struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ {
10415    /**
10416     * The contents of this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ, accessible via either
10417     * `err` or `result` depending on the state of `result_ok`.
10418     */
10419    union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr contents;
10420    /**
10421     * Whether this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents a success state.
10422     */
10423    bool result_ok;
10424 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ;
10425
10426 /**
10427  * An enum which can either contain a crate::lightning::ln::wire::Type or not
10428  */
10429 typedef enum LDKCOption_TypeZ_Tag {
10430    /**
10431     * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
10432     */
10433    LDKCOption_TypeZ_Some,
10434    /**
10435     * When we're in this state, this COption_TypeZ contains nothing
10436     */
10437    LDKCOption_TypeZ_None,
10438    /**
10439     * Must be last for serialization purposes
10440     */
10441    LDKCOption_TypeZ_Sentinel,
10442 } LDKCOption_TypeZ_Tag;
10443
10444 typedef struct LDKCOption_TypeZ {
10445    LDKCOption_TypeZ_Tag tag;
10446    union {
10447       struct {
10448          struct LDKType some;
10449       };
10450    };
10451 } LDKCOption_TypeZ;
10452
10453 /**
10454  * The contents of CResult_COption_TypeZDecodeErrorZ
10455  */
10456 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
10457    /**
10458     * A pointer to the contents in the success state.
10459     * Reading from this pointer when `result_ok` is not set is undefined.
10460     */
10461    struct LDKCOption_TypeZ *result;
10462    /**
10463     * A pointer to the contents in the error state.
10464     * Reading from this pointer when `result_ok` is set is undefined.
10465     */
10466    struct LDKDecodeError *err;
10467 } LDKCResult_COption_TypeZDecodeErrorZPtr;
10468
10469 /**
10470  * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
10471  * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10472  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10473  */
10474 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
10475    /**
10476     * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
10477     * `err` or `result` depending on the state of `result_ok`.
10478     */
10479    union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
10480    /**
10481     * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
10482     */
10483    bool result_ok;
10484 } LDKCResult_COption_TypeZDecodeErrorZ;
10485
10486 /**
10487  * An enum which can either contain a crate::lightning::ln::msgs::SocketAddress or not
10488  */
10489 typedef enum LDKCOption_SocketAddressZ_Tag {
10490    /**
10491     * When we're in this state, this COption_SocketAddressZ contains a crate::lightning::ln::msgs::SocketAddress
10492     */
10493    LDKCOption_SocketAddressZ_Some,
10494    /**
10495     * When we're in this state, this COption_SocketAddressZ contains nothing
10496     */
10497    LDKCOption_SocketAddressZ_None,
10498    /**
10499     * Must be last for serialization purposes
10500     */
10501    LDKCOption_SocketAddressZ_Sentinel,
10502 } LDKCOption_SocketAddressZ_Tag;
10503
10504 typedef struct LDKCOption_SocketAddressZ {
10505    LDKCOption_SocketAddressZ_Tag tag;
10506    union {
10507       struct {
10508          struct LDKSocketAddress some;
10509       };
10510    };
10511 } LDKCOption_SocketAddressZ;
10512
10513 /**
10514  * A tuple of 2 elements. See the individual fields for the types contained.
10515  */
10516 typedef struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ {
10517    /**
10518     * The element at position 0
10519     */
10520    struct LDKPublicKey a;
10521    /**
10522     * The element at position 1
10523     */
10524    struct LDKCOption_SocketAddressZ b;
10525 } LDKC2Tuple_PublicKeyCOption_SocketAddressZZ;
10526
10527 /**
10528  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCOption_SocketAddressZZs of arbitrary size.
10529  * This corresponds to std::vector in C++
10530  */
10531 typedef struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ {
10532    /**
10533     * The elements in the array.
10534     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10535     */
10536    struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *data;
10537    /**
10538     * The number of elements pointed to by `data`.
10539     */
10540    uintptr_t datalen;
10541 } LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ;
10542
10543
10544
10545 /**
10546  * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
10547  * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
10548  * descriptor.
10549  */
10550 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
10551    /**
10552     * A pointer to the opaque Rust object.
10553     * Nearly everywhere, inner must be non-null, however in places where
10554     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10555     */
10556    LDKnativePeerHandleError *inner;
10557    /**
10558     * Indicates that this is the only struct which contains the same pointer.
10559     * Rust functions which take ownership of an object provided via an argument require
10560     * this to be true and invalidate the object pointed to by inner.
10561     */
10562    bool is_owned;
10563 } LDKPeerHandleError;
10564
10565 /**
10566  * The contents of CResult_CVec_u8ZPeerHandleErrorZ
10567  */
10568 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
10569    /**
10570     * A pointer to the contents in the success state.
10571     * Reading from this pointer when `result_ok` is not set is undefined.
10572     */
10573    struct LDKCVec_u8Z *result;
10574    /**
10575     * A pointer to the contents in the error state.
10576     * Reading from this pointer when `result_ok` is set is undefined.
10577     */
10578    struct LDKPeerHandleError *err;
10579 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
10580
10581 /**
10582  * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
10583  * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10584  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10585  */
10586 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
10587    /**
10588     * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
10589     * `err` or `result` depending on the state of `result_ok`.
10590     */
10591    union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
10592    /**
10593     * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
10594     */
10595    bool result_ok;
10596 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
10597
10598 /**
10599  * The contents of CResult_NonePeerHandleErrorZ
10600  */
10601 typedef union LDKCResult_NonePeerHandleErrorZPtr {
10602    /**
10603     * Note that this value is always NULL, as there are no contents in the OK variant
10604     */
10605    void *result;
10606    /**
10607     * A pointer to the contents in the error state.
10608     * Reading from this pointer when `result_ok` is set is undefined.
10609     */
10610    struct LDKPeerHandleError *err;
10611 } LDKCResult_NonePeerHandleErrorZPtr;
10612
10613 /**
10614  * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
10615  * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10616  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10617  */
10618 typedef struct LDKCResult_NonePeerHandleErrorZ {
10619    /**
10620     * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
10621     * `err` or `result` depending on the state of `result_ok`.
10622     */
10623    union LDKCResult_NonePeerHandleErrorZPtr contents;
10624    /**
10625     * Whether this CResult_NonePeerHandleErrorZ represents a success state.
10626     */
10627    bool result_ok;
10628 } LDKCResult_NonePeerHandleErrorZ;
10629
10630 /**
10631  * The contents of CResult_boolPeerHandleErrorZ
10632  */
10633 typedef union LDKCResult_boolPeerHandleErrorZPtr {
10634    /**
10635     * A pointer to the contents in the success state.
10636     * Reading from this pointer when `result_ok` is not set is undefined.
10637     */
10638    bool *result;
10639    /**
10640     * A pointer to the contents in the error state.
10641     * Reading from this pointer when `result_ok` is set is undefined.
10642     */
10643    struct LDKPeerHandleError *err;
10644 } LDKCResult_boolPeerHandleErrorZPtr;
10645
10646 /**
10647  * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
10648  * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10649  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10650  */
10651 typedef struct LDKCResult_boolPeerHandleErrorZ {
10652    /**
10653     * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
10654     * `err` or `result` depending on the state of `result_ok`.
10655     */
10656    union LDKCResult_boolPeerHandleErrorZPtr contents;
10657    /**
10658     * Whether this CResult_boolPeerHandleErrorZ represents a success state.
10659     */
10660    bool result_ok;
10661 } LDKCResult_boolPeerHandleErrorZ;
10662
10663 /**
10664  * All-encompassing standard error type that processing can return
10665  */
10666 typedef enum LDKGraphSyncError_Tag {
10667    /**
10668     * Error trying to read the update data, typically due to an erroneous data length indication
10669     * that is greater than the actual amount of data provided
10670     */
10671    LDKGraphSyncError_DecodeError,
10672    /**
10673     * Error applying the patch to the network graph, usually the result of updates that are too
10674     * old or missing prerequisite data to the application of updates out of order
10675     */
10676    LDKGraphSyncError_LightningError,
10677    /**
10678     * Must be last for serialization purposes
10679     */
10680    LDKGraphSyncError_Sentinel,
10681 } LDKGraphSyncError_Tag;
10682
10683 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
10684    LDKGraphSyncError_Tag tag;
10685    union {
10686       struct {
10687          struct LDKDecodeError decode_error;
10688       };
10689       struct {
10690          struct LDKLightningError lightning_error;
10691       };
10692    };
10693 } LDKGraphSyncError;
10694
10695 /**
10696  * The contents of CResult_u32GraphSyncErrorZ
10697  */
10698 typedef union LDKCResult_u32GraphSyncErrorZPtr {
10699    /**
10700     * A pointer to the contents in the success state.
10701     * Reading from this pointer when `result_ok` is not set is undefined.
10702     */
10703    uint32_t *result;
10704    /**
10705     * A pointer to the contents in the error state.
10706     * Reading from this pointer when `result_ok` is set is undefined.
10707     */
10708    struct LDKGraphSyncError *err;
10709 } LDKCResult_u32GraphSyncErrorZPtr;
10710
10711 /**
10712  * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
10713  * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
10714  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10715  */
10716 typedef struct LDKCResult_u32GraphSyncErrorZ {
10717    /**
10718     * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
10719     * `err` or `result` depending on the state of `result_ok`.
10720     */
10721    union LDKCResult_u32GraphSyncErrorZPtr contents;
10722    /**
10723     * Whether this CResult_u32GraphSyncErrorZ represents a success state.
10724     */
10725    bool result_ok;
10726 } LDKCResult_u32GraphSyncErrorZ;
10727
10728 /**
10729  * The contents of CResult_CVec_u8ZIOErrorZ
10730  */
10731 typedef union LDKCResult_CVec_u8ZIOErrorZPtr {
10732    /**
10733     * A pointer to the contents in the success state.
10734     * Reading from this pointer when `result_ok` is not set is undefined.
10735     */
10736    struct LDKCVec_u8Z *result;
10737    /**
10738     * A pointer to the contents in the error state.
10739     * Reading from this pointer when `result_ok` is set is undefined.
10740     */
10741    enum LDKIOError *err;
10742 } LDKCResult_CVec_u8ZIOErrorZPtr;
10743
10744 /**
10745  * A CResult_CVec_u8ZIOErrorZ represents the result of a fallible operation,
10746  * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::IOError on failure.
10747  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10748  */
10749 typedef struct LDKCResult_CVec_u8ZIOErrorZ {
10750    /**
10751     * The contents of this CResult_CVec_u8ZIOErrorZ, accessible via either
10752     * `err` or `result` depending on the state of `result_ok`.
10753     */
10754    union LDKCResult_CVec_u8ZIOErrorZPtr contents;
10755    /**
10756     * Whether this CResult_CVec_u8ZIOErrorZ represents a success state.
10757     */
10758    bool result_ok;
10759 } LDKCResult_CVec_u8ZIOErrorZ;
10760
10761 /**
10762  * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
10763  * This corresponds to std::vector in C++
10764  */
10765 typedef struct LDKCVec_StrZ {
10766    /**
10767     * The elements in the array.
10768     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10769     */
10770    struct LDKStr *data;
10771    /**
10772     * The number of elements pointed to by `data`.
10773     */
10774    uintptr_t datalen;
10775 } LDKCVec_StrZ;
10776
10777 /**
10778  * The contents of CResult_CVec_StrZIOErrorZ
10779  */
10780 typedef union LDKCResult_CVec_StrZIOErrorZPtr {
10781    /**
10782     * A pointer to the contents in the success state.
10783     * Reading from this pointer when `result_ok` is not set is undefined.
10784     */
10785    struct LDKCVec_StrZ *result;
10786    /**
10787     * A pointer to the contents in the error state.
10788     * Reading from this pointer when `result_ok` is set is undefined.
10789     */
10790    enum LDKIOError *err;
10791 } LDKCResult_CVec_StrZIOErrorZPtr;
10792
10793 /**
10794  * A CResult_CVec_StrZIOErrorZ represents the result of a fallible operation,
10795  * containing a crate::c_types::derived::CVec_StrZ on success and a crate::c_types::IOError on failure.
10796  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10797  */
10798 typedef struct LDKCResult_CVec_StrZIOErrorZ {
10799    /**
10800     * The contents of this CResult_CVec_StrZIOErrorZ, accessible via either
10801     * `err` or `result` depending on the state of `result_ok`.
10802     */
10803    union LDKCResult_CVec_StrZIOErrorZPtr contents;
10804    /**
10805     * Whether this CResult_CVec_StrZIOErrorZ represents a success state.
10806     */
10807    bool result_ok;
10808 } LDKCResult_CVec_StrZIOErrorZ;
10809
10810 /**
10811  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZs of arbitrary size.
10812  * This corresponds to std::vector in C++
10813  */
10814 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ {
10815    /**
10816     * The elements in the array.
10817     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10818     */
10819    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *data;
10820    /**
10821     * The number of elements pointed to by `data`.
10822     */
10823    uintptr_t datalen;
10824 } LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ;
10825
10826 /**
10827  * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ
10828  */
10829 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr {
10830    /**
10831     * A pointer to the contents in the success state.
10832     * Reading from this pointer when `result_ok` is not set is undefined.
10833     */
10834    struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *result;
10835    /**
10836     * A pointer to the contents in the error state.
10837     * Reading from this pointer when `result_ok` is set is undefined.
10838     */
10839    enum LDKIOError *err;
10840 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr;
10841
10842 /**
10843  * A CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents the result of a fallible operation,
10844  * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ on success and a crate::c_types::IOError on failure.
10845  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10846  */
10847 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ {
10848    /**
10849     * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ, accessible via either
10850     * `err` or `result` depending on the state of `result_ok`.
10851     */
10852    union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr contents;
10853    /**
10854     * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents a success state.
10855     */
10856    bool result_ok;
10857 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ;
10858
10859 /**
10860  * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ
10861  */
10862 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr {
10863    /**
10864     * A pointer to the contents in the success state.
10865     * Reading from this pointer when `result_ok` is not set is undefined.
10866     */
10867    struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
10868    /**
10869     * A pointer to the contents in the error state.
10870     * Reading from this pointer when `result_ok` is set is undefined.
10871     */
10872    enum LDKIOError *err;
10873 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr;
10874
10875 /**
10876  * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents the result of a fallible operation,
10877  * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::c_types::IOError on failure.
10878  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10879  */
10880 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ {
10881    /**
10882     * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ, accessible via either
10883     * `err` or `result` depending on the state of `result_ok`.
10884     */
10885    union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr contents;
10886    /**
10887     * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents a success state.
10888     */
10889    bool result_ok;
10890 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ;
10891
10892 /**
10893  * Represents a valid secp256k1 secret key serialized as a 32 byte array.
10894  */
10895 typedef struct LDKSecretKey {
10896    /**
10897     * The bytes of the secret key
10898     */
10899    uint8_t bytes[32];
10900 } LDKSecretKey;
10901
10902 /**
10903  * An enum which can either contain a crate::c_types::SecretKey or not
10904  */
10905 typedef enum LDKCOption_SecretKeyZ_Tag {
10906    /**
10907     * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey
10908     */
10909    LDKCOption_SecretKeyZ_Some,
10910    /**
10911     * When we're in this state, this COption_SecretKeyZ contains nothing
10912     */
10913    LDKCOption_SecretKeyZ_None,
10914    /**
10915     * Must be last for serialization purposes
10916     */
10917    LDKCOption_SecretKeyZ_Sentinel,
10918 } LDKCOption_SecretKeyZ_Tag;
10919
10920 typedef struct LDKCOption_SecretKeyZ {
10921    LDKCOption_SecretKeyZ_Tag tag;
10922    union {
10923       struct {
10924          struct LDKSecretKey some;
10925       };
10926    };
10927 } LDKCOption_SecretKeyZ;
10928
10929
10930
10931 /**
10932  * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
10933  * ways to respond depending on whether the signing keys were derived.
10934  */
10935 typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
10936    /**
10937     * A pointer to the opaque Rust object.
10938     * Nearly everywhere, inner must be non-null, however in places where
10939     * the Rust equivalent takes an Option, it may be set to null to indicate None.
10940     */
10941    LDKnativeVerifiedInvoiceRequest *inner;
10942    /**
10943     * Indicates that this is the only struct which contains the same pointer.
10944     * Rust functions which take ownership of an object provided via an argument require
10945     * this to be true and invalidate the object pointed to by inner.
10946     */
10947    bool is_owned;
10948 } LDKVerifiedInvoiceRequest;
10949
10950 /**
10951  * The contents of CResult_VerifiedInvoiceRequestNoneZ
10952  */
10953 typedef union LDKCResult_VerifiedInvoiceRequestNoneZPtr {
10954    /**
10955     * A pointer to the contents in the success state.
10956     * Reading from this pointer when `result_ok` is not set is undefined.
10957     */
10958    struct LDKVerifiedInvoiceRequest *result;
10959    /**
10960     * Note that this value is always NULL, as there are no contents in the Err variant
10961     */
10962    void *err;
10963 } LDKCResult_VerifiedInvoiceRequestNoneZPtr;
10964
10965 /**
10966  * A CResult_VerifiedInvoiceRequestNoneZ represents the result of a fallible operation,
10967  * containing a crate::lightning::offers::invoice_request::VerifiedInvoiceRequest on success and a () on failure.
10968  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10969  */
10970 typedef struct LDKCResult_VerifiedInvoiceRequestNoneZ {
10971    /**
10972     * The contents of this CResult_VerifiedInvoiceRequestNoneZ, accessible via either
10973     * `err` or `result` depending on the state of `result_ok`.
10974     */
10975    union LDKCResult_VerifiedInvoiceRequestNoneZPtr contents;
10976    /**
10977     * Whether this CResult_VerifiedInvoiceRequestNoneZ represents a success state.
10978     */
10979    bool result_ok;
10980 } LDKCResult_VerifiedInvoiceRequestNoneZ;
10981
10982 /**
10983  * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
10984  * This corresponds to std::vector in C++
10985  */
10986 typedef struct LDKCVec_WitnessZ {
10987    /**
10988     * The elements in the array.
10989     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10990     */
10991    struct LDKWitness *data;
10992    /**
10993     * The number of elements pointed to by `data`.
10994     */
10995    uintptr_t datalen;
10996 } LDKCVec_WitnessZ;
10997
10998 /**
10999  * An enum which can either contain a i64 or not
11000  */
11001 typedef enum LDKCOption_i64Z_Tag {
11002    /**
11003     * When we're in this state, this COption_i64Z contains a i64
11004     */
11005    LDKCOption_i64Z_Some,
11006    /**
11007     * When we're in this state, this COption_i64Z contains nothing
11008     */
11009    LDKCOption_i64Z_None,
11010    /**
11011     * Must be last for serialization purposes
11012     */
11013    LDKCOption_i64Z_Sentinel,
11014 } LDKCOption_i64Z_Tag;
11015
11016 typedef struct LDKCOption_i64Z {
11017    LDKCOption_i64Z_Tag tag;
11018    union {
11019       struct {
11020          int64_t some;
11021       };
11022    };
11023 } LDKCOption_i64Z;
11024
11025 /**
11026  * The contents of CResult_SocketAddressDecodeErrorZ
11027  */
11028 typedef union LDKCResult_SocketAddressDecodeErrorZPtr {
11029    /**
11030     * A pointer to the contents in the success state.
11031     * Reading from this pointer when `result_ok` is not set is undefined.
11032     */
11033    struct LDKSocketAddress *result;
11034    /**
11035     * A pointer to the contents in the error state.
11036     * Reading from this pointer when `result_ok` is set is undefined.
11037     */
11038    struct LDKDecodeError *err;
11039 } LDKCResult_SocketAddressDecodeErrorZPtr;
11040
11041 /**
11042  * A CResult_SocketAddressDecodeErrorZ represents the result of a fallible operation,
11043  * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
11044  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11045  */
11046 typedef struct LDKCResult_SocketAddressDecodeErrorZ {
11047    /**
11048     * The contents of this CResult_SocketAddressDecodeErrorZ, accessible via either
11049     * `err` or `result` depending on the state of `result_ok`.
11050     */
11051    union LDKCResult_SocketAddressDecodeErrorZPtr contents;
11052    /**
11053     * Whether this CResult_SocketAddressDecodeErrorZ represents a success state.
11054     */
11055    bool result_ok;
11056 } LDKCResult_SocketAddressDecodeErrorZ;
11057
11058 /**
11059  * The contents of CResult_SocketAddressSocketAddressParseErrorZ
11060  */
11061 typedef union LDKCResult_SocketAddressSocketAddressParseErrorZPtr {
11062    /**
11063     * A pointer to the contents in the success state.
11064     * Reading from this pointer when `result_ok` is not set is undefined.
11065     */
11066    struct LDKSocketAddress *result;
11067    /**
11068     * A pointer to the contents in the error state.
11069     * Reading from this pointer when `result_ok` is set is undefined.
11070     */
11071    enum LDKSocketAddressParseError *err;
11072 } LDKCResult_SocketAddressSocketAddressParseErrorZPtr;
11073
11074 /**
11075  * A CResult_SocketAddressSocketAddressParseErrorZ represents the result of a fallible operation,
11076  * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::SocketAddressParseError on failure.
11077  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11078  */
11079 typedef struct LDKCResult_SocketAddressSocketAddressParseErrorZ {
11080    /**
11081     * The contents of this CResult_SocketAddressSocketAddressParseErrorZ, accessible via either
11082     * `err` or `result` depending on the state of `result_ok`.
11083     */
11084    union LDKCResult_SocketAddressSocketAddressParseErrorZPtr contents;
11085    /**
11086     * Whether this CResult_SocketAddressSocketAddressParseErrorZ represents a success state.
11087     */
11088    bool result_ok;
11089 } LDKCResult_SocketAddressSocketAddressParseErrorZ;
11090
11091
11092
11093 /**
11094  * An [`update_add_htlc`] message to be sent to or received from a peer.
11095  *
11096  * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
11097  */
11098 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
11099    /**
11100     * A pointer to the opaque Rust object.
11101     * Nearly everywhere, inner must be non-null, however in places where
11102     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11103     */
11104    LDKnativeUpdateAddHTLC *inner;
11105    /**
11106     * Indicates that this is the only struct which contains the same pointer.
11107     * Rust functions which take ownership of an object provided via an argument require
11108     * this to be true and invalidate the object pointed to by inner.
11109     */
11110    bool is_owned;
11111 } LDKUpdateAddHTLC;
11112
11113 /**
11114  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
11115  * This corresponds to std::vector in C++
11116  */
11117 typedef struct LDKCVec_UpdateAddHTLCZ {
11118    /**
11119     * The elements in the array.
11120     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11121     */
11122    struct LDKUpdateAddHTLC *data;
11123    /**
11124     * The number of elements pointed to by `data`.
11125     */
11126    uintptr_t datalen;
11127 } LDKCVec_UpdateAddHTLCZ;
11128
11129
11130
11131 /**
11132  * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
11133  *
11134  * [`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
11135  */
11136 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
11137    /**
11138     * A pointer to the opaque Rust object.
11139     * Nearly everywhere, inner must be non-null, however in places where
11140     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11141     */
11142    LDKnativeUpdateFulfillHTLC *inner;
11143    /**
11144     * Indicates that this is the only struct which contains the same pointer.
11145     * Rust functions which take ownership of an object provided via an argument require
11146     * this to be true and invalidate the object pointed to by inner.
11147     */
11148    bool is_owned;
11149 } LDKUpdateFulfillHTLC;
11150
11151 /**
11152  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
11153  * This corresponds to std::vector in C++
11154  */
11155 typedef struct LDKCVec_UpdateFulfillHTLCZ {
11156    /**
11157     * The elements in the array.
11158     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11159     */
11160    struct LDKUpdateFulfillHTLC *data;
11161    /**
11162     * The number of elements pointed to by `data`.
11163     */
11164    uintptr_t datalen;
11165 } LDKCVec_UpdateFulfillHTLCZ;
11166
11167
11168
11169 /**
11170  * An [`update_fail_htlc`] message to be sent to or received from a peer.
11171  *
11172  * [`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
11173  */
11174 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
11175    /**
11176     * A pointer to the opaque Rust object.
11177     * Nearly everywhere, inner must be non-null, however in places where
11178     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11179     */
11180    LDKnativeUpdateFailHTLC *inner;
11181    /**
11182     * Indicates that this is the only struct which contains the same pointer.
11183     * Rust functions which take ownership of an object provided via an argument require
11184     * this to be true and invalidate the object pointed to by inner.
11185     */
11186    bool is_owned;
11187 } LDKUpdateFailHTLC;
11188
11189 /**
11190  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
11191  * This corresponds to std::vector in C++
11192  */
11193 typedef struct LDKCVec_UpdateFailHTLCZ {
11194    /**
11195     * The elements in the array.
11196     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11197     */
11198    struct LDKUpdateFailHTLC *data;
11199    /**
11200     * The number of elements pointed to by `data`.
11201     */
11202    uintptr_t datalen;
11203 } LDKCVec_UpdateFailHTLCZ;
11204
11205
11206
11207 /**
11208  * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
11209  *
11210  * [`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
11211  */
11212 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
11213    /**
11214     * A pointer to the opaque Rust object.
11215     * Nearly everywhere, inner must be non-null, however in places where
11216     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11217     */
11218    LDKnativeUpdateFailMalformedHTLC *inner;
11219    /**
11220     * Indicates that this is the only struct which contains the same pointer.
11221     * Rust functions which take ownership of an object provided via an argument require
11222     * this to be true and invalidate the object pointed to by inner.
11223     */
11224    bool is_owned;
11225 } LDKUpdateFailMalformedHTLC;
11226
11227 /**
11228  * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
11229  * This corresponds to std::vector in C++
11230  */
11231 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
11232    /**
11233     * The elements in the array.
11234     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11235     */
11236    struct LDKUpdateFailMalformedHTLC *data;
11237    /**
11238     * The number of elements pointed to by `data`.
11239     */
11240    uintptr_t datalen;
11241 } LDKCVec_UpdateFailMalformedHTLCZ;
11242
11243 /**
11244  * The contents of CResult_AcceptChannelDecodeErrorZ
11245  */
11246 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
11247    /**
11248     * A pointer to the contents in the success state.
11249     * Reading from this pointer when `result_ok` is not set is undefined.
11250     */
11251    struct LDKAcceptChannel *result;
11252    /**
11253     * A pointer to the contents in the error state.
11254     * Reading from this pointer when `result_ok` is set is undefined.
11255     */
11256    struct LDKDecodeError *err;
11257 } LDKCResult_AcceptChannelDecodeErrorZPtr;
11258
11259 /**
11260  * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
11261  * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
11262  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11263  */
11264 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
11265    /**
11266     * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
11267     * `err` or `result` depending on the state of `result_ok`.
11268     */
11269    union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
11270    /**
11271     * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
11272     */
11273    bool result_ok;
11274 } LDKCResult_AcceptChannelDecodeErrorZ;
11275
11276 /**
11277  * The contents of CResult_AcceptChannelV2DecodeErrorZ
11278  */
11279 typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
11280    /**
11281     * A pointer to the contents in the success state.
11282     * Reading from this pointer when `result_ok` is not set is undefined.
11283     */
11284    struct LDKAcceptChannelV2 *result;
11285    /**
11286     * A pointer to the contents in the error state.
11287     * Reading from this pointer when `result_ok` is set is undefined.
11288     */
11289    struct LDKDecodeError *err;
11290 } LDKCResult_AcceptChannelV2DecodeErrorZPtr;
11291
11292 /**
11293  * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
11294  * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
11295  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11296  */
11297 typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
11298    /**
11299     * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
11300     * `err` or `result` depending on the state of `result_ok`.
11301     */
11302    union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
11303    /**
11304     * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
11305     */
11306    bool result_ok;
11307 } LDKCResult_AcceptChannelV2DecodeErrorZ;
11308
11309 /**
11310  * The contents of CResult_TxAddInputDecodeErrorZ
11311  */
11312 typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
11313    /**
11314     * A pointer to the contents in the success state.
11315     * Reading from this pointer when `result_ok` is not set is undefined.
11316     */
11317    struct LDKTxAddInput *result;
11318    /**
11319     * A pointer to the contents in the error state.
11320     * Reading from this pointer when `result_ok` is set is undefined.
11321     */
11322    struct LDKDecodeError *err;
11323 } LDKCResult_TxAddInputDecodeErrorZPtr;
11324
11325 /**
11326  * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
11327  * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11328  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11329  */
11330 typedef struct LDKCResult_TxAddInputDecodeErrorZ {
11331    /**
11332     * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
11333     * `err` or `result` depending on the state of `result_ok`.
11334     */
11335    union LDKCResult_TxAddInputDecodeErrorZPtr contents;
11336    /**
11337     * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
11338     */
11339    bool result_ok;
11340 } LDKCResult_TxAddInputDecodeErrorZ;
11341
11342 /**
11343  * The contents of CResult_TxAddOutputDecodeErrorZ
11344  */
11345 typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
11346    /**
11347     * A pointer to the contents in the success state.
11348     * Reading from this pointer when `result_ok` is not set is undefined.
11349     */
11350    struct LDKTxAddOutput *result;
11351    /**
11352     * A pointer to the contents in the error state.
11353     * Reading from this pointer when `result_ok` is set is undefined.
11354     */
11355    struct LDKDecodeError *err;
11356 } LDKCResult_TxAddOutputDecodeErrorZPtr;
11357
11358 /**
11359  * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
11360  * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11361  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11362  */
11363 typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
11364    /**
11365     * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
11366     * `err` or `result` depending on the state of `result_ok`.
11367     */
11368    union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
11369    /**
11370     * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
11371     */
11372    bool result_ok;
11373 } LDKCResult_TxAddOutputDecodeErrorZ;
11374
11375 /**
11376  * The contents of CResult_TxRemoveInputDecodeErrorZ
11377  */
11378 typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
11379    /**
11380     * A pointer to the contents in the success state.
11381     * Reading from this pointer when `result_ok` is not set is undefined.
11382     */
11383    struct LDKTxRemoveInput *result;
11384    /**
11385     * A pointer to the contents in the error state.
11386     * Reading from this pointer when `result_ok` is set is undefined.
11387     */
11388    struct LDKDecodeError *err;
11389 } LDKCResult_TxRemoveInputDecodeErrorZPtr;
11390
11391 /**
11392  * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
11393  * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11394  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11395  */
11396 typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
11397    /**
11398     * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
11399     * `err` or `result` depending on the state of `result_ok`.
11400     */
11401    union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
11402    /**
11403     * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
11404     */
11405    bool result_ok;
11406 } LDKCResult_TxRemoveInputDecodeErrorZ;
11407
11408 /**
11409  * The contents of CResult_TxRemoveOutputDecodeErrorZ
11410  */
11411 typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
11412    /**
11413     * A pointer to the contents in the success state.
11414     * Reading from this pointer when `result_ok` is not set is undefined.
11415     */
11416    struct LDKTxRemoveOutput *result;
11417    /**
11418     * A pointer to the contents in the error state.
11419     * Reading from this pointer when `result_ok` is set is undefined.
11420     */
11421    struct LDKDecodeError *err;
11422 } LDKCResult_TxRemoveOutputDecodeErrorZPtr;
11423
11424 /**
11425  * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
11426  * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
11427  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11428  */
11429 typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
11430    /**
11431     * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
11432     * `err` or `result` depending on the state of `result_ok`.
11433     */
11434    union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
11435    /**
11436     * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
11437     */
11438    bool result_ok;
11439 } LDKCResult_TxRemoveOutputDecodeErrorZ;
11440
11441 /**
11442  * The contents of CResult_TxCompleteDecodeErrorZ
11443  */
11444 typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
11445    /**
11446     * A pointer to the contents in the success state.
11447     * Reading from this pointer when `result_ok` is not set is undefined.
11448     */
11449    struct LDKTxComplete *result;
11450    /**
11451     * A pointer to the contents in the error state.
11452     * Reading from this pointer when `result_ok` is set is undefined.
11453     */
11454    struct LDKDecodeError *err;
11455 } LDKCResult_TxCompleteDecodeErrorZPtr;
11456
11457 /**
11458  * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
11459  * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
11460  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11461  */
11462 typedef struct LDKCResult_TxCompleteDecodeErrorZ {
11463    /**
11464     * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
11465     * `err` or `result` depending on the state of `result_ok`.
11466     */
11467    union LDKCResult_TxCompleteDecodeErrorZPtr contents;
11468    /**
11469     * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
11470     */
11471    bool result_ok;
11472 } LDKCResult_TxCompleteDecodeErrorZ;
11473
11474 /**
11475  * The contents of CResult_TxSignaturesDecodeErrorZ
11476  */
11477 typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
11478    /**
11479     * A pointer to the contents in the success state.
11480     * Reading from this pointer when `result_ok` is not set is undefined.
11481     */
11482    struct LDKTxSignatures *result;
11483    /**
11484     * A pointer to the contents in the error state.
11485     * Reading from this pointer when `result_ok` is set is undefined.
11486     */
11487    struct LDKDecodeError *err;
11488 } LDKCResult_TxSignaturesDecodeErrorZPtr;
11489
11490 /**
11491  * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
11492  * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
11493  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11494  */
11495 typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
11496    /**
11497     * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
11498     * `err` or `result` depending on the state of `result_ok`.
11499     */
11500    union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
11501    /**
11502     * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
11503     */
11504    bool result_ok;
11505 } LDKCResult_TxSignaturesDecodeErrorZ;
11506
11507 /**
11508  * The contents of CResult_TxInitRbfDecodeErrorZ
11509  */
11510 typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
11511    /**
11512     * A pointer to the contents in the success state.
11513     * Reading from this pointer when `result_ok` is not set is undefined.
11514     */
11515    struct LDKTxInitRbf *result;
11516    /**
11517     * A pointer to the contents in the error state.
11518     * Reading from this pointer when `result_ok` is set is undefined.
11519     */
11520    struct LDKDecodeError *err;
11521 } LDKCResult_TxInitRbfDecodeErrorZPtr;
11522
11523 /**
11524  * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
11525  * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
11526  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11527  */
11528 typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
11529    /**
11530     * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
11531     * `err` or `result` depending on the state of `result_ok`.
11532     */
11533    union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
11534    /**
11535     * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
11536     */
11537    bool result_ok;
11538 } LDKCResult_TxInitRbfDecodeErrorZ;
11539
11540 /**
11541  * The contents of CResult_TxAckRbfDecodeErrorZ
11542  */
11543 typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
11544    /**
11545     * A pointer to the contents in the success state.
11546     * Reading from this pointer when `result_ok` is not set is undefined.
11547     */
11548    struct LDKTxAckRbf *result;
11549    /**
11550     * A pointer to the contents in the error state.
11551     * Reading from this pointer when `result_ok` is set is undefined.
11552     */
11553    struct LDKDecodeError *err;
11554 } LDKCResult_TxAckRbfDecodeErrorZPtr;
11555
11556 /**
11557  * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
11558  * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
11559  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11560  */
11561 typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
11562    /**
11563     * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
11564     * `err` or `result` depending on the state of `result_ok`.
11565     */
11566    union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
11567    /**
11568     * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
11569     */
11570    bool result_ok;
11571 } LDKCResult_TxAckRbfDecodeErrorZ;
11572
11573 /**
11574  * The contents of CResult_TxAbortDecodeErrorZ
11575  */
11576 typedef union LDKCResult_TxAbortDecodeErrorZPtr {
11577    /**
11578     * A pointer to the contents in the success state.
11579     * Reading from this pointer when `result_ok` is not set is undefined.
11580     */
11581    struct LDKTxAbort *result;
11582    /**
11583     * A pointer to the contents in the error state.
11584     * Reading from this pointer when `result_ok` is set is undefined.
11585     */
11586    struct LDKDecodeError *err;
11587 } LDKCResult_TxAbortDecodeErrorZPtr;
11588
11589 /**
11590  * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
11591  * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
11592  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11593  */
11594 typedef struct LDKCResult_TxAbortDecodeErrorZ {
11595    /**
11596     * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
11597     * `err` or `result` depending on the state of `result_ok`.
11598     */
11599    union LDKCResult_TxAbortDecodeErrorZPtr contents;
11600    /**
11601     * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
11602     */
11603    bool result_ok;
11604 } LDKCResult_TxAbortDecodeErrorZ;
11605
11606 /**
11607  * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
11608  */
11609 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
11610    /**
11611     * A pointer to the contents in the success state.
11612     * Reading from this pointer when `result_ok` is not set is undefined.
11613     */
11614    struct LDKAnnouncementSignatures *result;
11615    /**
11616     * A pointer to the contents in the error state.
11617     * Reading from this pointer when `result_ok` is set is undefined.
11618     */
11619    struct LDKDecodeError *err;
11620 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
11621
11622 /**
11623  * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
11624  * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
11625  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11626  */
11627 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
11628    /**
11629     * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
11630     * `err` or `result` depending on the state of `result_ok`.
11631     */
11632    union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
11633    /**
11634     * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
11635     */
11636    bool result_ok;
11637 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
11638
11639 /**
11640  * The contents of CResult_ChannelReestablishDecodeErrorZ
11641  */
11642 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
11643    /**
11644     * A pointer to the contents in the success state.
11645     * Reading from this pointer when `result_ok` is not set is undefined.
11646     */
11647    struct LDKChannelReestablish *result;
11648    /**
11649     * A pointer to the contents in the error state.
11650     * Reading from this pointer when `result_ok` is set is undefined.
11651     */
11652    struct LDKDecodeError *err;
11653 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
11654
11655 /**
11656  * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
11657  * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
11658  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11659  */
11660 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
11661    /**
11662     * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
11663     * `err` or `result` depending on the state of `result_ok`.
11664     */
11665    union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
11666    /**
11667     * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
11668     */
11669    bool result_ok;
11670 } LDKCResult_ChannelReestablishDecodeErrorZ;
11671
11672 /**
11673  * The contents of CResult_ClosingSignedDecodeErrorZ
11674  */
11675 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
11676    /**
11677     * A pointer to the contents in the success state.
11678     * Reading from this pointer when `result_ok` is not set is undefined.
11679     */
11680    struct LDKClosingSigned *result;
11681    /**
11682     * A pointer to the contents in the error state.
11683     * Reading from this pointer when `result_ok` is set is undefined.
11684     */
11685    struct LDKDecodeError *err;
11686 } LDKCResult_ClosingSignedDecodeErrorZPtr;
11687
11688 /**
11689  * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
11690  * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11691  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11692  */
11693 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
11694    /**
11695     * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
11696     * `err` or `result` depending on the state of `result_ok`.
11697     */
11698    union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
11699    /**
11700     * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
11701     */
11702    bool result_ok;
11703 } LDKCResult_ClosingSignedDecodeErrorZ;
11704
11705
11706
11707 /**
11708  * The minimum and maximum fees which the sender is willing to place on the closing transaction.
11709  *
11710  * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
11711  * to use.
11712  */
11713 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
11714    /**
11715     * A pointer to the opaque Rust object.
11716     * Nearly everywhere, inner must be non-null, however in places where
11717     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11718     */
11719    LDKnativeClosingSignedFeeRange *inner;
11720    /**
11721     * Indicates that this is the only struct which contains the same pointer.
11722     * Rust functions which take ownership of an object provided via an argument require
11723     * this to be true and invalidate the object pointed to by inner.
11724     */
11725    bool is_owned;
11726 } LDKClosingSignedFeeRange;
11727
11728 /**
11729  * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
11730  */
11731 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
11732    /**
11733     * A pointer to the contents in the success state.
11734     * Reading from this pointer when `result_ok` is not set is undefined.
11735     */
11736    struct LDKClosingSignedFeeRange *result;
11737    /**
11738     * A pointer to the contents in the error state.
11739     * Reading from this pointer when `result_ok` is set is undefined.
11740     */
11741    struct LDKDecodeError *err;
11742 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
11743
11744 /**
11745  * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
11746  * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
11747  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11748  */
11749 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
11750    /**
11751     * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
11752     * `err` or `result` depending on the state of `result_ok`.
11753     */
11754    union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
11755    /**
11756     * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
11757     */
11758    bool result_ok;
11759 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
11760
11761
11762
11763 /**
11764  * A [`commitment_signed`] message to be sent to or received from a peer.
11765  *
11766  * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
11767  */
11768 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
11769    /**
11770     * A pointer to the opaque Rust object.
11771     * Nearly everywhere, inner must be non-null, however in places where
11772     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11773     */
11774    LDKnativeCommitmentSigned *inner;
11775    /**
11776     * Indicates that this is the only struct which contains the same pointer.
11777     * Rust functions which take ownership of an object provided via an argument require
11778     * this to be true and invalidate the object pointed to by inner.
11779     */
11780    bool is_owned;
11781 } LDKCommitmentSigned;
11782
11783 /**
11784  * The contents of CResult_CommitmentSignedDecodeErrorZ
11785  */
11786 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
11787    /**
11788     * A pointer to the contents in the success state.
11789     * Reading from this pointer when `result_ok` is not set is undefined.
11790     */
11791    struct LDKCommitmentSigned *result;
11792    /**
11793     * A pointer to the contents in the error state.
11794     * Reading from this pointer when `result_ok` is set is undefined.
11795     */
11796    struct LDKDecodeError *err;
11797 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
11798
11799 /**
11800  * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
11801  * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11802  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11803  */
11804 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
11805    /**
11806     * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
11807     * `err` or `result` depending on the state of `result_ok`.
11808     */
11809    union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
11810    /**
11811     * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
11812     */
11813    bool result_ok;
11814 } LDKCResult_CommitmentSignedDecodeErrorZ;
11815
11816 /**
11817  * The contents of CResult_FundingCreatedDecodeErrorZ
11818  */
11819 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
11820    /**
11821     * A pointer to the contents in the success state.
11822     * Reading from this pointer when `result_ok` is not set is undefined.
11823     */
11824    struct LDKFundingCreated *result;
11825    /**
11826     * A pointer to the contents in the error state.
11827     * Reading from this pointer when `result_ok` is set is undefined.
11828     */
11829    struct LDKDecodeError *err;
11830 } LDKCResult_FundingCreatedDecodeErrorZPtr;
11831
11832 /**
11833  * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
11834  * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
11835  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11836  */
11837 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
11838    /**
11839     * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
11840     * `err` or `result` depending on the state of `result_ok`.
11841     */
11842    union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
11843    /**
11844     * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
11845     */
11846    bool result_ok;
11847 } LDKCResult_FundingCreatedDecodeErrorZ;
11848
11849 /**
11850  * The contents of CResult_FundingSignedDecodeErrorZ
11851  */
11852 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
11853    /**
11854     * A pointer to the contents in the success state.
11855     * Reading from this pointer when `result_ok` is not set is undefined.
11856     */
11857    struct LDKFundingSigned *result;
11858    /**
11859     * A pointer to the contents in the error state.
11860     * Reading from this pointer when `result_ok` is set is undefined.
11861     */
11862    struct LDKDecodeError *err;
11863 } LDKCResult_FundingSignedDecodeErrorZPtr;
11864
11865 /**
11866  * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
11867  * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11868  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11869  */
11870 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
11871    /**
11872     * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
11873     * `err` or `result` depending on the state of `result_ok`.
11874     */
11875    union LDKCResult_FundingSignedDecodeErrorZPtr contents;
11876    /**
11877     * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
11878     */
11879    bool result_ok;
11880 } LDKCResult_FundingSignedDecodeErrorZ;
11881
11882 /**
11883  * The contents of CResult_ChannelReadyDecodeErrorZ
11884  */
11885 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
11886    /**
11887     * A pointer to the contents in the success state.
11888     * Reading from this pointer when `result_ok` is not set is undefined.
11889     */
11890    struct LDKChannelReady *result;
11891    /**
11892     * A pointer to the contents in the error state.
11893     * Reading from this pointer when `result_ok` is set is undefined.
11894     */
11895    struct LDKDecodeError *err;
11896 } LDKCResult_ChannelReadyDecodeErrorZPtr;
11897
11898 /**
11899  * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
11900  * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
11901  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11902  */
11903 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
11904    /**
11905     * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
11906     * `err` or `result` depending on the state of `result_ok`.
11907     */
11908    union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
11909    /**
11910     * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
11911     */
11912    bool result_ok;
11913 } LDKCResult_ChannelReadyDecodeErrorZ;
11914
11915
11916
11917 /**
11918  * An [`init`] message to be sent to or received from a peer.
11919  *
11920  * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
11921  */
11922 typedef struct MUST_USE_STRUCT LDKInit {
11923    /**
11924     * A pointer to the opaque Rust object.
11925     * Nearly everywhere, inner must be non-null, however in places where
11926     * the Rust equivalent takes an Option, it may be set to null to indicate None.
11927     */
11928    LDKnativeInit *inner;
11929    /**
11930     * Indicates that this is the only struct which contains the same pointer.
11931     * Rust functions which take ownership of an object provided via an argument require
11932     * this to be true and invalidate the object pointed to by inner.
11933     */
11934    bool is_owned;
11935 } LDKInit;
11936
11937 /**
11938  * The contents of CResult_InitDecodeErrorZ
11939  */
11940 typedef union LDKCResult_InitDecodeErrorZPtr {
11941    /**
11942     * A pointer to the contents in the success state.
11943     * Reading from this pointer when `result_ok` is not set is undefined.
11944     */
11945    struct LDKInit *result;
11946    /**
11947     * A pointer to the contents in the error state.
11948     * Reading from this pointer when `result_ok` is set is undefined.
11949     */
11950    struct LDKDecodeError *err;
11951 } LDKCResult_InitDecodeErrorZPtr;
11952
11953 /**
11954  * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
11955  * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
11956  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11957  */
11958 typedef struct LDKCResult_InitDecodeErrorZ {
11959    /**
11960     * The contents of this CResult_InitDecodeErrorZ, accessible via either
11961     * `err` or `result` depending on the state of `result_ok`.
11962     */
11963    union LDKCResult_InitDecodeErrorZPtr contents;
11964    /**
11965     * Whether this CResult_InitDecodeErrorZ represents a success state.
11966     */
11967    bool result_ok;
11968 } LDKCResult_InitDecodeErrorZ;
11969
11970 /**
11971  * The contents of CResult_OpenChannelDecodeErrorZ
11972  */
11973 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
11974    /**
11975     * A pointer to the contents in the success state.
11976     * Reading from this pointer when `result_ok` is not set is undefined.
11977     */
11978    struct LDKOpenChannel *result;
11979    /**
11980     * A pointer to the contents in the error state.
11981     * Reading from this pointer when `result_ok` is set is undefined.
11982     */
11983    struct LDKDecodeError *err;
11984 } LDKCResult_OpenChannelDecodeErrorZPtr;
11985
11986 /**
11987  * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
11988  * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
11989  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11990  */
11991 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
11992    /**
11993     * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
11994     * `err` or `result` depending on the state of `result_ok`.
11995     */
11996    union LDKCResult_OpenChannelDecodeErrorZPtr contents;
11997    /**
11998     * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
11999     */
12000    bool result_ok;
12001 } LDKCResult_OpenChannelDecodeErrorZ;
12002
12003 /**
12004  * The contents of CResult_OpenChannelV2DecodeErrorZ
12005  */
12006 typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
12007    /**
12008     * A pointer to the contents in the success state.
12009     * Reading from this pointer when `result_ok` is not set is undefined.
12010     */
12011    struct LDKOpenChannelV2 *result;
12012    /**
12013     * A pointer to the contents in the error state.
12014     * Reading from this pointer when `result_ok` is set is undefined.
12015     */
12016    struct LDKDecodeError *err;
12017 } LDKCResult_OpenChannelV2DecodeErrorZPtr;
12018
12019 /**
12020  * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
12021  * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
12022  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12023  */
12024 typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
12025    /**
12026     * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
12027     * `err` or `result` depending on the state of `result_ok`.
12028     */
12029    union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
12030    /**
12031     * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
12032     */
12033    bool result_ok;
12034 } LDKCResult_OpenChannelV2DecodeErrorZ;
12035
12036 /**
12037  * The contents of CResult_RevokeAndACKDecodeErrorZ
12038  */
12039 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
12040    /**
12041     * A pointer to the contents in the success state.
12042     * Reading from this pointer when `result_ok` is not set is undefined.
12043     */
12044    struct LDKRevokeAndACK *result;
12045    /**
12046     * A pointer to the contents in the error state.
12047     * Reading from this pointer when `result_ok` is set is undefined.
12048     */
12049    struct LDKDecodeError *err;
12050 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
12051
12052 /**
12053  * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
12054  * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
12055  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12056  */
12057 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
12058    /**
12059     * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
12060     * `err` or `result` depending on the state of `result_ok`.
12061     */
12062    union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
12063    /**
12064     * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
12065     */
12066    bool result_ok;
12067 } LDKCResult_RevokeAndACKDecodeErrorZ;
12068
12069 /**
12070  * The contents of CResult_ShutdownDecodeErrorZ
12071  */
12072 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
12073    /**
12074     * A pointer to the contents in the success state.
12075     * Reading from this pointer when `result_ok` is not set is undefined.
12076     */
12077    struct LDKShutdown *result;
12078    /**
12079     * A pointer to the contents in the error state.
12080     * Reading from this pointer when `result_ok` is set is undefined.
12081     */
12082    struct LDKDecodeError *err;
12083 } LDKCResult_ShutdownDecodeErrorZPtr;
12084
12085 /**
12086  * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
12087  * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
12088  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12089  */
12090 typedef struct LDKCResult_ShutdownDecodeErrorZ {
12091    /**
12092     * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
12093     * `err` or `result` depending on the state of `result_ok`.
12094     */
12095    union LDKCResult_ShutdownDecodeErrorZPtr contents;
12096    /**
12097     * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
12098     */
12099    bool result_ok;
12100 } LDKCResult_ShutdownDecodeErrorZ;
12101
12102 /**
12103  * The contents of CResult_UpdateFailHTLCDecodeErrorZ
12104  */
12105 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
12106    /**
12107     * A pointer to the contents in the success state.
12108     * Reading from this pointer when `result_ok` is not set is undefined.
12109     */
12110    struct LDKUpdateFailHTLC *result;
12111    /**
12112     * A pointer to the contents in the error state.
12113     * Reading from this pointer when `result_ok` is set is undefined.
12114     */
12115    struct LDKDecodeError *err;
12116 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
12117
12118 /**
12119  * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
12120  * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12121  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12122  */
12123 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
12124    /**
12125     * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
12126     * `err` or `result` depending on the state of `result_ok`.
12127     */
12128    union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
12129    /**
12130     * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
12131     */
12132    bool result_ok;
12133 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
12134
12135 /**
12136  * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
12137  */
12138 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
12139    /**
12140     * A pointer to the contents in the success state.
12141     * Reading from this pointer when `result_ok` is not set is undefined.
12142     */
12143    struct LDKUpdateFailMalformedHTLC *result;
12144    /**
12145     * A pointer to the contents in the error state.
12146     * Reading from this pointer when `result_ok` is set is undefined.
12147     */
12148    struct LDKDecodeError *err;
12149 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
12150
12151 /**
12152  * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
12153  * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12154  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12155  */
12156 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
12157    /**
12158     * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
12159     * `err` or `result` depending on the state of `result_ok`.
12160     */
12161    union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
12162    /**
12163     * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
12164     */
12165    bool result_ok;
12166 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
12167
12168
12169
12170 /**
12171  * An [`update_fee`] message to be sent to or received from a peer
12172  *
12173  * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
12174  */
12175 typedef struct MUST_USE_STRUCT LDKUpdateFee {
12176    /**
12177     * A pointer to the opaque Rust object.
12178     * Nearly everywhere, inner must be non-null, however in places where
12179     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12180     */
12181    LDKnativeUpdateFee *inner;
12182    /**
12183     * Indicates that this is the only struct which contains the same pointer.
12184     * Rust functions which take ownership of an object provided via an argument require
12185     * this to be true and invalidate the object pointed to by inner.
12186     */
12187    bool is_owned;
12188 } LDKUpdateFee;
12189
12190 /**
12191  * The contents of CResult_UpdateFeeDecodeErrorZ
12192  */
12193 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
12194    /**
12195     * A pointer to the contents in the success state.
12196     * Reading from this pointer when `result_ok` is not set is undefined.
12197     */
12198    struct LDKUpdateFee *result;
12199    /**
12200     * A pointer to the contents in the error state.
12201     * Reading from this pointer when `result_ok` is set is undefined.
12202     */
12203    struct LDKDecodeError *err;
12204 } LDKCResult_UpdateFeeDecodeErrorZPtr;
12205
12206 /**
12207  * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
12208  * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
12209  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12210  */
12211 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
12212    /**
12213     * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
12214     * `err` or `result` depending on the state of `result_ok`.
12215     */
12216    union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
12217    /**
12218     * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
12219     */
12220    bool result_ok;
12221 } LDKCResult_UpdateFeeDecodeErrorZ;
12222
12223 /**
12224  * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
12225  */
12226 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
12227    /**
12228     * A pointer to the contents in the success state.
12229     * Reading from this pointer when `result_ok` is not set is undefined.
12230     */
12231    struct LDKUpdateFulfillHTLC *result;
12232    /**
12233     * A pointer to the contents in the error state.
12234     * Reading from this pointer when `result_ok` is set is undefined.
12235     */
12236    struct LDKDecodeError *err;
12237 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
12238
12239 /**
12240  * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
12241  * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12242  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12243  */
12244 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
12245    /**
12246     * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
12247     * `err` or `result` depending on the state of `result_ok`.
12248     */
12249    union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
12250    /**
12251     * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
12252     */
12253    bool result_ok;
12254 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
12255
12256 /**
12257  * The contents of CResult_UpdateAddHTLCDecodeErrorZ
12258  */
12259 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
12260    /**
12261     * A pointer to the contents in the success state.
12262     * Reading from this pointer when `result_ok` is not set is undefined.
12263     */
12264    struct LDKUpdateAddHTLC *result;
12265    /**
12266     * A pointer to the contents in the error state.
12267     * Reading from this pointer when `result_ok` is set is undefined.
12268     */
12269    struct LDKDecodeError *err;
12270 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
12271
12272 /**
12273  * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
12274  * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12275  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12276  */
12277 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
12278    /**
12279     * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
12280     * `err` or `result` depending on the state of `result_ok`.
12281     */
12282    union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
12283    /**
12284     * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
12285     */
12286    bool result_ok;
12287 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
12288
12289
12290
12291 /**
12292  * An onion message to be sent to or received from a peer.
12293  *
12294  */
12295 typedef struct MUST_USE_STRUCT LDKOnionMessage {
12296    /**
12297     * A pointer to the opaque Rust object.
12298     * Nearly everywhere, inner must be non-null, however in places where
12299     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12300     */
12301    LDKnativeOnionMessage *inner;
12302    /**
12303     * Indicates that this is the only struct which contains the same pointer.
12304     * Rust functions which take ownership of an object provided via an argument require
12305     * this to be true and invalidate the object pointed to by inner.
12306     */
12307    bool is_owned;
12308 } LDKOnionMessage;
12309
12310 /**
12311  * The contents of CResult_OnionMessageDecodeErrorZ
12312  */
12313 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
12314    /**
12315     * A pointer to the contents in the success state.
12316     * Reading from this pointer when `result_ok` is not set is undefined.
12317     */
12318    struct LDKOnionMessage *result;
12319    /**
12320     * A pointer to the contents in the error state.
12321     * Reading from this pointer when `result_ok` is set is undefined.
12322     */
12323    struct LDKDecodeError *err;
12324 } LDKCResult_OnionMessageDecodeErrorZPtr;
12325
12326 /**
12327  * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
12328  * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12329  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12330  */
12331 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
12332    /**
12333     * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
12334     * `err` or `result` depending on the state of `result_ok`.
12335     */
12336    union LDKCResult_OnionMessageDecodeErrorZPtr contents;
12337    /**
12338     * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
12339     */
12340    bool result_ok;
12341 } LDKCResult_OnionMessageDecodeErrorZ;
12342
12343
12344
12345 /**
12346  * A [`ping`] message to be sent to or received from a peer.
12347  *
12348  * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
12349  */
12350 typedef struct MUST_USE_STRUCT LDKPing {
12351    /**
12352     * A pointer to the opaque Rust object.
12353     * Nearly everywhere, inner must be non-null, however in places where
12354     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12355     */
12356    LDKnativePing *inner;
12357    /**
12358     * Indicates that this is the only struct which contains the same pointer.
12359     * Rust functions which take ownership of an object provided via an argument require
12360     * this to be true and invalidate the object pointed to by inner.
12361     */
12362    bool is_owned;
12363 } LDKPing;
12364
12365 /**
12366  * The contents of CResult_PingDecodeErrorZ
12367  */
12368 typedef union LDKCResult_PingDecodeErrorZPtr {
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 LDKPing *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_PingDecodeErrorZPtr;
12380
12381 /**
12382  * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
12383  * containing a crate::lightning::ln::msgs::Ping 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_PingDecodeErrorZ {
12387    /**
12388     * The contents of this CResult_PingDecodeErrorZ, accessible via either
12389     * `err` or `result` depending on the state of `result_ok`.
12390     */
12391    union LDKCResult_PingDecodeErrorZPtr contents;
12392    /**
12393     * Whether this CResult_PingDecodeErrorZ represents a success state.
12394     */
12395    bool result_ok;
12396 } LDKCResult_PingDecodeErrorZ;
12397
12398
12399
12400 /**
12401  * A [`pong`] message to be sent to or received from a peer.
12402  *
12403  * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
12404  */
12405 typedef struct MUST_USE_STRUCT LDKPong {
12406    /**
12407     * A pointer to the opaque Rust object.
12408     * Nearly everywhere, inner must be non-null, however in places where
12409     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12410     */
12411    LDKnativePong *inner;
12412    /**
12413     * Indicates that this is the only struct which contains the same pointer.
12414     * Rust functions which take ownership of an object provided via an argument require
12415     * this to be true and invalidate the object pointed to by inner.
12416     */
12417    bool is_owned;
12418 } LDKPong;
12419
12420 /**
12421  * The contents of CResult_PongDecodeErrorZ
12422  */
12423 typedef union LDKCResult_PongDecodeErrorZPtr {
12424    /**
12425     * A pointer to the contents in the success state.
12426     * Reading from this pointer when `result_ok` is not set is undefined.
12427     */
12428    struct LDKPong *result;
12429    /**
12430     * A pointer to the contents in the error state.
12431     * Reading from this pointer when `result_ok` is set is undefined.
12432     */
12433    struct LDKDecodeError *err;
12434 } LDKCResult_PongDecodeErrorZPtr;
12435
12436 /**
12437  * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
12438  * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
12439  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12440  */
12441 typedef struct LDKCResult_PongDecodeErrorZ {
12442    /**
12443     * The contents of this CResult_PongDecodeErrorZ, accessible via either
12444     * `err` or `result` depending on the state of `result_ok`.
12445     */
12446    union LDKCResult_PongDecodeErrorZPtr contents;
12447    /**
12448     * Whether this CResult_PongDecodeErrorZ represents a success state.
12449     */
12450    bool result_ok;
12451 } LDKCResult_PongDecodeErrorZ;
12452
12453 /**
12454  * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
12455  */
12456 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
12457    /**
12458     * A pointer to the contents in the success state.
12459     * Reading from this pointer when `result_ok` is not set is undefined.
12460     */
12461    struct LDKUnsignedChannelAnnouncement *result;
12462    /**
12463     * A pointer to the contents in the error state.
12464     * Reading from this pointer when `result_ok` is set is undefined.
12465     */
12466    struct LDKDecodeError *err;
12467 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
12468
12469 /**
12470  * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
12471  * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12472  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12473  */
12474 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
12475    /**
12476     * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
12477     * `err` or `result` depending on the state of `result_ok`.
12478     */
12479    union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
12480    /**
12481     * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
12482     */
12483    bool result_ok;
12484 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
12485
12486 /**
12487  * The contents of CResult_ChannelAnnouncementDecodeErrorZ
12488  */
12489 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
12490    /**
12491     * A pointer to the contents in the success state.
12492     * Reading from this pointer when `result_ok` is not set is undefined.
12493     */
12494    struct LDKChannelAnnouncement *result;
12495    /**
12496     * A pointer to the contents in the error state.
12497     * Reading from this pointer when `result_ok` is set is undefined.
12498     */
12499    struct LDKDecodeError *err;
12500 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
12501
12502 /**
12503  * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
12504  * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12505  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12506  */
12507 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
12508    /**
12509     * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
12510     * `err` or `result` depending on the state of `result_ok`.
12511     */
12512    union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
12513    /**
12514     * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
12515     */
12516    bool result_ok;
12517 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
12518
12519 /**
12520  * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
12521  */
12522 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
12523    /**
12524     * A pointer to the contents in the success state.
12525     * Reading from this pointer when `result_ok` is not set is undefined.
12526     */
12527    struct LDKUnsignedChannelUpdate *result;
12528    /**
12529     * A pointer to the contents in the error state.
12530     * Reading from this pointer when `result_ok` is set is undefined.
12531     */
12532    struct LDKDecodeError *err;
12533 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
12534
12535 /**
12536  * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12537  * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12538  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12539  */
12540 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
12541    /**
12542     * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
12543     * `err` or `result` depending on the state of `result_ok`.
12544     */
12545    union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
12546    /**
12547     * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
12548     */
12549    bool result_ok;
12550 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
12551
12552 /**
12553  * The contents of CResult_ChannelUpdateDecodeErrorZ
12554  */
12555 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
12556    /**
12557     * A pointer to the contents in the success state.
12558     * Reading from this pointer when `result_ok` is not set is undefined.
12559     */
12560    struct LDKChannelUpdate *result;
12561    /**
12562     * A pointer to the contents in the error state.
12563     * Reading from this pointer when `result_ok` is set is undefined.
12564     */
12565    struct LDKDecodeError *err;
12566 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
12567
12568 /**
12569  * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12570  * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12571  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12572  */
12573 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
12574    /**
12575     * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
12576     * `err` or `result` depending on the state of `result_ok`.
12577     */
12578    union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
12579    /**
12580     * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
12581     */
12582    bool result_ok;
12583 } LDKCResult_ChannelUpdateDecodeErrorZ;
12584
12585 /**
12586  * The contents of CResult_ErrorMessageDecodeErrorZ
12587  */
12588 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
12589    /**
12590     * A pointer to the contents in the success state.
12591     * Reading from this pointer when `result_ok` is not set is undefined.
12592     */
12593    struct LDKErrorMessage *result;
12594    /**
12595     * A pointer to the contents in the error state.
12596     * Reading from this pointer when `result_ok` is set is undefined.
12597     */
12598    struct LDKDecodeError *err;
12599 } LDKCResult_ErrorMessageDecodeErrorZPtr;
12600
12601 /**
12602  * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
12603  * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12604  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12605  */
12606 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
12607    /**
12608     * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
12609     * `err` or `result` depending on the state of `result_ok`.
12610     */
12611    union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
12612    /**
12613     * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
12614     */
12615    bool result_ok;
12616 } LDKCResult_ErrorMessageDecodeErrorZ;
12617
12618 /**
12619  * The contents of CResult_WarningMessageDecodeErrorZ
12620  */
12621 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
12622    /**
12623     * A pointer to the contents in the success state.
12624     * Reading from this pointer when `result_ok` is not set is undefined.
12625     */
12626    struct LDKWarningMessage *result;
12627    /**
12628     * A pointer to the contents in the error state.
12629     * Reading from this pointer when `result_ok` is set is undefined.
12630     */
12631    struct LDKDecodeError *err;
12632 } LDKCResult_WarningMessageDecodeErrorZPtr;
12633
12634 /**
12635  * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
12636  * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12637  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12638  */
12639 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
12640    /**
12641     * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
12642     * `err` or `result` depending on the state of `result_ok`.
12643     */
12644    union LDKCResult_WarningMessageDecodeErrorZPtr contents;
12645    /**
12646     * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
12647     */
12648    bool result_ok;
12649 } LDKCResult_WarningMessageDecodeErrorZ;
12650
12651 /**
12652  * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
12653  */
12654 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
12655    /**
12656     * A pointer to the contents in the success state.
12657     * Reading from this pointer when `result_ok` is not set is undefined.
12658     */
12659    struct LDKUnsignedNodeAnnouncement *result;
12660    /**
12661     * A pointer to the contents in the error state.
12662     * Reading from this pointer when `result_ok` is set is undefined.
12663     */
12664    struct LDKDecodeError *err;
12665 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
12666
12667 /**
12668  * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12669  * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12670  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12671  */
12672 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
12673    /**
12674     * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
12675     * `err` or `result` depending on the state of `result_ok`.
12676     */
12677    union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
12678    /**
12679     * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
12680     */
12681    bool result_ok;
12682 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
12683
12684 /**
12685  * The contents of CResult_NodeAnnouncementDecodeErrorZ
12686  */
12687 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
12688    /**
12689     * A pointer to the contents in the success state.
12690     * Reading from this pointer when `result_ok` is not set is undefined.
12691     */
12692    struct LDKNodeAnnouncement *result;
12693    /**
12694     * A pointer to the contents in the error state.
12695     * Reading from this pointer when `result_ok` is set is undefined.
12696     */
12697    struct LDKDecodeError *err;
12698 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
12699
12700 /**
12701  * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12702  * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12703  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12704  */
12705 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
12706    /**
12707     * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
12708     * `err` or `result` depending on the state of `result_ok`.
12709     */
12710    union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
12711    /**
12712     * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
12713     */
12714    bool result_ok;
12715 } LDKCResult_NodeAnnouncementDecodeErrorZ;
12716
12717 /**
12718  * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
12719  */
12720 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
12721    /**
12722     * A pointer to the contents in the success state.
12723     * Reading from this pointer when `result_ok` is not set is undefined.
12724     */
12725    struct LDKQueryShortChannelIds *result;
12726    /**
12727     * A pointer to the contents in the error state.
12728     * Reading from this pointer when `result_ok` is set is undefined.
12729     */
12730    struct LDKDecodeError *err;
12731 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
12732
12733 /**
12734  * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
12735  * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
12736  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12737  */
12738 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
12739    /**
12740     * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
12741     * `err` or `result` depending on the state of `result_ok`.
12742     */
12743    union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
12744    /**
12745     * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
12746     */
12747    bool result_ok;
12748 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
12749
12750
12751
12752 /**
12753  * A [`reply_short_channel_ids_end`] message is sent as a reply to a
12754  * message. The query recipient makes a best
12755  * effort to respond based on their local network view which may not be
12756  * a perfect view of the network.
12757  *
12758  * [`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
12759  */
12760 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
12761    /**
12762     * A pointer to the opaque Rust object.
12763     * Nearly everywhere, inner must be non-null, however in places where
12764     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12765     */
12766    LDKnativeReplyShortChannelIdsEnd *inner;
12767    /**
12768     * Indicates that this is the only struct which contains the same pointer.
12769     * Rust functions which take ownership of an object provided via an argument require
12770     * this to be true and invalidate the object pointed to by inner.
12771     */
12772    bool is_owned;
12773 } LDKReplyShortChannelIdsEnd;
12774
12775 /**
12776  * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
12777  */
12778 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
12779    /**
12780     * A pointer to the contents in the success state.
12781     * Reading from this pointer when `result_ok` is not set is undefined.
12782     */
12783    struct LDKReplyShortChannelIdsEnd *result;
12784    /**
12785     * A pointer to the contents in the error state.
12786     * Reading from this pointer when `result_ok` is set is undefined.
12787     */
12788    struct LDKDecodeError *err;
12789 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
12790
12791 /**
12792  * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
12793  * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
12794  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12795  */
12796 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
12797    /**
12798     * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
12799     * `err` or `result` depending on the state of `result_ok`.
12800     */
12801    union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
12802    /**
12803     * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
12804     */
12805    bool result_ok;
12806 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
12807
12808 /**
12809  * The contents of CResult_QueryChannelRangeDecodeErrorZ
12810  */
12811 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
12812    /**
12813     * A pointer to the contents in the success state.
12814     * Reading from this pointer when `result_ok` is not set is undefined.
12815     */
12816    struct LDKQueryChannelRange *result;
12817    /**
12818     * A pointer to the contents in the error state.
12819     * Reading from this pointer when `result_ok` is set is undefined.
12820     */
12821    struct LDKDecodeError *err;
12822 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
12823
12824 /**
12825  * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
12826  * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
12827  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12828  */
12829 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
12830    /**
12831     * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
12832     * `err` or `result` depending on the state of `result_ok`.
12833     */
12834    union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
12835    /**
12836     * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
12837     */
12838    bool result_ok;
12839 } LDKCResult_QueryChannelRangeDecodeErrorZ;
12840
12841 /**
12842  * The contents of CResult_ReplyChannelRangeDecodeErrorZ
12843  */
12844 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
12845    /**
12846     * A pointer to the contents in the success state.
12847     * Reading from this pointer when `result_ok` is not set is undefined.
12848     */
12849    struct LDKReplyChannelRange *result;
12850    /**
12851     * A pointer to the contents in the error state.
12852     * Reading from this pointer when `result_ok` is set is undefined.
12853     */
12854    struct LDKDecodeError *err;
12855 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
12856
12857 /**
12858  * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
12859  * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
12860  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12861  */
12862 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
12863    /**
12864     * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
12865     * `err` or `result` depending on the state of `result_ok`.
12866     */
12867    union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
12868    /**
12869     * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
12870     */
12871    bool result_ok;
12872 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
12873
12874 /**
12875  * The contents of CResult_GossipTimestampFilterDecodeErrorZ
12876  */
12877 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
12878    /**
12879     * A pointer to the contents in the success state.
12880     * Reading from this pointer when `result_ok` is not set is undefined.
12881     */
12882    struct LDKGossipTimestampFilter *result;
12883    /**
12884     * A pointer to the contents in the error state.
12885     * Reading from this pointer when `result_ok` is set is undefined.
12886     */
12887    struct LDKDecodeError *err;
12888 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
12889
12890 /**
12891  * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
12892  * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
12893  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12894  */
12895 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
12896    /**
12897     * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
12898     * `err` or `result` depending on the state of `result_ok`.
12899     */
12900    union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
12901    /**
12902     * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
12903     */
12904    bool result_ok;
12905 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
12906
12907 /**
12908  * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
12909  * This corresponds to std::vector in C++
12910  */
12911 typedef struct LDKCVec_PhantomRouteHintsZ {
12912    /**
12913     * The elements in the array.
12914     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12915     */
12916    struct LDKPhantomRouteHints *data;
12917    /**
12918     * The number of elements pointed to by `data`.
12919     */
12920    uintptr_t datalen;
12921 } LDKCVec_PhantomRouteHintsZ;
12922
12923
12924
12925 /**
12926  * Represents a syntactically and semantically correct lightning BOLT11 invoice.
12927  *
12928  * There are three ways to construct a `Bolt11Invoice`:
12929  *  1. using [`InvoiceBuilder`]
12930  *  2. using [`Bolt11Invoice::from_signed`]
12931  *  3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
12932  *
12933  * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
12934  */
12935 typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
12936    /**
12937     * A pointer to the opaque Rust object.
12938     * Nearly everywhere, inner must be non-null, however in places where
12939     * the Rust equivalent takes an Option, it may be set to null to indicate None.
12940     */
12941    LDKnativeBolt11Invoice *inner;
12942    /**
12943     * Indicates that this is the only struct which contains the same pointer.
12944     * Rust functions which take ownership of an object provided via an argument require
12945     * this to be true and invalidate the object pointed to by inner.
12946     */
12947    bool is_owned;
12948 } LDKBolt11Invoice;
12949
12950 /**
12951  * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
12952  * may occur.
12953  */
12954 typedef enum LDKSignOrCreationError_Tag {
12955    /**
12956     * An error occurred during signing
12957     */
12958    LDKSignOrCreationError_SignError,
12959    /**
12960     * An error occurred while building the transaction
12961     */
12962    LDKSignOrCreationError_CreationError,
12963    /**
12964     * Must be last for serialization purposes
12965     */
12966    LDKSignOrCreationError_Sentinel,
12967 } LDKSignOrCreationError_Tag;
12968
12969 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
12970    LDKSignOrCreationError_Tag tag;
12971    union {
12972       struct {
12973          enum LDKCreationError creation_error;
12974       };
12975    };
12976 } LDKSignOrCreationError;
12977
12978 /**
12979  * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
12980  */
12981 typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
12982    /**
12983     * A pointer to the contents in the success state.
12984     * Reading from this pointer when `result_ok` is not set is undefined.
12985     */
12986    struct LDKBolt11Invoice *result;
12987    /**
12988     * A pointer to the contents in the error state.
12989     * Reading from this pointer when `result_ok` is set is undefined.
12990     */
12991    struct LDKSignOrCreationError *err;
12992 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
12993
12994 /**
12995  * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
12996  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
12997  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12998  */
12999 typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
13000    /**
13001     * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
13002     * `err` or `result` depending on the state of `result_ok`.
13003     */
13004    union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
13005    /**
13006     * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
13007     */
13008    bool result_ok;
13009 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
13010
13011
13012
13013 /**
13014  * A simple future which can complete once, and calls some callback(s) when it does so.
13015  *
13016  * Clones can be made and all futures cloned from the same source will complete at the same time.
13017  */
13018 typedef struct MUST_USE_STRUCT LDKFuture {
13019    /**
13020     * A pointer to the opaque Rust object.
13021     * Nearly everywhere, inner must be non-null, however in places where
13022     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13023     */
13024    LDKnativeFuture *inner;
13025    /**
13026     * Indicates that this is the only struct which contains the same pointer.
13027     * Rust functions which take ownership of an object provided via an argument require
13028     * this to be true and invalidate the object pointed to by inner.
13029     */
13030    bool is_owned;
13031 } LDKFuture;
13032
13033 /**
13034  * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
13035  * This corresponds to std::vector in C++
13036  */
13037 typedef struct LDKCVec_FutureZ {
13038    /**
13039     * The elements in the array.
13040     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13041     */
13042    struct LDKFuture *data;
13043    /**
13044     * The number of elements pointed to by `data`.
13045     */
13046    uintptr_t datalen;
13047 } LDKCVec_FutureZ;
13048
13049 /**
13050  * The contents of CResult_OffersMessageDecodeErrorZ
13051  */
13052 typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
13053    /**
13054     * A pointer to the contents in the success state.
13055     * Reading from this pointer when `result_ok` is not set is undefined.
13056     */
13057    struct LDKOffersMessage *result;
13058    /**
13059     * A pointer to the contents in the error state.
13060     * Reading from this pointer when `result_ok` is set is undefined.
13061     */
13062    struct LDKDecodeError *err;
13063 } LDKCResult_OffersMessageDecodeErrorZPtr;
13064
13065 /**
13066  * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
13067  * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
13068  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13069  */
13070 typedef struct LDKCResult_OffersMessageDecodeErrorZ {
13071    /**
13072     * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
13073     * `err` or `result` depending on the state of `result_ok`.
13074     */
13075    union LDKCResult_OffersMessageDecodeErrorZPtr contents;
13076    /**
13077     * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
13078     */
13079    bool result_ok;
13080 } LDKCResult_OffersMessageDecodeErrorZ;
13081
13082 /**
13083  * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
13084  */
13085 typedef enum LDKCOption_HTLCClaimZ_Tag {
13086    /**
13087     * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
13088     */
13089    LDKCOption_HTLCClaimZ_Some,
13090    /**
13091     * When we're in this state, this COption_HTLCClaimZ contains nothing
13092     */
13093    LDKCOption_HTLCClaimZ_None,
13094    /**
13095     * Must be last for serialization purposes
13096     */
13097    LDKCOption_HTLCClaimZ_Sentinel,
13098 } LDKCOption_HTLCClaimZ_Tag;
13099
13100 typedef struct LDKCOption_HTLCClaimZ {
13101    LDKCOption_HTLCClaimZ_Tag tag;
13102    union {
13103       struct {
13104          enum LDKHTLCClaim some;
13105       };
13106    };
13107 } LDKCOption_HTLCClaimZ;
13108
13109
13110
13111 /**
13112  * Implements the per-commitment secret storage scheme from
13113  * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
13114  *
13115  * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
13116  * or so.
13117  */
13118 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
13119    /**
13120     * A pointer to the opaque Rust object.
13121     * Nearly everywhere, inner must be non-null, however in places where
13122     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13123     */
13124    LDKnativeCounterpartyCommitmentSecrets *inner;
13125    /**
13126     * Indicates that this is the only struct which contains the same pointer.
13127     * Rust functions which take ownership of an object provided via an argument require
13128     * this to be true and invalidate the object pointed to by inner.
13129     */
13130    bool is_owned;
13131 } LDKCounterpartyCommitmentSecrets;
13132
13133 /**
13134  * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
13135  */
13136 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
13137    /**
13138     * A pointer to the contents in the success state.
13139     * Reading from this pointer when `result_ok` is not set is undefined.
13140     */
13141    struct LDKCounterpartyCommitmentSecrets *result;
13142    /**
13143     * A pointer to the contents in the error state.
13144     * Reading from this pointer when `result_ok` is set is undefined.
13145     */
13146    struct LDKDecodeError *err;
13147 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
13148
13149 /**
13150  * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
13151  * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
13152  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13153  */
13154 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
13155    /**
13156     * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
13157     * `err` or `result` depending on the state of `result_ok`.
13158     */
13159    union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
13160    /**
13161     * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
13162     */
13163    bool result_ok;
13164 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
13165
13166
13167
13168 /**
13169  * The set of public keys which are used in the creation of one commitment transaction.
13170  * These are derived from the channel base keys and per-commitment data.
13171  *
13172  * A broadcaster key is provided from potential broadcaster of the computed transaction.
13173  * A countersignatory key is coming from a protocol participant unable to broadcast the
13174  * transaction.
13175  *
13176  * These keys are assumed to be good, either because the code derived them from
13177  * channel basepoints via the new function, or they were obtained via
13178  * CommitmentTransaction.trust().keys() because we trusted the source of the
13179  * pre-calculated keys.
13180  */
13181 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
13182    /**
13183     * A pointer to the opaque Rust object.
13184     * Nearly everywhere, inner must be non-null, however in places where
13185     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13186     */
13187    LDKnativeTxCreationKeys *inner;
13188    /**
13189     * Indicates that this is the only struct which contains the same pointer.
13190     * Rust functions which take ownership of an object provided via an argument require
13191     * this to be true and invalidate the object pointed to by inner.
13192     */
13193    bool is_owned;
13194 } LDKTxCreationKeys;
13195
13196 /**
13197  * The contents of CResult_TxCreationKeysDecodeErrorZ
13198  */
13199 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
13200    /**
13201     * A pointer to the contents in the success state.
13202     * Reading from this pointer when `result_ok` is not set is undefined.
13203     */
13204    struct LDKTxCreationKeys *result;
13205    /**
13206     * A pointer to the contents in the error state.
13207     * Reading from this pointer when `result_ok` is set is undefined.
13208     */
13209    struct LDKDecodeError *err;
13210 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
13211
13212 /**
13213  * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
13214  * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
13215  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13216  */
13217 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
13218    /**
13219     * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
13220     * `err` or `result` depending on the state of `result_ok`.
13221     */
13222    union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
13223    /**
13224     * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
13225     */
13226    bool result_ok;
13227 } LDKCResult_TxCreationKeysDecodeErrorZ;
13228
13229 /**
13230  * The contents of CResult_ChannelPublicKeysDecodeErrorZ
13231  */
13232 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
13233    /**
13234     * A pointer to the contents in the success state.
13235     * Reading from this pointer when `result_ok` is not set is undefined.
13236     */
13237    struct LDKChannelPublicKeys *result;
13238    /**
13239     * A pointer to the contents in the error state.
13240     * Reading from this pointer when `result_ok` is set is undefined.
13241     */
13242    struct LDKDecodeError *err;
13243 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
13244
13245 /**
13246  * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
13247  * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
13248  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13249  */
13250 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
13251    /**
13252     * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
13253     * `err` or `result` depending on the state of `result_ok`.
13254     */
13255    union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
13256    /**
13257     * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
13258     */
13259    bool result_ok;
13260 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
13261
13262 /**
13263  * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
13264  */
13265 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
13266    /**
13267     * A pointer to the contents in the success state.
13268     * Reading from this pointer when `result_ok` is not set is undefined.
13269     */
13270    struct LDKHTLCOutputInCommitment *result;
13271    /**
13272     * A pointer to the contents in the error state.
13273     * Reading from this pointer when `result_ok` is set is undefined.
13274     */
13275    struct LDKDecodeError *err;
13276 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
13277
13278 /**
13279  * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
13280  * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
13281  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13282  */
13283 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
13284    /**
13285     * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
13286     * `err` or `result` depending on the state of `result_ok`.
13287     */
13288    union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
13289    /**
13290     * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
13291     */
13292    bool result_ok;
13293 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
13294
13295
13296
13297 /**
13298  * Late-bound per-channel counterparty data used to build transactions.
13299  */
13300 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
13301    /**
13302     * A pointer to the opaque Rust object.
13303     * Nearly everywhere, inner must be non-null, however in places where
13304     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13305     */
13306    LDKnativeCounterpartyChannelTransactionParameters *inner;
13307    /**
13308     * Indicates that this is the only struct which contains the same pointer.
13309     * Rust functions which take ownership of an object provided via an argument require
13310     * this to be true and invalidate the object pointed to by inner.
13311     */
13312    bool is_owned;
13313 } LDKCounterpartyChannelTransactionParameters;
13314
13315 /**
13316  * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
13317  */
13318 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
13319    /**
13320     * A pointer to the contents in the success state.
13321     * Reading from this pointer when `result_ok` is not set is undefined.
13322     */
13323    struct LDKCounterpartyChannelTransactionParameters *result;
13324    /**
13325     * A pointer to the contents in the error state.
13326     * Reading from this pointer when `result_ok` is set is undefined.
13327     */
13328    struct LDKDecodeError *err;
13329 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
13330
13331 /**
13332  * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
13333  * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
13334  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13335  */
13336 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
13337    /**
13338     * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
13339     * `err` or `result` depending on the state of `result_ok`.
13340     */
13341    union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
13342    /**
13343     * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
13344     */
13345    bool result_ok;
13346 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
13347
13348 /**
13349  * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
13350  */
13351 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
13352    /**
13353     * A pointer to the contents in the success state.
13354     * Reading from this pointer when `result_ok` is not set is undefined.
13355     */
13356    struct LDKChannelTransactionParameters *result;
13357    /**
13358     * A pointer to the contents in the error state.
13359     * Reading from this pointer when `result_ok` is set is undefined.
13360     */
13361    struct LDKDecodeError *err;
13362 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
13363
13364 /**
13365  * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
13366  * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
13367  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13368  */
13369 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
13370    /**
13371     * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
13372     * `err` or `result` depending on the state of `result_ok`.
13373     */
13374    union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
13375    /**
13376     * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
13377     */
13378    bool result_ok;
13379 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
13380
13381 /**
13382  * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
13383  */
13384 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
13385    /**
13386     * A pointer to the contents in the success state.
13387     * Reading from this pointer when `result_ok` is not set is undefined.
13388     */
13389    struct LDKHolderCommitmentTransaction *result;
13390    /**
13391     * A pointer to the contents in the error state.
13392     * Reading from this pointer when `result_ok` is set is undefined.
13393     */
13394    struct LDKDecodeError *err;
13395 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
13396
13397 /**
13398  * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13399  * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
13400  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13401  */
13402 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
13403    /**
13404     * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
13405     * `err` or `result` depending on the state of `result_ok`.
13406     */
13407    union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
13408    /**
13409     * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
13410     */
13411    bool result_ok;
13412 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
13413
13414
13415
13416 /**
13417  * A pre-built Bitcoin commitment transaction and its txid.
13418  */
13419 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
13420    /**
13421     * A pointer to the opaque Rust object.
13422     * Nearly everywhere, inner must be non-null, however in places where
13423     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13424     */
13425    LDKnativeBuiltCommitmentTransaction *inner;
13426    /**
13427     * Indicates that this is the only struct which contains the same pointer.
13428     * Rust functions which take ownership of an object provided via an argument require
13429     * this to be true and invalidate the object pointed to by inner.
13430     */
13431    bool is_owned;
13432 } LDKBuiltCommitmentTransaction;
13433
13434 /**
13435  * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
13436  */
13437 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
13438    /**
13439     * A pointer to the contents in the success state.
13440     * Reading from this pointer when `result_ok` is not set is undefined.
13441     */
13442    struct LDKBuiltCommitmentTransaction *result;
13443    /**
13444     * A pointer to the contents in the error state.
13445     * Reading from this pointer when `result_ok` is set is undefined.
13446     */
13447    struct LDKDecodeError *err;
13448 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
13449
13450 /**
13451  * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13452  * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
13453  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13454  */
13455 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
13456    /**
13457     * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
13458     * `err` or `result` depending on the state of `result_ok`.
13459     */
13460    union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
13461    /**
13462     * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
13463     */
13464    bool result_ok;
13465 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
13466
13467
13468
13469 /**
13470  * A wrapper on ClosingTransaction indicating that the built bitcoin
13471  * transaction is trusted.
13472  *
13473  * See trust() and verify() functions on CommitmentTransaction.
13474  *
13475  * This structure implements Deref.
13476  */
13477 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
13478    /**
13479     * A pointer to the opaque Rust object.
13480     * Nearly everywhere, inner must be non-null, however in places where
13481     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13482     */
13483    LDKnativeTrustedClosingTransaction *inner;
13484    /**
13485     * Indicates that this is the only struct which contains the same pointer.
13486     * Rust functions which take ownership of an object provided via an argument require
13487     * this to be true and invalidate the object pointed to by inner.
13488     */
13489    bool is_owned;
13490 } LDKTrustedClosingTransaction;
13491
13492 /**
13493  * The contents of CResult_TrustedClosingTransactionNoneZ
13494  */
13495 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
13496    /**
13497     * A pointer to the contents in the success state.
13498     * Reading from this pointer when `result_ok` is not set is undefined.
13499     */
13500    struct LDKTrustedClosingTransaction *result;
13501    /**
13502     * Note that this value is always NULL, as there are no contents in the Err variant
13503     */
13504    void *err;
13505 } LDKCResult_TrustedClosingTransactionNoneZPtr;
13506
13507 /**
13508  * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
13509  * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
13510  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13511  */
13512 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
13513    /**
13514     * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
13515     * `err` or `result` depending on the state of `result_ok`.
13516     */
13517    union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
13518    /**
13519     * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
13520     */
13521    bool result_ok;
13522 } LDKCResult_TrustedClosingTransactionNoneZ;
13523
13524 /**
13525  * The contents of CResult_CommitmentTransactionDecodeErrorZ
13526  */
13527 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
13528    /**
13529     * A pointer to the contents in the success state.
13530     * Reading from this pointer when `result_ok` is not set is undefined.
13531     */
13532    struct LDKCommitmentTransaction *result;
13533    /**
13534     * A pointer to the contents in the error state.
13535     * Reading from this pointer when `result_ok` is set is undefined.
13536     */
13537    struct LDKDecodeError *err;
13538 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
13539
13540 /**
13541  * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13542  * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
13543  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13544  */
13545 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
13546    /**
13547     * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
13548     * `err` or `result` depending on the state of `result_ok`.
13549     */
13550    union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
13551    /**
13552     * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
13553     */
13554    bool result_ok;
13555 } LDKCResult_CommitmentTransactionDecodeErrorZ;
13556
13557
13558
13559 /**
13560  * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
13561  * transaction and the transaction creation keys) are trusted.
13562  *
13563  * See trust() and verify() functions on CommitmentTransaction.
13564  *
13565  * This structure implements Deref.
13566  */
13567 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
13568    /**
13569     * A pointer to the opaque Rust object.
13570     * Nearly everywhere, inner must be non-null, however in places where
13571     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13572     */
13573    LDKnativeTrustedCommitmentTransaction *inner;
13574    /**
13575     * Indicates that this is the only struct which contains the same pointer.
13576     * Rust functions which take ownership of an object provided via an argument require
13577     * this to be true and invalidate the object pointed to by inner.
13578     */
13579    bool is_owned;
13580 } LDKTrustedCommitmentTransaction;
13581
13582 /**
13583  * The contents of CResult_TrustedCommitmentTransactionNoneZ
13584  */
13585 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
13586    /**
13587     * A pointer to the contents in the success state.
13588     * Reading from this pointer when `result_ok` is not set is undefined.
13589     */
13590    struct LDKTrustedCommitmentTransaction *result;
13591    /**
13592     * Note that this value is always NULL, as there are no contents in the Err variant
13593     */
13594    void *err;
13595 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
13596
13597 /**
13598  * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
13599  * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
13600  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13601  */
13602 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
13603    /**
13604     * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
13605     * `err` or `result` depending on the state of `result_ok`.
13606     */
13607    union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
13608    /**
13609     * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
13610     */
13611    bool result_ok;
13612 } LDKCResult_TrustedCommitmentTransactionNoneZ;
13613
13614 /**
13615  * The contents of CResult_CVec_ECDSASignatureZNoneZ
13616  */
13617 typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
13618    /**
13619     * A pointer to the contents in the success state.
13620     * Reading from this pointer when `result_ok` is not set is undefined.
13621     */
13622    struct LDKCVec_ECDSASignatureZ *result;
13623    /**
13624     * Note that this value is always NULL, as there are no contents in the Err variant
13625     */
13626    void *err;
13627 } LDKCResult_CVec_ECDSASignatureZNoneZPtr;
13628
13629 /**
13630  * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
13631  * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
13632  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13633  */
13634 typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
13635    /**
13636     * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
13637     * `err` or `result` depending on the state of `result_ok`.
13638     */
13639    union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
13640    /**
13641     * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
13642     */
13643    bool result_ok;
13644 } LDKCResult_CVec_ECDSASignatureZNoneZ;
13645
13646 /**
13647  * An enum which can either contain a usize or not
13648  */
13649 typedef enum LDKCOption_usizeZ_Tag {
13650    /**
13651     * When we're in this state, this COption_usizeZ contains a usize
13652     */
13653    LDKCOption_usizeZ_Some,
13654    /**
13655     * When we're in this state, this COption_usizeZ contains nothing
13656     */
13657    LDKCOption_usizeZ_None,
13658    /**
13659     * Must be last for serialization purposes
13660     */
13661    LDKCOption_usizeZ_Sentinel,
13662 } LDKCOption_usizeZ_Tag;
13663
13664 typedef struct LDKCOption_usizeZ {
13665    LDKCOption_usizeZ_Tag tag;
13666    union {
13667       struct {
13668          uintptr_t some;
13669       };
13670    };
13671 } LDKCOption_usizeZ;
13672
13673 /**
13674  * The contents of CResult_ShutdownScriptDecodeErrorZ
13675  */
13676 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
13677    /**
13678     * A pointer to the contents in the success state.
13679     * Reading from this pointer when `result_ok` is not set is undefined.
13680     */
13681    struct LDKShutdownScript *result;
13682    /**
13683     * A pointer to the contents in the error state.
13684     * Reading from this pointer when `result_ok` is set is undefined.
13685     */
13686    struct LDKDecodeError *err;
13687 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
13688
13689 /**
13690  * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
13691  * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
13692  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13693  */
13694 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
13695    /**
13696     * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
13697     * `err` or `result` depending on the state of `result_ok`.
13698     */
13699    union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
13700    /**
13701     * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
13702     */
13703    bool result_ok;
13704 } LDKCResult_ShutdownScriptDecodeErrorZ;
13705
13706
13707
13708 /**
13709  * An error occurring when converting from [`Script`] to [`ShutdownScript`].
13710  */
13711 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
13712    /**
13713     * A pointer to the opaque Rust object.
13714     * Nearly everywhere, inner must be non-null, however in places where
13715     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13716     */
13717    LDKnativeInvalidShutdownScript *inner;
13718    /**
13719     * Indicates that this is the only struct which contains the same pointer.
13720     * Rust functions which take ownership of an object provided via an argument require
13721     * this to be true and invalidate the object pointed to by inner.
13722     */
13723    bool is_owned;
13724 } LDKInvalidShutdownScript;
13725
13726 /**
13727  * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
13728  */
13729 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
13730    /**
13731     * A pointer to the contents in the success state.
13732     * Reading from this pointer when `result_ok` is not set is undefined.
13733     */
13734    struct LDKShutdownScript *result;
13735    /**
13736     * A pointer to the contents in the error state.
13737     * Reading from this pointer when `result_ok` is set is undefined.
13738     */
13739    struct LDKInvalidShutdownScript *err;
13740 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
13741
13742 /**
13743  * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
13744  * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
13745  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13746  */
13747 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
13748    /**
13749     * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
13750     * `err` or `result` depending on the state of `result_ok`.
13751     */
13752    union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
13753    /**
13754     * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
13755     */
13756    bool result_ok;
13757 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
13758
13759 /**
13760  * Some information provided on receipt of payment depends on whether the payment received is a
13761  * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
13762  */
13763 typedef enum LDKPaymentPurpose_Tag {
13764    /**
13765     * Information for receiving a payment that we generated an invoice for.
13766     */
13767    LDKPaymentPurpose_InvoicePayment,
13768    /**
13769     * Because this is a spontaneous payment, the payer generated their own preimage rather than us
13770     * (the payee) providing a preimage.
13771     */
13772    LDKPaymentPurpose_SpontaneousPayment,
13773    /**
13774     * Must be last for serialization purposes
13775     */
13776    LDKPaymentPurpose_Sentinel,
13777 } LDKPaymentPurpose_Tag;
13778
13779 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
13780    /**
13781     * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
13782     * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
13783     * [`ChannelManager::claim_funds`].
13784     *
13785     * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
13786     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
13787     */
13788    struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
13789    /**
13790     * The \"payment secret\". This authenticates the sender to the recipient, preventing a
13791     * number of deanonymization attacks during the routing process.
13792     * It is provided here for your reference, however its accuracy is enforced directly by
13793     * [`ChannelManager`] using the values you previously provided to
13794     * [`ChannelManager::create_inbound_payment`] or
13795     * [`ChannelManager::create_inbound_payment_for_hash`].
13796     *
13797     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
13798     * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
13799     * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
13800     */
13801    struct LDKThirtyTwoBytes payment_secret;
13802 } LDKPaymentPurpose_LDKInvoicePayment_Body;
13803
13804 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
13805    LDKPaymentPurpose_Tag tag;
13806    union {
13807       LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
13808       struct {
13809          struct LDKThirtyTwoBytes spontaneous_payment;
13810       };
13811    };
13812 } LDKPaymentPurpose;
13813
13814 /**
13815  * The contents of CResult_PaymentPurposeDecodeErrorZ
13816  */
13817 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
13818    /**
13819     * A pointer to the contents in the success state.
13820     * Reading from this pointer when `result_ok` is not set is undefined.
13821     */
13822    struct LDKPaymentPurpose *result;
13823    /**
13824     * A pointer to the contents in the error state.
13825     * Reading from this pointer when `result_ok` is set is undefined.
13826     */
13827    struct LDKDecodeError *err;
13828 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
13829
13830 /**
13831  * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
13832  * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
13833  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13834  */
13835 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
13836    /**
13837     * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
13838     * `err` or `result` depending on the state of `result_ok`.
13839     */
13840    union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
13841    /**
13842     * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
13843     */
13844    bool result_ok;
13845 } LDKCResult_PaymentPurposeDecodeErrorZ;
13846
13847
13848
13849 /**
13850  * Information about an HTLC that is part of a payment that can be claimed.
13851  */
13852 typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
13853    /**
13854     * A pointer to the opaque Rust object.
13855     * Nearly everywhere, inner must be non-null, however in places where
13856     * the Rust equivalent takes an Option, it may be set to null to indicate None.
13857     */
13858    LDKnativeClaimedHTLC *inner;
13859    /**
13860     * Indicates that this is the only struct which contains the same pointer.
13861     * Rust functions which take ownership of an object provided via an argument require
13862     * this to be true and invalidate the object pointed to by inner.
13863     */
13864    bool is_owned;
13865 } LDKClaimedHTLC;
13866
13867 /**
13868  * The contents of CResult_ClaimedHTLCDecodeErrorZ
13869  */
13870 typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
13871    /**
13872     * A pointer to the contents in the success state.
13873     * Reading from this pointer when `result_ok` is not set is undefined.
13874     */
13875    struct LDKClaimedHTLC *result;
13876    /**
13877     * A pointer to the contents in the error state.
13878     * Reading from this pointer when `result_ok` is set is undefined.
13879     */
13880    struct LDKDecodeError *err;
13881 } LDKCResult_ClaimedHTLCDecodeErrorZPtr;
13882
13883 /**
13884  * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
13885  * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
13886  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13887  */
13888 typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
13889    /**
13890     * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
13891     * `err` or `result` depending on the state of `result_ok`.
13892     */
13893    union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
13894    /**
13895     * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
13896     */
13897    bool result_ok;
13898 } LDKCResult_ClaimedHTLCDecodeErrorZ;
13899
13900 /**
13901  * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
13902  * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
13903  *
13904  * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
13905  * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
13906  */
13907 typedef enum LDKPathFailure_Tag {
13908    /**
13909     * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
13910     * error.
13911     */
13912    LDKPathFailure_InitialSend,
13913    /**
13914     * A hop on the path failed to forward our payment.
13915     */
13916    LDKPathFailure_OnPath,
13917    /**
13918     * Must be last for serialization purposes
13919     */
13920    LDKPathFailure_Sentinel,
13921 } LDKPathFailure_Tag;
13922
13923 typedef struct LDKPathFailure_LDKInitialSend_Body {
13924    /**
13925     * The error surfaced from initial send.
13926     */
13927    struct LDKAPIError err;
13928 } LDKPathFailure_LDKInitialSend_Body;
13929
13930 typedef struct LDKPathFailure_LDKOnPath_Body {
13931    /**
13932     * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
13933     * decisions can take into account the update.
13934     *
13935     * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
13936     * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
13937     */
13938    struct LDKCOption_NetworkUpdateZ network_update;
13939 } LDKPathFailure_LDKOnPath_Body;
13940
13941 typedef struct MUST_USE_STRUCT LDKPathFailure {
13942    LDKPathFailure_Tag tag;
13943    union {
13944       LDKPathFailure_LDKInitialSend_Body initial_send;
13945       LDKPathFailure_LDKOnPath_Body on_path;
13946    };
13947 } LDKPathFailure;
13948
13949 /**
13950  * An enum which can either contain a crate::lightning::events::PathFailure or not
13951  */
13952 typedef enum LDKCOption_PathFailureZ_Tag {
13953    /**
13954     * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
13955     */
13956    LDKCOption_PathFailureZ_Some,
13957    /**
13958     * When we're in this state, this COption_PathFailureZ contains nothing
13959     */
13960    LDKCOption_PathFailureZ_None,
13961    /**
13962     * Must be last for serialization purposes
13963     */
13964    LDKCOption_PathFailureZ_Sentinel,
13965 } LDKCOption_PathFailureZ_Tag;
13966
13967 typedef struct LDKCOption_PathFailureZ {
13968    LDKCOption_PathFailureZ_Tag tag;
13969    union {
13970       struct {
13971          struct LDKPathFailure some;
13972       };
13973    };
13974 } LDKCOption_PathFailureZ;
13975
13976 /**
13977  * The contents of CResult_COption_PathFailureZDecodeErrorZ
13978  */
13979 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
13980    /**
13981     * A pointer to the contents in the success state.
13982     * Reading from this pointer when `result_ok` is not set is undefined.
13983     */
13984    struct LDKCOption_PathFailureZ *result;
13985    /**
13986     * A pointer to the contents in the error state.
13987     * Reading from this pointer when `result_ok` is set is undefined.
13988     */
13989    struct LDKDecodeError *err;
13990 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
13991
13992 /**
13993  * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
13994  * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13995  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13996  */
13997 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
13998    /**
13999     * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
14000     * `err` or `result` depending on the state of `result_ok`.
14001     */
14002    union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
14003    /**
14004     * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
14005     */
14006    bool result_ok;
14007 } LDKCResult_COption_PathFailureZDecodeErrorZ;
14008
14009
14010
14011 /**
14012  * Struct to `Display` fields in a safe way using `PrintableString`
14013  */
14014 typedef struct MUST_USE_STRUCT LDKUntrustedString {
14015    /**
14016     * A pointer to the opaque Rust object.
14017     * Nearly everywhere, inner must be non-null, however in places where
14018     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14019     */
14020    LDKnativeUntrustedString *inner;
14021    /**
14022     * Indicates that this is the only struct which contains the same pointer.
14023     * Rust functions which take ownership of an object provided via an argument require
14024     * this to be true and invalidate the object pointed to by inner.
14025     */
14026    bool is_owned;
14027 } LDKUntrustedString;
14028
14029 /**
14030  * The reason the channel was closed. See individual variants for more details.
14031  */
14032 typedef enum LDKClosureReason_Tag {
14033    /**
14034     * Closure generated from receiving a peer error message.
14035     *
14036     * Our counterparty may have broadcasted their latest commitment state, and we have
14037     * as well.
14038     */
14039    LDKClosureReason_CounterpartyForceClosed,
14040    /**
14041     * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
14042     *
14043     * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
14044     */
14045    LDKClosureReason_HolderForceClosed,
14046    /**
14047     * The channel was closed after negotiating a cooperative close and we've now broadcasted
14048     * the cooperative close transaction. Note the shutdown may have been initiated by us.
14049     */
14050    LDKClosureReason_CooperativeClosure,
14051    /**
14052     * A commitment transaction was confirmed on chain, closing the channel. Most likely this
14053     * commitment transaction came from our counterparty, but it may also have come from
14054     * a copy of our own `ChannelMonitor`.
14055     */
14056    LDKClosureReason_CommitmentTxConfirmed,
14057    /**
14058     * The funding transaction failed to confirm in a timely manner on an inbound channel.
14059     */
14060    LDKClosureReason_FundingTimedOut,
14061    /**
14062     * Closure generated from processing an event, likely a HTLC forward/relay/reception.
14063     */
14064    LDKClosureReason_ProcessingError,
14065    /**
14066     * The peer disconnected prior to funding completing. In this case the spec mandates that we
14067     * forget the channel entirely - we can attempt again if the peer reconnects.
14068     *
14069     * This includes cases where we restarted prior to funding completion, including prior to the
14070     * initial [`ChannelMonitor`] persistence completing.
14071     *
14072     * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
14073     * peer because of mutual incompatibility between us and our channel counterparty.
14074     *
14075     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
14076     */
14077    LDKClosureReason_DisconnectedPeer,
14078    /**
14079     * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
14080     * the [`ChannelManager`] deserialized.
14081     *
14082     * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
14083     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14084     */
14085    LDKClosureReason_OutdatedChannelManager,
14086    /**
14087     * The counterparty requested a cooperative close of a channel that had not been funded yet.
14088     * The channel has been immediately closed.
14089     */
14090    LDKClosureReason_CounterpartyCoopClosedUnfundedChannel,
14091    /**
14092     * Another channel in the same funding batch closed before the funding transaction
14093     * was ready to be broadcast.
14094     */
14095    LDKClosureReason_FundingBatchClosure,
14096    /**
14097     * Must be last for serialization purposes
14098     */
14099    LDKClosureReason_Sentinel,
14100 } LDKClosureReason_Tag;
14101
14102 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
14103    /**
14104     * The error which the peer sent us.
14105     *
14106     * Be careful about printing the peer_msg, a well-crafted message could exploit
14107     * a security vulnerability in the terminal emulator or the logging subsystem.
14108     * To be safe, use `Display` on `UntrustedString`
14109     *
14110     * [`UntrustedString`]: crate::util::string::UntrustedString
14111     */
14112    struct LDKUntrustedString peer_msg;
14113 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
14114
14115 typedef struct LDKClosureReason_LDKProcessingError_Body {
14116    /**
14117     * A developer-readable error message which we generated.
14118     */
14119    struct LDKStr err;
14120 } LDKClosureReason_LDKProcessingError_Body;
14121
14122 typedef struct MUST_USE_STRUCT LDKClosureReason {
14123    LDKClosureReason_Tag tag;
14124    union {
14125       LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
14126       LDKClosureReason_LDKProcessingError_Body processing_error;
14127    };
14128 } LDKClosureReason;
14129
14130 /**
14131  * An enum which can either contain a crate::lightning::events::ClosureReason or not
14132  */
14133 typedef enum LDKCOption_ClosureReasonZ_Tag {
14134    /**
14135     * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
14136     */
14137    LDKCOption_ClosureReasonZ_Some,
14138    /**
14139     * When we're in this state, this COption_ClosureReasonZ contains nothing
14140     */
14141    LDKCOption_ClosureReasonZ_None,
14142    /**
14143     * Must be last for serialization purposes
14144     */
14145    LDKCOption_ClosureReasonZ_Sentinel,
14146 } LDKCOption_ClosureReasonZ_Tag;
14147
14148 typedef struct LDKCOption_ClosureReasonZ {
14149    LDKCOption_ClosureReasonZ_Tag tag;
14150    union {
14151       struct {
14152          struct LDKClosureReason some;
14153       };
14154    };
14155 } LDKCOption_ClosureReasonZ;
14156
14157 /**
14158  * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
14159  */
14160 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
14161    /**
14162     * A pointer to the contents in the success state.
14163     * Reading from this pointer when `result_ok` is not set is undefined.
14164     */
14165    struct LDKCOption_ClosureReasonZ *result;
14166    /**
14167     * A pointer to the contents in the error state.
14168     * Reading from this pointer when `result_ok` is set is undefined.
14169     */
14170    struct LDKDecodeError *err;
14171 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
14172
14173 /**
14174  * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
14175  * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
14176  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14177  */
14178 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
14179    /**
14180     * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
14181     * `err` or `result` depending on the state of `result_ok`.
14182     */
14183    union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
14184    /**
14185     * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
14186     */
14187    bool result_ok;
14188 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
14189
14190 /**
14191  * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
14192  */
14193 typedef enum LDKHTLCDestination_Tag {
14194    /**
14195     * We tried forwarding to a channel but failed to do so. An example of such an instance is when
14196     * there is insufficient capacity in our outbound channel.
14197     */
14198    LDKHTLCDestination_NextHopChannel,
14199    /**
14200     * Scenario where we are unsure of the next node to forward the HTLC to.
14201     */
14202    LDKHTLCDestination_UnknownNextHop,
14203    /**
14204     * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
14205     * intercept HTLC.
14206     */
14207    LDKHTLCDestination_InvalidForward,
14208    /**
14209     * Failure scenario where an HTLC may have been forwarded to be intended for us,
14210     * but is invalid for some reason, so we reject it.
14211     *
14212     * Some of the reasons may include:
14213     * * HTLC Timeouts
14214     * * Excess HTLCs for a payment that we have already fully received, over-paying for the
14215     *   payment,
14216     * * The counterparty node modified the HTLC in transit,
14217     * * A probing attack where an intermediary node is trying to detect if we are the ultimate
14218     *   recipient for a payment.
14219     */
14220    LDKHTLCDestination_FailedPayment,
14221    /**
14222     * Must be last for serialization purposes
14223     */
14224    LDKHTLCDestination_Sentinel,
14225 } LDKHTLCDestination_Tag;
14226
14227 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
14228    /**
14229     * The `node_id` of the next node. For backwards compatibility, this field is
14230     * marked as optional, versions prior to 0.0.110 may not always be able to provide
14231     * counterparty node information.
14232     *
14233     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14234     */
14235    struct LDKPublicKey node_id;
14236    /**
14237     * The outgoing `channel_id` between us and the next node.
14238     */
14239    struct LDKThirtyTwoBytes channel_id;
14240 } LDKHTLCDestination_LDKNextHopChannel_Body;
14241
14242 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
14243    /**
14244     * Short channel id we are requesting to forward an HTLC to.
14245     */
14246    uint64_t requested_forward_scid;
14247 } LDKHTLCDestination_LDKUnknownNextHop_Body;
14248
14249 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
14250    /**
14251     * Short channel id we are requesting to forward an HTLC to.
14252     */
14253    uint64_t requested_forward_scid;
14254 } LDKHTLCDestination_LDKInvalidForward_Body;
14255
14256 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
14257    /**
14258     * The payment hash of the payment we attempted to process.
14259     */
14260    struct LDKThirtyTwoBytes payment_hash;
14261 } LDKHTLCDestination_LDKFailedPayment_Body;
14262
14263 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
14264    LDKHTLCDestination_Tag tag;
14265    union {
14266       LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
14267       LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
14268       LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
14269       LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
14270    };
14271 } LDKHTLCDestination;
14272
14273 /**
14274  * An enum which can either contain a crate::lightning::events::HTLCDestination or not
14275  */
14276 typedef enum LDKCOption_HTLCDestinationZ_Tag {
14277    /**
14278     * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
14279     */
14280    LDKCOption_HTLCDestinationZ_Some,
14281    /**
14282     * When we're in this state, this COption_HTLCDestinationZ contains nothing
14283     */
14284    LDKCOption_HTLCDestinationZ_None,
14285    /**
14286     * Must be last for serialization purposes
14287     */
14288    LDKCOption_HTLCDestinationZ_Sentinel,
14289 } LDKCOption_HTLCDestinationZ_Tag;
14290
14291 typedef struct LDKCOption_HTLCDestinationZ {
14292    LDKCOption_HTLCDestinationZ_Tag tag;
14293    union {
14294       struct {
14295          struct LDKHTLCDestination some;
14296       };
14297    };
14298 } LDKCOption_HTLCDestinationZ;
14299
14300 /**
14301  * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
14302  */
14303 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
14304    /**
14305     * A pointer to the contents in the success state.
14306     * Reading from this pointer when `result_ok` is not set is undefined.
14307     */
14308    struct LDKCOption_HTLCDestinationZ *result;
14309    /**
14310     * A pointer to the contents in the error state.
14311     * Reading from this pointer when `result_ok` is set is undefined.
14312     */
14313    struct LDKDecodeError *err;
14314 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
14315
14316 /**
14317  * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
14318  * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
14319  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14320  */
14321 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
14322    /**
14323     * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
14324     * `err` or `result` depending on the state of `result_ok`.
14325     */
14326    union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
14327    /**
14328     * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
14329     */
14330    bool result_ok;
14331 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
14332
14333 /**
14334  * The contents of CResult_PaymentFailureReasonDecodeErrorZ
14335  */
14336 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
14337    /**
14338     * A pointer to the contents in the success state.
14339     * Reading from this pointer when `result_ok` is not set is undefined.
14340     */
14341    enum LDKPaymentFailureReason *result;
14342    /**
14343     * A pointer to the contents in the error state.
14344     * Reading from this pointer when `result_ok` is set is undefined.
14345     */
14346    struct LDKDecodeError *err;
14347 } LDKCResult_PaymentFailureReasonDecodeErrorZPtr;
14348
14349 /**
14350  * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
14351  * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
14352  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14353  */
14354 typedef struct LDKCResult_PaymentFailureReasonDecodeErrorZ {
14355    /**
14356     * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
14357     * `err` or `result` depending on the state of `result_ok`.
14358     */
14359    union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
14360    /**
14361     * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
14362     */
14363    bool result_ok;
14364 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
14365
14366 /**
14367  * An enum which can either contain a crate::c_types::U128 or not
14368  */
14369 typedef enum LDKCOption_U128Z_Tag {
14370    /**
14371     * When we're in this state, this COption_U128Z contains a crate::c_types::U128
14372     */
14373    LDKCOption_U128Z_Some,
14374    /**
14375     * When we're in this state, this COption_U128Z contains nothing
14376     */
14377    LDKCOption_U128Z_None,
14378    /**
14379     * Must be last for serialization purposes
14380     */
14381    LDKCOption_U128Z_Sentinel,
14382 } LDKCOption_U128Z_Tag;
14383
14384 typedef struct LDKCOption_U128Z {
14385    LDKCOption_U128Z_Tag tag;
14386    union {
14387       struct {
14388          struct LDKU128 some;
14389       };
14390    };
14391 } LDKCOption_U128Z;
14392
14393 /**
14394  * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
14395  * This corresponds to std::vector in C++
14396  */
14397 typedef struct LDKCVec_ClaimedHTLCZ {
14398    /**
14399     * The elements in the array.
14400     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14401     */
14402    struct LDKClaimedHTLC *data;
14403    /**
14404     * The number of elements pointed to by `data`.
14405     */
14406    uintptr_t datalen;
14407 } LDKCVec_ClaimedHTLCZ;
14408
14409 /**
14410  * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
14411  */
14412 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
14413    /**
14414     * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
14415     */
14416    LDKCOption_PaymentFailureReasonZ_Some,
14417    /**
14418     * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
14419     */
14420    LDKCOption_PaymentFailureReasonZ_None,
14421    /**
14422     * Must be last for serialization purposes
14423     */
14424    LDKCOption_PaymentFailureReasonZ_Sentinel,
14425 } LDKCOption_PaymentFailureReasonZ_Tag;
14426
14427 typedef struct LDKCOption_PaymentFailureReasonZ {
14428    LDKCOption_PaymentFailureReasonZ_Tag tag;
14429    union {
14430       struct {
14431          enum LDKPaymentFailureReason some;
14432       };
14433    };
14434 } LDKCOption_PaymentFailureReasonZ;
14435
14436
14437
14438 /**
14439  * A descriptor used to sign for a commitment transaction's anchor output.
14440  */
14441 typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
14442    /**
14443     * A pointer to the opaque Rust object.
14444     * Nearly everywhere, inner must be non-null, however in places where
14445     * the Rust equivalent takes an Option, it may be set to null to indicate None.
14446     */
14447    LDKnativeAnchorDescriptor *inner;
14448    /**
14449     * Indicates that this is the only struct which contains the same pointer.
14450     * Rust functions which take ownership of an object provided via an argument require
14451     * this to be true and invalidate the object pointed to by inner.
14452     */
14453    bool is_owned;
14454 } LDKAnchorDescriptor;
14455
14456 /**
14457  * Represents the different types of transactions, originating from LDK, to be bumped.
14458  */
14459 typedef enum LDKBumpTransactionEvent_Tag {
14460    /**
14461     * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
14462     * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
14463     * they may need additional fees to be attached through a child transaction using the popular
14464     * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
14465     * child transaction must include the anchor input described within `anchor_descriptor` along
14466     * with additional inputs to meet the target feerate. Failure to meet the target feerate
14467     * decreases the confirmation odds of the transaction package (which includes the commitment
14468     * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
14469     * is constructed, it must be fully signed for and broadcast by the consumer of the event
14470     * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
14471     * broadcast first, as the child anchor transaction depends on it.
14472     *
14473     * The consumer should be able to sign for any of the additional inputs included within the
14474     * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
14475     * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
14476     * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
14477     * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
14478     * full witness required to spend.
14479     *
14480     * It is possible to receive more than one instance of this event if a valid child anchor
14481     * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
14482     * be taken by the consumer of the event to ensure any future iterations of the child anchor
14483     * transaction adhere to the [Replace-By-Fee
14484     * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
14485     * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
14486     * these events is not user-controlled, users may ignore/drop the event if they are no longer
14487     * able to commit external confirmed funds to the child anchor transaction.
14488     *
14489     * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
14490     * determine whether a significant portion of the channel's funds are allocated to HTLCs,
14491     * enabling users to make their own decisions regarding the importance of the commitment
14492     * transaction's confirmation. Note that this is not required, but simply exists as an option
14493     * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
14494     * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
14495     * be not urgent.
14496     *
14497     * [`EcdsaChannelSigner`]: crate::sign::EcdsaChannelSigner
14498     * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::EcdsaChannelSigner::sign_holder_anchor_input
14499     * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
14500     */
14501    LDKBumpTransactionEvent_ChannelClose,
14502    /**
14503     * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
14504     * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
14505     * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
14506     * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
14507     * for a timely confirmation within the chain. These additional inputs and/or outputs must be
14508     * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
14509     * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
14510     * loss of funds. Once the transaction meets the target feerate, it must be signed for and
14511     * broadcast by the consumer of the event.
14512     *
14513     * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
14514     * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
14515     * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
14516     * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
14517     * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
14518     * to spend.
14519     *
14520     * It is possible to receive more than one instance of this event if a valid HTLC transaction
14521     * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
14522     * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
14523     * the [Replace-By-Fee
14524     * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
14525     * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
14526     * these events is not user-controlled, users may ignore/drop the event if either they are no
14527     * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
14528     * to the HTLC transaction is greater in value than the HTLCs being claimed.
14529     *
14530     * [`EcdsaChannelSigner`]: crate::sign::EcdsaChannelSigner
14531     * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::EcdsaChannelSigner::sign_holder_htlc_transaction
14532     * [`HTLCDescriptor::tx_input_witness`]: HTLCDescriptor::tx_input_witness
14533     */
14534    LDKBumpTransactionEvent_HTLCResolution,
14535    /**
14536     * Must be last for serialization purposes
14537     */
14538    LDKBumpTransactionEvent_Sentinel,
14539 } LDKBumpTransactionEvent_Tag;
14540
14541 typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
14542    /**
14543     * The unique identifier for the claim of the anchor output in the commitment transaction.
14544     *
14545     * The identifier must map to the set of external UTXOs assigned to the claim, such that
14546     * they can be reused when a new claim with the same identifier needs to be made, resulting
14547     * in a fee-bumping attempt.
14548     */
14549    struct LDKThirtyTwoBytes claim_id;
14550    /**
14551     * The target feerate that the transaction package, which consists of the commitment
14552     * transaction and the to-be-crafted child anchor transaction, must meet.
14553     */
14554    uint32_t package_target_feerate_sat_per_1000_weight;
14555    /**
14556     * The channel's commitment transaction to bump the fee of. This transaction should be
14557     * broadcast along with the anchor transaction constructed as a result of consuming this
14558     * event.
14559     */
14560    struct LDKTransaction commitment_tx;
14561    /**
14562     * The absolute fee in satoshis of the commitment transaction. This can be used along the
14563     * with weight of the commitment transaction to determine its feerate.
14564     */
14565    uint64_t commitment_tx_fee_satoshis;
14566    /**
14567     * The descriptor to sign the anchor input of the anchor transaction constructed as a
14568     * result of consuming this event.
14569     */
14570    struct LDKAnchorDescriptor anchor_descriptor;
14571    /**
14572     * The set of pending HTLCs on the commitment transaction that need to be resolved once the
14573     * commitment transaction confirms.
14574     */
14575    struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
14576 } LDKBumpTransactionEvent_LDKChannelClose_Body;
14577
14578 typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
14579    /**
14580     * The unique identifier for the claim of the HTLCs in the confirmed commitment
14581     * transaction.
14582     *
14583     * The identifier must map to the set of external UTXOs assigned to the claim, such that
14584     * they can be reused when a new claim with the same identifier needs to be made, resulting
14585     * in a fee-bumping attempt.
14586     */
14587    struct LDKThirtyTwoBytes claim_id;
14588    /**
14589     * The target feerate that the resulting HTLC transaction must meet.
14590     */
14591    uint32_t target_feerate_sat_per_1000_weight;
14592    /**
14593     * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
14594     * by the same transaction.
14595     */
14596    struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
14597    /**
14598     * The locktime required for the resulting HTLC transaction.
14599     */
14600    uint32_t tx_lock_time;
14601 } LDKBumpTransactionEvent_LDKHTLCResolution_Body;
14602
14603 typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
14604    LDKBumpTransactionEvent_Tag tag;
14605    union {
14606       LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
14607       LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
14608    };
14609 } LDKBumpTransactionEvent;
14610
14611 /**
14612  * An Event which you should probably take some action in response to.
14613  *
14614  * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
14615  * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
14616  * written as it makes no sense to respond to it after reconnecting to peers).
14617  */
14618 typedef enum LDKEvent_Tag {
14619    /**
14620     * Used to indicate that the client should generate a funding transaction with the given
14621     * parameters and then call [`ChannelManager::funding_transaction_generated`].
14622     * Generated in [`ChannelManager`] message handling.
14623     * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
14624     * counterparty can steal your funds!
14625     *
14626     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14627     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
14628     */
14629    LDKEvent_FundingGenerationReady,
14630    /**
14631     * Indicates that we've been offered a payment and it needs to be claimed via calling
14632     * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
14633     *
14634     * Note that if the preimage is not known, you should call
14635     * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
14636     * to free up resources for this HTLC and avoid network congestion.
14637     *
14638     * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
14639     * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
14640     * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
14641     * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
14642     * If you don't intend to check for custom TLVs, you can simply use
14643     * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
14644     *
14645     * If you fail to call [`ChannelManager::claim_funds`],
14646     * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
14647     * [`ChannelManager::fail_htlc_backwards`], or
14648     * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
14649     * be automatically failed.
14650     *
14651     * # Note
14652     * LDK will not stop an inbound payment from being paid multiple times, so multiple
14653     * `PaymentClaimable` events may be generated for the same payment. In such a case it is
14654     * polite (and required in the lightning specification) to fail the payment the second time
14655     * and give the sender their money back rather than accepting double payment.
14656     *
14657     * # Note
14658     * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
14659     *
14660     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14661     * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
14662     * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
14663     * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
14664     * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
14665     */
14666    LDKEvent_PaymentClaimable,
14667    /**
14668     * Indicates a payment has been claimed and we've received money!
14669     *
14670     * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
14671     * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
14672     * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
14673     * [`Event::PaymentClaimable`] event.
14674     *
14675     * # Note
14676     * LDK will not stop an inbound payment from being paid multiple times, so multiple
14677     * `PaymentClaimable` events may be generated for the same payment. If you then call
14678     * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
14679     * multiple `PaymentClaimed` events.
14680     *
14681     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14682     */
14683    LDKEvent_PaymentClaimed,
14684    /**
14685     * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
14686     * and we got back the payment preimage for it).
14687     *
14688     * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
14689     * event. In this situation, you SHOULD treat this payment as having succeeded.
14690     */
14691    LDKEvent_PaymentSent,
14692    /**
14693     * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
14694     * provide failure information for each path attempt in the payment, including retries.
14695     *
14696     * This event is provided once there are no further pending HTLCs for the payment and the
14697     * payment is no longer retryable, due either to the [`Retry`] provided or
14698     * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
14699     *
14700     * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
14701     * a payment after an [`Event::PaymentSent`] event for this same payment has already been
14702     * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
14703     * and the payment MUST be treated as having succeeded.
14704     *
14705     * [`Retry`]: crate::ln::channelmanager::Retry
14706     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14707     */
14708    LDKEvent_PaymentFailed,
14709    /**
14710     * Indicates that a path for an outbound payment was successful.
14711     *
14712     * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
14713     * [`Event::PaymentSent`] for obtaining the payment preimage.
14714     */
14715    LDKEvent_PaymentPathSuccessful,
14716    /**
14717     * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
14718     * handle the HTLC.
14719     *
14720     * Note that this does *not* indicate that all paths for an MPP payment have failed, see
14721     * [`Event::PaymentFailed`].
14722     *
14723     * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
14724     * been exhausted.
14725     *
14726     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14727     */
14728    LDKEvent_PaymentPathFailed,
14729    /**
14730     * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
14731     */
14732    LDKEvent_ProbeSuccessful,
14733    /**
14734     * Indicates that a probe payment we sent failed at an intermediary node on the path.
14735     */
14736    LDKEvent_ProbeFailed,
14737    /**
14738     * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
14739     * a time in the future.
14740     *
14741     * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
14742     */
14743    LDKEvent_PendingHTLCsForwardable,
14744    /**
14745     * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
14746     * you've encoded an intercept scid in the receiver's invoice route hints using
14747     * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
14748     *
14749     * [`ChannelManager::forward_intercepted_htlc`] or
14750     * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
14751     * their docs for more information.
14752     *
14753     * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
14754     * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
14755     * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
14756     * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
14757     */
14758    LDKEvent_HTLCIntercepted,
14759    /**
14760     * Used to indicate that an output which you should know how to spend was confirmed on chain
14761     * and is now spendable.
14762     * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
14763     * counterparty spending them due to some kind of timeout. Thus, you need to store them
14764     * somewhere and spend them when you create on-chain transactions.
14765     */
14766    LDKEvent_SpendableOutputs,
14767    /**
14768     * This event is generated when a payment has been successfully forwarded through us and a
14769     * forwarding fee earned.
14770     */
14771    LDKEvent_PaymentForwarded,
14772    /**
14773     * Used to indicate that a channel with the given `channel_id` is being opened and pending
14774     * confirmation on-chain.
14775     *
14776     * This event is emitted when the funding transaction has been signed and is broadcast to the
14777     * network. For 0conf channels it will be immediately followed by the corresponding
14778     * [`Event::ChannelReady`] event.
14779     */
14780    LDKEvent_ChannelPending,
14781    /**
14782     * Used to indicate that a channel with the given `channel_id` is ready to
14783     * be used. This event is emitted either when the funding transaction has been confirmed
14784     * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
14785     * establishment.
14786     */
14787    LDKEvent_ChannelReady,
14788    /**
14789     * Used to indicate that a previously opened channel with the given `channel_id` is in the
14790     * process of closure.
14791     *
14792     * Note that this event is only triggered for accepted channels: if the
14793     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
14794     * rejected, no `ChannelClosed` event will be sent.
14795     *
14796     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
14797     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
14798     */
14799    LDKEvent_ChannelClosed,
14800    /**
14801     * Used to indicate to the user that they can abandon the funding transaction and recycle the
14802     * inputs for another purpose.
14803     *
14804     * This event is not guaranteed to be generated for channels that are closed due to a restart.
14805     */
14806    LDKEvent_DiscardFunding,
14807    /**
14808     * Indicates a request to open a new channel by a peer.
14809     *
14810     * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
14811     * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
14812     * event will _not_ be triggered if the channel is rejected.
14813     *
14814     * The event is only triggered when a new open channel request is received and the
14815     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
14816     *
14817     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
14818     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
14819     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
14820     */
14821    LDKEvent_OpenChannelRequest,
14822    /**
14823     * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
14824     * forward it.
14825     *
14826     * Some scenarios where this event may be sent include:
14827     * * Insufficient capacity in the outbound channel
14828     * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
14829     * * When an unknown SCID is requested for forwarding a payment.
14830     * * Expected MPP amount has already been reached
14831     * * The HTLC has timed out
14832     *
14833     * This event, however, does not get generated if an HTLC fails to meet the forwarding
14834     * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
14835     */
14836    LDKEvent_HTLCHandlingFailed,
14837    /**
14838     * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
14839     * requires confirmed external funds to be readily available to spend.
14840     *
14841     * LDK does not currently generate this event unless the
14842     * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
14843     * It is limited to the scope of channels with anchor outputs.
14844     *
14845     * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
14846     */
14847    LDKEvent_BumpTransaction,
14848    /**
14849     * Must be last for serialization purposes
14850     */
14851    LDKEvent_Sentinel,
14852 } LDKEvent_Tag;
14853
14854 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
14855    /**
14856     * The random channel_id we picked which you'll need to pass into
14857     * [`ChannelManager::funding_transaction_generated`].
14858     *
14859     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
14860     */
14861    struct LDKThirtyTwoBytes temporary_channel_id;
14862    /**
14863     * The counterparty's node_id, which you'll need to pass back into
14864     * [`ChannelManager::funding_transaction_generated`].
14865     *
14866     * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
14867     */
14868    struct LDKPublicKey counterparty_node_id;
14869    /**
14870     * The value, in satoshis, that the output should have.
14871     */
14872    uint64_t channel_value_satoshis;
14873    /**
14874     * The script which should be used in the transaction output.
14875     */
14876    struct LDKCVec_u8Z output_script;
14877    /**
14878     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
14879     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
14880     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
14881     * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
14882     * serialized with LDK versions prior to 0.0.113.
14883     *
14884     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
14885     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
14886     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
14887     */
14888    struct LDKU128 user_channel_id;
14889 } LDKEvent_LDKFundingGenerationReady_Body;
14890
14891 typedef struct LDKEvent_LDKPaymentClaimable_Body {
14892    /**
14893     * The node that will receive the payment after it has been claimed.
14894     * This is useful to identify payments received via [phantom nodes].
14895     * This field will always be filled in when the event was generated by LDK versions
14896     * 0.0.113 and above.
14897     *
14898     * [phantom nodes]: crate::sign::PhantomKeysManager
14899     *
14900     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14901     */
14902    struct LDKPublicKey receiver_node_id;
14903    /**
14904     * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
14905     * not stop you from registering duplicate payment hashes for inbound payments.
14906     */
14907    struct LDKThirtyTwoBytes payment_hash;
14908    /**
14909     * The fields in the onion which were received with each HTLC. Only fields which were
14910     * identical in each HTLC involved in the payment will be included here.
14911     *
14912     * Payments received on LDK versions prior to 0.0.115 will have this field unset.
14913     *
14914     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14915     */
14916    struct LDKRecipientOnionFields onion_fields;
14917    /**
14918     * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
14919     * than the invoice amount.
14920     *
14921     * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
14922     * and the previous hop took an extra fee.
14923     *
14924     * # Note
14925     * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
14926     * field, you may lose money!
14927     *
14928     * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
14929     */
14930    uint64_t amount_msat;
14931    /**
14932     * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
14933     * taken by our channel counterparty.
14934     *
14935     * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
14936     *
14937     * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
14938     */
14939    uint64_t counterparty_skimmed_fee_msat;
14940    /**
14941     * Information for claiming this received payment, based on whether the purpose of the
14942     * payment is to pay an invoice or to send a spontaneous payment.
14943     */
14944    struct LDKPaymentPurpose purpose;
14945    /**
14946     * The `channel_id` indicating over which channel we received the payment.
14947     */
14948    struct LDKCOption_ThirtyTwoBytesZ via_channel_id;
14949    /**
14950     * The `user_channel_id` indicating over which channel we received the payment.
14951     */
14952    struct LDKCOption_U128Z via_user_channel_id;
14953    /**
14954     * The block height at which this payment will be failed back and will no longer be
14955     * eligible for claiming.
14956     *
14957     * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
14958     * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
14959     *
14960     * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14961     */
14962    struct LDKCOption_u32Z claim_deadline;
14963 } LDKEvent_LDKPaymentClaimable_Body;
14964
14965 typedef struct LDKEvent_LDKPaymentClaimed_Body {
14966    /**
14967     * The node that received the payment.
14968     * This is useful to identify payments which were received via [phantom nodes].
14969     * This field will always be filled in when the event was generated by LDK versions
14970     * 0.0.113 and above.
14971     *
14972     * [phantom nodes]: crate::sign::PhantomKeysManager
14973     *
14974     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14975     */
14976    struct LDKPublicKey receiver_node_id;
14977    /**
14978     * The payment hash of the claimed payment. Note that LDK will not stop you from
14979     * registering duplicate payment hashes for inbound payments.
14980     */
14981    struct LDKThirtyTwoBytes payment_hash;
14982    /**
14983     * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
14984     * invoice amount.
14985     */
14986    uint64_t amount_msat;
14987    /**
14988     * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
14989     * spontaneous payment.
14990     */
14991    struct LDKPaymentPurpose purpose;
14992    /**
14993     * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
14994     * to LDK version 0.0.117.
14995     */
14996    struct LDKCVec_ClaimedHTLCZ htlcs;
14997    /**
14998     * The sender-intended sum total of all the MPP parts. This will be `None` for events
14999     * serialized prior to LDK version 0.0.117.
15000     */
15001    struct LDKCOption_u64Z sender_intended_total_msat;
15002 } LDKEvent_LDKPaymentClaimed_Body;
15003
15004 typedef struct LDKEvent_LDKPaymentSent_Body {
15005    /**
15006     * The `payment_id` passed to [`ChannelManager::send_payment`].
15007     *
15008     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15009     */
15010    struct LDKCOption_ThirtyTwoBytesZ payment_id;
15011    /**
15012     * The preimage to the hash given to ChannelManager::send_payment.
15013     * Note that this serves as a payment receipt, if you wish to have such a thing, you must
15014     * store it somehow!
15015     */
15016    struct LDKThirtyTwoBytes payment_preimage;
15017    /**
15018     * The hash that was given to [`ChannelManager::send_payment`].
15019     *
15020     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15021     */
15022    struct LDKThirtyTwoBytes payment_hash;
15023    /**
15024     * The total fee which was spent at intermediate hops in this payment, across all paths.
15025     *
15026     * Note that, like [`Route::get_total_fees`] this does *not* include any potential
15027     * overpayment to the recipient node.
15028     *
15029     * If the recipient or an intermediate node misbehaves and gives us free money, this may
15030     * overstate the amount paid, though this is unlikely.
15031     *
15032     * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
15033     */
15034    struct LDKCOption_u64Z fee_paid_msat;
15035 } LDKEvent_LDKPaymentSent_Body;
15036
15037 typedef struct LDKEvent_LDKPaymentFailed_Body {
15038    /**
15039     * The `payment_id` passed to [`ChannelManager::send_payment`].
15040     *
15041     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15042     */
15043    struct LDKThirtyTwoBytes payment_id;
15044    /**
15045     * The hash that was given to [`ChannelManager::send_payment`].
15046     *
15047     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15048     */
15049    struct LDKThirtyTwoBytes payment_hash;
15050    /**
15051     * The reason the payment failed. This is only `None` for events generated or serialized
15052     * by versions prior to 0.0.115.
15053     */
15054    struct LDKCOption_PaymentFailureReasonZ reason;
15055 } LDKEvent_LDKPaymentFailed_Body;
15056
15057 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
15058    /**
15059     * The `payment_id` passed to [`ChannelManager::send_payment`].
15060     *
15061     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15062     */
15063    struct LDKThirtyTwoBytes payment_id;
15064    /**
15065     * The hash that was given to [`ChannelManager::send_payment`].
15066     *
15067     * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
15068     *
15069     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15070     */
15071    struct LDKCOption_ThirtyTwoBytesZ payment_hash;
15072    /**
15073     * The payment path that was successful.
15074     *
15075     * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
15076     */
15077    struct LDKPath path;
15078 } LDKEvent_LDKPaymentPathSuccessful_Body;
15079
15080 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
15081    /**
15082     * The `payment_id` passed to [`ChannelManager::send_payment`].
15083     *
15084     * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
15085     *
15086     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15087     * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
15088     */
15089    struct LDKCOption_ThirtyTwoBytesZ payment_id;
15090    /**
15091     * The hash that was given to [`ChannelManager::send_payment`].
15092     *
15093     * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
15094     */
15095    struct LDKThirtyTwoBytes payment_hash;
15096    /**
15097     * Indicates the payment was rejected for some reason by the recipient. This implies that
15098     * the payment has failed, not just the route in question. If this is not set, the payment may
15099     * be retried via a different route.
15100     */
15101    bool payment_failed_permanently;
15102    /**
15103     * Extra error details based on the failure type. May contain an update that needs to be
15104     * applied to the [`NetworkGraph`].
15105     *
15106     * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
15107     */
15108    struct LDKPathFailure failure;
15109    /**
15110     * The payment path that failed.
15111     */
15112    struct LDKPath path;
15113    /**
15114     * The channel responsible for the failed payment path.
15115     *
15116     * Note that for route hints or for the first hop in a path this may be an SCID alias and
15117     * may not refer to a channel in the public network graph. These aliases may also collide
15118     * with channels in the public network graph.
15119     *
15120     * If this is `Some`, then the corresponding channel should be avoided when the payment is
15121     * retried. May be `None` for older [`Event`] serializations.
15122     */
15123    struct LDKCOption_u64Z short_channel_id;
15124 } LDKEvent_LDKPaymentPathFailed_Body;
15125
15126 typedef struct LDKEvent_LDKProbeSuccessful_Body {
15127    /**
15128     * The id returned by [`ChannelManager::send_probe`].
15129     *
15130     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15131     */
15132    struct LDKThirtyTwoBytes payment_id;
15133    /**
15134     * The hash generated by [`ChannelManager::send_probe`].
15135     *
15136     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15137     */
15138    struct LDKThirtyTwoBytes payment_hash;
15139    /**
15140     * The payment path that was successful.
15141     */
15142    struct LDKPath path;
15143 } LDKEvent_LDKProbeSuccessful_Body;
15144
15145 typedef struct LDKEvent_LDKProbeFailed_Body {
15146    /**
15147     * The id returned by [`ChannelManager::send_probe`].
15148     *
15149     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15150     */
15151    struct LDKThirtyTwoBytes payment_id;
15152    /**
15153     * The hash generated by [`ChannelManager::send_probe`].
15154     *
15155     * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
15156     */
15157    struct LDKThirtyTwoBytes payment_hash;
15158    /**
15159     * The payment path that failed.
15160     */
15161    struct LDKPath path;
15162    /**
15163     * The channel responsible for the failed probe.
15164     *
15165     * Note that for route hints or for the first hop in a path this may be an SCID alias and
15166     * may not refer to a channel in the public network graph. These aliases may also collide
15167     * with channels in the public network graph.
15168     */
15169    struct LDKCOption_u64Z short_channel_id;
15170 } LDKEvent_LDKProbeFailed_Body;
15171
15172 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
15173    /**
15174     * The minimum amount of time that should be waited prior to calling
15175     * process_pending_htlc_forwards. To increase the effort required to correlate payments,
15176     * you should wait a random amount of time in roughly the range (now + time_forwardable,
15177     * now + 5*time_forwardable).
15178     */
15179    uint64_t time_forwardable;
15180 } LDKEvent_LDKPendingHTLCsForwardable_Body;
15181
15182 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
15183    /**
15184     * An id to help LDK identify which HTLC is being forwarded or failed.
15185     */
15186    struct LDKThirtyTwoBytes intercept_id;
15187    /**
15188     * The fake scid that was programmed as the next hop's scid, generated using
15189     * [`ChannelManager::get_intercept_scid`].
15190     *
15191     * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
15192     */
15193    uint64_t requested_next_hop_scid;
15194    /**
15195     * The payment hash used for this HTLC.
15196     */
15197    struct LDKThirtyTwoBytes payment_hash;
15198    /**
15199     * How many msats were received on the inbound edge of this HTLC.
15200     */
15201    uint64_t inbound_amount_msat;
15202    /**
15203     * How many msats the payer intended to route to the next node. Depending on the reason you are
15204     * intercepting this payment, you might take a fee by forwarding less than this amount.
15205     * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
15206     *
15207     * Note that LDK will NOT check that expected fees were factored into this value. You MUST
15208     * check that whatever fee you want has been included here or subtract it as required. Further,
15209     * LDK will not stop you from forwarding more than you received.
15210     */
15211    uint64_t expected_outbound_amount_msat;
15212 } LDKEvent_LDKHTLCIntercepted_Body;
15213
15214 typedef struct LDKEvent_LDKSpendableOutputs_Body {
15215    /**
15216     * The outputs which you should store as spendable by you.
15217     */
15218    struct LDKCVec_SpendableOutputDescriptorZ outputs;
15219    /**
15220     * The `channel_id` indicating which channel the spendable outputs belong to.
15221     *
15222     * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
15223     */
15224    struct LDKCOption_ThirtyTwoBytesZ channel_id;
15225 } LDKEvent_LDKSpendableOutputs_Body;
15226
15227 typedef struct LDKEvent_LDKPaymentForwarded_Body {
15228    /**
15229     * The incoming channel between the previous node and us. This is only `None` for events
15230     * generated or serialized by versions prior to 0.0.107.
15231     */
15232    struct LDKCOption_ThirtyTwoBytesZ prev_channel_id;
15233    /**
15234     * The outgoing channel between the next node and us. This is only `None` for events
15235     * generated or serialized by versions prior to 0.0.107.
15236     */
15237    struct LDKCOption_ThirtyTwoBytesZ next_channel_id;
15238    /**
15239     * The fee, in milli-satoshis, which was earned as a result of the payment.
15240     *
15241     * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
15242     * was pending, the amount the next hop claimed will have been rounded down to the nearest
15243     * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
15244     * claimed the full value in millisatoshis from the source. In this case,
15245     * `claim_from_onchain_tx` will be set.
15246     *
15247     * If the channel which sent us the payment has been force-closed, we will claim the funds
15248     * via an on-chain transaction. In that case we do not yet know the on-chain transaction
15249     * fees which we will spend and will instead set this to `None`. It is possible duplicate
15250     * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
15251     * `None`.
15252     */
15253    struct LDKCOption_u64Z fee_earned_msat;
15254    /**
15255     * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
15256     * transaction.
15257     */
15258    bool claim_from_onchain_tx;
15259    /**
15260     * The final amount forwarded, in milli-satoshis, after the fee is deducted.
15261     *
15262     * The caveat described above the `fee_earned_msat` field applies here as well.
15263     */
15264    struct LDKCOption_u64Z outbound_amount_forwarded_msat;
15265 } LDKEvent_LDKPaymentForwarded_Body;
15266
15267 typedef struct LDKEvent_LDKChannelPending_Body {
15268    /**
15269     * The `channel_id` of the channel that is pending confirmation.
15270     */
15271    struct LDKThirtyTwoBytes channel_id;
15272    /**
15273     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15274     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15275     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15276     * `user_channel_id` will be randomized for an inbound channel.
15277     *
15278     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15279     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15280     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15281     */
15282    struct LDKU128 user_channel_id;
15283    /**
15284     * The `temporary_channel_id` this channel used to be known by during channel establishment.
15285     *
15286     * Will be `None` for channels created prior to LDK version 0.0.115.
15287     */
15288    struct LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id;
15289    /**
15290     * The `node_id` of the channel counterparty.
15291     */
15292    struct LDKPublicKey counterparty_node_id;
15293    /**
15294     * The outpoint of the channel's funding transaction.
15295     */
15296    struct LDKOutPoint funding_txo;
15297 } LDKEvent_LDKChannelPending_Body;
15298
15299 typedef struct LDKEvent_LDKChannelReady_Body {
15300    /**
15301     * The `channel_id` of the channel that is ready.
15302     */
15303    struct LDKThirtyTwoBytes channel_id;
15304    /**
15305     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15306     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15307     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15308     * `user_channel_id` will be randomized for an inbound channel.
15309     *
15310     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15311     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15312     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15313     */
15314    struct LDKU128 user_channel_id;
15315    /**
15316     * The `node_id` of the channel counterparty.
15317     */
15318    struct LDKPublicKey counterparty_node_id;
15319    /**
15320     * The features that this channel will operate with.
15321     */
15322    struct LDKChannelTypeFeatures channel_type;
15323 } LDKEvent_LDKChannelReady_Body;
15324
15325 typedef struct LDKEvent_LDKChannelClosed_Body {
15326    /**
15327     * The `channel_id` of the channel which has been closed. Note that on-chain transactions
15328     * resolving the channel are likely still awaiting confirmation.
15329     */
15330    struct LDKThirtyTwoBytes channel_id;
15331    /**
15332     * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
15333     * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
15334     * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
15335     * `user_channel_id` will be randomized for inbound channels.
15336     * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
15337     * zero for objects serialized with LDK versions prior to 0.0.102.
15338     *
15339     * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
15340     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15341     * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
15342     */
15343    struct LDKU128 user_channel_id;
15344    /**
15345     * The reason the channel was closed.
15346     */
15347    struct LDKClosureReason reason;
15348    /**
15349     * Counterparty in the closed channel.
15350     *
15351     * This field will be `None` for objects serialized prior to LDK 0.0.117.
15352     *
15353     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
15354     */
15355    struct LDKPublicKey counterparty_node_id;
15356    /**
15357     * Channel capacity of the closing channel (sats).
15358     *
15359     * This field will be `None` for objects serialized prior to LDK 0.0.117.
15360     */
15361    struct LDKCOption_u64Z channel_capacity_sats;
15362 } LDKEvent_LDKChannelClosed_Body;
15363
15364 typedef struct LDKEvent_LDKDiscardFunding_Body {
15365    /**
15366     * The channel_id of the channel which has been closed.
15367     */
15368    struct LDKThirtyTwoBytes channel_id;
15369    /**
15370     * The full transaction received from the user
15371     */
15372    struct LDKTransaction transaction;
15373 } LDKEvent_LDKDiscardFunding_Body;
15374
15375 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
15376    /**
15377     * The temporary channel ID of the channel requested to be opened.
15378     *
15379     * When responding to the request, the `temporary_channel_id` should be passed
15380     * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
15381     * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
15382     *
15383     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15384     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
15385     */
15386    struct LDKThirtyTwoBytes temporary_channel_id;
15387    /**
15388     * The node_id of the counterparty requesting to open the channel.
15389     *
15390     * When responding to the request, the `counterparty_node_id` should be passed
15391     * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
15392     * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
15393     * request.
15394     *
15395     * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
15396     * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
15397     */
15398    struct LDKPublicKey counterparty_node_id;
15399    /**
15400     * The channel value of the requested channel.
15401     */
15402    uint64_t funding_satoshis;
15403    /**
15404     * Our starting balance in the channel if the request is accepted, in milli-satoshi.
15405     */
15406    uint64_t push_msat;
15407    /**
15408     * The features that this channel will operate with. If you reject the channel, a
15409     * well-behaved counterparty may automatically re-attempt the channel with a new set of
15410     * feature flags.
15411     *
15412     * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
15413     * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
15414     * 0.0.106.
15415     *
15416     * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
15417     * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
15418     * 0.0.107. Channels setting this type also need to get manually accepted via
15419     * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
15420     * or will be rejected otherwise.
15421     *
15422     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
15423     */
15424    struct LDKChannelTypeFeatures channel_type;
15425 } LDKEvent_LDKOpenChannelRequest_Body;
15426
15427 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
15428    /**
15429     * The channel over which the HTLC was received.
15430     */
15431    struct LDKThirtyTwoBytes prev_channel_id;
15432    /**
15433     * Destination of the HTLC that failed to be processed.
15434     */
15435    struct LDKHTLCDestination failed_next_destination;
15436 } LDKEvent_LDKHTLCHandlingFailed_Body;
15437
15438 typedef struct MUST_USE_STRUCT LDKEvent {
15439    LDKEvent_Tag tag;
15440    union {
15441       LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
15442       LDKEvent_LDKPaymentClaimable_Body payment_claimable;
15443       LDKEvent_LDKPaymentClaimed_Body payment_claimed;
15444       LDKEvent_LDKPaymentSent_Body payment_sent;
15445       LDKEvent_LDKPaymentFailed_Body payment_failed;
15446       LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
15447       LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
15448       LDKEvent_LDKProbeSuccessful_Body probe_successful;
15449       LDKEvent_LDKProbeFailed_Body probe_failed;
15450       LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
15451       LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
15452       LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
15453       LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
15454       LDKEvent_LDKChannelPending_Body channel_pending;
15455       LDKEvent_LDKChannelReady_Body channel_ready;
15456       LDKEvent_LDKChannelClosed_Body channel_closed;
15457       LDKEvent_LDKDiscardFunding_Body discard_funding;
15458       LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
15459       LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
15460       struct {
15461          struct LDKBumpTransactionEvent bump_transaction;
15462       };
15463    };
15464 } LDKEvent;
15465
15466 /**
15467  * An enum which can either contain a crate::lightning::events::Event or not
15468  */
15469 typedef enum LDKCOption_EventZ_Tag {
15470    /**
15471     * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
15472     */
15473    LDKCOption_EventZ_Some,
15474    /**
15475     * When we're in this state, this COption_EventZ contains nothing
15476     */
15477    LDKCOption_EventZ_None,
15478    /**
15479     * Must be last for serialization purposes
15480     */
15481    LDKCOption_EventZ_Sentinel,
15482 } LDKCOption_EventZ_Tag;
15483
15484 typedef struct LDKCOption_EventZ {
15485    LDKCOption_EventZ_Tag tag;
15486    union {
15487       struct {
15488          struct LDKEvent some;
15489       };
15490    };
15491 } LDKCOption_EventZ;
15492
15493 /**
15494  * The contents of CResult_COption_EventZDecodeErrorZ
15495  */
15496 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
15497    /**
15498     * A pointer to the contents in the success state.
15499     * Reading from this pointer when `result_ok` is not set is undefined.
15500     */
15501    struct LDKCOption_EventZ *result;
15502    /**
15503     * A pointer to the contents in the error state.
15504     * Reading from this pointer when `result_ok` is set is undefined.
15505     */
15506    struct LDKDecodeError *err;
15507 } LDKCResult_COption_EventZDecodeErrorZPtr;
15508
15509 /**
15510  * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
15511  * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
15512  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15513  */
15514 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
15515    /**
15516     * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
15517     * `err` or `result` depending on the state of `result_ok`.
15518     */
15519    union LDKCResult_COption_EventZDecodeErrorZPtr contents;
15520    /**
15521     * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
15522     */
15523    bool result_ok;
15524 } LDKCResult_COption_EventZDecodeErrorZ;
15525
15526 /**
15527  * Sub-errors which don't have specific information in them use this type.
15528  */
15529 typedef struct LDKError {
15530    /**
15531     * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
15532     */
15533    uint8_t _dummy;
15534 } LDKError;
15535
15536 /**
15537  * Errors that indicate what is wrong with the invoice. They have some granularity for debug
15538  * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
15539  */
15540 typedef enum LDKBolt11ParseError_Tag {
15541    LDKBolt11ParseError_Bech32Error,
15542    LDKBolt11ParseError_ParseAmountError,
15543    LDKBolt11ParseError_MalformedSignature,
15544    LDKBolt11ParseError_BadPrefix,
15545    LDKBolt11ParseError_UnknownCurrency,
15546    LDKBolt11ParseError_UnknownSiPrefix,
15547    LDKBolt11ParseError_MalformedHRP,
15548    LDKBolt11ParseError_TooShortDataPart,
15549    LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
15550    LDKBolt11ParseError_DescriptionDecodeError,
15551    LDKBolt11ParseError_PaddingError,
15552    LDKBolt11ParseError_IntegerOverflowError,
15553    LDKBolt11ParseError_InvalidSegWitProgramLength,
15554    LDKBolt11ParseError_InvalidPubKeyHashLength,
15555    LDKBolt11ParseError_InvalidScriptHashLength,
15556    LDKBolt11ParseError_InvalidRecoveryId,
15557    LDKBolt11ParseError_InvalidSliceLength,
15558    /**
15559     * Not an error, but used internally to signal that a part of the invoice should be ignored
15560     * according to BOLT11
15561     */
15562    LDKBolt11ParseError_Skip,
15563    /**
15564     * Must be last for serialization purposes
15565     */
15566    LDKBolt11ParseError_Sentinel,
15567 } LDKBolt11ParseError_Tag;
15568
15569 typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
15570    LDKBolt11ParseError_Tag tag;
15571    union {
15572       struct {
15573          struct LDKBech32Error bech32_error;
15574       };
15575       struct {
15576          struct LDKError parse_amount_error;
15577       };
15578       struct {
15579          enum LDKSecp256k1Error malformed_signature;
15580       };
15581       struct {
15582          struct LDKError description_decode_error;
15583       };
15584       struct {
15585          struct LDKStr invalid_slice_length;
15586       };
15587    };
15588 } LDKBolt11ParseError;
15589
15590 /**
15591  * The contents of CResult_SiPrefixBolt11ParseErrorZ
15592  */
15593 typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
15594    /**
15595     * A pointer to the contents in the success state.
15596     * Reading from this pointer when `result_ok` is not set is undefined.
15597     */
15598    enum LDKSiPrefix *result;
15599    /**
15600     * A pointer to the contents in the error state.
15601     * Reading from this pointer when `result_ok` is set is undefined.
15602     */
15603    struct LDKBolt11ParseError *err;
15604 } LDKCResult_SiPrefixBolt11ParseErrorZPtr;
15605
15606 /**
15607  * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
15608  * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
15609  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15610  */
15611 typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
15612    /**
15613     * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
15614     * `err` or `result` depending on the state of `result_ok`.
15615     */
15616    union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
15617    /**
15618     * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
15619     */
15620    bool result_ok;
15621 } LDKCResult_SiPrefixBolt11ParseErrorZ;
15622
15623 /**
15624  * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
15625  * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
15626  * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
15627  */
15628 typedef enum LDKParseOrSemanticError_Tag {
15629    /**
15630     * The invoice couldn't be decoded
15631     */
15632    LDKParseOrSemanticError_ParseError,
15633    /**
15634     * The invoice could be decoded but violates the BOLT11 standard
15635     */
15636    LDKParseOrSemanticError_SemanticError,
15637    /**
15638     * Must be last for serialization purposes
15639     */
15640    LDKParseOrSemanticError_Sentinel,
15641 } LDKParseOrSemanticError_Tag;
15642
15643 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
15644    LDKParseOrSemanticError_Tag tag;
15645    union {
15646       struct {
15647          struct LDKBolt11ParseError parse_error;
15648       };
15649       struct {
15650          enum LDKBolt11SemanticError semantic_error;
15651       };
15652    };
15653 } LDKParseOrSemanticError;
15654
15655 /**
15656  * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
15657  */
15658 typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
15659    /**
15660     * A pointer to the contents in the success state.
15661     * Reading from this pointer when `result_ok` is not set is undefined.
15662     */
15663    struct LDKBolt11Invoice *result;
15664    /**
15665     * A pointer to the contents in the error state.
15666     * Reading from this pointer when `result_ok` is set is undefined.
15667     */
15668    struct LDKParseOrSemanticError *err;
15669 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
15670
15671 /**
15672  * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
15673  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
15674  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15675  */
15676 typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
15677    /**
15678     * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
15679     * `err` or `result` depending on the state of `result_ok`.
15680     */
15681    union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
15682    /**
15683     * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
15684     */
15685    bool result_ok;
15686 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
15687
15688
15689
15690 /**
15691  * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
15692  * invalid.
15693  *
15694  * # Invariants
15695  * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
15696  */
15697 typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
15698    /**
15699     * A pointer to the opaque Rust object.
15700     * Nearly everywhere, inner must be non-null, however in places where
15701     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15702     */
15703    LDKnativeSignedRawBolt11Invoice *inner;
15704    /**
15705     * Indicates that this is the only struct which contains the same pointer.
15706     * Rust functions which take ownership of an object provided via an argument require
15707     * this to be true and invalidate the object pointed to by inner.
15708     */
15709    bool is_owned;
15710 } LDKSignedRawBolt11Invoice;
15711
15712 /**
15713  * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
15714  */
15715 typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
15716    /**
15717     * A pointer to the contents in the success state.
15718     * Reading from this pointer when `result_ok` is not set is undefined.
15719     */
15720    struct LDKSignedRawBolt11Invoice *result;
15721    /**
15722     * A pointer to the contents in the error state.
15723     * Reading from this pointer when `result_ok` is set is undefined.
15724     */
15725    struct LDKBolt11ParseError *err;
15726 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
15727
15728 /**
15729  * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
15730  * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
15731  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15732  */
15733 typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
15734    /**
15735     * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
15736     * `err` or `result` depending on the state of `result_ok`.
15737     */
15738    union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
15739    /**
15740     * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
15741     */
15742    bool result_ok;
15743 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
15744
15745
15746
15747 /**
15748  * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
15749  * but without the signature information.
15750  * Decoding and encoding should not lead to information loss but may lead to different hashes.
15751  *
15752  * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
15753  */
15754 typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
15755    /**
15756     * A pointer to the opaque Rust object.
15757     * Nearly everywhere, inner must be non-null, however in places where
15758     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15759     */
15760    LDKnativeRawBolt11Invoice *inner;
15761    /**
15762     * Indicates that this is the only struct which contains the same pointer.
15763     * Rust functions which take ownership of an object provided via an argument require
15764     * this to be true and invalidate the object pointed to by inner.
15765     */
15766    bool is_owned;
15767 } LDKRawBolt11Invoice;
15768
15769
15770
15771 /**
15772  * Recoverable signature
15773  */
15774 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
15775    /**
15776     * A pointer to the opaque Rust object.
15777     * Nearly everywhere, inner must be non-null, however in places where
15778     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15779     */
15780    LDKnativeBolt11InvoiceSignature *inner;
15781    /**
15782     * Indicates that this is the only struct which contains the same pointer.
15783     * Rust functions which take ownership of an object provided via an argument require
15784     * this to be true and invalidate the object pointed to by inner.
15785     */
15786    bool is_owned;
15787 } LDKBolt11InvoiceSignature;
15788
15789 /**
15790  * A tuple of 3 elements. See the individual fields for the types contained.
15791  */
15792 typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
15793    /**
15794     * The element at position 0
15795     */
15796    struct LDKRawBolt11Invoice a;
15797    /**
15798     * The element at position 1
15799     */
15800    struct LDKThirtyTwoBytes b;
15801    /**
15802     * The element at position 2
15803     */
15804    struct LDKBolt11InvoiceSignature c;
15805 } LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
15806
15807
15808
15809 /**
15810  * Payee public key
15811  */
15812 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
15813    /**
15814     * A pointer to the opaque Rust object.
15815     * Nearly everywhere, inner must be non-null, however in places where
15816     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15817     */
15818    LDKnativePayeePubKey *inner;
15819    /**
15820     * Indicates that this is the only struct which contains the same pointer.
15821     * Rust functions which take ownership of an object provided via an argument require
15822     * this to be true and invalidate the object pointed to by inner.
15823     */
15824    bool is_owned;
15825 } LDKPayeePubKey;
15826
15827 /**
15828  * The contents of CResult_PayeePubKeySecp256k1ErrorZ
15829  */
15830 typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
15831    /**
15832     * A pointer to the contents in the success state.
15833     * Reading from this pointer when `result_ok` is not set is undefined.
15834     */
15835    struct LDKPayeePubKey *result;
15836    /**
15837     * A pointer to the contents in the error state.
15838     * Reading from this pointer when `result_ok` is set is undefined.
15839     */
15840    enum LDKSecp256k1Error *err;
15841 } LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
15842
15843 /**
15844  * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
15845  * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
15846  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15847  */
15848 typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
15849    /**
15850     * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
15851     * `err` or `result` depending on the state of `result_ok`.
15852     */
15853    union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
15854    /**
15855     * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
15856     */
15857    bool result_ok;
15858 } LDKCResult_PayeePubKeySecp256k1ErrorZ;
15859
15860
15861
15862 /**
15863  * Private routing information
15864  *
15865  * # Invariants
15866  * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
15867  *
15868  */
15869 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
15870    /**
15871     * A pointer to the opaque Rust object.
15872     * Nearly everywhere, inner must be non-null, however in places where
15873     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15874     */
15875    LDKnativePrivateRoute *inner;
15876    /**
15877     * Indicates that this is the only struct which contains the same pointer.
15878     * Rust functions which take ownership of an object provided via an argument require
15879     * this to be true and invalidate the object pointed to by inner.
15880     */
15881    bool is_owned;
15882 } LDKPrivateRoute;
15883
15884 /**
15885  * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
15886  * This corresponds to std::vector in C++
15887  */
15888 typedef struct LDKCVec_PrivateRouteZ {
15889    /**
15890     * The elements in the array.
15891     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
15892     */
15893    struct LDKPrivateRoute *data;
15894    /**
15895     * The number of elements pointed to by `data`.
15896     */
15897    uintptr_t datalen;
15898 } LDKCVec_PrivateRouteZ;
15899
15900
15901
15902 /**
15903  * A timestamp that refers to a date after 1 January 1970.
15904  *
15905  * # Invariants
15906  *
15907  * The Unix timestamp representing the stored time has to be positive and no greater than
15908  * [`MAX_TIMESTAMP`].
15909  */
15910 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
15911    /**
15912     * A pointer to the opaque Rust object.
15913     * Nearly everywhere, inner must be non-null, however in places where
15914     * the Rust equivalent takes an Option, it may be set to null to indicate None.
15915     */
15916    LDKnativePositiveTimestamp *inner;
15917    /**
15918     * Indicates that this is the only struct which contains the same pointer.
15919     * Rust functions which take ownership of an object provided via an argument require
15920     * this to be true and invalidate the object pointed to by inner.
15921     */
15922    bool is_owned;
15923 } LDKPositiveTimestamp;
15924
15925 /**
15926  * The contents of CResult_PositiveTimestampCreationErrorZ
15927  */
15928 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
15929    /**
15930     * A pointer to the contents in the success state.
15931     * Reading from this pointer when `result_ok` is not set is undefined.
15932     */
15933    struct LDKPositiveTimestamp *result;
15934    /**
15935     * A pointer to the contents in the error state.
15936     * Reading from this pointer when `result_ok` is set is undefined.
15937     */
15938    enum LDKCreationError *err;
15939 } LDKCResult_PositiveTimestampCreationErrorZPtr;
15940
15941 /**
15942  * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
15943  * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
15944  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15945  */
15946 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
15947    /**
15948     * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
15949     * `err` or `result` depending on the state of `result_ok`.
15950     */
15951    union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
15952    /**
15953     * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
15954     */
15955    bool result_ok;
15956 } LDKCResult_PositiveTimestampCreationErrorZ;
15957
15958 /**
15959  * The contents of CResult_NoneBolt11SemanticErrorZ
15960  */
15961 typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
15962    /**
15963     * Note that this value is always NULL, as there are no contents in the OK variant
15964     */
15965    void *result;
15966    /**
15967     * A pointer to the contents in the error state.
15968     * Reading from this pointer when `result_ok` is set is undefined.
15969     */
15970    enum LDKBolt11SemanticError *err;
15971 } LDKCResult_NoneBolt11SemanticErrorZPtr;
15972
15973 /**
15974  * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
15975  * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
15976  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15977  */
15978 typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
15979    /**
15980     * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
15981     * `err` or `result` depending on the state of `result_ok`.
15982     */
15983    union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
15984    /**
15985     * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
15986     */
15987    bool result_ok;
15988 } LDKCResult_NoneBolt11SemanticErrorZ;
15989
15990 /**
15991  * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
15992  */
15993 typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
15994    /**
15995     * A pointer to the contents in the success state.
15996     * Reading from this pointer when `result_ok` is not set is undefined.
15997     */
15998    struct LDKBolt11Invoice *result;
15999    /**
16000     * A pointer to the contents in the error state.
16001     * Reading from this pointer when `result_ok` is set is undefined.
16002     */
16003    enum LDKBolt11SemanticError *err;
16004 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
16005
16006 /**
16007  * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
16008  * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
16009  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16010  */
16011 typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
16012    /**
16013     * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
16014     * `err` or `result` depending on the state of `result_ok`.
16015     */
16016    union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
16017    /**
16018     * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
16019     */
16020    bool result_ok;
16021 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
16022
16023
16024
16025 /**
16026  * Description string
16027  *
16028  * # Invariants
16029  * The description can be at most 639 __bytes__ long
16030  */
16031 typedef struct MUST_USE_STRUCT LDKDescription {
16032    /**
16033     * A pointer to the opaque Rust object.
16034     * Nearly everywhere, inner must be non-null, however in places where
16035     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16036     */
16037    LDKnativeDescription *inner;
16038    /**
16039     * Indicates that this is the only struct which contains the same pointer.
16040     * Rust functions which take ownership of an object provided via an argument require
16041     * this to be true and invalidate the object pointed to by inner.
16042     */
16043    bool is_owned;
16044 } LDKDescription;
16045
16046 /**
16047  * The contents of CResult_DescriptionCreationErrorZ
16048  */
16049 typedef union LDKCResult_DescriptionCreationErrorZPtr {
16050    /**
16051     * A pointer to the contents in the success state.
16052     * Reading from this pointer when `result_ok` is not set is undefined.
16053     */
16054    struct LDKDescription *result;
16055    /**
16056     * A pointer to the contents in the error state.
16057     * Reading from this pointer when `result_ok` is set is undefined.
16058     */
16059    enum LDKCreationError *err;
16060 } LDKCResult_DescriptionCreationErrorZPtr;
16061
16062 /**
16063  * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
16064  * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
16065  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16066  */
16067 typedef struct LDKCResult_DescriptionCreationErrorZ {
16068    /**
16069     * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
16070     * `err` or `result` depending on the state of `result_ok`.
16071     */
16072    union LDKCResult_DescriptionCreationErrorZPtr contents;
16073    /**
16074     * Whether this CResult_DescriptionCreationErrorZ represents a success state.
16075     */
16076    bool result_ok;
16077 } LDKCResult_DescriptionCreationErrorZ;
16078
16079 /**
16080  * The contents of CResult_PrivateRouteCreationErrorZ
16081  */
16082 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
16083    /**
16084     * A pointer to the contents in the success state.
16085     * Reading from this pointer when `result_ok` is not set is undefined.
16086     */
16087    struct LDKPrivateRoute *result;
16088    /**
16089     * A pointer to the contents in the error state.
16090     * Reading from this pointer when `result_ok` is set is undefined.
16091     */
16092    enum LDKCreationError *err;
16093 } LDKCResult_PrivateRouteCreationErrorZPtr;
16094
16095 /**
16096  * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
16097  * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
16098  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16099  */
16100 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
16101    /**
16102     * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
16103     * `err` or `result` depending on the state of `result_ok`.
16104     */
16105    union LDKCResult_PrivateRouteCreationErrorZPtr contents;
16106    /**
16107     * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
16108     */
16109    bool result_ok;
16110 } LDKCResult_PrivateRouteCreationErrorZ;
16111
16112 /**
16113  * The contents of CResult_OutPointDecodeErrorZ
16114  */
16115 typedef union LDKCResult_OutPointDecodeErrorZPtr {
16116    /**
16117     * A pointer to the contents in the success state.
16118     * Reading from this pointer when `result_ok` is not set is undefined.
16119     */
16120    struct LDKOutPoint *result;
16121    /**
16122     * A pointer to the contents in the error state.
16123     * Reading from this pointer when `result_ok` is set is undefined.
16124     */
16125    struct LDKDecodeError *err;
16126 } LDKCResult_OutPointDecodeErrorZPtr;
16127
16128 /**
16129  * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
16130  * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
16131  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16132  */
16133 typedef struct LDKCResult_OutPointDecodeErrorZ {
16134    /**
16135     * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
16136     * `err` or `result` depending on the state of `result_ok`.
16137     */
16138    union LDKCResult_OutPointDecodeErrorZPtr contents;
16139    /**
16140     * Whether this CResult_OutPointDecodeErrorZ represents a success state.
16141     */
16142    bool result_ok;
16143 } LDKCResult_OutPointDecodeErrorZ;
16144
16145
16146
16147 /**
16148  * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
16149  * variable-length integers except that it is serialized in big-endian instead of little-endian.
16150  *
16151  * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
16152  * encoded in several different ways, which we must check for at deserialization-time. Thus, if
16153  * you're looking for an example of a variable-length integer to use for your own project, move
16154  * along, this is a rather poor design.
16155  */
16156 typedef struct MUST_USE_STRUCT LDKBigSize {
16157    /**
16158     * A pointer to the opaque Rust object.
16159     * Nearly everywhere, inner must be non-null, however in places where
16160     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16161     */
16162    LDKnativeBigSize *inner;
16163    /**
16164     * Indicates that this is the only struct which contains the same pointer.
16165     * Rust functions which take ownership of an object provided via an argument require
16166     * this to be true and invalidate the object pointed to by inner.
16167     */
16168    bool is_owned;
16169 } LDKBigSize;
16170
16171 /**
16172  * The contents of CResult_BigSizeDecodeErrorZ
16173  */
16174 typedef union LDKCResult_BigSizeDecodeErrorZPtr {
16175    /**
16176     * A pointer to the contents in the success state.
16177     * Reading from this pointer when `result_ok` is not set is undefined.
16178     */
16179    struct LDKBigSize *result;
16180    /**
16181     * A pointer to the contents in the error state.
16182     * Reading from this pointer when `result_ok` is set is undefined.
16183     */
16184    struct LDKDecodeError *err;
16185 } LDKCResult_BigSizeDecodeErrorZPtr;
16186
16187 /**
16188  * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
16189  * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
16190  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16191  */
16192 typedef struct LDKCResult_BigSizeDecodeErrorZ {
16193    /**
16194     * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
16195     * `err` or `result` depending on the state of `result_ok`.
16196     */
16197    union LDKCResult_BigSizeDecodeErrorZPtr contents;
16198    /**
16199     * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
16200     */
16201    bool result_ok;
16202 } LDKCResult_BigSizeDecodeErrorZ;
16203
16204 /**
16205  * The contents of CResult_HostnameDecodeErrorZ
16206  */
16207 typedef union LDKCResult_HostnameDecodeErrorZPtr {
16208    /**
16209     * A pointer to the contents in the success state.
16210     * Reading from this pointer when `result_ok` is not set is undefined.
16211     */
16212    struct LDKHostname *result;
16213    /**
16214     * A pointer to the contents in the error state.
16215     * Reading from this pointer when `result_ok` is set is undefined.
16216     */
16217    struct LDKDecodeError *err;
16218 } LDKCResult_HostnameDecodeErrorZPtr;
16219
16220 /**
16221  * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
16222  * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
16223  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16224  */
16225 typedef struct LDKCResult_HostnameDecodeErrorZ {
16226    /**
16227     * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
16228     * `err` or `result` depending on the state of `result_ok`.
16229     */
16230    union LDKCResult_HostnameDecodeErrorZPtr contents;
16231    /**
16232     * Whether this CResult_HostnameDecodeErrorZ represents a success state.
16233     */
16234    bool result_ok;
16235 } LDKCResult_HostnameDecodeErrorZ;
16236
16237
16238
16239 /**
16240  * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
16241  * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
16242  *
16243  * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
16244  */
16245 typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
16246    /**
16247     * A pointer to the opaque Rust object.
16248     * Nearly everywhere, inner must be non-null, however in places where
16249     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16250     */
16251    LDKnativeTransactionU16LenLimited *inner;
16252    /**
16253     * Indicates that this is the only struct which contains the same pointer.
16254     * Rust functions which take ownership of an object provided via an argument require
16255     * this to be true and invalidate the object pointed to by inner.
16256     */
16257    bool is_owned;
16258 } LDKTransactionU16LenLimited;
16259
16260 /**
16261  * The contents of CResult_TransactionU16LenLimitedNoneZ
16262  */
16263 typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
16264    /**
16265     * A pointer to the contents in the success state.
16266     * Reading from this pointer when `result_ok` is not set is undefined.
16267     */
16268    struct LDKTransactionU16LenLimited *result;
16269    /**
16270     * Note that this value is always NULL, as there are no contents in the Err variant
16271     */
16272    void *err;
16273 } LDKCResult_TransactionU16LenLimitedNoneZPtr;
16274
16275 /**
16276  * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
16277  * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
16278  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16279  */
16280 typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
16281    /**
16282     * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
16283     * `err` or `result` depending on the state of `result_ok`.
16284     */
16285    union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
16286    /**
16287     * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
16288     */
16289    bool result_ok;
16290 } LDKCResult_TransactionU16LenLimitedNoneZ;
16291
16292 /**
16293  * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
16294  */
16295 typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
16296    /**
16297     * A pointer to the contents in the success state.
16298     * Reading from this pointer when `result_ok` is not set is undefined.
16299     */
16300    struct LDKTransactionU16LenLimited *result;
16301    /**
16302     * A pointer to the contents in the error state.
16303     * Reading from this pointer when `result_ok` is set is undefined.
16304     */
16305    struct LDKDecodeError *err;
16306 } LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
16307
16308 /**
16309  * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
16310  * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
16311  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16312  */
16313 typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
16314    /**
16315     * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
16316     * `err` or `result` depending on the state of `result_ok`.
16317     */
16318    union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
16319    /**
16320     * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
16321     */
16322    bool result_ok;
16323 } LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
16324
16325 /**
16326  * The contents of CResult_UntrustedStringDecodeErrorZ
16327  */
16328 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
16329    /**
16330     * A pointer to the contents in the success state.
16331     * Reading from this pointer when `result_ok` is not set is undefined.
16332     */
16333    struct LDKUntrustedString *result;
16334    /**
16335     * A pointer to the contents in the error state.
16336     * Reading from this pointer when `result_ok` is set is undefined.
16337     */
16338    struct LDKDecodeError *err;
16339 } LDKCResult_UntrustedStringDecodeErrorZPtr;
16340
16341 /**
16342  * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
16343  * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
16344  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16345  */
16346 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
16347    /**
16348     * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
16349     * `err` or `result` depending on the state of `result_ok`.
16350     */
16351    union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
16352    /**
16353     * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
16354     */
16355    bool result_ok;
16356 } LDKCResult_UntrustedStringDecodeErrorZ;
16357
16358
16359
16360 /**
16361  * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and
16362  * may not be valid if received by another lightning implementation.
16363  */
16364 typedef struct MUST_USE_STRUCT LDKReceiveTlvs {
16365    /**
16366     * A pointer to the opaque Rust object.
16367     * Nearly everywhere, inner must be non-null, however in places where
16368     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16369     */
16370    LDKnativeReceiveTlvs *inner;
16371    /**
16372     * Indicates that this is the only struct which contains the same pointer.
16373     * Rust functions which take ownership of an object provided via an argument require
16374     * this to be true and invalidate the object pointed to by inner.
16375     */
16376    bool is_owned;
16377 } LDKReceiveTlvs;
16378
16379 /**
16380  * The contents of CResult_ReceiveTlvsDecodeErrorZ
16381  */
16382 typedef union LDKCResult_ReceiveTlvsDecodeErrorZPtr {
16383    /**
16384     * A pointer to the contents in the success state.
16385     * Reading from this pointer when `result_ok` is not set is undefined.
16386     */
16387    struct LDKReceiveTlvs *result;
16388    /**
16389     * A pointer to the contents in the error state.
16390     * Reading from this pointer when `result_ok` is set is undefined.
16391     */
16392    struct LDKDecodeError *err;
16393 } LDKCResult_ReceiveTlvsDecodeErrorZPtr;
16394
16395 /**
16396  * A CResult_ReceiveTlvsDecodeErrorZ represents the result of a fallible operation,
16397  * containing a crate::lightning::blinded_path::payment::ReceiveTlvs on success and a crate::lightning::ln::msgs::DecodeError on failure.
16398  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16399  */
16400 typedef struct LDKCResult_ReceiveTlvsDecodeErrorZ {
16401    /**
16402     * The contents of this CResult_ReceiveTlvsDecodeErrorZ, accessible via either
16403     * `err` or `result` depending on the state of `result_ok`.
16404     */
16405    union LDKCResult_ReceiveTlvsDecodeErrorZPtr contents;
16406    /**
16407     * Whether this CResult_ReceiveTlvsDecodeErrorZ represents a success state.
16408     */
16409    bool result_ok;
16410 } LDKCResult_ReceiveTlvsDecodeErrorZ;
16411
16412
16413
16414 /**
16415  * Parameters for relaying over a given [`BlindedHop`].
16416  *
16417  * [`BlindedHop`]: crate::blinded_path::BlindedHop
16418  */
16419 typedef struct MUST_USE_STRUCT LDKPaymentRelay {
16420    /**
16421     * A pointer to the opaque Rust object.
16422     * Nearly everywhere, inner must be non-null, however in places where
16423     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16424     */
16425    LDKnativePaymentRelay *inner;
16426    /**
16427     * Indicates that this is the only struct which contains the same pointer.
16428     * Rust functions which take ownership of an object provided via an argument require
16429     * this to be true and invalidate the object pointed to by inner.
16430     */
16431    bool is_owned;
16432 } LDKPaymentRelay;
16433
16434 /**
16435  * The contents of CResult_PaymentRelayDecodeErrorZ
16436  */
16437 typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
16438    /**
16439     * A pointer to the contents in the success state.
16440     * Reading from this pointer when `result_ok` is not set is undefined.
16441     */
16442    struct LDKPaymentRelay *result;
16443    /**
16444     * A pointer to the contents in the error state.
16445     * Reading from this pointer when `result_ok` is set is undefined.
16446     */
16447    struct LDKDecodeError *err;
16448 } LDKCResult_PaymentRelayDecodeErrorZPtr;
16449
16450 /**
16451  * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
16452  * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
16453  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16454  */
16455 typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
16456    /**
16457     * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
16458     * `err` or `result` depending on the state of `result_ok`.
16459     */
16460    union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
16461    /**
16462     * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
16463     */
16464    bool result_ok;
16465 } LDKCResult_PaymentRelayDecodeErrorZ;
16466
16467
16468
16469 /**
16470  * Constraints for relaying over a given [`BlindedHop`].
16471  *
16472  * [`BlindedHop`]: crate::blinded_path::BlindedHop
16473  */
16474 typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
16475    /**
16476     * A pointer to the opaque Rust object.
16477     * Nearly everywhere, inner must be non-null, however in places where
16478     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16479     */
16480    LDKnativePaymentConstraints *inner;
16481    /**
16482     * Indicates that this is the only struct which contains the same pointer.
16483     * Rust functions which take ownership of an object provided via an argument require
16484     * this to be true and invalidate the object pointed to by inner.
16485     */
16486    bool is_owned;
16487 } LDKPaymentConstraints;
16488
16489 /**
16490  * The contents of CResult_PaymentConstraintsDecodeErrorZ
16491  */
16492 typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
16493    /**
16494     * A pointer to the contents in the success state.
16495     * Reading from this pointer when `result_ok` is not set is undefined.
16496     */
16497    struct LDKPaymentConstraints *result;
16498    /**
16499     * A pointer to the contents in the error state.
16500     * Reading from this pointer when `result_ok` is set is undefined.
16501     */
16502    struct LDKDecodeError *err;
16503 } LDKCResult_PaymentConstraintsDecodeErrorZPtr;
16504
16505 /**
16506  * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
16507  * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
16508  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16509  */
16510 typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
16511    /**
16512     * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
16513     * `err` or `result` depending on the state of `result_ok`.
16514     */
16515    union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
16516    /**
16517     * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
16518     */
16519    bool result_ok;
16520 } LDKCResult_PaymentConstraintsDecodeErrorZ;
16521
16522 /**
16523  * An error that may occur when making a payment.
16524  */
16525 typedef enum LDKPaymentError_Tag {
16526    /**
16527     * An error resulting from the provided [`Bolt11Invoice`] or payment hash.
16528     */
16529    LDKPaymentError_Invoice,
16530    /**
16531     * An error occurring when sending a payment.
16532     */
16533    LDKPaymentError_Sending,
16534    /**
16535     * Must be last for serialization purposes
16536     */
16537    LDKPaymentError_Sentinel,
16538 } LDKPaymentError_Tag;
16539
16540 typedef struct MUST_USE_STRUCT LDKPaymentError {
16541    LDKPaymentError_Tag tag;
16542    union {
16543       struct {
16544          struct LDKStr invoice;
16545       };
16546       struct {
16547          enum LDKRetryableSendFailure sending;
16548       };
16549    };
16550 } LDKPaymentError;
16551
16552 /**
16553  * The contents of CResult_ThirtyTwoBytesPaymentErrorZ
16554  */
16555 typedef union LDKCResult_ThirtyTwoBytesPaymentErrorZPtr {
16556    /**
16557     * A pointer to the contents in the success state.
16558     * Reading from this pointer when `result_ok` is not set is undefined.
16559     */
16560    struct LDKThirtyTwoBytes *result;
16561    /**
16562     * A pointer to the contents in the error state.
16563     * Reading from this pointer when `result_ok` is set is undefined.
16564     */
16565    struct LDKPaymentError *err;
16566 } LDKCResult_ThirtyTwoBytesPaymentErrorZPtr;
16567
16568 /**
16569  * A CResult_ThirtyTwoBytesPaymentErrorZ represents the result of a fallible operation,
16570  * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
16571  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16572  */
16573 typedef struct LDKCResult_ThirtyTwoBytesPaymentErrorZ {
16574    /**
16575     * The contents of this CResult_ThirtyTwoBytesPaymentErrorZ, accessible via either
16576     * `err` or `result` depending on the state of `result_ok`.
16577     */
16578    union LDKCResult_ThirtyTwoBytesPaymentErrorZPtr contents;
16579    /**
16580     * Whether this CResult_ThirtyTwoBytesPaymentErrorZ represents a success state.
16581     */
16582    bool result_ok;
16583 } LDKCResult_ThirtyTwoBytesPaymentErrorZ;
16584
16585 /**
16586  * The contents of CResult_NonePaymentErrorZ
16587  */
16588 typedef union LDKCResult_NonePaymentErrorZPtr {
16589    /**
16590     * Note that this value is always NULL, as there are no contents in the OK variant
16591     */
16592    void *result;
16593    /**
16594     * A pointer to the contents in the error state.
16595     * Reading from this pointer when `result_ok` is set is undefined.
16596     */
16597    struct LDKPaymentError *err;
16598 } LDKCResult_NonePaymentErrorZPtr;
16599
16600 /**
16601  * A CResult_NonePaymentErrorZ represents the result of a fallible operation,
16602  * containing a () on success and a crate::lightning_invoice::payment::PaymentError on failure.
16603  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16604  */
16605 typedef struct LDKCResult_NonePaymentErrorZ {
16606    /**
16607     * The contents of this CResult_NonePaymentErrorZ, accessible via either
16608     * `err` or `result` depending on the state of `result_ok`.
16609     */
16610    union LDKCResult_NonePaymentErrorZPtr contents;
16611    /**
16612     * Whether this CResult_NonePaymentErrorZ represents a success state.
16613     */
16614    bool result_ok;
16615 } LDKCResult_NonePaymentErrorZ;
16616
16617 /**
16618  * An error that may occur when sending a payment probe.
16619  */
16620 typedef enum LDKProbingError_Tag {
16621    /**
16622     * An error resulting from the provided [`Bolt11Invoice`].
16623     */
16624    LDKProbingError_Invoice,
16625    /**
16626     * An error occurring when sending a payment probe.
16627     */
16628    LDKProbingError_Sending,
16629    /**
16630     * Must be last for serialization purposes
16631     */
16632    LDKProbingError_Sentinel,
16633 } LDKProbingError_Tag;
16634
16635 typedef struct MUST_USE_STRUCT LDKProbingError {
16636    LDKProbingError_Tag tag;
16637    union {
16638       struct {
16639          struct LDKStr invoice;
16640       };
16641       struct {
16642          struct LDKProbeSendFailure sending;
16643       };
16644    };
16645 } LDKProbingError;
16646
16647 /**
16648  * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ
16649  */
16650 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZPtr {
16651    /**
16652     * A pointer to the contents in the success state.
16653     * Reading from this pointer when `result_ok` is not set is undefined.
16654     */
16655    struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
16656    /**
16657     * A pointer to the contents in the error state.
16658     * Reading from this pointer when `result_ok` is set is undefined.
16659     */
16660    struct LDKProbingError *err;
16661 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZPtr;
16662
16663 /**
16664  * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ represents the result of a fallible operation,
16665  * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning_invoice::payment::ProbingError on failure.
16666  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16667  */
16668 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ {
16669    /**
16670     * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ, accessible via either
16671     * `err` or `result` depending on the state of `result_ok`.
16672     */
16673    union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZPtr contents;
16674    /**
16675     * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ represents a success state.
16676     */
16677    bool result_ok;
16678 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ;
16679
16680 /**
16681  * The contents of CResult_StrSecp256k1ErrorZ
16682  */
16683 typedef union LDKCResult_StrSecp256k1ErrorZPtr {
16684    /**
16685     * A pointer to the contents in the success state.
16686     * Reading from this pointer when `result_ok` is not set is undefined.
16687     */
16688    struct LDKStr *result;
16689    /**
16690     * A pointer to the contents in the error state.
16691     * Reading from this pointer when `result_ok` is set is undefined.
16692     */
16693    enum LDKSecp256k1Error *err;
16694 } LDKCResult_StrSecp256k1ErrorZPtr;
16695
16696 /**
16697  * A CResult_StrSecp256k1ErrorZ represents the result of a fallible operation,
16698  * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
16699  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16700  */
16701 typedef struct LDKCResult_StrSecp256k1ErrorZ {
16702    /**
16703     * The contents of this CResult_StrSecp256k1ErrorZ, accessible via either
16704     * `err` or `result` depending on the state of `result_ok`.
16705     */
16706    union LDKCResult_StrSecp256k1ErrorZPtr contents;
16707    /**
16708     * Whether this CResult_StrSecp256k1ErrorZ represents a success state.
16709     */
16710    bool result_ok;
16711 } LDKCResult_StrSecp256k1ErrorZ;
16712
16713
16714
16715 /**
16716  * A path for sending an [`msgs::OnionMessage`].
16717  */
16718 typedef struct MUST_USE_STRUCT LDKOnionMessagePath {
16719    /**
16720     * A pointer to the opaque Rust object.
16721     * Nearly everywhere, inner must be non-null, however in places where
16722     * the Rust equivalent takes an Option, it may be set to null to indicate None.
16723     */
16724    LDKnativeOnionMessagePath *inner;
16725    /**
16726     * Indicates that this is the only struct which contains the same pointer.
16727     * Rust functions which take ownership of an object provided via an argument require
16728     * this to be true and invalidate the object pointed to by inner.
16729     */
16730    bool is_owned;
16731 } LDKOnionMessagePath;
16732
16733 /**
16734  * The contents of CResult_OnionMessagePathNoneZ
16735  */
16736 typedef union LDKCResult_OnionMessagePathNoneZPtr {
16737    /**
16738     * A pointer to the contents in the success state.
16739     * Reading from this pointer when `result_ok` is not set is undefined.
16740     */
16741    struct LDKOnionMessagePath *result;
16742    /**
16743     * Note that this value is always NULL, as there are no contents in the Err variant
16744     */
16745    void *err;
16746 } LDKCResult_OnionMessagePathNoneZPtr;
16747
16748 /**
16749  * A CResult_OnionMessagePathNoneZ represents the result of a fallible operation,
16750  * containing a crate::lightning::onion_message::messenger::OnionMessagePath on success and a () on failure.
16751  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16752  */
16753 typedef struct LDKCResult_OnionMessagePathNoneZ {
16754    /**
16755     * The contents of this CResult_OnionMessagePathNoneZ, accessible via either
16756     * `err` or `result` depending on the state of `result_ok`.
16757     */
16758    union LDKCResult_OnionMessagePathNoneZPtr contents;
16759    /**
16760     * Whether this CResult_OnionMessagePathNoneZ represents a success state.
16761     */
16762    bool result_ok;
16763 } LDKCResult_OnionMessagePathNoneZ;
16764
16765 /**
16766  * A tuple of 2 elements. See the individual fields for the types contained.
16767  */
16768 typedef struct LDKC2Tuple_PublicKeyOnionMessageZ {
16769    /**
16770     * The element at position 0
16771     */
16772    struct LDKPublicKey a;
16773    /**
16774     * The element at position 1
16775     */
16776    struct LDKOnionMessage b;
16777 } LDKC2Tuple_PublicKeyOnionMessageZ;
16778
16779 /**
16780  * Errors that may occur when [sending an onion message].
16781  *
16782  * [sending an onion message]: OnionMessenger::send_onion_message
16783  */
16784 typedef enum LDKSendError_Tag {
16785    /**
16786     * Errored computing onion message packet keys.
16787     */
16788    LDKSendError_Secp256k1,
16789    /**
16790     * Because implementations such as Eclair will drop onion messages where the message packet
16791     * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
16792     */
16793    LDKSendError_TooBigPacket,
16794    /**
16795     * The provided [`Destination`] was an invalid [`BlindedPath`], due to having fewer than two
16796     * blinded hops.
16797     */
16798    LDKSendError_TooFewBlindedHops,
16799    /**
16800     * Our next-hop peer was offline or does not support onion message forwarding.
16801     */
16802    LDKSendError_InvalidFirstHop,
16803    /**
16804     * Onion message contents must have a TLV type >= 64.
16805     */
16806    LDKSendError_InvalidMessage,
16807    /**
16808     * Our next-hop peer's buffer was full or our total outbound buffer was full.
16809     */
16810    LDKSendError_BufferFull,
16811    /**
16812     * Failed to retrieve our node id from the provided [`NodeSigner`].
16813     *
16814     * [`NodeSigner`]: crate::sign::NodeSigner
16815     */
16816    LDKSendError_GetNodeIdFailed,
16817    /**
16818     * We attempted to send to a blinded path where we are the introduction node, and failed to
16819     * advance the blinded path to make the second hop the new introduction node. Either
16820     * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
16821     * new blinding point, or we were attempting to send to ourselves.
16822     */
16823    LDKSendError_BlindedPathAdvanceFailed,
16824    /**
16825     * Must be last for serialization purposes
16826     */
16827    LDKSendError_Sentinel,
16828 } LDKSendError_Tag;
16829
16830 typedef struct MUST_USE_STRUCT LDKSendError {
16831    LDKSendError_Tag tag;
16832    union {
16833       struct {
16834          enum LDKSecp256k1Error secp256k1;
16835       };
16836    };
16837 } LDKSendError;
16838
16839 /**
16840  * The contents of CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ
16841  */
16842 typedef union LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZPtr {
16843    /**
16844     * A pointer to the contents in the success state.
16845     * Reading from this pointer when `result_ok` is not set is undefined.
16846     */
16847    struct LDKC2Tuple_PublicKeyOnionMessageZ *result;
16848    /**
16849     * A pointer to the contents in the error state.
16850     * Reading from this pointer when `result_ok` is set is undefined.
16851     */
16852    struct LDKSendError *err;
16853 } LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZPtr;
16854
16855 /**
16856  * A CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ represents the result of a fallible operation,
16857  * containing a crate::c_types::derived::C2Tuple_PublicKeyOnionMessageZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
16858  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16859  */
16860 typedef struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ {
16861    /**
16862     * The contents of this CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ, accessible via either
16863     * `err` or `result` depending on the state of `result_ok`.
16864     */
16865    union LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZPtr contents;
16866    /**
16867     * Whether this CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ represents a success state.
16868     */
16869    bool result_ok;
16870 } LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ;
16871
16872 /**
16873  * The contents of CResult_NoneSendErrorZ
16874  */
16875 typedef union LDKCResult_NoneSendErrorZPtr {
16876    /**
16877     * Note that this value is always NULL, as there are no contents in the OK variant
16878     */
16879    void *result;
16880    /**
16881     * A pointer to the contents in the error state.
16882     * Reading from this pointer when `result_ok` is set is undefined.
16883     */
16884    struct LDKSendError *err;
16885 } LDKCResult_NoneSendErrorZPtr;
16886
16887 /**
16888  * A CResult_NoneSendErrorZ represents the result of a fallible operation,
16889  * containing a () on success and a crate::lightning::onion_message::messenger::SendError on failure.
16890  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16891  */
16892 typedef struct LDKCResult_NoneSendErrorZ {
16893    /**
16894     * The contents of this CResult_NoneSendErrorZ, accessible via either
16895     * `err` or `result` depending on the state of `result_ok`.
16896     */
16897    union LDKCResult_NoneSendErrorZPtr contents;
16898    /**
16899     * Whether this CResult_NoneSendErrorZ represents a success state.
16900     */
16901    bool result_ok;
16902 } LDKCResult_NoneSendErrorZ;
16903
16904 /**
16905  * The contents of CResult_BlindedPathNoneZ
16906  */
16907 typedef union LDKCResult_BlindedPathNoneZPtr {
16908    /**
16909     * A pointer to the contents in the success state.
16910     * Reading from this pointer when `result_ok` is not set is undefined.
16911     */
16912    struct LDKBlindedPath *result;
16913    /**
16914     * Note that this value is always NULL, as there are no contents in the Err variant
16915     */
16916    void *err;
16917 } LDKCResult_BlindedPathNoneZPtr;
16918
16919 /**
16920  * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
16921  * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
16922  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16923  */
16924 typedef struct LDKCResult_BlindedPathNoneZ {
16925    /**
16926     * The contents of this CResult_BlindedPathNoneZ, accessible via either
16927     * `err` or `result` depending on the state of `result_ok`.
16928     */
16929    union LDKCResult_BlindedPathNoneZPtr contents;
16930    /**
16931     * Whether this CResult_BlindedPathNoneZ represents a success state.
16932     */
16933    bool result_ok;
16934 } LDKCResult_BlindedPathNoneZ;
16935
16936 /**
16937  * The contents of CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ
16938  */
16939 typedef union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr {
16940    /**
16941     * A pointer to the contents in the success state.
16942     * Reading from this pointer when `result_ok` is not set is undefined.
16943     */
16944    struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *result;
16945    /**
16946     * Note that this value is always NULL, as there are no contents in the Err variant
16947     */
16948    void *err;
16949 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr;
16950
16951 /**
16952  * A CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents the result of a fallible operation,
16953  * containing a crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZ on success and a () on failure.
16954  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16955  */
16956 typedef struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
16957    /**
16958     * The contents of this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ, accessible via either
16959     * `err` or `result` depending on the state of `result_ok`.
16960     */
16961    union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr contents;
16962    /**
16963     * Whether this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents a success state.
16964     */
16965    bool result_ok;
16966 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ;
16967
16968 /**
16969  * The contents of CResult_BlindedPathDecodeErrorZ
16970  */
16971 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
16972    /**
16973     * A pointer to the contents in the success state.
16974     * Reading from this pointer when `result_ok` is not set is undefined.
16975     */
16976    struct LDKBlindedPath *result;
16977    /**
16978     * A pointer to the contents in the error state.
16979     * Reading from this pointer when `result_ok` is set is undefined.
16980     */
16981    struct LDKDecodeError *err;
16982 } LDKCResult_BlindedPathDecodeErrorZPtr;
16983
16984 /**
16985  * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
16986  * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
16987  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16988  */
16989 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
16990    /**
16991     * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
16992     * `err` or `result` depending on the state of `result_ok`.
16993     */
16994    union LDKCResult_BlindedPathDecodeErrorZPtr contents;
16995    /**
16996     * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
16997     */
16998    bool result_ok;
16999 } LDKCResult_BlindedPathDecodeErrorZ;
17000
17001 /**
17002  * The contents of CResult_BlindedHopDecodeErrorZ
17003  */
17004 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
17005    /**
17006     * A pointer to the contents in the success state.
17007     * Reading from this pointer when `result_ok` is not set is undefined.
17008     */
17009    struct LDKBlindedHop *result;
17010    /**
17011     * A pointer to the contents in the error state.
17012     * Reading from this pointer when `result_ok` is set is undefined.
17013     */
17014    struct LDKDecodeError *err;
17015 } LDKCResult_BlindedHopDecodeErrorZPtr;
17016
17017 /**
17018  * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
17019  * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
17020  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17021  */
17022 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
17023    /**
17024     * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
17025     * `err` or `result` depending on the state of `result_ok`.
17026     */
17027    union LDKCResult_BlindedHopDecodeErrorZPtr contents;
17028    /**
17029     * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
17030     */
17031    bool result_ok;
17032 } LDKCResult_BlindedHopDecodeErrorZ;
17033
17034 /**
17035  * The contents of CResult_InvoiceErrorDecodeErrorZ
17036  */
17037 typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
17038    /**
17039     * A pointer to the contents in the success state.
17040     * Reading from this pointer when `result_ok` is not set is undefined.
17041     */
17042    struct LDKInvoiceError *result;
17043    /**
17044     * A pointer to the contents in the error state.
17045     * Reading from this pointer when `result_ok` is set is undefined.
17046     */
17047    struct LDKDecodeError *err;
17048 } LDKCResult_InvoiceErrorDecodeErrorZPtr;
17049
17050 /**
17051  * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
17052  * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
17053  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17054  */
17055 typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
17056    /**
17057     * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
17058     * `err` or `result` depending on the state of `result_ok`.
17059     */
17060    union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
17061    /**
17062     * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
17063     */
17064    bool result_ok;
17065 } LDKCResult_InvoiceErrorDecodeErrorZ;
17066
17067
17068
17069 /**
17070  * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
17071  *
17072  * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
17073  * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
17074  * [`Confirm::transactions_confirmed`].
17075  *
17076  * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
17077  * may have been spent there. See [`Filter::register_output`] for details.
17078  *
17079  * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
17080  * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
17081  */
17082 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
17083    /**
17084     * A pointer to the opaque Rust object.
17085     * Nearly everywhere, inner must be non-null, however in places where
17086     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17087     */
17088    LDKnativeWatchedOutput *inner;
17089    /**
17090     * Indicates that this is the only struct which contains the same pointer.
17091     * Rust functions which take ownership of an object provided via an argument require
17092     * this to be true and invalidate the object pointed to by inner.
17093     */
17094    bool is_owned;
17095 } LDKWatchedOutput;
17096
17097 /**
17098  * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
17099  * channels.
17100  *
17101  * This is useful in order to have a [`Watch`] implementation convey to a chain source which
17102  * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
17103  * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
17104  * receiving full blocks from a chain source, any further filtering is unnecessary.
17105  *
17106  * After an output has been registered, subsequent block retrievals from the chain source must not
17107  * exclude any transactions matching the new criteria nor any in-block descendants of such
17108  * transactions.
17109  *
17110  * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
17111  * should not block on I/O. Implementations should instead queue the newly monitored data to be
17112  * processed later. Then, in order to block until the data has been processed, any [`Watch`]
17113  * invocation that has called the `Filter` must return [`InProgress`].
17114  *
17115  * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
17116  * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
17117  * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
17118  */
17119 typedef struct LDKFilter {
17120    /**
17121     * An opaque pointer which is passed to your function implementations as an argument.
17122     * This has no meaning in the LDK, and can be NULL or any other value.
17123     */
17124    void *this_arg;
17125    /**
17126     * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
17127     * a spending condition.
17128     */
17129    void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
17130    /**
17131     * Registers interest in spends of a transaction output.
17132     *
17133     * Note that this method might be called during processing of a new block. You therefore need
17134     * to ensure that also dependent output spents within an already connected block are correctly
17135     * handled, e.g., by re-scanning the block in question whenever new outputs have been
17136     * registered mid-processing.
17137     */
17138    void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
17139    /**
17140     * Frees any resources associated with this object given its this_arg pointer.
17141     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17142     */
17143    void (*free)(void *this_arg);
17144 } LDKFilter;
17145
17146 /**
17147  * An enum which can either contain a crate::lightning::chain::Filter or not
17148  */
17149 typedef enum LDKCOption_FilterZ_Tag {
17150    /**
17151     * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
17152     */
17153    LDKCOption_FilterZ_Some,
17154    /**
17155     * When we're in this state, this COption_FilterZ contains nothing
17156     */
17157    LDKCOption_FilterZ_None,
17158    /**
17159     * Must be last for serialization purposes
17160     */
17161    LDKCOption_FilterZ_Sentinel,
17162 } LDKCOption_FilterZ_Tag;
17163
17164 typedef struct LDKCOption_FilterZ {
17165    LDKCOption_FilterZ_Tag tag;
17166    union {
17167       struct {
17168          struct LDKFilter some;
17169       };
17170    };
17171 } LDKCOption_FilterZ;
17172
17173
17174
17175 /**
17176  * A read-only reference to a current ChannelMonitor.
17177  *
17178  * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
17179  * released.
17180  */
17181 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
17182    /**
17183     * A pointer to the opaque Rust object.
17184     * Nearly everywhere, inner must be non-null, however in places where
17185     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17186     */
17187    LDKnativeLockedChannelMonitor *inner;
17188    /**
17189     * Indicates that this is the only struct which contains the same pointer.
17190     * Rust functions which take ownership of an object provided via an argument require
17191     * this to be true and invalidate the object pointed to by inner.
17192     */
17193    bool is_owned;
17194 } LDKLockedChannelMonitor;
17195
17196 /**
17197  * The contents of CResult_LockedChannelMonitorNoneZ
17198  */
17199 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
17200    /**
17201     * A pointer to the contents in the success state.
17202     * Reading from this pointer when `result_ok` is not set is undefined.
17203     */
17204    struct LDKLockedChannelMonitor *result;
17205    /**
17206     * Note that this value is always NULL, as there are no contents in the Err variant
17207     */
17208    void *err;
17209 } LDKCResult_LockedChannelMonitorNoneZPtr;
17210
17211 /**
17212  * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
17213  * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
17214  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17215  */
17216 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
17217    /**
17218     * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
17219     * `err` or `result` depending on the state of `result_ok`.
17220     */
17221    union LDKCResult_LockedChannelMonitorNoneZPtr contents;
17222    /**
17223     * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
17224     */
17225    bool result_ok;
17226 } LDKCResult_LockedChannelMonitorNoneZ;
17227
17228 /**
17229  * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
17230  * This corresponds to std::vector in C++
17231  */
17232 typedef struct LDKCVec_OutPointZ {
17233    /**
17234     * The elements in the array.
17235     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17236     */
17237    struct LDKOutPoint *data;
17238    /**
17239     * The number of elements pointed to by `data`.
17240     */
17241    uintptr_t datalen;
17242 } LDKCVec_OutPointZ;
17243
17244
17245
17246 /**
17247  * An opaque identifier describing a specific [`Persist`] method call.
17248  */
17249 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
17250    /**
17251     * A pointer to the opaque Rust object.
17252     * Nearly everywhere, inner must be non-null, however in places where
17253     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17254     */
17255    LDKnativeMonitorUpdateId *inner;
17256    /**
17257     * Indicates that this is the only struct which contains the same pointer.
17258     * Rust functions which take ownership of an object provided via an argument require
17259     * this to be true and invalidate the object pointed to by inner.
17260     */
17261    bool is_owned;
17262 } LDKMonitorUpdateId;
17263
17264 /**
17265  * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
17266  * This corresponds to std::vector in C++
17267  */
17268 typedef struct LDKCVec_MonitorUpdateIdZ {
17269    /**
17270     * The elements in the array.
17271     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17272     */
17273    struct LDKMonitorUpdateId *data;
17274    /**
17275     * The number of elements pointed to by `data`.
17276     */
17277    uintptr_t datalen;
17278 } LDKCVec_MonitorUpdateIdZ;
17279
17280 /**
17281  * A tuple of 2 elements. See the individual fields for the types contained.
17282  */
17283 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
17284    /**
17285     * The element at position 0
17286     */
17287    struct LDKOutPoint a;
17288    /**
17289     * The element at position 1
17290     */
17291    struct LDKCVec_MonitorUpdateIdZ b;
17292 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
17293
17294 /**
17295  * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
17296  * This corresponds to std::vector in C++
17297  */
17298 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
17299    /**
17300     * The elements in the array.
17301     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17302     */
17303    struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
17304    /**
17305     * The number of elements pointed to by `data`.
17306     */
17307    uintptr_t datalen;
17308 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
17309
17310 /**
17311  * Provides an interface that allows storage and retrieval of persisted values that are associated
17312  * with given keys.
17313  *
17314  * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
17315  * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
17316  * ways, as long as per-namespace key uniqueness is asserted.
17317  *
17318  * Keys and namespaces are required to be valid ASCII strings in the range of
17319  * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
17320  * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
17321  * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
17322  * that concerns should always be separated by primary namespace first, before secondary
17323  * namespaces are used. While the number of primary namespaces will be relatively small and is
17324  * determined at compile time, there may be many secondary namespaces per primary namespace. Note
17325  * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
17326  * namespace, i.e., conflicts between keys and equally named
17327  * primary namespaces/secondary namespaces must be avoided.
17328  *
17329  * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
17330  * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
17331  * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
17332  */
17333 typedef struct LDKKVStore {
17334    /**
17335     * An opaque pointer which is passed to your function implementations as an argument.
17336     * This has no meaning in the LDK, and can be NULL or any other value.
17337     */
17338    void *this_arg;
17339    /**
17340     * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
17341     * `key`.
17342     *
17343     * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
17344     * `primary_namespace` and `secondary_namespace`.
17345     *
17346     * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
17347     */
17348    struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
17349    /**
17350     * Persists the given data under the given `key`.
17351     *
17352     * Will create the given `primary_namespace` and `secondary_namespace` if not already present
17353     * in the store.
17354     */
17355    struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
17356    /**
17357     * Removes any data that had previously been persisted under the given `key`.
17358     *
17359     * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
17360     * remove the given `key` at some point in time after the method returns, e.g., as part of an
17361     * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
17362     * [`KVStore::list`] might include the removed key until the changes are actually persisted.
17363     *
17364     * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
17365     * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
17366     * potentially get lost on crash after the method returns. Therefore, this flag should only be
17367     * set for `remove` operations that can be safely replayed at a later time.
17368     *
17369     * Returns successfully if no data will be stored for the given `primary_namespace`,
17370     * `secondary_namespace`, and `key`, independently of whether it was present before its
17371     * invokation or not.
17372     */
17373    struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
17374    /**
17375     * Returns a list of keys that are stored under the given `secondary_namespace` in
17376     * `primary_namespace`.
17377     *
17378     * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
17379     * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
17380     */
17381    struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
17382    /**
17383     * Frees any resources associated with this object given its this_arg pointer.
17384     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17385     */
17386    void (*free)(void *this_arg);
17387 } LDKKVStore;
17388
17389 /**
17390  * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
17391  */
17392 typedef struct LDKPersister {
17393    /**
17394     * An opaque pointer which is passed to your function implementations as an argument.
17395     * This has no meaning in the LDK, and can be NULL or any other value.
17396     */
17397    void *this_arg;
17398    /**
17399     * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
17400     */
17401    struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
17402    /**
17403     * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
17404     */
17405    struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
17406    /**
17407     * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
17408     */
17409    struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
17410    /**
17411     * Frees any resources associated with this object given its this_arg pointer.
17412     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17413     */
17414    void (*free)(void *this_arg);
17415 } LDKPersister;
17416
17417
17418
17419 /**
17420  * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
17421  * [`ChannelMonitorUpdate`]s.
17422  *
17423  * # Overview
17424  *
17425  * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
17426  * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
17427  * deleting) and complexity. This is because it writes channel monitor differential updates,
17428  * whereas the other (default) implementation rewrites the entire monitor on each update. For
17429  * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
17430  * of megabytes (or more). Updates can be as small as a few hundred bytes.
17431  *
17432  * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
17433  * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
17434  * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
17435  * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
17436  * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
17437  * sentinel bytes.
17438  *
17439  * # Storing monitors
17440  *
17441  * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
17442  *
17443  *   - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
17444  *   - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
17445  *
17446  * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
17447  * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
17448  *
17449  * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
17450  *
17451  *   - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
17452  *   - secondary namespace: [the monitor's encoded outpoint name]
17453  *
17454  * Under that secondary namespace, each update is stored with a number string, like `21`, which
17455  * represents its `update_id` value.
17456  *
17457  * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
17458  *
17459  *   - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
17460  *   - Index: `1`
17461  *
17462  * Full channel monitors would be stored at a single key:
17463  *
17464  * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
17465  *
17466  * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
17467  *
17468  * ```text
17469  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
17470  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
17471  * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
17472  * ```
17473  * ... and so on.
17474  *
17475  * # Reading channel state from storage
17476  *
17477  * Channel state can be reconstructed by calling
17478  * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
17479  * list channel monitors themselves and load channels individually using
17480  * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
17481  *
17482  * ## EXTREMELY IMPORTANT
17483  *
17484  * It is extremely important that your [`KVStore::read`] implementation uses the
17485  * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
17486  * that circumstance (not when there is really a permissions error, for example). This is because
17487  * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
17488  * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
17489  * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
17490  *
17491  * # Pruning stale channel updates
17492  *
17493  * Stale updates are pruned when a full monitor is written. The old monitor is first read, and if
17494  * that succeeds, updates in the range between the old and new monitors are deleted. The `lazy`
17495  * flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
17496  * will complete. However, stale updates are not a problem for data integrity, since updates are
17497  * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
17498  *
17499  * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
17500  * would like to get rid of them, consider using the
17501  * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
17502  */
17503 typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
17504    /**
17505     * A pointer to the opaque Rust object.
17506     * Nearly everywhere, inner must be non-null, however in places where
17507     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17508     */
17509    LDKnativeMonitorUpdatingPersister *inner;
17510    /**
17511     * Indicates that this is the only struct which contains the same pointer.
17512     * Rust functions which take ownership of an object provided via an argument require
17513     * this to be true and invalidate the object pointed to by inner.
17514     */
17515    bool is_owned;
17516 } LDKMonitorUpdatingPersister;
17517
17518 /**
17519  * `Persist` defines behavior for persisting channel monitors: this could mean
17520  * writing once to disk, and/or uploading to one or more backup services.
17521  *
17522  * Persistence can happen in one of two ways - synchronously completing before the trait method
17523  * calls return or asynchronously in the background.
17524  *
17525  * # For those implementing synchronous persistence
17526  *
17527  *  * If persistence completes fully (including any relevant `fsync()` calls), the implementation
17528  *    should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
17529  *    should continue.
17530  *
17531  *  * If persistence fails for some reason, implementations should consider returning
17532  *    [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
17533  *    the background with [`ChainMonitor::list_pending_monitor_updates`] and
17534  *    [`ChainMonitor::get_monitor`].
17535  *
17536  *    Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
17537  *    be marked as complete via [`ChainMonitor::channel_monitor_updated`].
17538  *
17539  *    If at some point no further progress can be made towards persisting the pending updates, the
17540  *    node should simply shut down.
17541  *
17542  *  * If the persistence has failed and cannot be retried further (e.g. because of an outage),
17543  *    [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
17544  *    an immediate panic and future operations in LDK generally failing.
17545  *
17546  * # For those implementing asynchronous persistence
17547  *
17548  *  All calls should generally spawn a background task and immediately return
17549  *  [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
17550  *  [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
17551  *  [`MonitorUpdateId`].
17552  *
17553  *  Note that unlike the direct [`chain::Watch`] interface,
17554  *  [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
17555  *
17556  *  If at some point no further progress can be made towards persisting a pending update, the node
17557  *  should simply shut down. Until then, the background task should either loop indefinitely, or
17558  *  persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
17559  *  and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
17560  *  monitor updates may be marked completed).
17561  *
17562  * # Using remote watchtowers
17563  *
17564  * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
17565  * update process described above while the watchtower is being updated. The following methods are
17566  * provided for bulding transactions for a watchtower:
17567  * [`ChannelMonitor::initial_counterparty_commitment_tx`],
17568  * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
17569  * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
17570  * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
17571  *
17572  * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
17573  * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
17574  */
17575 typedef struct LDKPersist {
17576    /**
17577     * An opaque pointer which is passed to your function implementations as an argument.
17578     * This has no meaning in the LDK, and can be NULL or any other value.
17579     */
17580    void *this_arg;
17581    /**
17582     * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
17583     * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
17584     *
17585     * The data can be stored any way you want, but the identifier provided by LDK is the
17586     * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
17587     * and the stored channel data). Note that you **must** persist every new monitor to disk.
17588     *
17589     * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
17590     * if you return [`ChannelMonitorUpdateStatus::InProgress`].
17591     *
17592     * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
17593     * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
17594     *
17595     * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17596     * [`Writeable::write`]: crate::util::ser::Writeable::write
17597     */
17598    enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
17599    /**
17600     * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
17601     * update.
17602     *
17603     * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
17604     * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
17605     * details.
17606     *
17607     * During blockchain synchronization operations, and in some rare cases, this may be called with
17608     * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
17609     * Note that after the full [`ChannelMonitor`] is persisted any previous
17610     * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
17611     * applied to the persisted [`ChannelMonitor`] as they were already applied.
17612     *
17613     * If an implementer chooses to persist the updates only, they need to make
17614     * sure that all the updates are applied to the `ChannelMonitors` *before*
17615     * the set of channel monitors is given to the `ChannelManager`
17616     * deserialization routine. See [`ChannelMonitor::update_monitor`] for
17617     * applying a monitor update to a monitor. If full `ChannelMonitors` are
17618     * persisted, then there is no need to persist individual updates.
17619     *
17620     * Note that there could be a performance tradeoff between persisting complete
17621     * channel monitors on every update vs. persisting only updates and applying
17622     * them in batches. The size of each monitor grows `O(number of state updates)`
17623     * whereas updates are small and `O(1)`.
17624     *
17625     * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
17626     * if you return [`ChannelMonitorUpdateStatus::InProgress`].
17627     *
17628     * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
17629     * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
17630     * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
17631     *
17632     * [`Writeable::write`]: crate::util::ser::Writeable::write
17633     *
17634     * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
17635     */
17636    enum LDKChannelMonitorUpdateStatus (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_id, struct LDKChannelMonitorUpdate update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
17637    /**
17638     * Frees any resources associated with this object given its this_arg pointer.
17639     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17640     */
17641    void (*free)(void *this_arg);
17642 } LDKPersist;
17643
17644
17645
17646 /**
17647  * A string that displays only printable characters, replacing control characters with
17648  * [`core::char::REPLACEMENT_CHARACTER`].
17649  */
17650 typedef struct MUST_USE_STRUCT LDKPrintableString {
17651    /**
17652     * A pointer to the opaque Rust object.
17653     * Nearly everywhere, inner must be non-null, however in places where
17654     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17655     */
17656    LDKnativePrintableString *inner;
17657    /**
17658     * Indicates that this is the only struct which contains the same pointer.
17659     * Rust functions which take ownership of an object provided via an argument require
17660     * this to be true and invalidate the object pointed to by inner.
17661     */
17662    bool is_owned;
17663 } LDKPrintableString;
17664
17665 /**
17666  * A callback which is called when a [`Future`] completes.
17667  *
17668  * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
17669  * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
17670  * instead.
17671  *
17672  * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
17673  * futures when they receive a wake, rather than immediately executing them.
17674  */
17675 typedef struct LDKFutureCallback {
17676    /**
17677     * An opaque pointer which is passed to your function implementations as an argument.
17678     * This has no meaning in the LDK, and can be NULL or any other value.
17679     */
17680    void *this_arg;
17681    /**
17682     * The method which is called.
17683     */
17684    void (*call)(const void *this_arg);
17685    /**
17686     * Frees any resources associated with this object given its this_arg pointer.
17687     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17688     */
17689    void (*free)(void *this_arg);
17690 } LDKFutureCallback;
17691
17692
17693
17694 /**
17695  * A struct which can be used to select across many [`Future`]s at once without relying on a full
17696  * async context.
17697  */
17698 typedef struct MUST_USE_STRUCT LDKSleeper {
17699    /**
17700     * A pointer to the opaque Rust object.
17701     * Nearly everywhere, inner must be non-null, however in places where
17702     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17703     */
17704    LDKnativeSleeper *inner;
17705    /**
17706     * Indicates that this is the only struct which contains the same pointer.
17707     * Rust functions which take ownership of an object provided via an argument require
17708     * this to be true and invalidate the object pointed to by inner.
17709     */
17710    bool is_owned;
17711 } LDKSleeper;
17712
17713
17714
17715 /**
17716  * Configuration we set when applicable.
17717  *
17718  * Default::default() provides sane defaults.
17719  */
17720 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
17721    /**
17722     * A pointer to the opaque Rust object.
17723     * Nearly everywhere, inner must be non-null, however in places where
17724     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17725     */
17726    LDKnativeChannelHandshakeConfig *inner;
17727    /**
17728     * Indicates that this is the only struct which contains the same pointer.
17729     * Rust functions which take ownership of an object provided via an argument require
17730     * this to be true and invalidate the object pointed to by inner.
17731     */
17732    bool is_owned;
17733 } LDKChannelHandshakeConfig;
17734
17735
17736
17737 /**
17738  * Optional channel limits which are applied during channel creation.
17739  *
17740  * These limits are only applied to our counterparty's limits, not our own.
17741  *
17742  * Use 0/`<type>::max_value()` as appropriate to skip checking.
17743  *
17744  * Provides sane defaults for most configurations.
17745  *
17746  * Most additional limits are disabled except those with which specify a default in individual
17747  * field documentation. Note that this may result in barely-usable channels, but since they
17748  * are applied mostly only to incoming channels that's not much of a problem.
17749  */
17750 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
17751    /**
17752     * A pointer to the opaque Rust object.
17753     * Nearly everywhere, inner must be non-null, however in places where
17754     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17755     */
17756    LDKnativeChannelHandshakeLimits *inner;
17757    /**
17758     * Indicates that this is the only struct which contains the same pointer.
17759     * Rust functions which take ownership of an object provided via an argument require
17760     * this to be true and invalidate the object pointed to by inner.
17761     */
17762    bool is_owned;
17763 } LDKChannelHandshakeLimits;
17764
17765
17766
17767 /**
17768  * A parallel struct to [`ChannelConfig`] to define partial updates.
17769  */
17770 typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
17771    /**
17772     * A pointer to the opaque Rust object.
17773     * Nearly everywhere, inner must be non-null, however in places where
17774     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17775     */
17776    LDKnativeChannelConfigUpdate *inner;
17777    /**
17778     * Indicates that this is the only struct which contains the same pointer.
17779     * Rust functions which take ownership of an object provided via an argument require
17780     * this to be true and invalidate the object pointed to by inner.
17781     */
17782    bool is_owned;
17783 } LDKChannelConfigUpdate;
17784
17785
17786
17787 /**
17788  * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
17789  *
17790  * Default::default() provides sane defaults for most configurations
17791  * (but currently with 0 relay fees!)
17792  */
17793 typedef struct MUST_USE_STRUCT LDKUserConfig {
17794    /**
17795     * A pointer to the opaque Rust object.
17796     * Nearly everywhere, inner must be non-null, however in places where
17797     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17798     */
17799    LDKnativeUserConfig *inner;
17800    /**
17801     * Indicates that this is the only struct which contains the same pointer.
17802     * Rust functions which take ownership of an object provided via an argument require
17803     * this to be true and invalidate the object pointed to by inner.
17804     */
17805    bool is_owned;
17806 } LDKUserConfig;
17807
17808
17809
17810 /**
17811  * The best known block as identified by its hash and height.
17812  */
17813 typedef struct MUST_USE_STRUCT LDKBestBlock {
17814    /**
17815     * A pointer to the opaque Rust object.
17816     * Nearly everywhere, inner must be non-null, however in places where
17817     * the Rust equivalent takes an Option, it may be set to null to indicate None.
17818     */
17819    LDKnativeBestBlock *inner;
17820    /**
17821     * Indicates that this is the only struct which contains the same pointer.
17822     * Rust functions which take ownership of an object provided via an argument require
17823     * this to be true and invalidate the object pointed to by inner.
17824     */
17825    bool is_owned;
17826 } LDKBestBlock;
17827
17828 /**
17829  * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
17830  * chain.
17831  *
17832  * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
17833  * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
17834  * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
17835  * when needed.
17836  *
17837  * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
17838  * entire header chain and only blocks with matching transaction data using BIP 157 filters or
17839  * other similar filtering.
17840  */
17841 typedef struct LDKListen {
17842    /**
17843     * An opaque pointer which is passed to your function implementations as an argument.
17844     * This has no meaning in the LDK, and can be NULL or any other value.
17845     */
17846    void *this_arg;
17847    /**
17848     * Notifies the listener that a block was added at the given height, with the transaction data
17849     * possibly filtered.
17850     */
17851    void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
17852    /**
17853     * Notifies the listener that a block was added at the given height.
17854     */
17855    void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
17856    /**
17857     * Notifies the listener that a block was removed at the given height.
17858     */
17859    void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
17860    /**
17861     * Frees any resources associated with this object given its this_arg pointer.
17862     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17863     */
17864    void (*free)(void *this_arg);
17865 } LDKListen;
17866
17867 /**
17868  * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
17869  * chain or unconfirmed during a chain reorganization.
17870  *
17871  * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
17872  * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
17873  * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
17874  * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
17875  * with reference to the confirmation status of the monitored objects.
17876  *
17877  * # Use
17878  * The intended use is as follows:
17879  * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
17880  *   outputs are, respectively, confirmed or spent on chain.
17881  * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
17882  *   [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
17883  * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
17884  *
17885  * # Order
17886  *
17887  * Clients must call these methods in chain order. Specifically:
17888  * - Transactions which are confirmed in a particular block must be given before transactions
17889  *   confirmed in a later block.
17890  * - Dependent transactions within the same block must be given in topological order, possibly in
17891  *   separate calls.
17892  * - All unconfirmed transactions must be given after the original confirmations and before *any*
17893  *   reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
17894  *   never be interleaved, but always conduced *en bloc*.
17895  * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
17896  *   in regard to the new block.
17897  *
17898  * See individual method documentation for further details.
17899  *
17900  * [`transactions_confirmed`]: Self::transactions_confirmed
17901  * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
17902  * [`best_block_updated`]: Self::best_block_updated
17903  * [`get_relevant_txids`]: Self::get_relevant_txids
17904  */
17905 typedef struct LDKConfirm {
17906    /**
17907     * An opaque pointer which is passed to your function implementations as an argument.
17908     * This has no meaning in the LDK, and can be NULL or any other value.
17909     */
17910    void *this_arg;
17911    /**
17912     * Notifies LDK of transactions confirmed in a block with a given header and height.
17913     *
17914     * Must be called for any transactions registered by [`Filter::register_tx`] or any
17915     * transactions spending an output registered by [`Filter::register_output`]. Such transactions
17916     * appearing in the same block do not need to be included in the same call; instead, multiple
17917     * calls with additional transactions may be made so long as they are made in [chain order].
17918     *
17919     * May be called before or after [`best_block_updated`] for the corresponding block. However,
17920     * in the event of a chain reorganization, it must not be called with a `header` that is no
17921     * longer in the chain as of the last call to [`best_block_updated`].
17922     *
17923     * [chain order]: Confirm#order
17924     * [`best_block_updated`]: Self::best_block_updated
17925     */
17926    void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
17927    /**
17928     * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
17929     *
17930     * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
17931     * reorganized out of the best chain or if it is no longer confirmed in the block with the
17932     * given block hash. Once called, the given transaction will not be returned
17933     * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
17934     *
17935     * [`get_relevant_txids`]: Self::get_relevant_txids
17936     * [`transactions_confirmed`]: Self::transactions_confirmed
17937     */
17938    void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
17939    /**
17940     * Notifies LDK of an update to the best header connected at the given height.
17941     *
17942     * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
17943     * blocks.
17944     */
17945    void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
17946    /**
17947     * Returns transactions that must be monitored for reorganization out of the chain along
17948     * with the hash of the block as part of which it had been previously confirmed.
17949     *
17950     * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
17951     * 0.0.112 and prior, in which case you need to manually track previous confirmations.
17952     *
17953     * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
17954     * confirmations to be safe from a chain reorganization. Will not include any transactions
17955     * passed to [`transaction_unconfirmed`], unless later reconfirmed.
17956     *
17957     * Must be called to determine the subset of transactions that must be monitored for
17958     * reorganization. Will be idempotent between calls but may change as a result of calls to the
17959     * other interface methods. Thus, this is useful to determine which transactions must be
17960     * given to [`transaction_unconfirmed`].
17961     *
17962     * If any of the returned transactions are confirmed in a block other than the one with the
17963     * given hash, they need to be unconfirmed and reconfirmed via [`transaction_unconfirmed`] and
17964     * [`transactions_confirmed`], respectively.
17965     *
17966     * [`transactions_confirmed`]: Self::transactions_confirmed
17967     * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
17968     */
17969    struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
17970    /**
17971     * Frees any resources associated with this object given its this_arg pointer.
17972     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17973     */
17974    void (*free)(void *this_arg);
17975 } LDKConfirm;
17976
17977
17978
17979 /**
17980  * An implementation of [`chain::Watch`] for monitoring channels.
17981  *
17982  * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
17983  * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
17984  * or used independently to monitor channels remotely. See the [module-level documentation] for
17985  * details.
17986  *
17987  * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
17988  * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
17989  * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
17990  * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
17991  * environment with spotty connections, like on mobile.
17992  *
17993  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
17994  * [module-level documentation]: crate::chain::chainmonitor
17995  * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
17996  */
17997 typedef struct MUST_USE_STRUCT LDKChainMonitor {
17998    /**
17999     * A pointer to the opaque Rust object.
18000     * Nearly everywhere, inner must be non-null, however in places where
18001     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18002     */
18003    LDKnativeChainMonitor *inner;
18004    /**
18005     * Indicates that this is the only struct which contains the same pointer.
18006     * Rust functions which take ownership of an object provided via an argument require
18007     * this to be true and invalidate the object pointed to by inner.
18008     */
18009    bool is_owned;
18010 } LDKChainMonitor;
18011
18012 /**
18013  * A trait implemented for objects handling events from [`EventsProvider`].
18014  *
18015  * An async variation also exists for implementations of [`EventsProvider`] that support async
18016  * event handling. The async event handler should satisfy the generic bounds: `F:
18017  * core::future::Future, H: Fn(Event) -> F`.
18018  */
18019 typedef struct LDKEventHandler {
18020    /**
18021     * An opaque pointer which is passed to your function implementations as an argument.
18022     * This has no meaning in the LDK, and can be NULL or any other value.
18023     */
18024    void *this_arg;
18025    /**
18026     * Handles the given [`Event`].
18027     *
18028     * See [`EventsProvider`] for details that must be considered when implementing this method.
18029     */
18030    void (*handle_event)(const void *this_arg, struct LDKEvent event);
18031    /**
18032     * Frees any resources associated with this object given its this_arg pointer.
18033     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18034     */
18035    void (*free)(void *this_arg);
18036 } LDKEventHandler;
18037
18038 /**
18039  * A trait indicating an object may generate events.
18040  *
18041  * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
18042  *
18043  * Implementations of this trait may also feature an async version of event handling, as shown with
18044  * [`ChannelManager::process_pending_events_async`] and
18045  * [`ChainMonitor::process_pending_events_async`].
18046  *
18047  * # Requirements
18048  *
18049  * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
18050  * event since the last invocation.
18051  *
18052  * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
18053  * and replay any unhandled events on startup. An [`Event`] is considered handled when
18054  * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
18055  * relevant changes to disk *before* returning.
18056  *
18057  * Further, because an application may crash between an [`Event`] being handled and the
18058  * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
18059  * effect, [`Event`]s may be replayed.
18060  *
18061  * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
18062  * consult the provider's documentation on the implication of processing events and how a handler
18063  * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
18064  * [`ChainMonitor::process_pending_events`]).
18065  *
18066  * (C-not implementable) As there is likely no reason for a user to implement this trait on their
18067  * own type(s).
18068  *
18069  * [`process_pending_events`]: Self::process_pending_events
18070  * [`handle_event`]: EventHandler::handle_event
18071  * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
18072  * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
18073  * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
18074  * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
18075  */
18076 typedef struct LDKEventsProvider {
18077    /**
18078     * An opaque pointer which is passed to your function implementations as an argument.
18079     * This has no meaning in the LDK, and can be NULL or any other value.
18080     */
18081    void *this_arg;
18082    /**
18083     * Processes any events generated since the last call using the given event handler.
18084     *
18085     * See the trait-level documentation for requirements.
18086     */
18087    void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
18088    /**
18089     * Frees any resources associated with this object given its this_arg pointer.
18090     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18091     */
18092    void (*free)(void *this_arg);
18093 } LDKEventsProvider;
18094
18095 /**
18096  * This enum is used to specify which error data to send to peers when failing back an HTLC
18097  * using [`ChannelManager::fail_htlc_backwards_with_reason`].
18098  *
18099  * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
18100  */
18101 typedef enum LDKFailureCode_Tag {
18102    /**
18103     * We had a temporary error processing the payment. Useful if no other error codes fit
18104     * and you want to indicate that the payer may want to retry.
18105     */
18106    LDKFailureCode_TemporaryNodeFailure,
18107    /**
18108     * We have a required feature which was not in this onion. For example, you may require
18109     * some additional metadata that was not provided with this payment.
18110     */
18111    LDKFailureCode_RequiredNodeFeatureMissing,
18112    /**
18113     * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
18114     * the HTLC is too close to the current block height for safe handling.
18115     * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
18116     * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
18117     */
18118    LDKFailureCode_IncorrectOrUnknownPaymentDetails,
18119    /**
18120     * We failed to process the payload after the onion was decrypted. You may wish to
18121     * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
18122     *
18123     * If available, the tuple data may include the type number and byte offset in the
18124     * decrypted byte stream where the failure occurred.
18125     */
18126    LDKFailureCode_InvalidOnionPayload,
18127    /**
18128     * Must be last for serialization purposes
18129     */
18130    LDKFailureCode_Sentinel,
18131 } LDKFailureCode_Tag;
18132
18133 typedef struct MUST_USE_STRUCT LDKFailureCode {
18134    LDKFailureCode_Tag tag;
18135    union {
18136       struct {
18137          struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
18138       };
18139    };
18140 } LDKFailureCode;
18141
18142
18143
18144 /**
18145  * Chain-related parameters used to construct a new `ChannelManager`.
18146  *
18147  * Typically, the block-specific parameters are derived from the best block hash for the network,
18148  * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
18149  * are not needed when deserializing a previously constructed `ChannelManager`.
18150  */
18151 typedef struct MUST_USE_STRUCT LDKChainParameters {
18152    /**
18153     * A pointer to the opaque Rust object.
18154     * Nearly everywhere, inner must be non-null, however in places where
18155     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18156     */
18157    LDKnativeChainParameters *inner;
18158    /**
18159     * Indicates that this is the only struct which contains the same pointer.
18160     * Rust functions which take ownership of an object provided via an argument require
18161     * this to be true and invalidate the object pointed to by inner.
18162     */
18163    bool is_owned;
18164 } LDKChainParameters;
18165
18166 /**
18167  * A trait indicating an object may generate message send events
18168  */
18169 typedef struct LDKMessageSendEventsProvider {
18170    /**
18171     * An opaque pointer which is passed to your function implementations as an argument.
18172     * This has no meaning in the LDK, and can be NULL or any other value.
18173     */
18174    void *this_arg;
18175    /**
18176     * Gets the list of pending events which were generated by previous actions, clearing the list
18177     * in the process.
18178     */
18179    struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
18180    /**
18181     * Frees any resources associated with this object given its this_arg pointer.
18182     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18183     */
18184    void (*free)(void *this_arg);
18185 } LDKMessageSendEventsProvider;
18186
18187 /**
18188  * A trait to describe an object which can receive channel messages.
18189  *
18190  * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
18191  * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
18192  */
18193 typedef struct LDKChannelMessageHandler {
18194    /**
18195     * An opaque pointer which is passed to your function implementations as an argument.
18196     * This has no meaning in the LDK, and can be NULL or any other value.
18197     */
18198    void *this_arg;
18199    /**
18200     * Handle an incoming `open_channel` message from the given peer.
18201     */
18202    void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
18203    /**
18204     * Handle an incoming `open_channel2` message from the given peer.
18205     */
18206    void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
18207    /**
18208     * Handle an incoming `accept_channel` message from the given peer.
18209     */
18210    void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
18211    /**
18212     * Handle an incoming `accept_channel2` message from the given peer.
18213     */
18214    void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
18215    /**
18216     * Handle an incoming `funding_created` message from the given peer.
18217     */
18218    void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
18219    /**
18220     * Handle an incoming `funding_signed` message from the given peer.
18221     */
18222    void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
18223    /**
18224     * Handle an incoming `channel_ready` message from the given peer.
18225     */
18226    void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
18227    /**
18228     * Handle an incoming `shutdown` message from the given peer.
18229     */
18230    void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
18231    /**
18232     * Handle an incoming `closing_signed` message from the given peer.
18233     */
18234    void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
18235    /**
18236     * Handle an incoming `tx_add_input message` from the given peer.
18237     */
18238    void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
18239    /**
18240     * Handle an incoming `tx_add_output` message from the given peer.
18241     */
18242    void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
18243    /**
18244     * Handle an incoming `tx_remove_input` message from the given peer.
18245     */
18246    void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
18247    /**
18248     * Handle an incoming `tx_remove_output` message from the given peer.
18249     */
18250    void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
18251    /**
18252     * Handle an incoming `tx_complete message` from the given peer.
18253     */
18254    void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
18255    /**
18256     * Handle an incoming `tx_signatures` message from the given peer.
18257     */
18258    void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
18259    /**
18260     * Handle an incoming `tx_init_rbf` message from the given peer.
18261     */
18262    void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
18263    /**
18264     * Handle an incoming `tx_ack_rbf` message from the given peer.
18265     */
18266    void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
18267    /**
18268     * Handle an incoming `tx_abort message` from the given peer.
18269     */
18270    void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
18271    /**
18272     * Handle an incoming `update_add_htlc` message from the given peer.
18273     */
18274    void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
18275    /**
18276     * Handle an incoming `update_fulfill_htlc` message from the given peer.
18277     */
18278    void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
18279    /**
18280     * Handle an incoming `update_fail_htlc` message from the given peer.
18281     */
18282    void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
18283    /**
18284     * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
18285     */
18286    void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
18287    /**
18288     * Handle an incoming `commitment_signed` message from the given peer.
18289     */
18290    void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
18291    /**
18292     * Handle an incoming `revoke_and_ack` message from the given peer.
18293     */
18294    void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
18295    /**
18296     * Handle an incoming `update_fee` message from the given peer.
18297     */
18298    void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
18299    /**
18300     * Handle an incoming `announcement_signatures` message from the given peer.
18301     */
18302    void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
18303    /**
18304     * Indicates a connection to the peer failed/an existing connection was lost.
18305     */
18306    void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
18307    /**
18308     * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
18309     *
18310     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
18311     * with us. Implementors should be somewhat conservative about doing so, however, as other
18312     * message handlers may still wish to communicate with this peer.
18313     */
18314    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
18315    /**
18316     * Handle an incoming `channel_reestablish` message from the given peer.
18317     */
18318    void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
18319    /**
18320     * Handle an incoming `channel_update` message from the given peer.
18321     */
18322    void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
18323    /**
18324     * Handle an incoming `error` message from the given peer.
18325     */
18326    void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
18327    /**
18328     * Gets the node feature flags which this handler itself supports. All available handlers are
18329     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
18330     * which are broadcasted in our [`NodeAnnouncement`] message.
18331     */
18332    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
18333    /**
18334     * Gets the init feature flags which should be sent to the given peer. All available handlers
18335     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
18336     * which are sent in our [`Init`] message.
18337     *
18338     * Note that this method is called before [`Self::peer_connected`].
18339     */
18340    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
18341    /**
18342     * Gets the genesis hashes for this `ChannelMessageHandler` indicating which chains it supports.
18343     *
18344     * If it's `None`, then no particular network chain hash compatibility will be enforced when
18345     * connecting to peers.
18346     */
18347    struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_genesis_hashes)(const void *this_arg);
18348    /**
18349     * Implementation of MessageSendEventsProvider for this object.
18350     */
18351    struct LDKMessageSendEventsProvider MessageSendEventsProvider;
18352    /**
18353     * Frees any resources associated with this object given its this_arg pointer.
18354     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18355     */
18356    void (*free)(void *this_arg);
18357 } LDKChannelMessageHandler;
18358
18359
18360
18361 /**
18362  * Arguments for the creation of a ChannelManager that are not deserialized.
18363  *
18364  * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
18365  * is:
18366  * 1) Deserialize all stored [`ChannelMonitor`]s.
18367  * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
18368  *    `<(BlockHash, ChannelManager)>::read(reader, args)`
18369  *    This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
18370  *    [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
18371  * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
18372  *    same way you would handle a [`chain::Filter`] call using
18373  *    [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
18374  * 4) Reconnect blocks on your [`ChannelMonitor`]s.
18375  * 5) Disconnect/connect blocks on the [`ChannelManager`].
18376  * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
18377  *    Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
18378  *    will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
18379  *    the next step.
18380  * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
18381  *    [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
18382  *
18383  * Note that the ordering of #4-7 is not of importance, however all four must occur before you
18384  * call any other methods on the newly-deserialized [`ChannelManager`].
18385  *
18386  * Note that because some channels may be closed during deserialization, it is critical that you
18387  * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
18388  * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
18389  * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
18390  * not force-close the same channels but consider them live), you may end up revoking a state for
18391  * which you've already broadcasted the transaction.
18392  *
18393  * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
18394  */
18395 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
18396    /**
18397     * A pointer to the opaque Rust object.
18398     * Nearly everywhere, inner must be non-null, however in places where
18399     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18400     */
18401    LDKnativeChannelManagerReadArgs *inner;
18402    /**
18403     * Indicates that this is the only struct which contains the same pointer.
18404     * Rust functions which take ownership of an object provided via an argument require
18405     * this to be true and invalidate the object pointed to by inner.
18406     */
18407    bool is_owned;
18408 } LDKChannelManagerReadArgs;
18409
18410
18411
18412 /**
18413  * A set of keys that were HKDF-expanded from an initial call to
18414  * [`NodeSigner::get_inbound_payment_key_material`].
18415  *
18416  * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
18417  */
18418 typedef struct MUST_USE_STRUCT LDKExpandedKey {
18419    /**
18420     * A pointer to the opaque Rust object.
18421     * Nearly everywhere, inner must be non-null, however in places where
18422     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18423     */
18424    LDKnativeExpandedKey *inner;
18425    /**
18426     * Indicates that this is the only struct which contains the same pointer.
18427     * Rust functions which take ownership of an object provided via an argument require
18428     * this to be true and invalidate the object pointed to by inner.
18429     */
18430    bool is_owned;
18431 } LDKExpandedKey;
18432
18433
18434
18435 /**
18436  * Packet of hop data for next peer
18437  */
18438 typedef struct MUST_USE_STRUCT LDKPacket {
18439    /**
18440     * A pointer to the opaque Rust object.
18441     * Nearly everywhere, inner must be non-null, however in places where
18442     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18443     */
18444    LDKnativePacket *inner;
18445    /**
18446     * Indicates that this is the only struct which contains the same pointer.
18447     * Rust functions which take ownership of an object provided via an argument require
18448     * this to be true and invalidate the object pointed to by inner.
18449     */
18450    bool is_owned;
18451 } LDKPacket;
18452
18453 /**
18454  * A 3-byte byte array.
18455  */
18456 typedef struct LDKThreeBytes {
18457    /**
18458     * The three bytes
18459     */
18460    uint8_t data[3];
18461 } LDKThreeBytes;
18462
18463 /**
18464  * A trait to describe an object which can receive routing messages.
18465  *
18466  * # Implementor DoS Warnings
18467  *
18468  * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
18469  * handling inbound queries. Implementors using an on-disk network graph should be aware of
18470  * repeated disk I/O for queries accessing different parts of the network graph.
18471  */
18472 typedef struct LDKRoutingMessageHandler {
18473    /**
18474     * An opaque pointer which is passed to your function implementations as an argument.
18475     * This has no meaning in the LDK, and can be NULL or any other value.
18476     */
18477    void *this_arg;
18478    /**
18479     * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
18480     * `false` or returning an `Err` otherwise.
18481     */
18482    struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
18483    /**
18484     * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
18485     * or returning an `Err` otherwise.
18486     */
18487    struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
18488    /**
18489     * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
18490     * `false` or returning an `Err` otherwise.
18491     */
18492    struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
18493    /**
18494     * Gets channel announcements and updates required to dump our routing table to a remote node,
18495     * starting at the `short_channel_id` indicated by `starting_point` and including announcements
18496     * for a single channel.
18497     */
18498    struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
18499    /**
18500     * Gets a node announcement required to dump our routing table to a remote node, starting at
18501     * the node *after* the provided pubkey and including up to one announcement immediately
18502     * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
18503     * If `None` is provided for `starting_point`, we start at the first node.
18504     *
18505     * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
18506     * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18507     */
18508    struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
18509    /**
18510     * Called when a connection is established with a peer. This can be used to
18511     * perform routing table synchronization using a strategy defined by the
18512     * implementor.
18513     *
18514     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
18515     * with us. Implementors should be somewhat conservative about doing so, however, as other
18516     * message handlers may still wish to communicate with this peer.
18517     */
18518    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
18519    /**
18520     * Handles the reply of a query we initiated to learn about channels
18521     * for a given range of blocks. We can expect to receive one or more
18522     * replies to a single query.
18523     */
18524    struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
18525    /**
18526     * Handles the reply of a query we initiated asking for routing gossip
18527     * messages for a list of channels. We should receive this message when
18528     * a node has completed its best effort to send us the pertaining routing
18529     * gossip messages.
18530     */
18531    struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
18532    /**
18533     * Handles when a peer asks us to send a list of `short_channel_id`s
18534     * for the requested range of blocks.
18535     */
18536    struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
18537    /**
18538     * Handles when a peer asks us to send routing gossip messages for a
18539     * list of `short_channel_id`s.
18540     */
18541    struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
18542    /**
18543     * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
18544     * pending some async action. While there is no guarantee of the rate of future messages, the
18545     * caller should seek to reduce the rate of new gossip messages handled, especially
18546     * [`ChannelAnnouncement`]s.
18547     */
18548    bool (*processing_queue_high)(const void *this_arg);
18549    /**
18550     * Gets the node feature flags which this handler itself supports. All available handlers are
18551     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
18552     * which are broadcasted in our [`NodeAnnouncement`] message.
18553     */
18554    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
18555    /**
18556     * Gets the init feature flags which should be sent to the given peer. All available handlers
18557     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
18558     * which are sent in our [`Init`] message.
18559     *
18560     * Note that this method is called before [`Self::peer_connected`].
18561     */
18562    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
18563    /**
18564     * Implementation of MessageSendEventsProvider for this object.
18565     */
18566    struct LDKMessageSendEventsProvider MessageSendEventsProvider;
18567    /**
18568     * Frees any resources associated with this object given its this_arg pointer.
18569     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18570     */
18571    void (*free)(void *this_arg);
18572 } LDKRoutingMessageHandler;
18573
18574 /**
18575  * A trait indicating an object may generate onion messages to send
18576  */
18577 typedef struct LDKOnionMessageProvider {
18578    /**
18579     * An opaque pointer which is passed to your function implementations as an argument.
18580     * This has no meaning in the LDK, and can be NULL or any other value.
18581     */
18582    void *this_arg;
18583    /**
18584     * Gets the next pending onion message for the peer with the given node id.
18585     *
18586     * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18587     */
18588    struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
18589    /**
18590     * Frees any resources associated with this object given its this_arg pointer.
18591     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18592     */
18593    void (*free)(void *this_arg);
18594 } LDKOnionMessageProvider;
18595
18596 /**
18597  * A trait to describe an object that can receive onion messages.
18598  */
18599 typedef struct LDKOnionMessageHandler {
18600    /**
18601     * An opaque pointer which is passed to your function implementations as an argument.
18602     * This has no meaning in the LDK, and can be NULL or any other value.
18603     */
18604    void *this_arg;
18605    /**
18606     * Handle an incoming `onion_message` message from the given peer.
18607     */
18608    void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
18609    /**
18610     * Called when a connection is established with a peer. Can be used to track which peers
18611     * advertise onion message support and are online.
18612     *
18613     * May return an `Err(())` if the features the peer supports are not sufficient to communicate
18614     * with us. Implementors should be somewhat conservative about doing so, however, as other
18615     * message handlers may still wish to communicate with this peer.
18616     */
18617    struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
18618    /**
18619     * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
18620     * drop and refuse to forward onion messages to this peer.
18621     */
18622    void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
18623    /**
18624     * Gets the node feature flags which this handler itself supports. All available handlers are
18625     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
18626     * which are broadcasted in our [`NodeAnnouncement`] message.
18627     */
18628    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
18629    /**
18630     * Gets the init feature flags which should be sent to the given peer. All available handlers
18631     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
18632     * which are sent in our [`Init`] message.
18633     *
18634     * Note that this method is called before [`Self::peer_connected`].
18635     */
18636    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
18637    /**
18638     * Implementation of OnionMessageProvider for this object.
18639     */
18640    struct LDKOnionMessageProvider OnionMessageProvider;
18641    /**
18642     * Frees any resources associated with this object given its this_arg pointer.
18643     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18644     */
18645    void (*free)(void *this_arg);
18646 } LDKOnionMessageHandler;
18647
18648 /**
18649  * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
18650  * decoders.
18651  */
18652 typedef struct LDKCustomMessageReader {
18653    /**
18654     * An opaque pointer which is passed to your function implementations as an argument.
18655     * This has no meaning in the LDK, and can be NULL or any other value.
18656     */
18657    void *this_arg;
18658    /**
18659     * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
18660     * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
18661     * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
18662     * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
18663     */
18664    struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
18665    /**
18666     * Frees any resources associated with this object given its this_arg pointer.
18667     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18668     */
18669    void (*free)(void *this_arg);
18670 } LDKCustomMessageReader;
18671
18672 /**
18673  * A handler provided to [`PeerManager`] for reading and handling custom messages.
18674  *
18675  * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
18676  * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
18677  * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
18678  *
18679  * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
18680  * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
18681  */
18682 typedef struct LDKCustomMessageHandler {
18683    /**
18684     * An opaque pointer which is passed to your function implementations as an argument.
18685     * This has no meaning in the LDK, and can be NULL or any other value.
18686     */
18687    void *this_arg;
18688    /**
18689     * Handles the given message sent from `sender_node_id`, possibly producing messages for
18690     * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
18691     * to send.
18692     */
18693    struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
18694    /**
18695     * Returns the list of pending messages that were generated by the handler, clearing the list
18696     * in the process. Each message is paired with the node id of the intended recipient. If no
18697     * connection to the node exists, then the message is simply not sent.
18698     */
18699    struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
18700    /**
18701     * Gets the node feature flags which this handler itself supports. All available handlers are
18702     * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
18703     * which are broadcasted in our [`NodeAnnouncement`] message.
18704     *
18705     * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
18706     */
18707    struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
18708    /**
18709     * Gets the init feature flags which should be sent to the given peer. All available handlers
18710     * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
18711     * which are sent in our [`Init`] message.
18712     *
18713     * [`Init`]: crate::ln::msgs::Init
18714     */
18715    struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
18716    /**
18717     * Implementation of CustomMessageReader for this object.
18718     */
18719    struct LDKCustomMessageReader CustomMessageReader;
18720    /**
18721     * Frees any resources associated with this object given its this_arg pointer.
18722     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18723     */
18724    void (*free)(void *this_arg);
18725 } LDKCustomMessageHandler;
18726
18727
18728
18729 /**
18730  * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
18731  * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
18732  */
18733 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
18734    /**
18735     * A pointer to the opaque Rust object.
18736     * Nearly everywhere, inner must be non-null, however in places where
18737     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18738     */
18739    LDKnativeIgnoringMessageHandler *inner;
18740    /**
18741     * Indicates that this is the only struct which contains the same pointer.
18742     * Rust functions which take ownership of an object provided via an argument require
18743     * this to be true and invalidate the object pointed to by inner.
18744     */
18745    bool is_owned;
18746 } LDKIgnoringMessageHandler;
18747
18748 /**
18749  * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
18750  *
18751  * [`OnionMessage`]: crate::ln::msgs::OnionMessage
18752  */
18753 typedef struct LDKOffersMessageHandler {
18754    /**
18755     * An opaque pointer which is passed to your function implementations as an argument.
18756     * This has no meaning in the LDK, and can be NULL or any other value.
18757     */
18758    void *this_arg;
18759    /**
18760     * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
18761     * or replying with an error.
18762     */
18763    struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
18764    /**
18765     * Frees any resources associated with this object given its this_arg pointer.
18766     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18767     */
18768    void (*free)(void *this_arg);
18769 } LDKOffersMessageHandler;
18770
18771 /**
18772  * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
18773  * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
18774  * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
18775  * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
18776  * message types.
18777  *
18778  * See [`OnionMessenger`] for example usage.
18779  *
18780  * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
18781  * [`CustomMessage`]: Self::CustomMessage
18782  */
18783 typedef struct LDKCustomOnionMessageHandler {
18784    /**
18785     * An opaque pointer which is passed to your function implementations as an argument.
18786     * This has no meaning in the LDK, and can be NULL or any other value.
18787     */
18788    void *this_arg;
18789    /**
18790     * Called with the custom message that was received, returning a response to send, if any.
18791     */
18792    struct LDKCOption_CustomOnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKCustomOnionMessageContents msg);
18793    /**
18794     * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
18795     * message type is unknown.
18796     */
18797    struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
18798    /**
18799     * Frees any resources associated with this object given its this_arg pointer.
18800     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18801     */
18802    void (*free)(void *this_arg);
18803 } LDKCustomOnionMessageHandler;
18804
18805
18806
18807 /**
18808  * A dummy struct which implements `ChannelMessageHandler` without having any channels.
18809  * You can provide one of these as the route_handler in a MessageHandler.
18810  */
18811 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
18812    /**
18813     * A pointer to the opaque Rust object.
18814     * Nearly everywhere, inner must be non-null, however in places where
18815     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18816     */
18817    LDKnativeErroringMessageHandler *inner;
18818    /**
18819     * Indicates that this is the only struct which contains the same pointer.
18820     * Rust functions which take ownership of an object provided via an argument require
18821     * this to be true and invalidate the object pointed to by inner.
18822     */
18823    bool is_owned;
18824 } LDKErroringMessageHandler;
18825
18826
18827
18828 /**
18829  * Provides references to trait impls which handle different types of messages.
18830  */
18831 typedef struct MUST_USE_STRUCT LDKMessageHandler {
18832    /**
18833     * A pointer to the opaque Rust object.
18834     * Nearly everywhere, inner must be non-null, however in places where
18835     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18836     */
18837    LDKnativeMessageHandler *inner;
18838    /**
18839     * Indicates that this is the only struct which contains the same pointer.
18840     * Rust functions which take ownership of an object provided via an argument require
18841     * this to be true and invalidate the object pointed to by inner.
18842     */
18843    bool is_owned;
18844 } LDKMessageHandler;
18845
18846 /**
18847  * Provides an object which can be used to send data to and which uniquely identifies a connection
18848  * to a remote host. You will need to be able to generate multiple of these which meet Eq and
18849  * implement Hash to meet the PeerManager API.
18850  *
18851  * For efficiency, [`Clone`] should be relatively cheap for this type.
18852  *
18853  * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
18854  * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
18855  * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
18856  * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
18857  * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
18858  * to simply use another value which is guaranteed to be globally unique instead.
18859  */
18860 typedef struct LDKSocketDescriptor {
18861    /**
18862     * An opaque pointer which is passed to your function implementations as an argument.
18863     * This has no meaning in the LDK, and can be NULL or any other value.
18864     */
18865    void *this_arg;
18866    /**
18867     * Attempts to send some data from the given slice to the peer.
18868     *
18869     * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
18870     * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
18871     * called and further write attempts may occur until that time.
18872     *
18873     * If the returned size is smaller than `data.len()`, a
18874     * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
18875     * written. Additionally, until a `send_data` event completes fully, no further
18876     * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
18877     * prevent denial-of-service issues, you should not read or buffer any data from the socket
18878     * until then.
18879     *
18880     * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
18881     * (indicating that read events should be paused to prevent DoS in the send buffer),
18882     * `resume_read` may be set indicating that read events on this descriptor should resume. A
18883     * `resume_read` of false carries no meaning, and should not cause any action.
18884     */
18885    uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
18886    /**
18887     * Disconnect the socket pointed to by this SocketDescriptor.
18888     *
18889     * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
18890     * call (doing so is a noop).
18891     */
18892    void (*disconnect_socket)(void *this_arg);
18893    /**
18894     * Checks if two objects are equal given this object's this_arg pointer and another object.
18895     */
18896    bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
18897    /**
18898     * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
18899     * This is used, for example, for inclusion of this object in a hash map.
18900     */
18901    uint64_t (*hash)(const void *this_arg);
18902    /**
18903     * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
18904     * The new SocketDescriptor is provided, and should be mutated as needed to perform a
18905     * deep copy of the object pointed to by this_arg or avoid any double-freeing.
18906     */
18907    void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
18908    /**
18909     * Frees any resources associated with this object given its this_arg pointer.
18910     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18911     */
18912    void (*free)(void *this_arg);
18913 } LDKSocketDescriptor;
18914
18915
18916
18917 /**
18918  * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
18919  * socket events into messages which it passes on to its [`MessageHandler`].
18920  *
18921  * Locks are taken internally, so you must never assume that reentrancy from a
18922  * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
18923  *
18924  * Calls to [`read_event`] will decode relevant messages and pass them to the
18925  * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
18926  * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
18927  * [`PeerManager`] functions related to the same connection must occur only in serial, making new
18928  * calls only after previous ones have returned.
18929  *
18930  * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
18931  * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
18932  * essentially you should default to using a [`SimpleRefPeerManager`], and use a
18933  * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
18934  * you're using lightning-net-tokio.
18935  *
18936  * [`read_event`]: PeerManager::read_event
18937  */
18938 typedef struct MUST_USE_STRUCT LDKPeerManager {
18939    /**
18940     * A pointer to the opaque Rust object.
18941     * Nearly everywhere, inner must be non-null, however in places where
18942     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18943     */
18944    LDKnativePeerManager *inner;
18945    /**
18946     * Indicates that this is the only struct which contains the same pointer.
18947     * Rust functions which take ownership of an object provided via an argument require
18948     * this to be true and invalidate the object pointed to by inner.
18949     */
18950    bool is_owned;
18951 } LDKPeerManager;
18952
18953
18954
18955 /**
18956  * Static channel fields used to build transactions given per-commitment fields, organized by
18957  * broadcaster/countersignatory.
18958  *
18959  * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
18960  * as_holder_broadcastable and as_counterparty_broadcastable functions.
18961  */
18962 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
18963    /**
18964     * A pointer to the opaque Rust object.
18965     * Nearly everywhere, inner must be non-null, however in places where
18966     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18967     */
18968    LDKnativeDirectedChannelTransactionParameters *inner;
18969    /**
18970     * Indicates that this is the only struct which contains the same pointer.
18971     * Rust functions which take ownership of an object provided via an argument require
18972     * this to be true and invalidate the object pointed to by inner.
18973     */
18974    bool is_owned;
18975 } LDKDirectedChannelTransactionParameters;
18976
18977
18978
18979 /**
18980  * Features used within an `offer`.
18981  */
18982 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
18983    /**
18984     * A pointer to the opaque Rust object.
18985     * Nearly everywhere, inner must be non-null, however in places where
18986     * the Rust equivalent takes an Option, it may be set to null to indicate None.
18987     */
18988    LDKnativeOfferFeatures *inner;
18989    /**
18990     * Indicates that this is the only struct which contains the same pointer.
18991     * Rust functions which take ownership of an object provided via an argument require
18992     * this to be true and invalidate the object pointed to by inner.
18993     */
18994    bool is_owned;
18995 } LDKOfferFeatures;
18996
18997
18998
18999 /**
19000  * Features used within an `invoice_request`.
19001  */
19002 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
19003    /**
19004     * A pointer to the opaque Rust object.
19005     * Nearly everywhere, inner must be non-null, however in places where
19006     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19007     */
19008    LDKnativeInvoiceRequestFeatures *inner;
19009    /**
19010     * Indicates that this is the only struct which contains the same pointer.
19011     * Rust functions which take ownership of an object provided via an argument require
19012     * this to be true and invalidate the object pointed to by inner.
19013     */
19014    bool is_owned;
19015 } LDKInvoiceRequestFeatures;
19016
19017 /**
19018  * Integer in the range `0..=16`
19019  */
19020 typedef struct LDKWitnessVersion {
19021    uint8_t _0;
19022 } LDKWitnessVersion;
19023
19024
19025
19026 /**
19027  * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
19028  * another currency.
19029  */
19030 typedef struct MUST_USE_STRUCT LDKAmount {
19031    /**
19032     * A pointer to the opaque Rust object.
19033     * Nearly everywhere, inner must be non-null, however in places where
19034     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19035     */
19036    LDKnativeAmount *inner;
19037    /**
19038     * Indicates that this is the only struct which contains the same pointer.
19039     * Rust functions which take ownership of an object provided via an argument require
19040     * this to be true and invalidate the object pointed to by inner.
19041     */
19042    bool is_owned;
19043 } LDKAmount;
19044
19045
19046
19047 /**
19048  * Quantity of items supported by an [`Offer`].
19049  */
19050 typedef struct MUST_USE_STRUCT LDKQuantity {
19051    /**
19052     * A pointer to the opaque Rust object.
19053     * Nearly everywhere, inner must be non-null, however in places where
19054     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19055     */
19056    LDKnativeQuantity *inner;
19057    /**
19058     * Indicates that this is the only struct which contains the same pointer.
19059     * Rust functions which take ownership of an object provided via an argument require
19060     * this to be true and invalidate the object pointed to by inner.
19061     */
19062    bool is_owned;
19063 } LDKQuantity;
19064
19065
19066
19067 /**
19068  * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
19069  * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
19070  *
19071  * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
19072  * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
19073  */
19074 typedef struct MUST_USE_STRUCT LDKTaggedHash {
19075    /**
19076     * A pointer to the opaque Rust object.
19077     * Nearly everywhere, inner must be non-null, however in places where
19078     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19079     */
19080    LDKnativeTaggedHash *inner;
19081    /**
19082     * Indicates that this is the only struct which contains the same pointer.
19083     * Rust functions which take ownership of an object provided via an argument require
19084     * this to be true and invalidate the object pointed to by inner.
19085     */
19086    bool is_owned;
19087 } LDKTaggedHash;
19088
19089
19090
19091 /**
19092  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
19093  *
19094  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
19095  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
19096  */
19097 typedef struct MUST_USE_STRUCT LDKErroneousField {
19098    /**
19099     * A pointer to the opaque Rust object.
19100     * Nearly everywhere, inner must be non-null, however in places where
19101     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19102     */
19103    LDKnativeErroneousField *inner;
19104    /**
19105     * Indicates that this is the only struct which contains the same pointer.
19106     * Rust functions which take ownership of an object provided via an argument require
19107     * this to be true and invalidate the object pointed to by inner.
19108     */
19109    bool is_owned;
19110 } LDKErroneousField;
19111
19112
19113
19114 /**
19115  * Receives and validates network updates from peers,
19116  * stores authentic and relevant data as a network graph.
19117  * This network graph is then used for routing payments.
19118  * Provides interface to help with initial routing sync by
19119  * serving historical announcements.
19120  */
19121 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
19122    /**
19123     * A pointer to the opaque Rust object.
19124     * Nearly everywhere, inner must be non-null, however in places where
19125     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19126     */
19127    LDKnativeP2PGossipSync *inner;
19128    /**
19129     * Indicates that this is the only struct which contains the same pointer.
19130     * Rust functions which take ownership of an object provided via an argument require
19131     * this to be true and invalidate the object pointed to by inner.
19132     */
19133    bool is_owned;
19134 } LDKP2PGossipSync;
19135
19136
19137
19138 /**
19139  * A read-only view of [`NetworkGraph`].
19140  */
19141 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
19142    /**
19143     * A pointer to the opaque Rust object.
19144     * Nearly everywhere, inner must be non-null, however in places where
19145     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19146     */
19147    LDKnativeReadOnlyNetworkGraph *inner;
19148    /**
19149     * Indicates that this is the only struct which contains the same pointer.
19150     * Rust functions which take ownership of an object provided via an argument require
19151     * this to be true and invalidate the object pointed to by inner.
19152     */
19153    bool is_owned;
19154 } LDKReadOnlyNetworkGraph;
19155
19156
19157
19158 /**
19159  * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
19160  * source node to a target node.
19161  */
19162 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
19163    /**
19164     * A pointer to the opaque Rust object.
19165     * Nearly everywhere, inner must be non-null, however in places where
19166     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19167     */
19168    LDKnativeDirectedChannelInfo *inner;
19169    /**
19170     * Indicates that this is the only struct which contains the same pointer.
19171     * Rust functions which take ownership of an object provided via an argument require
19172     * this to be true and invalidate the object pointed to by inner.
19173     */
19174    bool is_owned;
19175 } LDKDirectedChannelInfo;
19176
19177 /**
19178  * The effective capacity of a channel for routing purposes.
19179  *
19180  * While this may be smaller than the actual channel capacity, amounts greater than
19181  * [`Self::as_msat`] should not be routed through the channel.
19182  */
19183 typedef enum LDKEffectiveCapacity_Tag {
19184    /**
19185     * The available liquidity in the channel known from being a channel counterparty, and thus a
19186     * direct hop.
19187     */
19188    LDKEffectiveCapacity_ExactLiquidity,
19189    /**
19190     * The maximum HTLC amount in one direction as advertised on the gossip network.
19191     */
19192    LDKEffectiveCapacity_AdvertisedMaxHTLC,
19193    /**
19194     * The total capacity of the channel as determined by the funding transaction.
19195     */
19196    LDKEffectiveCapacity_Total,
19197    /**
19198     * A capacity sufficient to route any payment, typically used for private channels provided by
19199     * an invoice.
19200     */
19201    LDKEffectiveCapacity_Infinite,
19202    /**
19203     * The maximum HTLC amount as provided by an invoice route hint.
19204     */
19205    LDKEffectiveCapacity_HintMaxHTLC,
19206    /**
19207     * A capacity that is unknown possibly because either the chain state is unavailable to know
19208     * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
19209     */
19210    LDKEffectiveCapacity_Unknown,
19211    /**
19212     * Must be last for serialization purposes
19213     */
19214    LDKEffectiveCapacity_Sentinel,
19215 } LDKEffectiveCapacity_Tag;
19216
19217 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
19218    /**
19219     * Either the inbound or outbound liquidity depending on the direction, denominated in
19220     * millisatoshi.
19221     */
19222    uint64_t liquidity_msat;
19223 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
19224
19225 typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
19226    /**
19227     * The maximum HTLC amount denominated in millisatoshi.
19228     */
19229    uint64_t amount_msat;
19230 } LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
19231
19232 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
19233    /**
19234     * The funding amount denominated in millisatoshi.
19235     */
19236    uint64_t capacity_msat;
19237    /**
19238     * The maximum HTLC amount denominated in millisatoshi.
19239     */
19240    uint64_t htlc_maximum_msat;
19241 } LDKEffectiveCapacity_LDKTotal_Body;
19242
19243 typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
19244    /**
19245     * The maximum HTLC amount denominated in millisatoshi.
19246     */
19247    uint64_t amount_msat;
19248 } LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
19249
19250 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
19251    LDKEffectiveCapacity_Tag tag;
19252    union {
19253       LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
19254       LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
19255       LDKEffectiveCapacity_LDKTotal_Body total;
19256       LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
19257    };
19258 } LDKEffectiveCapacity;
19259
19260
19261
19262 /**
19263  * A [`Router`] implemented using [`find_route`].
19264  */
19265 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
19266    /**
19267     * A pointer to the opaque Rust object.
19268     * Nearly everywhere, inner must be non-null, however in places where
19269     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19270     */
19271    LDKnativeDefaultRouter *inner;
19272    /**
19273     * Indicates that this is the only struct which contains the same pointer.
19274     * Rust functions which take ownership of an object provided via an argument require
19275     * this to be true and invalidate the object pointed to by inner.
19276     */
19277    bool is_owned;
19278 } LDKDefaultRouter;
19279
19280
19281
19282 /**
19283  * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
19284  *
19285  * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
19286  * [`find_route`].
19287  *
19288  * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
19289  */
19290 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
19291    /**
19292     * A pointer to the opaque Rust object.
19293     * Nearly everywhere, inner must be non-null, however in places where
19294     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19295     */
19296    LDKnativeScorerAccountingForInFlightHtlcs *inner;
19297    /**
19298     * Indicates that this is the only struct which contains the same pointer.
19299     * Rust functions which take ownership of an object provided via an argument require
19300     * this to be true and invalidate the object pointed to by inner.
19301     */
19302    bool is_owned;
19303 } LDKScorerAccountingForInFlightHtlcs;
19304
19305 /**
19306  * The recipient of a payment, differing based on whether they've hidden their identity with route
19307  * blinding.
19308  */
19309 typedef enum LDKPayee_Tag {
19310    /**
19311     * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
19312     * will be included in the final [`Route`].
19313     */
19314    LDKPayee_Blinded,
19315    /**
19316     * The recipient included these route hints in their BOLT11 invoice.
19317     */
19318    LDKPayee_Clear,
19319    /**
19320     * Must be last for serialization purposes
19321     */
19322    LDKPayee_Sentinel,
19323 } LDKPayee_Tag;
19324
19325 typedef struct LDKPayee_LDKBlinded_Body {
19326    /**
19327     * Aggregated routing info and blinded paths, for routing to the payee without knowing their
19328     * node id.
19329     */
19330    struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
19331    /**
19332     * Features supported by the payee.
19333     *
19334     * May be set from the payee's invoice. May be `None` if the invoice does not contain any
19335     * features.
19336     *
19337     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19338     */
19339    struct LDKBolt12InvoiceFeatures features;
19340 } LDKPayee_LDKBlinded_Body;
19341
19342 typedef struct LDKPayee_LDKClear_Body {
19343    /**
19344     * The node id of the payee.
19345     */
19346    struct LDKPublicKey node_id;
19347    /**
19348     * Hints for routing to the payee, containing channels connecting the payee to public nodes.
19349     */
19350    struct LDKCVec_RouteHintZ route_hints;
19351    /**
19352     * Features supported by the payee.
19353     *
19354     * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
19355     * does not contain any features.
19356     *
19357     * [`for_keysend`]: PaymentParameters::for_keysend
19358     *
19359     * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
19360     */
19361    struct LDKBolt11InvoiceFeatures features;
19362    /**
19363     * The minimum CLTV delta at the end of the route. This value must not be zero.
19364     */
19365    uint32_t final_cltv_expiry_delta;
19366 } LDKPayee_LDKClear_Body;
19367
19368 typedef struct MUST_USE_STRUCT LDKPayee {
19369    LDKPayee_Tag tag;
19370    union {
19371       LDKPayee_LDKBlinded_Body blinded;
19372       LDKPayee_LDKClear_Body clear;
19373    };
19374 } LDKPayee;
19375
19376 /**
19377  * A trait which can both lookup and update routing channel penalty scores.
19378  *
19379  * This is used in places where both bounds are required and implemented for all types which
19380  * implement [`ScoreLookUp`] and [`ScoreUpdate`].
19381  *
19382  * Bindings users may need to manually implement this for their custom scoring implementations.
19383  */
19384 typedef struct LDKScore {
19385    /**
19386     * An opaque pointer which is passed to your function implementations as an argument.
19387     * This has no meaning in the LDK, and can be NULL or any other value.
19388     */
19389    void *this_arg;
19390    /**
19391     * Implementation of ScoreLookUp for this object.
19392     */
19393    struct LDKScoreLookUp ScoreLookUp;
19394    /**
19395     * Implementation of ScoreUpdate for this object.
19396     */
19397    struct LDKScoreUpdate ScoreUpdate;
19398    /**
19399     * Serialize the object into a byte array
19400     */
19401    struct LDKCVec_u8Z (*write)(const void *this_arg);
19402    /**
19403     * Frees any resources associated with this object given its this_arg pointer.
19404     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19405     */
19406    void (*free)(void *this_arg);
19407 } LDKScore;
19408
19409
19410
19411 /**
19412  * A concrete implementation of [`LockableScore`] which supports multi-threading.
19413  */
19414 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
19415    /**
19416     * A pointer to the opaque Rust object.
19417     * Nearly everywhere, inner must be non-null, however in places where
19418     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19419     */
19420    LDKnativeMultiThreadedLockableScore *inner;
19421    /**
19422     * Indicates that this is the only struct which contains the same pointer.
19423     * Rust functions which take ownership of an object provided via an argument require
19424     * this to be true and invalidate the object pointed to by inner.
19425     */
19426    bool is_owned;
19427 } LDKMultiThreadedLockableScore;
19428
19429
19430
19431 /**
19432  * A locked `MultiThreadedLockableScore`.
19433  */
19434 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
19435    /**
19436     * A pointer to the opaque Rust object.
19437     * Nearly everywhere, inner must be non-null, however in places where
19438     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19439     */
19440    LDKnativeMultiThreadedScoreLockRead *inner;
19441    /**
19442     * Indicates that this is the only struct which contains the same pointer.
19443     * Rust functions which take ownership of an object provided via an argument require
19444     * this to be true and invalidate the object pointed to by inner.
19445     */
19446    bool is_owned;
19447 } LDKMultiThreadedScoreLockRead;
19448
19449
19450
19451 /**
19452  * A locked `MultiThreadedLockableScore`.
19453  */
19454 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
19455    /**
19456     * A pointer to the opaque Rust object.
19457     * Nearly everywhere, inner must be non-null, however in places where
19458     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19459     */
19460    LDKnativeMultiThreadedScoreLockWrite *inner;
19461    /**
19462     * Indicates that this is the only struct which contains the same pointer.
19463     * Rust functions which take ownership of an object provided via an argument require
19464     * this to be true and invalidate the object pointed to by inner.
19465     */
19466    bool is_owned;
19467 } LDKMultiThreadedScoreLockWrite;
19468
19469
19470
19471 /**
19472  * Parameters for configuring [`ProbabilisticScorer`].
19473  *
19474  * Used to configure decay parameters that are static throughout the lifetime of the scorer.
19475  * these decay parameters affect the score of the channel penalty and are not changed on a
19476  * per-route penalty cost call.
19477  */
19478 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
19479    /**
19480     * A pointer to the opaque Rust object.
19481     * Nearly everywhere, inner must be non-null, however in places where
19482     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19483     */
19484    LDKnativeProbabilisticScoringDecayParameters *inner;
19485    /**
19486     * Indicates that this is the only struct which contains the same pointer.
19487     * Rust functions which take ownership of an object provided via an argument require
19488     * this to be true and invalidate the object pointed to by inner.
19489     */
19490    bool is_owned;
19491 } LDKProbabilisticScoringDecayParameters;
19492
19493
19494
19495 /**
19496  * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
19497  * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
19498  *
19499  * Your `node_id` is seed/0'.
19500  * Unilateral closes may use seed/1'.
19501  * Cooperative closes may use seed/2'.
19502  * The two close keys may be needed to claim on-chain funds!
19503  *
19504  * This struct cannot be used for nodes that wish to support receiving phantom payments;
19505  * [`PhantomKeysManager`] must be used instead.
19506  *
19507  * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
19508  * previously issued invoices and attempts to pay previous invoices will fail.
19509  */
19510 typedef struct MUST_USE_STRUCT LDKKeysManager {
19511    /**
19512     * A pointer to the opaque Rust object.
19513     * Nearly everywhere, inner must be non-null, however in places where
19514     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19515     */
19516    LDKnativeKeysManager *inner;
19517    /**
19518     * Indicates that this is the only struct which contains the same pointer.
19519     * Rust functions which take ownership of an object provided via an argument require
19520     * this to be true and invalidate the object pointed to by inner.
19521     */
19522    bool is_owned;
19523 } LDKKeysManager;
19524
19525
19526
19527 /**
19528  * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
19529  * payments.
19530  *
19531  * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
19532  * paid to one of multiple nodes. This works because we encode the invoice route hints such that
19533  * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
19534  * itself without ever needing to forward to this fake node.
19535  *
19536  * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
19537  * provide some fault tolerance, because payers will automatically retry paying other provided
19538  * nodes in the case that one node goes down.
19539  *
19540  * Note that multi-path payments are not supported in phantom invoices for security reasons.
19541  * Switching between this struct and [`KeysManager`] will invalidate any previously issued
19542  * invoices and attempts to pay previous invoices will fail.
19543  */
19544 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
19545    /**
19546     * A pointer to the opaque Rust object.
19547     * Nearly everywhere, inner must be non-null, however in places where
19548     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19549     */
19550    LDKnativePhantomKeysManager *inner;
19551    /**
19552     * Indicates that this is the only struct which contains the same pointer.
19553     * Rust functions which take ownership of an object provided via an argument require
19554     * this to be true and invalidate the object pointed to by inner.
19555     */
19556    bool is_owned;
19557 } LDKPhantomKeysManager;
19558
19559 /**
19560  * The destination of an onion message.
19561  */
19562 typedef enum LDKDestination_Tag {
19563    /**
19564     * We're sending this onion message to a node.
19565     */
19566    LDKDestination_Node,
19567    /**
19568     * We're sending this onion message to a blinded path.
19569     */
19570    LDKDestination_BlindedPath,
19571    /**
19572     * Must be last for serialization purposes
19573     */
19574    LDKDestination_Sentinel,
19575 } LDKDestination_Tag;
19576
19577 typedef struct MUST_USE_STRUCT LDKDestination {
19578    LDKDestination_Tag tag;
19579    union {
19580       struct {
19581          struct LDKPublicKey node;
19582       };
19583       struct {
19584          struct LDKBlindedPath blinded_path;
19585       };
19586    };
19587 } LDKDestination;
19588
19589 /**
19590  * A trait defining behavior for routing an [`OnionMessage`].
19591  *
19592  * [`OnionMessage`]: msgs::OnionMessage
19593  */
19594 typedef struct LDKMessageRouter {
19595    /**
19596     * An opaque pointer which is passed to your function implementations as an argument.
19597     * This has no meaning in the LDK, and can be NULL or any other value.
19598     */
19599    void *this_arg;
19600    /**
19601     * Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
19602     *
19603     * [`OnionMessage`]: msgs::OnionMessage
19604     */
19605    struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
19606    /**
19607     * Frees any resources associated with this object given its this_arg pointer.
19608     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19609     */
19610    void (*free)(void *this_arg);
19611 } LDKMessageRouter;
19612
19613
19614
19615 /**
19616  * A sender, receiver and forwarder of onion messages. In upcoming releases, this object will be
19617  * used to retrieve invoices and fulfill invoice requests from [offers]. Currently, only sending
19618  * and receiving custom onion messages is supported.
19619  *
19620  * # Example
19621  *
19622  * ```
19623  * # extern crate bitcoin;
19624  * # use bitcoin::hashes::_export::_core::time::Duration;
19625  * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
19626  * # use lightning::blinded_path::BlindedPath;
19627  * # use lightning::sign::KeysManager;
19628  * # use lightning::ln::peer_handler::IgnoringMessageHandler;
19629  * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessenger, OnionMessagePath};
19630  * # use lightning::onion_message::packet::{CustomOnionMessageContents, OnionMessageContents};
19631  * # use lightning::util::logger::{Logger, Record};
19632  * # use lightning::util::ser::{Writeable, Writer};
19633  * # use lightning::io;
19634  * # use std::sync::Arc;
19635  * # struct FakeLogger;
19636  * # impl Logger for FakeLogger {
19637  * #     fn log(&self, record: &Record) { unimplemented!() }
19638  * # }
19639  * # struct FakeMessageRouter {}
19640  * # impl MessageRouter for FakeMessageRouter {
19641  * #     fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
19642  * #         unimplemented!()
19643  * #     }
19644  * # }
19645  * # let seed = [42u8; 32];
19646  * # let time = Duration::from_secs(123456);
19647  * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
19648  * # let logger = Arc::new(FakeLogger {});
19649  * # let node_secret = SecretKey::from_slice(&hex::decode(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
19650  * # let secp_ctx = Secp256k1::new();
19651  * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
19652  * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1, hop_node_id1);
19653  * # let destination_node_id = hop_node_id1;
19654  * # let message_router = Arc::new(FakeMessageRouter {});
19655  * # let custom_message_handler = IgnoringMessageHandler {};
19656  * # let offers_message_handler = IgnoringMessageHandler {};
19657  * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
19658  * // ChannelManager.
19659  * let onion_messenger = OnionMessenger::new(
19660  *     &keys_manager, &keys_manager, logger, message_router, &offers_message_handler,
19661  *     &custom_message_handler
19662  * );
19663  *
19664  * # #[derive(Clone)]
19665  * # struct YourCustomMessage {}
19666  * impl Writeable for YourCustomMessage {
19667  * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
19668  * \t\t# Ok(())
19669  * \t\t// Write your custom onion message to `w`
19670  * \t}
19671  * }
19672  * impl CustomOnionMessageContents for YourCustomMessage {
19673  * \tfn tlv_type(&self) -> u64 {
19674  * \t\t# let your_custom_message_type = 42;
19675  * \t\tyour_custom_message_type
19676  * \t}
19677  * }
19678  * // Send a custom onion message to a node id.
19679  * let path = OnionMessagePath {
19680  * \tintermediate_nodes: vec![hop_node_id1, hop_node_id2],
19681  * \tdestination: Destination::Node(destination_node_id),
19682  * };
19683  * let reply_path = None;
19684  * # let your_custom_message = YourCustomMessage {};
19685  * let message = OnionMessageContents::Custom(your_custom_message);
19686  * onion_messenger.send_onion_message(path, message, reply_path);
19687  *
19688  * // Create a blinded path to yourself, for someone to send an onion message to.
19689  * # let your_node_id = hop_node_id1;
19690  * let hops = [hop_node_id3, hop_node_id4, your_node_id];
19691  * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
19692  *
19693  * // Send a custom onion message to a blinded path.
19694  * let path = OnionMessagePath {
19695  * \tintermediate_nodes: vec![hop_node_id1, hop_node_id2],
19696  * \tdestination: Destination::BlindedPath(blinded_path),
19697  * };
19698  * let reply_path = None;
19699  * # let your_custom_message = YourCustomMessage {};
19700  * let message = OnionMessageContents::Custom(your_custom_message);
19701  * onion_messenger.send_onion_message(path, message, reply_path);
19702  * ```
19703  *
19704  * [offers]: <https://github.com/lightning/bolts/pull/798>
19705  * [`OnionMessenger`]: crate::onion_message::OnionMessenger
19706  */
19707 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
19708    /**
19709     * A pointer to the opaque Rust object.
19710     * Nearly everywhere, inner must be non-null, however in places where
19711     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19712     */
19713    LDKnativeOnionMessenger *inner;
19714    /**
19715     * Indicates that this is the only struct which contains the same pointer.
19716     * Rust functions which take ownership of an object provided via an argument require
19717     * this to be true and invalidate the object pointed to by inner.
19718     */
19719    bool is_owned;
19720 } LDKOnionMessenger;
19721
19722
19723
19724 /**
19725  * A [`MessageRouter`] that always fails.
19726  */
19727 typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
19728    /**
19729     * A pointer to the opaque Rust object.
19730     * Nearly everywhere, inner must be non-null, however in places where
19731     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19732     */
19733    LDKnativeDefaultMessageRouter *inner;
19734    /**
19735     * Indicates that this is the only struct which contains the same pointer.
19736     * Rust functions which take ownership of an object provided via an argument require
19737     * this to be true and invalidate the object pointed to by inner.
19738     */
19739    bool is_owned;
19740 } LDKDefaultMessageRouter;
19741
19742 /**
19743  * The contents of an onion message. In the context of offers, this would be the invoice, invoice
19744  * request, or invoice error.
19745  */
19746 typedef enum LDKOnionMessageContents_Tag {
19747    /**
19748     * A message related to BOLT 12 Offers.
19749     */
19750    LDKOnionMessageContents_Offers,
19751    /**
19752     * A custom onion message specified by the user.
19753     */
19754    LDKOnionMessageContents_Custom,
19755    /**
19756     * Must be last for serialization purposes
19757     */
19758    LDKOnionMessageContents_Sentinel,
19759 } LDKOnionMessageContents_Tag;
19760
19761 typedef struct MUST_USE_STRUCT LDKOnionMessageContents {
19762    LDKOnionMessageContents_Tag tag;
19763    union {
19764       struct {
19765          struct LDKOffersMessage offers;
19766       };
19767       struct {
19768          struct LDKCustomOnionMessageContents custom;
19769       };
19770    };
19771 } LDKOnionMessageContents;
19772
19773
19774
19775 /**
19776  * An intermediate node, its outbound channel, and relay parameters.
19777  */
19778 typedef struct MUST_USE_STRUCT LDKForwardNode {
19779    /**
19780     * A pointer to the opaque Rust object.
19781     * Nearly everywhere, inner must be non-null, however in places where
19782     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19783     */
19784    LDKnativeForwardNode *inner;
19785    /**
19786     * Indicates that this is the only struct which contains the same pointer.
19787     * Rust functions which take ownership of an object provided via an argument require
19788     * this to be true and invalidate the object pointed to by inner.
19789     */
19790    bool is_owned;
19791 } LDKForwardNode;
19792
19793
19794
19795 /**
19796  * Data to construct a [`BlindedHop`] for forwarding a payment.
19797  */
19798 typedef struct MUST_USE_STRUCT LDKForwardTlvs {
19799    /**
19800     * A pointer to the opaque Rust object.
19801     * Nearly everywhere, inner must be non-null, however in places where
19802     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19803     */
19804    LDKnativeForwardTlvs *inner;
19805    /**
19806     * Indicates that this is the only struct which contains the same pointer.
19807     * Rust functions which take ownership of an object provided via an argument require
19808     * this to be true and invalidate the object pointed to by inner.
19809     */
19810    bool is_owned;
19811 } LDKForwardTlvs;
19812
19813 /**
19814  * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
19815  * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
19816  * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
19817  * which can provide a default implementation of this trait when used with [`Wallet`].
19818  */
19819 typedef struct LDKCoinSelectionSource {
19820    /**
19821     * An opaque pointer which is passed to your function implementations as an argument.
19822     * This has no meaning in the LDK, and can be NULL or any other value.
19823     */
19824    void *this_arg;
19825    /**
19826     * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
19827     * available to spend. Implementations are free to pick their coin selection algorithm of
19828     * choice, as long as the following requirements are met:
19829     *
19830     * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
19831     *    throughout coin selection, but must not be returned as part of the result.
19832     * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
19833     *    throughout coin selection. In some cases, like when funding an anchor transaction, this
19834     *    set is empty. Implementations should ensure they handle this correctly on their end,
19835     *    e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
19836     *    provided, in which case a zero-value empty OP_RETURN output can be used instead.
19837     * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
19838     *    inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
19839     *
19840     * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
19841     * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
19842     * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
19843     * delaying block inclusion.
19844     *
19845     * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
19846     * can be re-used within new fee-bumped iterations of the original claiming transaction,
19847     * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
19848     * transaction associated with it, and all of the available UTXOs have already been assigned to
19849     * other claims, implementations must be willing to double spend their UTXOs. The choice of
19850     * which UTXOs to double spend is left to the implementation, but it must strive to keep the
19851     * set of other claims being double spent to a minimum.
19852     */
19853    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);
19854    /**
19855     * Signs and provides the full witness for all inputs within the transaction known to the
19856     * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
19857     */
19858    struct LDKCResult_TransactionNoneZ (*sign_tx)(const void *this_arg, struct LDKTransaction tx);
19859    /**
19860     * Frees any resources associated with this object given its this_arg pointer.
19861     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19862     */
19863    void (*free)(void *this_arg);
19864 } LDKCoinSelectionSource;
19865
19866 /**
19867  * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
19868  * provide a default implementation to [`CoinSelectionSource`].
19869  */
19870 typedef struct LDKWalletSource {
19871    /**
19872     * An opaque pointer which is passed to your function implementations as an argument.
19873     * This has no meaning in the LDK, and can be NULL or any other value.
19874     */
19875    void *this_arg;
19876    /**
19877     * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
19878     */
19879    struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
19880    /**
19881     * Returns a script to use for change above dust resulting from a successful coin selection
19882     * attempt.
19883     */
19884    struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
19885    /**
19886     * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
19887     * the transaction known to the wallet (i.e., any provided via
19888     * [`WalletSource::list_confirmed_utxos`]).
19889     */
19890    struct LDKCResult_TransactionNoneZ (*sign_tx)(const void *this_arg, struct LDKTransaction tx);
19891    /**
19892     * Frees any resources associated with this object given its this_arg pointer.
19893     * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19894     */
19895    void (*free)(void *this_arg);
19896 } LDKWalletSource;
19897
19898
19899
19900 /**
19901  * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
19902  * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
19903  * spends may happen.
19904  */
19905 typedef struct MUST_USE_STRUCT LDKWallet {
19906    /**
19907     * A pointer to the opaque Rust object.
19908     * Nearly everywhere, inner must be non-null, however in places where
19909     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19910     */
19911    LDKnativeWallet *inner;
19912    /**
19913     * Indicates that this is the only struct which contains the same pointer.
19914     * Rust functions which take ownership of an object provided via an argument require
19915     * this to be true and invalidate the object pointed to by inner.
19916     */
19917    bool is_owned;
19918 } LDKWallet;
19919
19920
19921
19922 /**
19923  * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
19924  * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
19925  * Replace-By-Fee (RBF).
19926  *
19927  * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
19928  */
19929 typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
19930    /**
19931     * A pointer to the opaque Rust object.
19932     * Nearly everywhere, inner must be non-null, however in places where
19933     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19934     */
19935    LDKnativeBumpTransactionEventHandler *inner;
19936    /**
19937     * Indicates that this is the only struct which contains the same pointer.
19938     * Rust functions which take ownership of an object provided via an argument require
19939     * this to be true and invalidate the object pointed to by inner.
19940     */
19941    bool is_owned;
19942 } LDKBumpTransactionEventHandler;
19943
19944
19945
19946 /**
19947  * A [`KVStore`] implementation that writes to and reads from the file system.
19948  */
19949 typedef struct MUST_USE_STRUCT LDKFilesystemStore {
19950    /**
19951     * A pointer to the opaque Rust object.
19952     * Nearly everywhere, inner must be non-null, however in places where
19953     * the Rust equivalent takes an Option, it may be set to null to indicate None.
19954     */
19955    LDKnativeFilesystemStore *inner;
19956    /**
19957     * Indicates that this is the only struct which contains the same pointer.
19958     * Rust functions which take ownership of an object provided via an argument require
19959     * this to be true and invalidate the object pointed to by inner.
19960     */
19961    bool is_owned;
19962 } LDKFilesystemStore;
19963
19964
19965
19966 /**
19967  * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
19968  * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
19969  * responsibilities are:
19970  * * Processing [`Event`]s with a user-provided [`EventHandler`].
19971  * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
19972  *   writing it to disk/backups by invoking the callback given to it at startup.
19973  *   [`ChannelManager`] persistence should be done in the background.
19974  * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
19975  *   and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
19976  * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
19977  *   [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
19978  *
19979  * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
19980  * upon as doing so may result in high latency.
19981  *
19982  * # Note
19983  *
19984  * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
19985  * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
19986  * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
19987  * unilateral chain closure fees are at risk.
19988  *
19989  * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
19990  * [`Event`]: lightning::events::Event
19991  * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
19992  * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
19993  *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
19994  */
19995 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
19996    /**
19997     * A pointer to the opaque Rust object.
19998     * Nearly everywhere, inner must be non-null, however in places where
19999     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20000     */
20001    LDKnativeBackgroundProcessor *inner;
20002    /**
20003     * Indicates that this is the only struct which contains the same pointer.
20004     * Rust functions which take ownership of an object provided via an argument require
20005     * this to be true and invalidate the object pointed to by inner.
20006     */
20007    bool is_owned;
20008 } LDKBackgroundProcessor;
20009
20010
20011
20012 /**
20013  * The main Rapid Gossip Sync object.
20014  *
20015  * See [crate-level documentation] for usage.
20016  *
20017  * [crate-level documentation]: crate
20018  */
20019 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
20020    /**
20021     * A pointer to the opaque Rust object.
20022     * Nearly everywhere, inner must be non-null, however in places where
20023     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20024     */
20025    LDKnativeRapidGossipSync *inner;
20026    /**
20027     * Indicates that this is the only struct which contains the same pointer.
20028     * Rust functions which take ownership of an object provided via an argument require
20029     * this to be true and invalidate the object pointed to by inner.
20030     */
20031    bool is_owned;
20032 } LDKRapidGossipSync;
20033
20034 /**
20035  * Either [`P2PGossipSync`] or [`RapidGossipSync`].
20036  */
20037 typedef enum LDKGossipSync_Tag {
20038    /**
20039     * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
20040     */
20041    LDKGossipSync_P2P,
20042    /**
20043     * Rapid gossip sync from a trusted server.
20044     */
20045    LDKGossipSync_Rapid,
20046    /**
20047     * No gossip sync.
20048     */
20049    LDKGossipSync_None,
20050    /**
20051     * Must be last for serialization purposes
20052     */
20053    LDKGossipSync_Sentinel,
20054 } LDKGossipSync_Tag;
20055
20056 typedef struct MUST_USE_STRUCT LDKGossipSync {
20057    LDKGossipSync_Tag tag;
20058    union {
20059       struct {
20060          /**
20061           * Note that this field is expected to be a reference.
20062           */
20063          struct LDKP2PGossipSync p2p;
20064       };
20065       struct {
20066          /**
20067           * Note that this field is expected to be a reference.
20068           */
20069          struct LDKRapidGossipSync rapid;
20070       };
20071    };
20072 } LDKGossipSync;
20073
20074
20075
20076 /**
20077  * Data of the [`RawBolt11Invoice`] that is encoded in the data part
20078  */
20079 typedef struct MUST_USE_STRUCT LDKRawDataPart {
20080    /**
20081     * A pointer to the opaque Rust object.
20082     * Nearly everywhere, inner must be non-null, however in places where
20083     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20084     */
20085    LDKnativeRawDataPart *inner;
20086    /**
20087     * Indicates that this is the only struct which contains the same pointer.
20088     * Rust functions which take ownership of an object provided via an argument require
20089     * this to be true and invalidate the object pointed to by inner.
20090     */
20091    bool is_owned;
20092 } LDKRawDataPart;
20093
20094
20095
20096 /**
20097  * SHA-256 hash
20098  */
20099 typedef struct MUST_USE_STRUCT LDKSha256 {
20100    /**
20101     * A pointer to the opaque Rust object.
20102     * Nearly everywhere, inner must be non-null, however in places where
20103     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20104     */
20105    LDKnativeSha256 *inner;
20106    /**
20107     * Indicates that this is the only struct which contains the same pointer.
20108     * Rust functions which take ownership of an object provided via an argument require
20109     * this to be true and invalidate the object pointed to by inner.
20110     */
20111    bool is_owned;
20112 } LDKSha256;
20113
20114
20115
20116 /**
20117  * Positive duration that defines when (relatively to the timestamp) in the future the invoice
20118  * expires
20119  */
20120 typedef struct MUST_USE_STRUCT LDKExpiryTime {
20121    /**
20122     * A pointer to the opaque Rust object.
20123     * Nearly everywhere, inner must be non-null, however in places where
20124     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20125     */
20126    LDKnativeExpiryTime *inner;
20127    /**
20128     * Indicates that this is the only struct which contains the same pointer.
20129     * Rust functions which take ownership of an object provided via an argument require
20130     * this to be true and invalidate the object pointed to by inner.
20131     */
20132    bool is_owned;
20133 } LDKExpiryTime;
20134
20135
20136
20137 /**
20138  * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
20139  */
20140 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
20141    /**
20142     * A pointer to the opaque Rust object.
20143     * Nearly everywhere, inner must be non-null, however in places where
20144     * the Rust equivalent takes an Option, it may be set to null to indicate None.
20145     */
20146    LDKnativeMinFinalCltvExpiryDelta *inner;
20147    /**
20148     * Indicates that this is the only struct which contains the same pointer.
20149     * Rust functions which take ownership of an object provided via an argument require
20150     * this to be true and invalidate the object pointed to by inner.
20151     */
20152    bool is_owned;
20153 } LDKMinFinalCltvExpiryDelta;
20154
20155 /**
20156  * A 20-byte byte array.
20157  */
20158 typedef struct LDKTwentyBytes {
20159    /**
20160     * The twenty bytes
20161     */
20162    uint8_t data[20];
20163 } LDKTwentyBytes;
20164
20165 /**
20166  * Fallback address in case no LN payment is possible
20167  */
20168 typedef enum LDKFallback_Tag {
20169    LDKFallback_SegWitProgram,
20170    LDKFallback_PubKeyHash,
20171    LDKFallback_ScriptHash,
20172    /**
20173     * Must be last for serialization purposes
20174     */
20175    LDKFallback_Sentinel,
20176 } LDKFallback_Tag;
20177
20178 typedef struct LDKFallback_LDKSegWitProgram_Body {
20179    struct LDKWitnessVersion version;
20180    struct LDKCVec_u8Z program;
20181 } LDKFallback_LDKSegWitProgram_Body;
20182
20183 typedef struct MUST_USE_STRUCT LDKFallback {
20184    LDKFallback_Tag tag;
20185    union {
20186       LDKFallback_LDKSegWitProgram_Body seg_wit_program;
20187       struct {
20188          struct LDKTwentyBytes pub_key_hash;
20189       };
20190       struct {
20191          struct LDKTwentyBytes script_hash;
20192       };
20193    };
20194 } LDKFallback;
20195
20196 extern const uintptr_t MAX_BUF_SIZE;
20197
20198 extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
20199
20200 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
20201
20202 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
20203
20204 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
20205
20206 extern const uint32_t ANTI_REORG_DELAY;
20207
20208 extern const uint16_t BREAKDOWN_TIMEOUT;
20209
20210 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
20211
20212 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
20213
20214 extern const uint16_t MAX_HTLCS;
20215
20216 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
20217
20218 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
20219
20220 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
20221
20222 extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
20223
20224 extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
20225
20226 extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
20227
20228 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
20229
20230 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
20231
20232 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
20233
20234 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
20235
20236 extern const uint64_t MAX_TIMESTAMP;
20237
20238 extern const uint64_t DEFAULT_EXPIRY_TIME;
20239
20240 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
20241
20242 extern const uint8_t TAG_PAYMENT_HASH;
20243
20244 extern const uint8_t TAG_DESCRIPTION;
20245
20246 extern const uint8_t TAG_PAYEE_PUB_KEY;
20247
20248 extern const uint8_t TAG_DESCRIPTION_HASH;
20249
20250 extern const uint8_t TAG_EXPIRY_TIME;
20251
20252 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
20253
20254 extern const uint8_t TAG_FALLBACK;
20255
20256 extern const uint8_t TAG_PRIVATE_ROUTE;
20257
20258 extern const uint8_t TAG_PAYMENT_SECRET;
20259
20260 extern const uint8_t TAG_PAYMENT_METADATA;
20261
20262 extern const uint8_t TAG_FEATURES;
20263
20264 struct LDKStr _ldk_get_compiled_version(void);
20265
20266 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
20267
20268 /**
20269  * Gets the 128-bit integer, as 16 little-endian bytes
20270  */
20271 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
20272
20273 /**
20274  * Constructs a new U128 from 16 little-endian bytes
20275  */
20276 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
20277
20278 /**
20279  * Convenience function for constructing a new BigEndianScalar
20280  */
20281 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
20282
20283 /**
20284  * Creates a new Bech32Error which has the same data as `orig`
20285  */
20286 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
20287
20288 /**
20289  * Releases any memory held by the given `Bech32Error` (which is currently none)
20290  */
20291 void Bech32Error_free(struct LDKBech32Error o);
20292
20293 /**
20294  * Frees the data buffer, if data_is_owned is set and datalen > 0.
20295  */
20296 void Transaction_free(struct LDKTransaction _res);
20297
20298 /**
20299  * Creates a new Witness which has the same data as `orig` but with a new buffer.
20300  */
20301 struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
20302
20303 /**
20304  * Frees the data pointed to by data
20305  */
20306 void Witness_free(struct LDKWitness _res);
20307
20308 /**
20309  * Frees the witness and script_sig in a TxIn
20310  */
20311 void TxIn_free(struct LDKTxIn _res);
20312
20313 /**
20314  * Convenience function for constructing a new TxIn
20315  */
20316 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
20317
20318 /**
20319  * Convenience function for constructing a new TxOut
20320  */
20321 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
20322
20323 /**
20324  * Frees the data pointed to by script_pubkey.
20325  */
20326 void TxOut_free(struct LDKTxOut _res);
20327
20328 /**
20329  * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
20330  */
20331 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
20332
20333 /**
20334  * Frees the data buffer, if chars_is_owned is set and len > 0.
20335  */
20336 void Str_free(struct LDKStr _res);
20337
20338 #if defined(LDK_DEBUG_BUILD)
20339 /**
20340  * This function exists for memory safety testing purposes. It should never be used in production
20341  * code
20342  */
20343 const void *__unmangle_inner_ptr(const void *ptr);
20344 #endif
20345
20346 /**
20347  * Constructs a new COption_u64Z containing a u64
20348  */
20349 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
20350
20351 /**
20352  * Constructs a new COption_u64Z containing nothing
20353  */
20354 struct LDKCOption_u64Z COption_u64Z_none(void);
20355
20356 /**
20357  * Frees any resources associated with the u64, if we are in the Some state
20358  */
20359 void COption_u64Z_free(struct LDKCOption_u64Z _res);
20360
20361 /**
20362  * Creates a new COption_u64Z which has the same data as `orig`
20363  * but with all dynamically-allocated buffers duplicated in new buffers.
20364  */
20365 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
20366
20367 /**
20368  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20369  */
20370 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
20371
20372 /**
20373  * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
20374  */
20375 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
20376
20377 /**
20378  * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
20379  */
20380 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
20381
20382 /**
20383  * Checks if the given object is currently in the success state
20384  */
20385 bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
20386
20387 /**
20388  * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
20389  */
20390 void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
20391
20392 /**
20393  * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
20394  * but with all dynamically-allocated buffers duplicated in new buffers.
20395  */
20396 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
20397
20398 /**
20399  * Creates a new CResult_RetryDecodeErrorZ in the success state.
20400  */
20401 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_ok(struct LDKRetry o);
20402
20403 /**
20404  * Creates a new CResult_RetryDecodeErrorZ in the error state.
20405  */
20406 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_err(struct LDKDecodeError e);
20407
20408 /**
20409  * Checks if the given object is currently in the success state
20410  */
20411 bool CResult_RetryDecodeErrorZ_is_ok(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR o);
20412
20413 /**
20414  * Frees any resources used by the CResult_RetryDecodeErrorZ.
20415  */
20416 void CResult_RetryDecodeErrorZ_free(struct LDKCResult_RetryDecodeErrorZ _res);
20417
20418 /**
20419  * Creates a new CResult_RetryDecodeErrorZ which has the same data as `orig`
20420  * but with all dynamically-allocated buffers duplicated in new buffers.
20421  */
20422 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig);
20423
20424 /**
20425  * Creates a new CResult_NoneAPIErrorZ in the success state.
20426  */
20427 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
20428
20429 /**
20430  * Creates a new CResult_NoneAPIErrorZ in the error state.
20431  */
20432 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
20433
20434 /**
20435  * Checks if the given object is currently in the success state
20436  */
20437 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
20438
20439 /**
20440  * Frees any resources used by the CResult_NoneAPIErrorZ.
20441  */
20442 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
20443
20444 /**
20445  * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
20446  * but with all dynamically-allocated buffers duplicated in new buffers.
20447  */
20448 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
20449
20450 /**
20451  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20452  */
20453 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
20454
20455 /**
20456  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20457  */
20458 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
20459
20460 /**
20461  * Constructs a new COption_ThirtyTwoBytesZ containing a crate::c_types::ThirtyTwoBytes
20462  */
20463 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o);
20464
20465 /**
20466  * Constructs a new COption_ThirtyTwoBytesZ containing nothing
20467  */
20468 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void);
20469
20470 /**
20471  * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
20472  */
20473 void COption_ThirtyTwoBytesZ_free(struct LDKCOption_ThirtyTwoBytesZ _res);
20474
20475 /**
20476  * Creates a new COption_ThirtyTwoBytesZ which has the same data as `orig`
20477  * but with all dynamically-allocated buffers duplicated in new buffers.
20478  */
20479 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig);
20480
20481 /**
20482  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20483  */
20484 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
20485
20486 /**
20487  * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
20488  */
20489 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
20490
20491 /**
20492  * Constructs a new COption_CVec_u8ZZ containing nothing
20493  */
20494 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
20495
20496 /**
20497  * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
20498  */
20499 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
20500
20501 /**
20502  * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
20503  * but with all dynamically-allocated buffers duplicated in new buffers.
20504  */
20505 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
20506
20507 /**
20508  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
20509  */
20510 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
20511
20512 /**
20513  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
20514  */
20515 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
20516
20517 /**
20518  * Checks if the given object is currently in the success state
20519  */
20520 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
20521
20522 /**
20523  * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
20524  */
20525 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
20526
20527 /**
20528  * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
20529  * but with all dynamically-allocated buffers duplicated in new buffers.
20530  */
20531 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
20532
20533 /**
20534  * Creates a new tuple which has the same data as `orig`
20535  * but with all dynamically-allocated buffers duplicated in new buffers.
20536  */
20537 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_clone(const struct LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR orig);
20538
20539 /**
20540  * Creates a new C2Tuple_u64CVec_u8ZZ from the contained elements.
20541  */
20542 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_new(uint64_t a, struct LDKCVec_u8Z b);
20543
20544 /**
20545  * Frees any resources used by the C2Tuple_u64CVec_u8ZZ.
20546  */
20547 void C2Tuple_u64CVec_u8ZZ_free(struct LDKC2Tuple_u64CVec_u8ZZ _res);
20548
20549 /**
20550  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20551  */
20552 void CVec_C2Tuple_u64CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u64CVec_u8ZZZ _res);
20553
20554 /**
20555  * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state.
20556  */
20557 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_ok(struct LDKRecipientOnionFields o);
20558
20559 /**
20560  * Creates a new CResult_RecipientOnionFieldsNoneZ in the error state.
20561  */
20562 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_err(void);
20563
20564 /**
20565  * Checks if the given object is currently in the success state
20566  */
20567 bool CResult_RecipientOnionFieldsNoneZ_is_ok(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR o);
20568
20569 /**
20570  * Frees any resources used by the CResult_RecipientOnionFieldsNoneZ.
20571  */
20572 void CResult_RecipientOnionFieldsNoneZ_free(struct LDKCResult_RecipientOnionFieldsNoneZ _res);
20573
20574 /**
20575  * Creates a new CResult_RecipientOnionFieldsNoneZ which has the same data as `orig`
20576  * but with all dynamically-allocated buffers duplicated in new buffers.
20577  */
20578 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig);
20579
20580 /**
20581  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20582  */
20583 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
20584
20585 /**
20586  * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
20587  */
20588 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o);
20589
20590 /**
20591  * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
20592  */
20593 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_none(void);
20594
20595 /**
20596  * Frees any resources associated with the crate::c_types::derived::CVec_ThirtyTwoBytesZ, if we are in the Some state
20597  */
20598 void COption_CVec_ThirtyTwoBytesZZ_free(struct LDKCOption_CVec_ThirtyTwoBytesZZ _res);
20599
20600 /**
20601  * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
20602  * but with all dynamically-allocated buffers duplicated in new buffers.
20603  */
20604 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig);
20605
20606 /**
20607  * Creates a new CResult_ThirtyTwoBytesNoneZ in the success state.
20608  */
20609 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o);
20610
20611 /**
20612  * Creates a new CResult_ThirtyTwoBytesNoneZ in the error state.
20613  */
20614 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void);
20615
20616 /**
20617  * Checks if the given object is currently in the success state
20618  */
20619 bool CResult_ThirtyTwoBytesNoneZ_is_ok(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR o);
20620
20621 /**
20622  * Frees any resources used by the CResult_ThirtyTwoBytesNoneZ.
20623  */
20624 void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res);
20625
20626 /**
20627  * Creates a new CResult_ThirtyTwoBytesNoneZ which has the same data as `orig`
20628  * but with all dynamically-allocated buffers duplicated in new buffers.
20629  */
20630 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
20631
20632 /**
20633  * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
20634  */
20635 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
20636
20637 /**
20638  * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
20639  */
20640 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
20641
20642 /**
20643  * Checks if the given object is currently in the success state
20644  */
20645 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
20646
20647 /**
20648  * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
20649  */
20650 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
20651
20652 /**
20653  * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
20654  * but with all dynamically-allocated buffers duplicated in new buffers.
20655  */
20656 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
20657
20658 /**
20659  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
20660  */
20661 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
20662
20663 /**
20664  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
20665  */
20666 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
20667
20668 /**
20669  * Checks if the given object is currently in the success state
20670  */
20671 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
20672
20673 /**
20674  * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
20675  */
20676 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
20677
20678 /**
20679  * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
20680  * but with all dynamically-allocated buffers duplicated in new buffers.
20681  */
20682 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
20683
20684 /**
20685  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
20686  */
20687 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
20688
20689 /**
20690  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
20691  */
20692 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
20693
20694 /**
20695  * Checks if the given object is currently in the success state
20696  */
20697 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
20698
20699 /**
20700  * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
20701  */
20702 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
20703
20704 /**
20705  * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
20706  * but with all dynamically-allocated buffers duplicated in new buffers.
20707  */
20708 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
20709
20710 /**
20711  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
20712  */
20713 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
20714
20715 /**
20716  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
20717  */
20718 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
20719
20720 /**
20721  * Checks if the given object is currently in the success state
20722  */
20723 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
20724
20725 /**
20726  * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
20727  */
20728 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
20729
20730 /**
20731  * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
20732  * but with all dynamically-allocated buffers duplicated in new buffers.
20733  */
20734 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
20735
20736 /**
20737  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20738  */
20739 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
20740
20741 /**
20742  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20743  */
20744 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
20745
20746 /**
20747  * Constructs a new COption_u32Z containing a u32
20748  */
20749 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
20750
20751 /**
20752  * Constructs a new COption_u32Z containing nothing
20753  */
20754 struct LDKCOption_u32Z COption_u32Z_none(void);
20755
20756 /**
20757  * Frees any resources associated with the u32, if we are in the Some state
20758  */
20759 void COption_u32Z_free(struct LDKCOption_u32Z _res);
20760
20761 /**
20762  * Creates a new COption_u32Z which has the same data as `orig`
20763  * but with all dynamically-allocated buffers duplicated in new buffers.
20764  */
20765 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
20766
20767 /**
20768  * Creates a new tuple which has the same data as `orig`
20769  * but with all dynamically-allocated buffers duplicated in new buffers.
20770  */
20771 struct LDKC2Tuple_CVec_u8ZusizeZ C2Tuple_CVec_u8ZusizeZ_clone(const struct LDKC2Tuple_CVec_u8ZusizeZ *NONNULL_PTR orig);
20772
20773 /**
20774  * Creates a new C2Tuple_CVec_u8ZusizeZ from the contained elements.
20775  */
20776 struct LDKC2Tuple_CVec_u8ZusizeZ C2Tuple_CVec_u8ZusizeZ_new(struct LDKCVec_u8Z a, uintptr_t b);
20777
20778 /**
20779  * Frees any resources used by the C2Tuple_CVec_u8ZusizeZ.
20780  */
20781 void C2Tuple_CVec_u8ZusizeZ_free(struct LDKC2Tuple_CVec_u8ZusizeZ _res);
20782
20783 /**
20784  * Creates a new CResult_C2Tuple_CVec_u8ZusizeZNoneZ in the success state.
20785  */
20786 struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_ok(struct LDKC2Tuple_CVec_u8ZusizeZ o);
20787
20788 /**
20789  * Creates a new CResult_C2Tuple_CVec_u8ZusizeZNoneZ in the error state.
20790  */
20791 struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_err(void);
20792
20793 /**
20794  * Checks if the given object is currently in the success state
20795  */
20796 bool CResult_C2Tuple_CVec_u8ZusizeZNoneZ_is_ok(const struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ *NONNULL_PTR o);
20797
20798 /**
20799  * Frees any resources used by the CResult_C2Tuple_CVec_u8ZusizeZNoneZ.
20800  */
20801 void CResult_C2Tuple_CVec_u8ZusizeZNoneZ_free(struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ _res);
20802
20803 /**
20804  * Creates a new CResult_C2Tuple_CVec_u8ZusizeZNoneZ which has the same data as `orig`
20805  * but with all dynamically-allocated buffers duplicated in new buffers.
20806  */
20807 struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ CResult_C2Tuple_CVec_u8ZusizeZNoneZ_clone(const struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ *NONNULL_PTR orig);
20808
20809 /**
20810  * Creates a new CResult_NoneNoneZ in the success state.
20811  */
20812 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
20813
20814 /**
20815  * Creates a new CResult_NoneNoneZ in the error state.
20816  */
20817 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
20818
20819 /**
20820  * Checks if the given object is currently in the success state
20821  */
20822 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
20823
20824 /**
20825  * Frees any resources used by the CResult_NoneNoneZ.
20826  */
20827 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
20828
20829 /**
20830  * Creates a new CResult_NoneNoneZ which has the same data as `orig`
20831  * but with all dynamically-allocated buffers duplicated in new buffers.
20832  */
20833 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
20834
20835 /**
20836  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20837  */
20838 void CVec_ECDSASignatureZ_free(struct LDKCVec_ECDSASignatureZ _res);
20839
20840 /**
20841  * Creates a new tuple which has the same data as `orig`
20842  * but with all dynamically-allocated buffers duplicated in new buffers.
20843  */
20844 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(const struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR orig);
20845
20846 /**
20847  * Creates a new C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ from the contained elements.
20848  */
20849 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(struct LDKECDSASignature a, struct LDKCVec_ECDSASignatureZ b);
20850
20851 /**
20852  * Frees any resources used by the C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ.
20853  */
20854 void C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res);
20855
20856 /**
20857  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state.
20858  */
20859 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o);
20860
20861 /**
20862  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the error state.
20863  */
20864 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(void);
20865
20866 /**
20867  * Checks if the given object is currently in the success state
20868  */
20869 bool CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR o);
20870
20871 /**
20872  * Frees any resources used by the CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.
20873  */
20874 void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res);
20875
20876 /**
20877  * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ which has the same data as `orig`
20878  * but with all dynamically-allocated buffers duplicated in new buffers.
20879  */
20880 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR orig);
20881
20882 /**
20883  * Creates a new CResult_ECDSASignatureNoneZ in the success state.
20884  */
20885 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o);
20886
20887 /**
20888  * Creates a new CResult_ECDSASignatureNoneZ in the error state.
20889  */
20890 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void);
20891
20892 /**
20893  * Checks if the given object is currently in the success state
20894  */
20895 bool CResult_ECDSASignatureNoneZ_is_ok(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR o);
20896
20897 /**
20898  * Frees any resources used by the CResult_ECDSASignatureNoneZ.
20899  */
20900 void CResult_ECDSASignatureNoneZ_free(struct LDKCResult_ECDSASignatureNoneZ _res);
20901
20902 /**
20903  * Creates a new CResult_ECDSASignatureNoneZ which has the same data as `orig`
20904  * but with all dynamically-allocated buffers duplicated in new buffers.
20905  */
20906 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig);
20907
20908 /**
20909  * Creates a new CResult_PublicKeyNoneZ in the success state.
20910  */
20911 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
20912
20913 /**
20914  * Creates a new CResult_PublicKeyNoneZ in the error state.
20915  */
20916 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
20917
20918 /**
20919  * Checks if the given object is currently in the success state
20920  */
20921 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
20922
20923 /**
20924  * Frees any resources used by the CResult_PublicKeyNoneZ.
20925  */
20926 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
20927
20928 /**
20929  * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
20930  * but with all dynamically-allocated buffers duplicated in new buffers.
20931  */
20932 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
20933
20934 /**
20935  * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
20936  */
20937 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o);
20938
20939 /**
20940  * Constructs a new COption_BigEndianScalarZ containing nothing
20941  */
20942 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void);
20943
20944 /**
20945  * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
20946  */
20947 void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
20948
20949 /**
20950  * Creates a new COption_BigEndianScalarZ which has the same data as `orig`
20951  * but with all dynamically-allocated buffers duplicated in new buffers.
20952  */
20953 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
20954
20955 /**
20956  * Frees the buffer pointed to by `data` if `datalen` is non-0.
20957  */
20958 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
20959
20960 /**
20961  * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
20962  */
20963 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
20964
20965 /**
20966  * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
20967  */
20968 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
20969
20970 /**
20971  * Checks if the given object is currently in the success state
20972  */
20973 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
20974
20975 /**
20976  * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
20977  */
20978 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
20979
20980 /**
20981  * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
20982  * but with all dynamically-allocated buffers duplicated in new buffers.
20983  */
20984 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
20985
20986 /**
20987  * Creates a new CResult_SchnorrSignatureNoneZ in the success state.
20988  */
20989 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o);
20990
20991 /**
20992  * Creates a new CResult_SchnorrSignatureNoneZ in the error state.
20993  */
20994 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void);
20995
20996 /**
20997  * Checks if the given object is currently in the success state
20998  */
20999 bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o);
21000
21001 /**
21002  * Frees any resources used by the CResult_SchnorrSignatureNoneZ.
21003  */
21004 void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res);
21005
21006 /**
21007  * Creates a new CResult_SchnorrSignatureNoneZ which has the same data as `orig`
21008  * but with all dynamically-allocated buffers duplicated in new buffers.
21009  */
21010 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
21011
21012 /**
21013  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
21014  */
21015 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
21016
21017 /**
21018  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
21019  */
21020 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
21021
21022 /**
21023  * Checks if the given object is currently in the success state
21024  */
21025 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
21026
21027 /**
21028  * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
21029  */
21030 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
21031
21032 /**
21033  * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
21034  * but with all dynamically-allocated buffers duplicated in new buffers.
21035  */
21036 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
21037
21038 /**
21039  * Creates a new CResult_CVec_u8ZNoneZ in the success state.
21040  */
21041 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o);
21042
21043 /**
21044  * Creates a new CResult_CVec_u8ZNoneZ in the error state.
21045  */
21046 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void);
21047
21048 /**
21049  * Checks if the given object is currently in the success state
21050  */
21051 bool CResult_CVec_u8ZNoneZ_is_ok(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR o);
21052
21053 /**
21054  * Frees any resources used by the CResult_CVec_u8ZNoneZ.
21055  */
21056 void CResult_CVec_u8ZNoneZ_free(struct LDKCResult_CVec_u8ZNoneZ _res);
21057
21058 /**
21059  * Creates a new CResult_CVec_u8ZNoneZ which has the same data as `orig`
21060  * but with all dynamically-allocated buffers duplicated in new buffers.
21061  */
21062 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_clone(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR orig);
21063
21064 /**
21065  * Creates a new CResult_ShutdownScriptNoneZ in the success state.
21066  */
21067 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
21068
21069 /**
21070  * Creates a new CResult_ShutdownScriptNoneZ in the error state.
21071  */
21072 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
21073
21074 /**
21075  * Checks if the given object is currently in the success state
21076  */
21077 bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
21078
21079 /**
21080  * Frees any resources used by the CResult_ShutdownScriptNoneZ.
21081  */
21082 void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
21083
21084 /**
21085  * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
21086  * but with all dynamically-allocated buffers duplicated in new buffers.
21087  */
21088 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
21089
21090 /**
21091  * Constructs a new COption_u16Z containing a u16
21092  */
21093 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
21094
21095 /**
21096  * Constructs a new COption_u16Z containing nothing
21097  */
21098 struct LDKCOption_u16Z COption_u16Z_none(void);
21099
21100 /**
21101  * Frees any resources associated with the u16, if we are in the Some state
21102  */
21103 void COption_u16Z_free(struct LDKCOption_u16Z _res);
21104
21105 /**
21106  * Creates a new COption_u16Z which has the same data as `orig`
21107  * but with all dynamically-allocated buffers duplicated in new buffers.
21108  */
21109 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
21110
21111 /**
21112  * Constructs a new COption_boolZ containing a bool
21113  */
21114 struct LDKCOption_boolZ COption_boolZ_some(bool o);
21115
21116 /**
21117  * Constructs a new COption_boolZ containing nothing
21118  */
21119 struct LDKCOption_boolZ COption_boolZ_none(void);
21120
21121 /**
21122  * Frees any resources associated with the bool, if we are in the Some state
21123  */
21124 void COption_boolZ_free(struct LDKCOption_boolZ _res);
21125
21126 /**
21127  * Creates a new COption_boolZ which has the same data as `orig`
21128  * but with all dynamically-allocated buffers duplicated in new buffers.
21129  */
21130 struct LDKCOption_boolZ COption_boolZ_clone(const struct LDKCOption_boolZ *NONNULL_PTR orig);
21131
21132 /**
21133  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21134  */
21135 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
21136
21137 /**
21138  * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
21139  */
21140 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
21141
21142 /**
21143  * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
21144  */
21145 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
21146
21147 /**
21148  * Checks if the given object is currently in the success state
21149  */
21150 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
21151
21152 /**
21153  * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
21154  */
21155 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
21156
21157 /**
21158  * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
21159  * but with all dynamically-allocated buffers duplicated in new buffers.
21160  */
21161 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
21162
21163 /**
21164  * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
21165  */
21166 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
21167
21168 /**
21169  * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
21170  */
21171 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
21172
21173 /**
21174  * Checks if the given object is currently in the success state
21175  */
21176 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
21177
21178 /**
21179  * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
21180  */
21181 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
21182
21183 /**
21184  * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
21185  * but with all dynamically-allocated buffers duplicated in new buffers.
21186  */
21187 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
21188
21189 /**
21190  * Creates a new CResult_TransactionNoneZ in the success state.
21191  */
21192 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
21193
21194 /**
21195  * Creates a new CResult_TransactionNoneZ in the error state.
21196  */
21197 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
21198
21199 /**
21200  * Checks if the given object is currently in the success state
21201  */
21202 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
21203
21204 /**
21205  * Frees any resources used by the CResult_TransactionNoneZ.
21206  */
21207 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
21208
21209 /**
21210  * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
21211  * but with all dynamically-allocated buffers duplicated in new buffers.
21212  */
21213 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
21214
21215 /**
21216  * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
21217  */
21218 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
21219
21220 /**
21221  * Constructs a new COption_WriteableScoreZ containing nothing
21222  */
21223 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
21224
21225 /**
21226  * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
21227  */
21228 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
21229
21230 /**
21231  * Creates a new CResult_NoneIOErrorZ in the success state.
21232  */
21233 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_ok(void);
21234
21235 /**
21236  * Creates a new CResult_NoneIOErrorZ in the error state.
21237  */
21238 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_err(enum LDKIOError e);
21239
21240 /**
21241  * Checks if the given object is currently in the success state
21242  */
21243 bool CResult_NoneIOErrorZ_is_ok(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR o);
21244
21245 /**
21246  * Frees any resources used by the CResult_NoneIOErrorZ.
21247  */
21248 void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
21249
21250 /**
21251  * Creates a new CResult_NoneIOErrorZ which has the same data as `orig`
21252  * but with all dynamically-allocated buffers duplicated in new buffers.
21253  */
21254 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
21255
21256 /**
21257  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21258  */
21259 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
21260
21261 /**
21262  * Creates a new CResult_RouteLightningErrorZ in the success state.
21263  */
21264 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
21265
21266 /**
21267  * Creates a new CResult_RouteLightningErrorZ in the error state.
21268  */
21269 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
21270
21271 /**
21272  * Checks if the given object is currently in the success state
21273  */
21274 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
21275
21276 /**
21277  * Frees any resources used by the CResult_RouteLightningErrorZ.
21278  */
21279 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
21280
21281 /**
21282  * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
21283  * but with all dynamically-allocated buffers duplicated in new buffers.
21284  */
21285 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
21286
21287 /**
21288  * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
21289  */
21290 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
21291
21292 /**
21293  * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
21294  */
21295 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
21296
21297 /**
21298  * Checks if the given object is currently in the success state
21299  */
21300 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
21301
21302 /**
21303  * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
21304  */
21305 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
21306
21307 /**
21308  * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
21309  * but with all dynamically-allocated buffers duplicated in new buffers.
21310  */
21311 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
21312
21313 /**
21314  * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
21315  */
21316 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
21317
21318 /**
21319  * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
21320  */
21321 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
21322
21323 /**
21324  * Checks if the given object is currently in the success state
21325  */
21326 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
21327
21328 /**
21329  * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
21330  */
21331 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
21332
21333 /**
21334  * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
21335  * but with all dynamically-allocated buffers duplicated in new buffers.
21336  */
21337 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
21338
21339 /**
21340  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21341  */
21342 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
21343
21344 /**
21345  * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
21346  */
21347 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
21348
21349 /**
21350  * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
21351  */
21352 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
21353
21354 /**
21355  * Checks if the given object is currently in the success state
21356  */
21357 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
21358
21359 /**
21360  * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
21361  */
21362 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
21363
21364 /**
21365  * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
21366  * but with all dynamically-allocated buffers duplicated in new buffers.
21367  */
21368 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
21369
21370 /**
21371  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21372  */
21373 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
21374
21375 /**
21376  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21377  */
21378 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
21379
21380 /**
21381  * Creates a new CResult_RouteDecodeErrorZ in the success state.
21382  */
21383 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
21384
21385 /**
21386  * Creates a new CResult_RouteDecodeErrorZ in the error state.
21387  */
21388 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
21389
21390 /**
21391  * Checks if the given object is currently in the success state
21392  */
21393 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
21394
21395 /**
21396  * Frees any resources used by the CResult_RouteDecodeErrorZ.
21397  */
21398 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
21399
21400 /**
21401  * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
21402  * but with all dynamically-allocated buffers duplicated in new buffers.
21403  */
21404 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
21405
21406 /**
21407  * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
21408  */
21409 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
21410
21411 /**
21412  * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
21413  */
21414 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
21415
21416 /**
21417  * Checks if the given object is currently in the success state
21418  */
21419 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
21420
21421 /**
21422  * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
21423  */
21424 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
21425
21426 /**
21427  * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
21428  * but with all dynamically-allocated buffers duplicated in new buffers.
21429  */
21430 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
21431
21432 /**
21433  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21434  */
21435 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
21436
21437 /**
21438  * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
21439  */
21440 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
21441
21442 /**
21443  * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
21444  */
21445 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
21446
21447 /**
21448  * Checks if the given object is currently in the success state
21449  */
21450 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
21451
21452 /**
21453  * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
21454  */
21455 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
21456
21457 /**
21458  * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
21459  * but with all dynamically-allocated buffers duplicated in new buffers.
21460  */
21461 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
21462
21463 /**
21464  * Creates a new tuple which has the same data as `orig`
21465  * but with all dynamically-allocated buffers duplicated in new buffers.
21466  */
21467 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
21468
21469 /**
21470  * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
21471  */
21472 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
21473
21474 /**
21475  * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
21476  */
21477 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
21478
21479 /**
21480  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21481  */
21482 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
21483
21484 /**
21485  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21486  */
21487 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
21488
21489 /**
21490  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21491  */
21492 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
21493
21494 /**
21495  * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
21496  */
21497 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
21498
21499 /**
21500  * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
21501  */
21502 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
21503
21504 /**
21505  * Checks if the given object is currently in the success state
21506  */
21507 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
21508
21509 /**
21510  * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
21511  */
21512 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
21513
21514 /**
21515  * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
21516  * but with all dynamically-allocated buffers duplicated in new buffers.
21517  */
21518 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
21519
21520 /**
21521  * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
21522  */
21523 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
21524
21525 /**
21526  * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
21527  */
21528 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
21529
21530 /**
21531  * Checks if the given object is currently in the success state
21532  */
21533 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
21534
21535 /**
21536  * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
21537  */
21538 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
21539
21540 /**
21541  * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
21542  * but with all dynamically-allocated buffers duplicated in new buffers.
21543  */
21544 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
21545
21546 /**
21547  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21548  */
21549 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
21550
21551 /**
21552  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
21553  */
21554 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
21555
21556 /**
21557  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
21558  */
21559 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
21560
21561 /**
21562  * Checks if the given object is currently in the success state
21563  */
21564 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
21565
21566 /**
21567  * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
21568  */
21569 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
21570
21571 /**
21572  * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
21573  * but with all dynamically-allocated buffers duplicated in new buffers.
21574  */
21575 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
21576
21577 /**
21578  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21579  */
21580 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
21581
21582 /**
21583  * Creates a new tuple which has the same data as `orig`
21584  * but with all dynamically-allocated buffers duplicated in new buffers.
21585  */
21586 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
21587
21588 /**
21589  * Creates a new C2Tuple_u64u64Z from the contained elements.
21590  */
21591 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
21592
21593 /**
21594  * Frees any resources used by the C2Tuple_u64u64Z.
21595  */
21596 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
21597
21598 /**
21599  * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
21600  */
21601 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
21602
21603 /**
21604  * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
21605  */
21606 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
21607
21608 /**
21609  * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
21610  */
21611 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
21612
21613 /**
21614  * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
21615  * but with all dynamically-allocated buffers duplicated in new buffers.
21616  */
21617 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
21618
21619 /**
21620  * Creates a new C2Tuple_Z from the contained elements.
21621  */
21622 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
21623
21624 /**
21625  * Frees any resources used by the C2Tuple_Z.
21626  */
21627 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
21628
21629 /**
21630  * Creates a new C2Tuple__u1632_u1632Z from the contained elements.
21631  */
21632 struct LDKC2Tuple__u1632_u1632Z C2Tuple__u1632_u1632Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
21633
21634 /**
21635  * Frees any resources used by the C2Tuple__u1632_u1632Z.
21636  */
21637 void C2Tuple__u1632_u1632Z_free(struct LDKC2Tuple__u1632_u1632Z _res);
21638
21639 /**
21640  * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
21641  */
21642 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(struct LDKC2Tuple__u1632_u1632Z o);
21643
21644 /**
21645  * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
21646  */
21647 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none(void);
21648
21649 /**
21650  * Frees any resources associated with the crate::c_types::derived::C2Tuple__u1632_u1632Z, if we are in the Some state
21651  */
21652 void COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ _res);
21653
21654 /**
21655  * Constructs a new COption_f64Z containing a f64
21656  */
21657 struct LDKCOption_f64Z COption_f64Z_some(double o);
21658
21659 /**
21660  * Constructs a new COption_f64Z containing nothing
21661  */
21662 struct LDKCOption_f64Z COption_f64Z_none(void);
21663
21664 /**
21665  * Frees any resources associated with the f64, if we are in the Some state
21666  */
21667 void COption_f64Z_free(struct LDKCOption_f64Z _res);
21668
21669 /**
21670  * Creates a new COption_f64Z which has the same data as `orig`
21671  * but with all dynamically-allocated buffers duplicated in new buffers.
21672  */
21673 struct LDKCOption_f64Z COption_f64Z_clone(const struct LDKCOption_f64Z *NONNULL_PTR orig);
21674
21675 /**
21676  * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
21677  */
21678 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
21679
21680 /**
21681  * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
21682  */
21683 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
21684
21685 /**
21686  * Checks if the given object is currently in the success state
21687  */
21688 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
21689
21690 /**
21691  * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
21692  */
21693 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
21694
21695 /**
21696  * Creates a new tuple which has the same data as `orig`
21697  * but with all dynamically-allocated buffers duplicated in new buffers.
21698  */
21699 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
21700
21701 /**
21702  * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
21703  */
21704 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
21705
21706 /**
21707  * Frees any resources used by the C2Tuple_usizeTransactionZ.
21708  */
21709 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
21710
21711 /**
21712  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21713  */
21714 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
21715
21716 /**
21717  * Creates a new tuple which has the same data as `orig`
21718  * but with all dynamically-allocated buffers duplicated in new buffers.
21719  */
21720 struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ *NONNULL_PTR orig);
21721
21722 /**
21723  * Creates a new C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ from the contained elements.
21724  */
21725 struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_new(struct LDKThirtyTwoBytes a, struct LDKCOption_ThirtyTwoBytesZ b);
21726
21727 /**
21728  * Frees any resources used by the C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ.
21729  */
21730 void C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZ _res);
21731
21732 /**
21733  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21734  */
21735 void CVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ _res);
21736
21737 /**
21738  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the success state.
21739  */
21740 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o);
21741
21742 /**
21743  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the error state.
21744  */
21745 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void);
21746
21747 /**
21748  * Checks if the given object is currently in the success state
21749  */
21750 bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o);
21751
21752 /**
21753  * Frees any resources used by the CResult_ChannelMonitorUpdateStatusNoneZ.
21754  */
21755 void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res);
21756
21757 /**
21758  * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ which has the same data as `orig`
21759  * but with all dynamically-allocated buffers duplicated in new buffers.
21760  */
21761 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig);
21762
21763 /**
21764  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21765  */
21766 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
21767
21768 /**
21769  * Creates a new tuple which has the same data as `orig`
21770  * but with all dynamically-allocated buffers duplicated in new buffers.
21771  */
21772 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
21773
21774 /**
21775  * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
21776  */
21777 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
21778
21779 /**
21780  * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
21781  */
21782 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
21783
21784 /**
21785  * Frees the buffer pointed to by `data` if `datalen` is non-0.
21786  */
21787 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
21788
21789 /**
21790  * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
21791  */
21792 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
21793
21794 /**
21795  * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
21796  */
21797 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21798
21799 /**
21800  * Checks if the given object is currently in the success state
21801  */
21802 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
21803
21804 /**
21805  * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
21806  */
21807 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
21808
21809 /**
21810  * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
21811  * but with all dynamically-allocated buffers duplicated in new buffers.
21812  */
21813 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
21814
21815 /**
21816  * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
21817  */
21818 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
21819
21820 /**
21821  * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
21822  */
21823 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21824
21825 /**
21826  * Checks if the given object is currently in the success state
21827  */
21828 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
21829
21830 /**
21831  * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
21832  */
21833 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
21834
21835 /**
21836  * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
21837  * but with all dynamically-allocated buffers duplicated in new buffers.
21838  */
21839 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
21840
21841 /**
21842  * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
21843  */
21844 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
21845
21846 /**
21847  * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
21848  */
21849 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21850
21851 /**
21852  * Checks if the given object is currently in the success state
21853  */
21854 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
21855
21856 /**
21857  * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
21858  */
21859 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
21860
21861 /**
21862  * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
21863  * but with all dynamically-allocated buffers duplicated in new buffers.
21864  */
21865 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
21866
21867 /**
21868  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
21869  */
21870 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
21871
21872 /**
21873  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
21874  */
21875 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21876
21877 /**
21878  * Checks if the given object is currently in the success state
21879  */
21880 bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
21881
21882 /**
21883  * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
21884  */
21885 void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
21886
21887 /**
21888  * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
21889  * but with all dynamically-allocated buffers duplicated in new buffers.
21890  */
21891 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
21892
21893 /**
21894  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
21895  */
21896 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
21897
21898 /**
21899  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
21900  */
21901 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21902
21903 /**
21904  * Checks if the given object is currently in the success state
21905  */
21906 bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
21907
21908 /**
21909  * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
21910  */
21911 void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
21912
21913 /**
21914  * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
21915  * but with all dynamically-allocated buffers duplicated in new buffers.
21916  */
21917 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
21918
21919 /**
21920  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
21921  */
21922 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
21923
21924 /**
21925  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
21926  */
21927 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21928
21929 /**
21930  * Checks if the given object is currently in the success state
21931  */
21932 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
21933
21934 /**
21935  * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
21936  */
21937 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
21938
21939 /**
21940  * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
21941  * but with all dynamically-allocated buffers duplicated in new buffers.
21942  */
21943 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
21944
21945 /**
21946  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
21947  */
21948 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
21949
21950 /**
21951  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
21952  */
21953 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
21954
21955 /**
21956  * Checks if the given object is currently in the success state
21957  */
21958 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
21959
21960 /**
21961  * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
21962  */
21963 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
21964
21965 /**
21966  * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
21967  * but with all dynamically-allocated buffers duplicated in new buffers.
21968  */
21969 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
21970
21971 /**
21972  * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
21973  */
21974 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
21975
21976 /**
21977  * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
21978  */
21979 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
21980
21981 /**
21982  * Checks if the given object is currently in the success state
21983  */
21984 bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
21985
21986 /**
21987  * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
21988  */
21989 void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
21990
21991 /**
21992  * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
21993  * but with all dynamically-allocated buffers duplicated in new buffers.
21994  */
21995 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
21996
21997 /**
21998  * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
21999  */
22000 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o);
22001
22002 /**
22003  * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
22004  */
22005 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
22006
22007 /**
22008  * Checks if the given object is currently in the success state
22009  */
22010 bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o);
22011
22012 /**
22013  * Frees any resources used by the CResult_PublicKeySecp256k1ErrorZ.
22014  */
22015 void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res);
22016
22017 /**
22018  * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
22019  * but with all dynamically-allocated buffers duplicated in new buffers.
22020  */
22021 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig);
22022
22023 /**
22024  * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
22025  */
22026 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
22027
22028 /**
22029  * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
22030  */
22031 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
22032
22033 /**
22034  * Checks if the given object is currently in the success state
22035  */
22036 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
22037
22038 /**
22039  * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
22040  */
22041 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
22042
22043 /**
22044  * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
22045  * but with all dynamically-allocated buffers duplicated in new buffers.
22046  */
22047 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
22048
22049 /**
22050  * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
22051  */
22052 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
22053
22054 /**
22055  * Constructs a new COption_NetworkUpdateZ containing nothing
22056  */
22057 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
22058
22059 /**
22060  * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
22061  */
22062 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
22063
22064 /**
22065  * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
22066  * but with all dynamically-allocated buffers duplicated in new buffers.
22067  */
22068 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
22069
22070 /**
22071  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
22072  */
22073 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
22074
22075 /**
22076  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
22077  */
22078 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
22079
22080 /**
22081  * Checks if the given object is currently in the success state
22082  */
22083 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
22084
22085 /**
22086  * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
22087  */
22088 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
22089
22090 /**
22091  * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
22092  * but with all dynamically-allocated buffers duplicated in new buffers.
22093  */
22094 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
22095
22096 /**
22097  * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
22098  */
22099 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
22100
22101 /**
22102  * Constructs a new COption_UtxoLookupZ containing nothing
22103  */
22104 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
22105
22106 /**
22107  * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
22108  */
22109 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
22110
22111 /**
22112  * Creates a new CResult_NoneLightningErrorZ in the success state.
22113  */
22114 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
22115
22116 /**
22117  * Creates a new CResult_NoneLightningErrorZ in the error state.
22118  */
22119 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
22120
22121 /**
22122  * Checks if the given object is currently in the success state
22123  */
22124 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
22125
22126 /**
22127  * Frees any resources used by the CResult_NoneLightningErrorZ.
22128  */
22129 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
22130
22131 /**
22132  * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
22133  * but with all dynamically-allocated buffers duplicated in new buffers.
22134  */
22135 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
22136
22137 /**
22138  * Creates a new CResult_boolLightningErrorZ in the success state.
22139  */
22140 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
22141
22142 /**
22143  * Creates a new CResult_boolLightningErrorZ in the error state.
22144  */
22145 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
22146
22147 /**
22148  * Checks if the given object is currently in the success state
22149  */
22150 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
22151
22152 /**
22153  * Frees any resources used by the CResult_boolLightningErrorZ.
22154  */
22155 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
22156
22157 /**
22158  * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
22159  * but with all dynamically-allocated buffers duplicated in new buffers.
22160  */
22161 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
22162
22163 /**
22164  * Creates a new tuple which has the same data as `orig`
22165  * but with all dynamically-allocated buffers duplicated in new buffers.
22166  */
22167 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
22168
22169 /**
22170  * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
22171  */
22172 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
22173
22174 /**
22175  * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
22176  */
22177 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
22178
22179 /**
22180  * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
22181  */
22182 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
22183
22184 /**
22185  * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
22186  */
22187 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
22188
22189 /**
22190  * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
22191  */
22192 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
22193
22194 /**
22195  * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
22196  * but with all dynamically-allocated buffers duplicated in new buffers.
22197  */
22198 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
22199
22200 /**
22201  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22202  */
22203 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
22204
22205 /**
22206  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
22207  */
22208 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
22209
22210 /**
22211  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
22212  */
22213 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
22214
22215 /**
22216  * Checks if the given object is currently in the success state
22217  */
22218 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
22219
22220 /**
22221  * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
22222  */
22223 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
22224
22225 /**
22226  * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
22227  * but with all dynamically-allocated buffers duplicated in new buffers.
22228  */
22229 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
22230
22231 /**
22232  * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
22233  */
22234 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
22235
22236 /**
22237  * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
22238  */
22239 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
22240
22241 /**
22242  * Checks if the given object is currently in the success state
22243  */
22244 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
22245
22246 /**
22247  * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
22248  */
22249 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
22250
22251 /**
22252  * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
22253  * but with all dynamically-allocated buffers duplicated in new buffers.
22254  */
22255 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
22256
22257 /**
22258  * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
22259  */
22260 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
22261
22262 /**
22263  * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
22264  */
22265 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
22266
22267 /**
22268  * Checks if the given object is currently in the success state
22269  */
22270 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
22271
22272 /**
22273  * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
22274  */
22275 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
22276
22277 /**
22278  * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
22279  * but with all dynamically-allocated buffers duplicated in new buffers.
22280  */
22281 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
22282
22283 /**
22284  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22285  */
22286 void CVec_SocketAddressZ_free(struct LDKCVec_SocketAddressZ _res);
22287
22288 /**
22289  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
22290  */
22291 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
22292
22293 /**
22294  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
22295  */
22296 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
22297
22298 /**
22299  * Checks if the given object is currently in the success state
22300  */
22301 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
22302
22303 /**
22304  * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
22305  */
22306 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
22307
22308 /**
22309  * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
22310  * but with all dynamically-allocated buffers duplicated in new buffers.
22311  */
22312 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
22313
22314 /**
22315  * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
22316  */
22317 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
22318
22319 /**
22320  * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
22321  */
22322 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
22323
22324 /**
22325  * Checks if the given object is currently in the success state
22326  */
22327 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
22328
22329 /**
22330  * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
22331  */
22332 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
22333
22334 /**
22335  * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
22336  * but with all dynamically-allocated buffers duplicated in new buffers.
22337  */
22338 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
22339
22340 /**
22341  * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
22342  */
22343 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
22344
22345 /**
22346  * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
22347  */
22348 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
22349
22350 /**
22351  * Checks if the given object is currently in the success state
22352  */
22353 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
22354
22355 /**
22356  * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
22357  */
22358 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
22359
22360 /**
22361  * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
22362  * but with all dynamically-allocated buffers duplicated in new buffers.
22363  */
22364 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
22365
22366 /**
22367  * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
22368  */
22369 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
22370
22371 /**
22372  * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
22373  */
22374 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
22375
22376 /**
22377  * Checks if the given object is currently in the success state
22378  */
22379 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
22380
22381 /**
22382  * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
22383  */
22384 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
22385
22386 /**
22387  * Constructs a new COption_CVec_SocketAddressZZ containing a crate::c_types::derived::CVec_SocketAddressZ
22388  */
22389 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_some(struct LDKCVec_SocketAddressZ o);
22390
22391 /**
22392  * Constructs a new COption_CVec_SocketAddressZZ containing nothing
22393  */
22394 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_none(void);
22395
22396 /**
22397  * Frees any resources associated with the crate::c_types::derived::CVec_SocketAddressZ, if we are in the Some state
22398  */
22399 void COption_CVec_SocketAddressZZ_free(struct LDKCOption_CVec_SocketAddressZZ _res);
22400
22401 /**
22402  * Creates a new COption_CVec_SocketAddressZZ which has the same data as `orig`
22403  * but with all dynamically-allocated buffers duplicated in new buffers.
22404  */
22405 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig);
22406
22407 /**
22408  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state.
22409  */
22410 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_ok(struct LDKChannelDerivationParameters o);
22411
22412 /**
22413  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the error state.
22414  */
22415 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_err(struct LDKDecodeError e);
22416
22417 /**
22418  * Checks if the given object is currently in the success state
22419  */
22420 bool CResult_ChannelDerivationParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR o);
22421
22422 /**
22423  * Frees any resources used by the CResult_ChannelDerivationParametersDecodeErrorZ.
22424  */
22425 void CResult_ChannelDerivationParametersDecodeErrorZ_free(struct LDKCResult_ChannelDerivationParametersDecodeErrorZ _res);
22426
22427 /**
22428  * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ which has the same data as `orig`
22429  * but with all dynamically-allocated buffers duplicated in new buffers.
22430  */
22431 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR orig);
22432
22433 /**
22434  * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state.
22435  */
22436 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_ok(struct LDKHTLCDescriptor o);
22437
22438 /**
22439  * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the error state.
22440  */
22441 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
22442
22443 /**
22444  * Checks if the given object is currently in the success state
22445  */
22446 bool CResult_HTLCDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR o);
22447
22448 /**
22449  * Frees any resources used by the CResult_HTLCDescriptorDecodeErrorZ.
22450  */
22451 void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDecodeErrorZ _res);
22452
22453 /**
22454  * Creates a new CResult_HTLCDescriptorDecodeErrorZ which has the same data as `orig`
22455  * but with all dynamically-allocated buffers duplicated in new buffers.
22456  */
22457 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
22458
22459 /**
22460  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22461  */
22462 void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
22463
22464 /**
22465  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22466  */
22467 void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
22468
22469 /**
22470  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22471  */
22472 void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
22473
22474 /**
22475  * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
22476  */
22477 struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
22478
22479 /**
22480  * Constructs a new COption_TxOutZ containing nothing
22481  */
22482 struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
22483
22484 /**
22485  * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
22486  */
22487 void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
22488
22489 /**
22490  * Creates a new COption_TxOutZ which has the same data as `orig`
22491  * but with all dynamically-allocated buffers duplicated in new buffers.
22492  */
22493 struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
22494
22495 /**
22496  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22497  */
22498 void CVec_InputZ_free(struct LDKCVec_InputZ _res);
22499
22500 /**
22501  * Creates a new CResult_CoinSelectionNoneZ in the success state.
22502  */
22503 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
22504
22505 /**
22506  * Creates a new CResult_CoinSelectionNoneZ in the error state.
22507  */
22508 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
22509
22510 /**
22511  * Checks if the given object is currently in the success state
22512  */
22513 bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
22514
22515 /**
22516  * Frees any resources used by the CResult_CoinSelectionNoneZ.
22517  */
22518 void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
22519
22520 /**
22521  * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
22522  * but with all dynamically-allocated buffers duplicated in new buffers.
22523  */
22524 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
22525
22526 /**
22527  * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
22528  */
22529 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
22530
22531 /**
22532  * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
22533  */
22534 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
22535
22536 /**
22537  * Checks if the given object is currently in the success state
22538  */
22539 bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
22540
22541 /**
22542  * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
22543  */
22544 void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
22545
22546 /**
22547  * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
22548  * but with all dynamically-allocated buffers duplicated in new buffers.
22549  */
22550 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
22551
22552 /**
22553  * Creates a new tuple which has the same data as `orig`
22554  * but with all dynamically-allocated buffers duplicated in new buffers.
22555  */
22556 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig);
22557
22558 /**
22559  * Creates a new C2Tuple_u64u16Z from the contained elements.
22560  */
22561 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_new(uint64_t a, uint16_t b);
22562
22563 /**
22564  * Frees any resources used by the C2Tuple_u64u16Z.
22565  */
22566 void C2Tuple_u64u16Z_free(struct LDKC2Tuple_u64u16Z _res);
22567
22568 /**
22569  * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z
22570  */
22571 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_some(struct LDKC2Tuple_u64u16Z o);
22572
22573 /**
22574  * Constructs a new COption_C2Tuple_u64u16ZZ containing nothing
22575  */
22576 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_none(void);
22577
22578 /**
22579  * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u16Z, if we are in the Some state
22580  */
22581 void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
22582
22583 /**
22584  * Creates a new COption_C2Tuple_u64u16ZZ which has the same data as `orig`
22585  * but with all dynamically-allocated buffers duplicated in new buffers.
22586  */
22587 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
22588
22589 /**
22590  * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState
22591  */
22592 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
22593
22594 /**
22595  * Constructs a new COption_ChannelShutdownStateZ containing nothing
22596  */
22597 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
22598
22599 /**
22600  * Frees any resources associated with the crate::lightning::ln::channelmanager::ChannelShutdownState, if we are in the Some state
22601  */
22602 void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
22603
22604 /**
22605  * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
22606  * but with all dynamically-allocated buffers duplicated in new buffers.
22607  */
22608 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
22609
22610 /**
22611  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the success state.
22612  */
22613 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
22614
22615 /**
22616  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the error state.
22617  */
22618 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e);
22619
22620 /**
22621  * Checks if the given object is currently in the success state
22622  */
22623 bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o);
22624
22625 /**
22626  * Frees any resources used by the CResult_ThirtyTwoBytesAPIErrorZ.
22627  */
22628 void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res);
22629
22630 /**
22631  * Creates a new CResult_ThirtyTwoBytesAPIErrorZ which has the same data as `orig`
22632  * but with all dynamically-allocated buffers duplicated in new buffers.
22633  */
22634 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
22635
22636 /**
22637  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22638  */
22639 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
22640
22641 /**
22642  * Creates a new CResult_NonePaymentSendFailureZ in the success state.
22643  */
22644 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
22645
22646 /**
22647  * Creates a new CResult_NonePaymentSendFailureZ in the error state.
22648  */
22649 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
22650
22651 /**
22652  * Checks if the given object is currently in the success state
22653  */
22654 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
22655
22656 /**
22657  * Frees any resources used by the CResult_NonePaymentSendFailureZ.
22658  */
22659 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
22660
22661 /**
22662  * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
22663  * but with all dynamically-allocated buffers duplicated in new buffers.
22664  */
22665 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
22666
22667 /**
22668  * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
22669  */
22670 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
22671
22672 /**
22673  * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
22674  */
22675 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
22676
22677 /**
22678  * Checks if the given object is currently in the success state
22679  */
22680 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
22681
22682 /**
22683  * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
22684  */
22685 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
22686
22687 /**
22688  * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
22689  * but with all dynamically-allocated buffers duplicated in new buffers.
22690  */
22691 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
22692
22693 /**
22694  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the success state.
22695  */
22696 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
22697
22698 /**
22699  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state.
22700  */
22701 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
22702
22703 /**
22704  * Checks if the given object is currently in the success state
22705  */
22706 bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o);
22707
22708 /**
22709  * Frees any resources used by the CResult_ThirtyTwoBytesPaymentSendFailureZ.
22710  */
22711 void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res);
22712
22713 /**
22714  * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig`
22715  * but with all dynamically-allocated buffers duplicated in new buffers.
22716  */
22717 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig);
22718
22719 /**
22720  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the success state.
22721  */
22722 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
22723
22724 /**
22725  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the error state.
22726  */
22727 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
22728
22729 /**
22730  * Checks if the given object is currently in the success state
22731  */
22732 bool CResult_ThirtyTwoBytesRetryableSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR o);
22733
22734 /**
22735  * Frees any resources used by the CResult_ThirtyTwoBytesRetryableSendFailureZ.
22736  */
22737 void CResult_ThirtyTwoBytesRetryableSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ _res);
22738
22739 /**
22740  * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ which has the same data as `orig`
22741  * but with all dynamically-allocated buffers duplicated in new buffers.
22742  */
22743 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR orig);
22744
22745 /**
22746  * Creates a new tuple which has the same data as `orig`
22747  * but with all dynamically-allocated buffers duplicated in new buffers.
22748  */
22749 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR orig);
22750
22751 /**
22752  * Creates a new C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ from the contained elements.
22753  */
22754 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
22755
22756 /**
22757  * Frees any resources used by the C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ.
22758  */
22759 void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res);
22760
22761 /**
22762  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state.
22763  */
22764 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
22765
22766 /**
22767  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state.
22768  */
22769 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
22770
22771 /**
22772  * Checks if the given object is currently in the success state
22773  */
22774 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o);
22775
22776 /**
22777  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.
22778  */
22779 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res);
22780
22781 /**
22782  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig`
22783  * but with all dynamically-allocated buffers duplicated in new buffers.
22784  */
22785 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig);
22786
22787 /**
22788  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22789  */
22790 void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res);
22791
22792 /**
22793  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state.
22794  */
22795 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
22796
22797 /**
22798  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the error state.
22799  */
22800 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_err(struct LDKProbeSendFailure e);
22801
22802 /**
22803  * Checks if the given object is currently in the success state
22804  */
22805 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR o);
22806
22807 /**
22808  * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.
22809  */
22810 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ _res);
22811
22812 /**
22813  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ which has the same data as `orig`
22814  * but with all dynamically-allocated buffers duplicated in new buffers.
22815  */
22816 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig);
22817
22818 /**
22819  * Creates a new tuple which has the same data as `orig`
22820  * but with all dynamically-allocated buffers duplicated in new buffers.
22821  */
22822 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR orig);
22823
22824 /**
22825  * Creates a new C2Tuple_ThirtyTwoBytesPublicKeyZ from the contained elements.
22826  */
22827 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_new(struct LDKThirtyTwoBytes a, struct LDKPublicKey b);
22828
22829 /**
22830  * Frees any resources used by the C2Tuple_ThirtyTwoBytesPublicKeyZ.
22831  */
22832 void C2Tuple_ThirtyTwoBytesPublicKeyZ_free(struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ _res);
22833
22834 /**
22835  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22836  */
22837 void CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ _res);
22838
22839 /**
22840  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state.
22841  */
22842 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
22843
22844 /**
22845  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the error state.
22846  */
22847 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void);
22848
22849 /**
22850  * Checks if the given object is currently in the success state
22851  */
22852 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR o);
22853
22854 /**
22855  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.
22856  */
22857 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ _res);
22858
22859 /**
22860  * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ which has the same data as `orig`
22861  * but with all dynamically-allocated buffers duplicated in new buffers.
22862  */
22863 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig);
22864
22865 /**
22866  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
22867  */
22868 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
22869
22870 /**
22871  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
22872  */
22873 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
22874
22875 /**
22876  * Checks if the given object is currently in the success state
22877  */
22878 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
22879
22880 /**
22881  * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
22882  */
22883 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
22884
22885 /**
22886  * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
22887  * but with all dynamically-allocated buffers duplicated in new buffers.
22888  */
22889 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
22890
22891 /**
22892  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
22893  */
22894 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
22895
22896 /**
22897  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
22898  */
22899 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
22900
22901 /**
22902  * Checks if the given object is currently in the success state
22903  */
22904 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
22905
22906 /**
22907  * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
22908  */
22909 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
22910
22911 /**
22912  * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
22913  * but with all dynamically-allocated buffers duplicated in new buffers.
22914  */
22915 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
22916
22917 /**
22918  * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
22919  */
22920 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
22921
22922 /**
22923  * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
22924  */
22925 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
22926
22927 /**
22928  * Checks if the given object is currently in the success state
22929  */
22930 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
22931
22932 /**
22933  * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
22934  */
22935 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
22936
22937 /**
22938  * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
22939  * but with all dynamically-allocated buffers duplicated in new buffers.
22940  */
22941 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
22942
22943 /**
22944  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
22945  */
22946 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
22947
22948 /**
22949  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
22950  */
22951 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
22952
22953 /**
22954  * Checks if the given object is currently in the success state
22955  */
22956 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
22957
22958 /**
22959  * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
22960  */
22961 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
22962
22963 /**
22964  * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
22965  * but with all dynamically-allocated buffers duplicated in new buffers.
22966  */
22967 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
22968
22969 /**
22970  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
22971  */
22972 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
22973
22974 /**
22975  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
22976  */
22977 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
22978
22979 /**
22980  * Checks if the given object is currently in the success state
22981  */
22982 bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
22983
22984 /**
22985  * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
22986  */
22987 void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
22988
22989 /**
22990  * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
22991  * but with all dynamically-allocated buffers duplicated in new buffers.
22992  */
22993 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
22994
22995 /**
22996  * Frees the buffer pointed to by `data` if `datalen` is non-0.
22997  */
22998 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
22999
23000 /**
23001  * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements.
23002  */
23003 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
23004
23005 /**
23006  * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelManagerZ.
23007  */
23008 void C2Tuple_ThirtyTwoBytesChannelManagerZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ _res);
23009
23010 /**
23011  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
23012  */
23013 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ o);
23014
23015 /**
23016  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
23017  */
23018 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
23019
23020 /**
23021  * Checks if the given object is currently in the success state
23022  */
23023 bool CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ *NONNULL_PTR o);
23024
23025 /**
23026  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.
23027  */
23028 void CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ _res);
23029
23030 /**
23031  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
23032  */
23033 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
23034
23035 /**
23036  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
23037  */
23038 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
23039
23040 /**
23041  * Checks if the given object is currently in the success state
23042  */
23043 bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
23044
23045 /**
23046  * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
23047  */
23048 void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
23049
23050 /**
23051  * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
23052  * but with all dynamically-allocated buffers duplicated in new buffers.
23053  */
23054 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
23055
23056 /**
23057  * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
23058  */
23059 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
23060
23061 /**
23062  * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
23063  */
23064 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
23065
23066 /**
23067  * Checks if the given object is currently in the success state
23068  */
23069 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
23070
23071 /**
23072  * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
23073  */
23074 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
23075
23076 /**
23077  * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
23078  * but with all dynamically-allocated buffers duplicated in new buffers.
23079  */
23080 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
23081
23082 /**
23083  * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
23084  */
23085 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
23086
23087 /**
23088  * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
23089  */
23090 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
23091
23092 /**
23093  * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
23094  */
23095 void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
23096
23097 /**
23098  * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
23099  * but with all dynamically-allocated buffers duplicated in new buffers.
23100  */
23101 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
23102
23103 /**
23104  * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
23105  */
23106 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
23107
23108 /**
23109  * Constructs a new COption_APIErrorZ containing nothing
23110  */
23111 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
23112
23113 /**
23114  * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
23115  */
23116 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
23117
23118 /**
23119  * Creates a new COption_APIErrorZ which has the same data as `orig`
23120  * but with all dynamically-allocated buffers duplicated in new buffers.
23121  */
23122 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
23123
23124 /**
23125  * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
23126  */
23127 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
23128
23129 /**
23130  * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
23131  */
23132 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
23133
23134 /**
23135  * Checks if the given object is currently in the success state
23136  */
23137 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
23138
23139 /**
23140  * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
23141  */
23142 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
23143
23144 /**
23145  * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
23146  * but with all dynamically-allocated buffers duplicated in new buffers.
23147  */
23148 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
23149
23150 /**
23151  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
23152  */
23153 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
23154
23155 /**
23156  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
23157  */
23158 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
23159
23160 /**
23161  * Checks if the given object is currently in the success state
23162  */
23163 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
23164
23165 /**
23166  * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
23167  */
23168 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
23169
23170 /**
23171  * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
23172  * but with all dynamically-allocated buffers duplicated in new buffers.
23173  */
23174 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
23175
23176 /**
23177  * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
23178  */
23179 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
23180
23181 /**
23182  * Constructs a new COption_MonitorEventZ containing nothing
23183  */
23184 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
23185
23186 /**
23187  * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
23188  */
23189 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
23190
23191 /**
23192  * Creates a new COption_MonitorEventZ which has the same data as `orig`
23193  * but with all dynamically-allocated buffers duplicated in new buffers.
23194  */
23195 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
23196
23197 /**
23198  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
23199  */
23200 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
23201
23202 /**
23203  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
23204  */
23205 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
23206
23207 /**
23208  * Checks if the given object is currently in the success state
23209  */
23210 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
23211
23212 /**
23213  * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
23214  */
23215 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
23216
23217 /**
23218  * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
23219  * but with all dynamically-allocated buffers duplicated in new buffers.
23220  */
23221 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
23222
23223 /**
23224  * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
23225  */
23226 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
23227
23228 /**
23229  * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
23230  */
23231 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
23232
23233 /**
23234  * Checks if the given object is currently in the success state
23235  */
23236 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
23237
23238 /**
23239  * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
23240  */
23241 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
23242
23243 /**
23244  * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
23245  * but with all dynamically-allocated buffers duplicated in new buffers.
23246  */
23247 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
23248
23249 /**
23250  * Creates a new tuple which has the same data as `orig`
23251  * but with all dynamically-allocated buffers duplicated in new buffers.
23252  */
23253 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u8ZZ *NONNULL_PTR orig);
23254
23255 /**
23256  * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements.
23257  */
23258 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
23259
23260 /**
23261  * Frees any resources used by the C2Tuple_OutPointCVec_u8ZZ.
23262  */
23263 void C2Tuple_OutPointCVec_u8ZZ_free(struct LDKC2Tuple_OutPointCVec_u8ZZ _res);
23264
23265 /**
23266  * Creates a new tuple which has the same data as `orig`
23267  * but with all dynamically-allocated buffers duplicated in new buffers.
23268  */
23269 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_clone(const struct LDKC2Tuple_u32CVec_u8ZZ *NONNULL_PTR orig);
23270
23271 /**
23272  * Creates a new C2Tuple_u32CVec_u8ZZ from the contained elements.
23273  */
23274 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_new(uint32_t a, struct LDKCVec_u8Z b);
23275
23276 /**
23277  * Frees any resources used by the C2Tuple_u32CVec_u8ZZ.
23278  */
23279 void C2Tuple_u32CVec_u8ZZ_free(struct LDKC2Tuple_u32CVec_u8ZZ _res);
23280
23281 /**
23282  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23283  */
23284 void CVec_C2Tuple_u32CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u32CVec_u8ZZZ _res);
23285
23286 /**
23287  * Creates a new tuple which has the same data as `orig`
23288  * but with all dynamically-allocated buffers duplicated in new buffers.
23289  */
23290 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR orig);
23291
23292 /**
23293  * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements.
23294  */
23295 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b);
23296
23297 /**
23298  * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.
23299  */
23300 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ _res);
23301
23302 /**
23303  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23304  */
23305 void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
23306
23307 /**
23308  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23309  */
23310 void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res);
23311
23312 /**
23313  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23314  */
23315 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
23316
23317 /**
23318  * Creates a new tuple which has the same data as `orig`
23319  * but with all dynamically-allocated buffers duplicated in new buffers.
23320  */
23321 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
23322
23323 /**
23324  * Creates a new C2Tuple_u32TxOutZ from the contained elements.
23325  */
23326 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
23327
23328 /**
23329  * Frees any resources used by the C2Tuple_u32TxOutZ.
23330  */
23331 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
23332
23333 /**
23334  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23335  */
23336 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
23337
23338 /**
23339  * Creates a new tuple which has the same data as `orig`
23340  * but with all dynamically-allocated buffers duplicated in new buffers.
23341  */
23342 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
23343
23344 /**
23345  * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements.
23346  */
23347 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
23348
23349 /**
23350  * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.
23351  */
23352 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ _res);
23353
23354 /**
23355  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23356  */
23357 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
23358
23359 /**
23360  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23361  */
23362 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
23363
23364 /**
23365  * Creates a new tuple which has the same data as `orig`
23366  * but with all dynamically-allocated buffers duplicated in new buffers.
23367  */
23368 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR orig);
23369
23370 /**
23371  * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements.
23372  */
23373 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
23374
23375 /**
23376  * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelMonitorZ.
23377  */
23378 void C2Tuple_ThirtyTwoBytesChannelMonitorZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ _res);
23379
23380 /**
23381  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state.
23382  */
23383 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
23384
23385 /**
23386  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the error state.
23387  */
23388 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
23389
23390 /**
23391  * Checks if the given object is currently in the success state
23392  */
23393 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
23394
23395 /**
23396  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.
23397  */
23398 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ _res);
23399
23400 /**
23401  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ which has the same data as `orig`
23402  * but with all dynamically-allocated buffers duplicated in new buffers.
23403  */
23404 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR orig);
23405
23406 /**
23407  * Creates a new tuple which has the same data as `orig`
23408  * but with all dynamically-allocated buffers duplicated in new buffers.
23409  */
23410 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig);
23411
23412 /**
23413  * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
23414  */
23415 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
23416
23417 /**
23418  * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
23419  */
23420 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
23421
23422 /**
23423  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23424  */
23425 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
23426
23427 /**
23428  * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
23429  */
23430 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
23431
23432 /**
23433  * Constructs a new COption_OffersMessageZ containing nothing
23434  */
23435 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
23436
23437 /**
23438  * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
23439  */
23440 void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
23441
23442 /**
23443  * Creates a new COption_OffersMessageZ which has the same data as `orig`
23444  * but with all dynamically-allocated buffers duplicated in new buffers.
23445  */
23446 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
23447
23448 /**
23449  * Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents
23450  */
23451 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_some(struct LDKCustomOnionMessageContents o);
23452
23453 /**
23454  * Constructs a new COption_CustomOnionMessageContentsZ containing nothing
23455  */
23456 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_none(void);
23457
23458 /**
23459  * Frees any resources associated with the crate::lightning::onion_message::packet::CustomOnionMessageContents, if we are in the Some state
23460  */
23461 void COption_CustomOnionMessageContentsZ_free(struct LDKCOption_CustomOnionMessageContentsZ _res);
23462
23463 /**
23464  * Creates a new COption_CustomOnionMessageContentsZ which has the same data as `orig`
23465  * but with all dynamically-allocated buffers duplicated in new buffers.
23466  */
23467 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_clone(const struct LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR orig);
23468
23469 /**
23470  * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the success state.
23471  */
23472 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_CustomOnionMessageContentsZ o);
23473
23474 /**
23475  * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the error state.
23476  */
23477 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
23478
23479 /**
23480  * Checks if the given object is currently in the success state
23481  */
23482 bool CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
23483
23484 /**
23485  * Frees any resources used by the CResult_COption_CustomOnionMessageContentsZDecodeErrorZ.
23486  */
23487 void CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res);
23488
23489 /**
23490  * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ which has the same data as `orig`
23491  * but with all dynamically-allocated buffers duplicated in new buffers.
23492  */
23493 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
23494
23495 /**
23496  * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
23497  */
23498 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
23499
23500 /**
23501  * Constructs a new COption_TypeZ containing nothing
23502  */
23503 struct LDKCOption_TypeZ COption_TypeZ_none(void);
23504
23505 /**
23506  * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
23507  */
23508 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
23509
23510 /**
23511  * Creates a new COption_TypeZ which has the same data as `orig`
23512  * but with all dynamically-allocated buffers duplicated in new buffers.
23513  */
23514 struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig);
23515
23516 /**
23517  * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
23518  */
23519 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
23520
23521 /**
23522  * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
23523  */
23524 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
23525
23526 /**
23527  * Checks if the given object is currently in the success state
23528  */
23529 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
23530
23531 /**
23532  * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
23533  */
23534 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
23535
23536 /**
23537  * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig`
23538  * but with all dynamically-allocated buffers duplicated in new buffers.
23539  */
23540 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
23541
23542 /**
23543  * Constructs a new COption_SocketAddressZ containing a crate::lightning::ln::msgs::SocketAddress
23544  */
23545 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_some(struct LDKSocketAddress o);
23546
23547 /**
23548  * Constructs a new COption_SocketAddressZ containing nothing
23549  */
23550 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_none(void);
23551
23552 /**
23553  * Frees any resources associated with the crate::lightning::ln::msgs::SocketAddress, if we are in the Some state
23554  */
23555 void COption_SocketAddressZ_free(struct LDKCOption_SocketAddressZ _res);
23556
23557 /**
23558  * Creates a new COption_SocketAddressZ which has the same data as `orig`
23559  * but with all dynamically-allocated buffers duplicated in new buffers.
23560  */
23561 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig);
23562
23563 /**
23564  * Creates a new tuple which has the same data as `orig`
23565  * but with all dynamically-allocated buffers duplicated in new buffers.
23566  */
23567 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR orig);
23568
23569 /**
23570  * Creates a new C2Tuple_PublicKeyCOption_SocketAddressZZ from the contained elements.
23571  */
23572 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCOption_SocketAddressZ b);
23573
23574 /**
23575  * Frees any resources used by the C2Tuple_PublicKeyCOption_SocketAddressZZ.
23576  */
23577 void C2Tuple_PublicKeyCOption_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ _res);
23578
23579 /**
23580  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23581  */
23582 void CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ _res);
23583
23584 /**
23585  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
23586  */
23587 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
23588
23589 /**
23590  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
23591  */
23592 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
23593
23594 /**
23595  * Checks if the given object is currently in the success state
23596  */
23597 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
23598
23599 /**
23600  * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
23601  */
23602 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
23603
23604 /**
23605  * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
23606  * but with all dynamically-allocated buffers duplicated in new buffers.
23607  */
23608 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
23609
23610 /**
23611  * Creates a new CResult_NonePeerHandleErrorZ in the success state.
23612  */
23613 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
23614
23615 /**
23616  * Creates a new CResult_NonePeerHandleErrorZ in the error state.
23617  */
23618 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
23619
23620 /**
23621  * Checks if the given object is currently in the success state
23622  */
23623 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
23624
23625 /**
23626  * Frees any resources used by the CResult_NonePeerHandleErrorZ.
23627  */
23628 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
23629
23630 /**
23631  * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
23632  * but with all dynamically-allocated buffers duplicated in new buffers.
23633  */
23634 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
23635
23636 /**
23637  * Creates a new CResult_boolPeerHandleErrorZ in the success state.
23638  */
23639 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
23640
23641 /**
23642  * Creates a new CResult_boolPeerHandleErrorZ in the error state.
23643  */
23644 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
23645
23646 /**
23647  * Checks if the given object is currently in the success state
23648  */
23649 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
23650
23651 /**
23652  * Frees any resources used by the CResult_boolPeerHandleErrorZ.
23653  */
23654 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
23655
23656 /**
23657  * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
23658  * but with all dynamically-allocated buffers duplicated in new buffers.
23659  */
23660 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
23661
23662 /**
23663  * Creates a new CResult_u32GraphSyncErrorZ in the success state.
23664  */
23665 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
23666
23667 /**
23668  * Creates a new CResult_u32GraphSyncErrorZ in the error state.
23669  */
23670 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
23671
23672 /**
23673  * Checks if the given object is currently in the success state
23674  */
23675 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
23676
23677 /**
23678  * Frees any resources used by the CResult_u32GraphSyncErrorZ.
23679  */
23680 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
23681
23682 /**
23683  * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
23684  */
23685 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_ok(struct LDKCVec_u8Z o);
23686
23687 /**
23688  * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
23689  */
23690 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_err(enum LDKIOError e);
23691
23692 /**
23693  * Checks if the given object is currently in the success state
23694  */
23695 bool CResult_CVec_u8ZIOErrorZ_is_ok(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR o);
23696
23697 /**
23698  * Frees any resources used by the CResult_CVec_u8ZIOErrorZ.
23699  */
23700 void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
23701
23702 /**
23703  * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
23704  * but with all dynamically-allocated buffers duplicated in new buffers.
23705  */
23706 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
23707
23708 /**
23709  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23710  */
23711 void CVec_StrZ_free(struct LDKCVec_StrZ _res);
23712
23713 /**
23714  * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
23715  */
23716 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o);
23717
23718 /**
23719  * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
23720  */
23721 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e);
23722
23723 /**
23724  * Checks if the given object is currently in the success state
23725  */
23726 bool CResult_CVec_StrZIOErrorZ_is_ok(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR o);
23727
23728 /**
23729  * Frees any resources used by the CResult_CVec_StrZIOErrorZ.
23730  */
23731 void CResult_CVec_StrZIOErrorZ_free(struct LDKCResult_CVec_StrZIOErrorZ _res);
23732
23733 /**
23734  * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
23735  * but with all dynamically-allocated buffers duplicated in new buffers.
23736  */
23737 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig);
23738
23739 /**
23740  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23741  */
23742 void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res);
23743
23744 /**
23745  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state.
23746  */
23747 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o);
23748
23749 /**
23750  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the error state.
23751  */
23752 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_err(enum LDKIOError e);
23753
23754 /**
23755  * Checks if the given object is currently in the success state
23756  */
23757 bool CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR o);
23758
23759 /**
23760  * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.
23761  */
23762 void CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ _res);
23763
23764 /**
23765  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ which has the same data as `orig`
23766  * but with all dynamically-allocated buffers duplicated in new buffers.
23767  */
23768 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR orig);
23769
23770 /**
23771  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state.
23772  */
23773 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
23774
23775 /**
23776  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the error state.
23777  */
23778 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_err(enum LDKIOError e);
23779
23780 /**
23781  * Checks if the given object is currently in the success state
23782  */
23783 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR o);
23784
23785 /**
23786  * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.
23787  */
23788 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ _res);
23789
23790 /**
23791  * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ which has the same data as `orig`
23792  * but with all dynamically-allocated buffers duplicated in new buffers.
23793  */
23794 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig);
23795
23796 /**
23797  * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey
23798  */
23799 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o);
23800
23801 /**
23802  * Constructs a new COption_SecretKeyZ containing nothing
23803  */
23804 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void);
23805
23806 /**
23807  * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
23808  */
23809 void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res);
23810
23811 /**
23812  * Creates a new COption_SecretKeyZ which has the same data as `orig`
23813  * but with all dynamically-allocated buffers duplicated in new buffers.
23814  */
23815 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig);
23816
23817 /**
23818  * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state.
23819  */
23820 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o);
23821
23822 /**
23823  * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the error state.
23824  */
23825 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void);
23826
23827 /**
23828  * Checks if the given object is currently in the success state
23829  */
23830 bool CResult_VerifiedInvoiceRequestNoneZ_is_ok(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR o);
23831
23832 /**
23833  * Frees any resources used by the CResult_VerifiedInvoiceRequestNoneZ.
23834  */
23835 void CResult_VerifiedInvoiceRequestNoneZ_free(struct LDKCResult_VerifiedInvoiceRequestNoneZ _res);
23836
23837 /**
23838  * Creates a new CResult_VerifiedInvoiceRequestNoneZ which has the same data as `orig`
23839  * but with all dynamically-allocated buffers duplicated in new buffers.
23840  */
23841 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig);
23842
23843 /**
23844  * Constructs a new COption_NoneZ containing a
23845  */
23846 enum LDKCOption_NoneZ COption_NoneZ_some(void);
23847
23848 /**
23849  * Constructs a new COption_NoneZ containing nothing
23850  */
23851 enum LDKCOption_NoneZ COption_NoneZ_none(void);
23852
23853 /**
23854  * Frees any resources associated with the , if we are in the Some state
23855  */
23856 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
23857
23858 /**
23859  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23860  */
23861 void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
23862
23863 /**
23864  * Constructs a new COption_i64Z containing a i64
23865  */
23866 struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
23867
23868 /**
23869  * Constructs a new COption_i64Z containing nothing
23870  */
23871 struct LDKCOption_i64Z COption_i64Z_none(void);
23872
23873 /**
23874  * Frees any resources associated with the i64, if we are in the Some state
23875  */
23876 void COption_i64Z_free(struct LDKCOption_i64Z _res);
23877
23878 /**
23879  * Creates a new COption_i64Z which has the same data as `orig`
23880  * but with all dynamically-allocated buffers duplicated in new buffers.
23881  */
23882 struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
23883
23884 /**
23885  * Creates a new CResult_SocketAddressDecodeErrorZ in the success state.
23886  */
23887 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_ok(struct LDKSocketAddress o);
23888
23889 /**
23890  * Creates a new CResult_SocketAddressDecodeErrorZ in the error state.
23891  */
23892 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_err(struct LDKDecodeError e);
23893
23894 /**
23895  * Checks if the given object is currently in the success state
23896  */
23897 bool CResult_SocketAddressDecodeErrorZ_is_ok(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR o);
23898
23899 /**
23900  * Frees any resources used by the CResult_SocketAddressDecodeErrorZ.
23901  */
23902 void CResult_SocketAddressDecodeErrorZ_free(struct LDKCResult_SocketAddressDecodeErrorZ _res);
23903
23904 /**
23905  * Creates a new CResult_SocketAddressDecodeErrorZ which has the same data as `orig`
23906  * but with all dynamically-allocated buffers duplicated in new buffers.
23907  */
23908 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_clone(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR orig);
23909
23910 /**
23911  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the success state.
23912  */
23913 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_ok(struct LDKSocketAddress o);
23914
23915 /**
23916  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the error state.
23917  */
23918 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_err(enum LDKSocketAddressParseError e);
23919
23920 /**
23921  * Checks if the given object is currently in the success state
23922  */
23923 bool CResult_SocketAddressSocketAddressParseErrorZ_is_ok(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR o);
23924
23925 /**
23926  * Frees any resources used by the CResult_SocketAddressSocketAddressParseErrorZ.
23927  */
23928 void CResult_SocketAddressSocketAddressParseErrorZ_free(struct LDKCResult_SocketAddressSocketAddressParseErrorZ _res);
23929
23930 /**
23931  * Creates a new CResult_SocketAddressSocketAddressParseErrorZ which has the same data as `orig`
23932  * but with all dynamically-allocated buffers duplicated in new buffers.
23933  */
23934 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_clone(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR orig);
23935
23936 /**
23937  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23938  */
23939 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
23940
23941 /**
23942  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23943  */
23944 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
23945
23946 /**
23947  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23948  */
23949 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
23950
23951 /**
23952  * Frees the buffer pointed to by `data` if `datalen` is non-0.
23953  */
23954 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
23955
23956 /**
23957  * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
23958  */
23959 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
23960
23961 /**
23962  * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
23963  */
23964 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
23965
23966 /**
23967  * Checks if the given object is currently in the success state
23968  */
23969 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
23970
23971 /**
23972  * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
23973  */
23974 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
23975
23976 /**
23977  * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
23978  * but with all dynamically-allocated buffers duplicated in new buffers.
23979  */
23980 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
23981
23982 /**
23983  * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
23984  */
23985 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
23986
23987 /**
23988  * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
23989  */
23990 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
23991
23992 /**
23993  * Checks if the given object is currently in the success state
23994  */
23995 bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
23996
23997 /**
23998  * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
23999  */
24000 void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
24001
24002 /**
24003  * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
24004  * but with all dynamically-allocated buffers duplicated in new buffers.
24005  */
24006 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
24007
24008 /**
24009  * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
24010  */
24011 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
24012
24013 /**
24014  * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
24015  */
24016 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
24017
24018 /**
24019  * Checks if the given object is currently in the success state
24020  */
24021 bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
24022
24023 /**
24024  * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
24025  */
24026 void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
24027
24028 /**
24029  * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
24030  * but with all dynamically-allocated buffers duplicated in new buffers.
24031  */
24032 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
24033
24034 /**
24035  * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
24036  */
24037 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
24038
24039 /**
24040  * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
24041  */
24042 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
24043
24044 /**
24045  * Checks if the given object is currently in the success state
24046  */
24047 bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
24048
24049 /**
24050  * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
24051  */
24052 void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
24053
24054 /**
24055  * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
24056  * but with all dynamically-allocated buffers duplicated in new buffers.
24057  */
24058 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
24059
24060 /**
24061  * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
24062  */
24063 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
24064
24065 /**
24066  * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
24067  */
24068 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
24069
24070 /**
24071  * Checks if the given object is currently in the success state
24072  */
24073 bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
24074
24075 /**
24076  * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
24077  */
24078 void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
24079
24080 /**
24081  * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
24082  * but with all dynamically-allocated buffers duplicated in new buffers.
24083  */
24084 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
24085
24086 /**
24087  * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
24088  */
24089 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
24090
24091 /**
24092  * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
24093  */
24094 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
24095
24096 /**
24097  * Checks if the given object is currently in the success state
24098  */
24099 bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
24100
24101 /**
24102  * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
24103  */
24104 void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
24105
24106 /**
24107  * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
24108  * but with all dynamically-allocated buffers duplicated in new buffers.
24109  */
24110 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
24111
24112 /**
24113  * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
24114  */
24115 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
24116
24117 /**
24118  * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
24119  */
24120 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
24121
24122 /**
24123  * Checks if the given object is currently in the success state
24124  */
24125 bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
24126
24127 /**
24128  * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
24129  */
24130 void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
24131
24132 /**
24133  * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
24134  * but with all dynamically-allocated buffers duplicated in new buffers.
24135  */
24136 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
24137
24138 /**
24139  * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
24140  */
24141 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
24142
24143 /**
24144  * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
24145  */
24146 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
24147
24148 /**
24149  * Checks if the given object is currently in the success state
24150  */
24151 bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
24152
24153 /**
24154  * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
24155  */
24156 void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
24157
24158 /**
24159  * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
24160  * but with all dynamically-allocated buffers duplicated in new buffers.
24161  */
24162 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
24163
24164 /**
24165  * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
24166  */
24167 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
24168
24169 /**
24170  * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
24171  */
24172 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
24173
24174 /**
24175  * Checks if the given object is currently in the success state
24176  */
24177 bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
24178
24179 /**
24180  * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
24181  */
24182 void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
24183
24184 /**
24185  * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
24186  * but with all dynamically-allocated buffers duplicated in new buffers.
24187  */
24188 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
24189
24190 /**
24191  * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
24192  */
24193 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
24194
24195 /**
24196  * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
24197  */
24198 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
24199
24200 /**
24201  * Checks if the given object is currently in the success state
24202  */
24203 bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
24204
24205 /**
24206  * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
24207  */
24208 void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
24209
24210 /**
24211  * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
24212  * but with all dynamically-allocated buffers duplicated in new buffers.
24213  */
24214 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
24215
24216 /**
24217  * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
24218  */
24219 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
24220
24221 /**
24222  * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
24223  */
24224 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
24225
24226 /**
24227  * Checks if the given object is currently in the success state
24228  */
24229 bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
24230
24231 /**
24232  * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
24233  */
24234 void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
24235
24236 /**
24237  * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
24238  * but with all dynamically-allocated buffers duplicated in new buffers.
24239  */
24240 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
24241
24242 /**
24243  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
24244  */
24245 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
24246
24247 /**
24248  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
24249  */
24250 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
24251
24252 /**
24253  * Checks if the given object is currently in the success state
24254  */
24255 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
24256
24257 /**
24258  * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
24259  */
24260 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
24261
24262 /**
24263  * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
24264  * but with all dynamically-allocated buffers duplicated in new buffers.
24265  */
24266 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
24267
24268 /**
24269  * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
24270  */
24271 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
24272
24273 /**
24274  * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
24275  */
24276 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
24277
24278 /**
24279  * Checks if the given object is currently in the success state
24280  */
24281 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
24282
24283 /**
24284  * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
24285  */
24286 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
24287
24288 /**
24289  * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
24290  * but with all dynamically-allocated buffers duplicated in new buffers.
24291  */
24292 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
24293
24294 /**
24295  * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
24296  */
24297 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
24298
24299 /**
24300  * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
24301  */
24302 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
24303
24304 /**
24305  * Checks if the given object is currently in the success state
24306  */
24307 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
24308
24309 /**
24310  * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
24311  */
24312 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
24313
24314 /**
24315  * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
24316  * but with all dynamically-allocated buffers duplicated in new buffers.
24317  */
24318 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
24319
24320 /**
24321  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
24322  */
24323 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
24324
24325 /**
24326  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
24327  */
24328 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
24329
24330 /**
24331  * Checks if the given object is currently in the success state
24332  */
24333 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
24334
24335 /**
24336  * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
24337  */
24338 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
24339
24340 /**
24341  * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
24342  * but with all dynamically-allocated buffers duplicated in new buffers.
24343  */
24344 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
24345
24346 /**
24347  * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
24348  */
24349 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
24350
24351 /**
24352  * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
24353  */
24354 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
24355
24356 /**
24357  * Checks if the given object is currently in the success state
24358  */
24359 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
24360
24361 /**
24362  * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
24363  */
24364 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
24365
24366 /**
24367  * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
24368  * but with all dynamically-allocated buffers duplicated in new buffers.
24369  */
24370 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
24371
24372 /**
24373  * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
24374  */
24375 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
24376
24377 /**
24378  * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
24379  */
24380 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
24381
24382 /**
24383  * Checks if the given object is currently in the success state
24384  */
24385 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
24386
24387 /**
24388  * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
24389  */
24390 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
24391
24392 /**
24393  * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
24394  * but with all dynamically-allocated buffers duplicated in new buffers.
24395  */
24396 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
24397
24398 /**
24399  * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
24400  */
24401 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
24402
24403 /**
24404  * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
24405  */
24406 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
24407
24408 /**
24409  * Checks if the given object is currently in the success state
24410  */
24411 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
24412
24413 /**
24414  * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
24415  */
24416 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
24417
24418 /**
24419  * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
24420  * but with all dynamically-allocated buffers duplicated in new buffers.
24421  */
24422 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
24423
24424 /**
24425  * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
24426  */
24427 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
24428
24429 /**
24430  * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
24431  */
24432 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
24433
24434 /**
24435  * Checks if the given object is currently in the success state
24436  */
24437 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
24438
24439 /**
24440  * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
24441  */
24442 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
24443
24444 /**
24445  * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
24446  * but with all dynamically-allocated buffers duplicated in new buffers.
24447  */
24448 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
24449
24450 /**
24451  * Creates a new CResult_InitDecodeErrorZ in the success state.
24452  */
24453 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
24454
24455 /**
24456  * Creates a new CResult_InitDecodeErrorZ in the error state.
24457  */
24458 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
24459
24460 /**
24461  * Checks if the given object is currently in the success state
24462  */
24463 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
24464
24465 /**
24466  * Frees any resources used by the CResult_InitDecodeErrorZ.
24467  */
24468 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
24469
24470 /**
24471  * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
24472  * but with all dynamically-allocated buffers duplicated in new buffers.
24473  */
24474 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
24475
24476 /**
24477  * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
24478  */
24479 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
24480
24481 /**
24482  * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
24483  */
24484 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
24485
24486 /**
24487  * Checks if the given object is currently in the success state
24488  */
24489 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
24490
24491 /**
24492  * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
24493  */
24494 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
24495
24496 /**
24497  * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
24498  * but with all dynamically-allocated buffers duplicated in new buffers.
24499  */
24500 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
24501
24502 /**
24503  * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
24504  */
24505 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
24506
24507 /**
24508  * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
24509  */
24510 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
24511
24512 /**
24513  * Checks if the given object is currently in the success state
24514  */
24515 bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
24516
24517 /**
24518  * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
24519  */
24520 void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
24521
24522 /**
24523  * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
24524  * but with all dynamically-allocated buffers duplicated in new buffers.
24525  */
24526 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
24527
24528 /**
24529  * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
24530  */
24531 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
24532
24533 /**
24534  * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
24535  */
24536 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
24537
24538 /**
24539  * Checks if the given object is currently in the success state
24540  */
24541 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
24542
24543 /**
24544  * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
24545  */
24546 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
24547
24548 /**
24549  * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
24550  * but with all dynamically-allocated buffers duplicated in new buffers.
24551  */
24552 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
24553
24554 /**
24555  * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
24556  */
24557 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
24558
24559 /**
24560  * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
24561  */
24562 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
24563
24564 /**
24565  * Checks if the given object is currently in the success state
24566  */
24567 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
24568
24569 /**
24570  * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
24571  */
24572 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
24573
24574 /**
24575  * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
24576  * but with all dynamically-allocated buffers duplicated in new buffers.
24577  */
24578 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
24579
24580 /**
24581  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
24582  */
24583 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
24584
24585 /**
24586  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
24587  */
24588 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
24589
24590 /**
24591  * Checks if the given object is currently in the success state
24592  */
24593 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
24594
24595 /**
24596  * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
24597  */
24598 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
24599
24600 /**
24601  * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
24602  * but with all dynamically-allocated buffers duplicated in new buffers.
24603  */
24604 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
24605
24606 /**
24607  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
24608  */
24609 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
24610
24611 /**
24612  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
24613  */
24614 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
24615
24616 /**
24617  * Checks if the given object is currently in the success state
24618  */
24619 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
24620
24621 /**
24622  * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
24623  */
24624 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
24625
24626 /**
24627  * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
24628  * but with all dynamically-allocated buffers duplicated in new buffers.
24629  */
24630 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
24631
24632 /**
24633  * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
24634  */
24635 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
24636
24637 /**
24638  * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
24639  */
24640 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
24641
24642 /**
24643  * Checks if the given object is currently in the success state
24644  */
24645 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
24646
24647 /**
24648  * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
24649  */
24650 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
24651
24652 /**
24653  * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
24654  * but with all dynamically-allocated buffers duplicated in new buffers.
24655  */
24656 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
24657
24658 /**
24659  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
24660  */
24661 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
24662
24663 /**
24664  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
24665  */
24666 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
24667
24668 /**
24669  * Checks if the given object is currently in the success state
24670  */
24671 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
24672
24673 /**
24674  * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
24675  */
24676 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
24677
24678 /**
24679  * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
24680  * but with all dynamically-allocated buffers duplicated in new buffers.
24681  */
24682 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
24683
24684 /**
24685  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
24686  */
24687 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
24688
24689 /**
24690  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
24691  */
24692 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
24693
24694 /**
24695  * Checks if the given object is currently in the success state
24696  */
24697 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
24698
24699 /**
24700  * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
24701  */
24702 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
24703
24704 /**
24705  * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
24706  * but with all dynamically-allocated buffers duplicated in new buffers.
24707  */
24708 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
24709
24710 /**
24711  * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
24712  */
24713 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
24714
24715 /**
24716  * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
24717  */
24718 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
24719
24720 /**
24721  * Checks if the given object is currently in the success state
24722  */
24723 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
24724
24725 /**
24726  * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
24727  */
24728 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
24729
24730 /**
24731  * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
24732  * but with all dynamically-allocated buffers duplicated in new buffers.
24733  */
24734 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
24735
24736 /**
24737  * Creates a new CResult_PingDecodeErrorZ in the success state.
24738  */
24739 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
24740
24741 /**
24742  * Creates a new CResult_PingDecodeErrorZ in the error state.
24743  */
24744 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
24745
24746 /**
24747  * Checks if the given object is currently in the success state
24748  */
24749 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
24750
24751 /**
24752  * Frees any resources used by the CResult_PingDecodeErrorZ.
24753  */
24754 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
24755
24756 /**
24757  * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
24758  * but with all dynamically-allocated buffers duplicated in new buffers.
24759  */
24760 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
24761
24762 /**
24763  * Creates a new CResult_PongDecodeErrorZ in the success state.
24764  */
24765 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
24766
24767 /**
24768  * Creates a new CResult_PongDecodeErrorZ in the error state.
24769  */
24770 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
24771
24772 /**
24773  * Checks if the given object is currently in the success state
24774  */
24775 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
24776
24777 /**
24778  * Frees any resources used by the CResult_PongDecodeErrorZ.
24779  */
24780 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
24781
24782 /**
24783  * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
24784  * but with all dynamically-allocated buffers duplicated in new buffers.
24785  */
24786 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
24787
24788 /**
24789  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
24790  */
24791 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
24792
24793 /**
24794  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
24795  */
24796 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
24797
24798 /**
24799  * Checks if the given object is currently in the success state
24800  */
24801 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
24802
24803 /**
24804  * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
24805  */
24806 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
24807
24808 /**
24809  * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
24810  * but with all dynamically-allocated buffers duplicated in new buffers.
24811  */
24812 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
24813
24814 /**
24815  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
24816  */
24817 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
24818
24819 /**
24820  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
24821  */
24822 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
24823
24824 /**
24825  * Checks if the given object is currently in the success state
24826  */
24827 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
24828
24829 /**
24830  * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
24831  */
24832 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
24833
24834 /**
24835  * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
24836  * but with all dynamically-allocated buffers duplicated in new buffers.
24837  */
24838 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
24839
24840 /**
24841  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
24842  */
24843 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
24844
24845 /**
24846  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
24847  */
24848 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
24849
24850 /**
24851  * Checks if the given object is currently in the success state
24852  */
24853 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
24854
24855 /**
24856  * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
24857  */
24858 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
24859
24860 /**
24861  * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
24862  * but with all dynamically-allocated buffers duplicated in new buffers.
24863  */
24864 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
24865
24866 /**
24867  * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
24868  */
24869 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
24870
24871 /**
24872  * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
24873  */
24874 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
24875
24876 /**
24877  * Checks if the given object is currently in the success state
24878  */
24879 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
24880
24881 /**
24882  * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
24883  */
24884 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
24885
24886 /**
24887  * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
24888  * but with all dynamically-allocated buffers duplicated in new buffers.
24889  */
24890 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
24891
24892 /**
24893  * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
24894  */
24895 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
24896
24897 /**
24898  * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
24899  */
24900 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
24901
24902 /**
24903  * Checks if the given object is currently in the success state
24904  */
24905 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
24906
24907 /**
24908  * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
24909  */
24910 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
24911
24912 /**
24913  * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
24914  * but with all dynamically-allocated buffers duplicated in new buffers.
24915  */
24916 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
24917
24918 /**
24919  * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
24920  */
24921 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
24922
24923 /**
24924  * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
24925  */
24926 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
24927
24928 /**
24929  * Checks if the given object is currently in the success state
24930  */
24931 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
24932
24933 /**
24934  * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
24935  */
24936 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
24937
24938 /**
24939  * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
24940  * but with all dynamically-allocated buffers duplicated in new buffers.
24941  */
24942 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
24943
24944 /**
24945  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
24946  */
24947 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
24948
24949 /**
24950  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
24951  */
24952 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
24953
24954 /**
24955  * Checks if the given object is currently in the success state
24956  */
24957 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
24958
24959 /**
24960  * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
24961  */
24962 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
24963
24964 /**
24965  * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
24966  * but with all dynamically-allocated buffers duplicated in new buffers.
24967  */
24968 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
24969
24970 /**
24971  * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
24972  */
24973 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
24974
24975 /**
24976  * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
24977  */
24978 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
24979
24980 /**
24981  * Checks if the given object is currently in the success state
24982  */
24983 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
24984
24985 /**
24986  * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
24987  */
24988 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
24989
24990 /**
24991  * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
24992  * but with all dynamically-allocated buffers duplicated in new buffers.
24993  */
24994 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
24995
24996 /**
24997  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
24998  */
24999 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
25000
25001 /**
25002  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
25003  */
25004 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
25005
25006 /**
25007  * Checks if the given object is currently in the success state
25008  */
25009 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
25010
25011 /**
25012  * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
25013  */
25014 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
25015
25016 /**
25017  * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
25018  * but with all dynamically-allocated buffers duplicated in new buffers.
25019  */
25020 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
25021
25022 /**
25023  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
25024  */
25025 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
25026
25027 /**
25028  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
25029  */
25030 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
25031
25032 /**
25033  * Checks if the given object is currently in the success state
25034  */
25035 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
25036
25037 /**
25038  * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
25039  */
25040 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
25041
25042 /**
25043  * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
25044  * but with all dynamically-allocated buffers duplicated in new buffers.
25045  */
25046 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
25047
25048 /**
25049  * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
25050  */
25051 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
25052
25053 /**
25054  * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
25055  */
25056 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
25057
25058 /**
25059  * Checks if the given object is currently in the success state
25060  */
25061 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
25062
25063 /**
25064  * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
25065  */
25066 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
25067
25068 /**
25069  * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
25070  * but with all dynamically-allocated buffers duplicated in new buffers.
25071  */
25072 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
25073
25074 /**
25075  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
25076  */
25077 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
25078
25079 /**
25080  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
25081  */
25082 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
25083
25084 /**
25085  * Checks if the given object is currently in the success state
25086  */
25087 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
25088
25089 /**
25090  * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
25091  */
25092 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
25093
25094 /**
25095  * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
25096  * but with all dynamically-allocated buffers duplicated in new buffers.
25097  */
25098 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
25099
25100 /**
25101  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
25102  */
25103 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
25104
25105 /**
25106  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
25107  */
25108 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
25109
25110 /**
25111  * Checks if the given object is currently in the success state
25112  */
25113 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
25114
25115 /**
25116  * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
25117  */
25118 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
25119
25120 /**
25121  * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
25122  * but with all dynamically-allocated buffers duplicated in new buffers.
25123  */
25124 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
25125
25126 /**
25127  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25128  */
25129 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
25130
25131 /**
25132  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
25133  */
25134 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
25135
25136 /**
25137  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
25138  */
25139 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
25140
25141 /**
25142  * Checks if the given object is currently in the success state
25143  */
25144 bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
25145
25146 /**
25147  * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
25148  */
25149 void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
25150
25151 /**
25152  * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
25153  * but with all dynamically-allocated buffers duplicated in new buffers.
25154  */
25155 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
25156
25157 /**
25158  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25159  */
25160 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
25161
25162 /**
25163  * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
25164  */
25165 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
25166
25167 /**
25168  * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
25169  */
25170 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
25171
25172 /**
25173  * Checks if the given object is currently in the success state
25174  */
25175 bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
25176
25177 /**
25178  * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
25179  */
25180 void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
25181
25182 /**
25183  * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
25184  * but with all dynamically-allocated buffers duplicated in new buffers.
25185  */
25186 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
25187
25188 /**
25189  * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
25190  */
25191 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
25192
25193 /**
25194  * Constructs a new COption_HTLCClaimZ containing nothing
25195  */
25196 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
25197
25198 /**
25199  * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
25200  */
25201 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
25202
25203 /**
25204  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
25205  */
25206 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
25207
25208 /**
25209  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
25210  */
25211 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
25212
25213 /**
25214  * Checks if the given object is currently in the success state
25215  */
25216 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
25217
25218 /**
25219  * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
25220  */
25221 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
25222
25223 /**
25224  * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
25225  * but with all dynamically-allocated buffers duplicated in new buffers.
25226  */
25227 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
25228
25229 /**
25230  * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
25231  */
25232 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
25233
25234 /**
25235  * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
25236  */
25237 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
25238
25239 /**
25240  * Checks if the given object is currently in the success state
25241  */
25242 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
25243
25244 /**
25245  * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
25246  */
25247 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
25248
25249 /**
25250  * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
25251  * but with all dynamically-allocated buffers duplicated in new buffers.
25252  */
25253 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
25254
25255 /**
25256  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
25257  */
25258 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
25259
25260 /**
25261  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
25262  */
25263 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
25264
25265 /**
25266  * Checks if the given object is currently in the success state
25267  */
25268 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
25269
25270 /**
25271  * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
25272  */
25273 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
25274
25275 /**
25276  * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
25277  * but with all dynamically-allocated buffers duplicated in new buffers.
25278  */
25279 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
25280
25281 /**
25282  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
25283  */
25284 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
25285
25286 /**
25287  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
25288  */
25289 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
25290
25291 /**
25292  * Checks if the given object is currently in the success state
25293  */
25294 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
25295
25296 /**
25297  * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
25298  */
25299 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
25300
25301 /**
25302  * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
25303  * but with all dynamically-allocated buffers duplicated in new buffers.
25304  */
25305 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
25306
25307 /**
25308  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
25309  */
25310 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
25311
25312 /**
25313  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
25314  */
25315 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
25316
25317 /**
25318  * Checks if the given object is currently in the success state
25319  */
25320 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
25321
25322 /**
25323  * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
25324  */
25325 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
25326
25327 /**
25328  * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
25329  * but with all dynamically-allocated buffers duplicated in new buffers.
25330  */
25331 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
25332
25333 /**
25334  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
25335  */
25336 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
25337
25338 /**
25339  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
25340  */
25341 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
25342
25343 /**
25344  * Checks if the given object is currently in the success state
25345  */
25346 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
25347
25348 /**
25349  * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
25350  */
25351 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
25352
25353 /**
25354  * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
25355  * but with all dynamically-allocated buffers duplicated in new buffers.
25356  */
25357 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
25358
25359 /**
25360  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
25361  */
25362 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
25363
25364 /**
25365  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
25366  */
25367 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
25368
25369 /**
25370  * Checks if the given object is currently in the success state
25371  */
25372 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
25373
25374 /**
25375  * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
25376  */
25377 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
25378
25379 /**
25380  * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
25381  * but with all dynamically-allocated buffers duplicated in new buffers.
25382  */
25383 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
25384
25385 /**
25386  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
25387  */
25388 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
25389
25390 /**
25391  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
25392  */
25393 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
25394
25395 /**
25396  * Checks if the given object is currently in the success state
25397  */
25398 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
25399
25400 /**
25401  * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
25402  */
25403 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
25404
25405 /**
25406  * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
25407  * but with all dynamically-allocated buffers duplicated in new buffers.
25408  */
25409 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
25410
25411 /**
25412  * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
25413  */
25414 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
25415
25416 /**
25417  * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
25418  */
25419 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
25420
25421 /**
25422  * Checks if the given object is currently in the success state
25423  */
25424 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
25425
25426 /**
25427  * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
25428  */
25429 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
25430
25431 /**
25432  * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
25433  */
25434 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
25435
25436 /**
25437  * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
25438  */
25439 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
25440
25441 /**
25442  * Checks if the given object is currently in the success state
25443  */
25444 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
25445
25446 /**
25447  * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
25448  */
25449 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
25450
25451 /**
25452  * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
25453  * but with all dynamically-allocated buffers duplicated in new buffers.
25454  */
25455 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
25456
25457 /**
25458  * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
25459  */
25460 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
25461
25462 /**
25463  * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
25464  */
25465 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
25466
25467 /**
25468  * Checks if the given object is currently in the success state
25469  */
25470 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
25471
25472 /**
25473  * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
25474  */
25475 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
25476
25477 /**
25478  * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
25479  */
25480 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
25481
25482 /**
25483  * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
25484  */
25485 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
25486
25487 /**
25488  * Checks if the given object is currently in the success state
25489  */
25490 bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
25491
25492 /**
25493  * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
25494  */
25495 void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
25496
25497 /**
25498  * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
25499  * but with all dynamically-allocated buffers duplicated in new buffers.
25500  */
25501 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
25502
25503 /**
25504  * Constructs a new COption_usizeZ containing a usize
25505  */
25506 struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
25507
25508 /**
25509  * Constructs a new COption_usizeZ containing nothing
25510  */
25511 struct LDKCOption_usizeZ COption_usizeZ_none(void);
25512
25513 /**
25514  * Frees any resources associated with the usize, if we are in the Some state
25515  */
25516 void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
25517
25518 /**
25519  * Creates a new COption_usizeZ which has the same data as `orig`
25520  * but with all dynamically-allocated buffers duplicated in new buffers.
25521  */
25522 struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
25523
25524 /**
25525  * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
25526  */
25527 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
25528
25529 /**
25530  * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
25531  */
25532 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
25533
25534 /**
25535  * Checks if the given object is currently in the success state
25536  */
25537 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
25538
25539 /**
25540  * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
25541  */
25542 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
25543
25544 /**
25545  * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
25546  * but with all dynamically-allocated buffers duplicated in new buffers.
25547  */
25548 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
25549
25550 /**
25551  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
25552  */
25553 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
25554
25555 /**
25556  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
25557  */
25558 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
25559
25560 /**
25561  * Checks if the given object is currently in the success state
25562  */
25563 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
25564
25565 /**
25566  * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
25567  */
25568 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
25569
25570 /**
25571  * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
25572  * but with all dynamically-allocated buffers duplicated in new buffers.
25573  */
25574 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
25575
25576 /**
25577  * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
25578  */
25579 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
25580
25581 /**
25582  * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
25583  */
25584 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
25585
25586 /**
25587  * Checks if the given object is currently in the success state
25588  */
25589 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
25590
25591 /**
25592  * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
25593  */
25594 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
25595
25596 /**
25597  * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
25598  * but with all dynamically-allocated buffers duplicated in new buffers.
25599  */
25600 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
25601
25602 /**
25603  * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state.
25604  */
25605 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_ok(struct LDKClaimedHTLC o);
25606
25607 /**
25608  * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the error state.
25609  */
25610 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
25611
25612 /**
25613  * Checks if the given object is currently in the success state
25614  */
25615 bool CResult_ClaimedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR o);
25616
25617 /**
25618  * Frees any resources used by the CResult_ClaimedHTLCDecodeErrorZ.
25619  */
25620 void CResult_ClaimedHTLCDecodeErrorZ_free(struct LDKCResult_ClaimedHTLCDecodeErrorZ _res);
25621
25622 /**
25623  * Creates a new CResult_ClaimedHTLCDecodeErrorZ which has the same data as `orig`
25624  * but with all dynamically-allocated buffers duplicated in new buffers.
25625  */
25626 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_clone(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR orig);
25627
25628 /**
25629  * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
25630  */
25631 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
25632
25633 /**
25634  * Constructs a new COption_PathFailureZ containing nothing
25635  */
25636 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
25637
25638 /**
25639  * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
25640  */
25641 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
25642
25643 /**
25644  * Creates a new COption_PathFailureZ which has the same data as `orig`
25645  * but with all dynamically-allocated buffers duplicated in new buffers.
25646  */
25647 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
25648
25649 /**
25650  * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
25651  */
25652 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
25653
25654 /**
25655  * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
25656  */
25657 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
25658
25659 /**
25660  * Checks if the given object is currently in the success state
25661  */
25662 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
25663
25664 /**
25665  * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
25666  */
25667 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
25668
25669 /**
25670  * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
25671  * but with all dynamically-allocated buffers duplicated in new buffers.
25672  */
25673 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
25674
25675 /**
25676  * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
25677  */
25678 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
25679
25680 /**
25681  * Constructs a new COption_ClosureReasonZ containing nothing
25682  */
25683 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
25684
25685 /**
25686  * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
25687  */
25688 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
25689
25690 /**
25691  * Creates a new COption_ClosureReasonZ which has the same data as `orig`
25692  * but with all dynamically-allocated buffers duplicated in new buffers.
25693  */
25694 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
25695
25696 /**
25697  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
25698  */
25699 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
25700
25701 /**
25702  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
25703  */
25704 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
25705
25706 /**
25707  * Checks if the given object is currently in the success state
25708  */
25709 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
25710
25711 /**
25712  * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
25713  */
25714 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
25715
25716 /**
25717  * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
25718  * but with all dynamically-allocated buffers duplicated in new buffers.
25719  */
25720 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
25721
25722 /**
25723  * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
25724  */
25725 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
25726
25727 /**
25728  * Constructs a new COption_HTLCDestinationZ containing nothing
25729  */
25730 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
25731
25732 /**
25733  * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
25734  */
25735 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
25736
25737 /**
25738  * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
25739  * but with all dynamically-allocated buffers duplicated in new buffers.
25740  */
25741 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
25742
25743 /**
25744  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
25745  */
25746 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
25747
25748 /**
25749  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
25750  */
25751 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
25752
25753 /**
25754  * Checks if the given object is currently in the success state
25755  */
25756 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
25757
25758 /**
25759  * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
25760  */
25761 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
25762
25763 /**
25764  * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
25765  * but with all dynamically-allocated buffers duplicated in new buffers.
25766  */
25767 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
25768
25769 /**
25770  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
25771  */
25772 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
25773
25774 /**
25775  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
25776  */
25777 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
25778
25779 /**
25780  * Checks if the given object is currently in the success state
25781  */
25782 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
25783
25784 /**
25785  * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
25786  */
25787 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
25788
25789 /**
25790  * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
25791  * but with all dynamically-allocated buffers duplicated in new buffers.
25792  */
25793 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
25794
25795 /**
25796  * Constructs a new COption_U128Z containing a crate::c_types::U128
25797  */
25798 struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
25799
25800 /**
25801  * Constructs a new COption_U128Z containing nothing
25802  */
25803 struct LDKCOption_U128Z COption_U128Z_none(void);
25804
25805 /**
25806  * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
25807  */
25808 void COption_U128Z_free(struct LDKCOption_U128Z _res);
25809
25810 /**
25811  * Creates a new COption_U128Z which has the same data as `orig`
25812  * but with all dynamically-allocated buffers duplicated in new buffers.
25813  */
25814 struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
25815
25816 /**
25817  * Frees the buffer pointed to by `data` if `datalen` is non-0.
25818  */
25819 void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
25820
25821 /**
25822  * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
25823  */
25824 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
25825
25826 /**
25827  * Constructs a new COption_PaymentFailureReasonZ containing nothing
25828  */
25829 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
25830
25831 /**
25832  * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
25833  */
25834 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
25835
25836 /**
25837  * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
25838  * but with all dynamically-allocated buffers duplicated in new buffers.
25839  */
25840 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
25841
25842 /**
25843  * Constructs a new COption_EventZ containing a crate::lightning::events::Event
25844  */
25845 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
25846
25847 /**
25848  * Constructs a new COption_EventZ containing nothing
25849  */
25850 struct LDKCOption_EventZ COption_EventZ_none(void);
25851
25852 /**
25853  * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
25854  */
25855 void COption_EventZ_free(struct LDKCOption_EventZ _res);
25856
25857 /**
25858  * Creates a new COption_EventZ which has the same data as `orig`
25859  * but with all dynamically-allocated buffers duplicated in new buffers.
25860  */
25861 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
25862
25863 /**
25864  * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
25865  */
25866 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
25867
25868 /**
25869  * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
25870  */
25871 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
25872
25873 /**
25874  * Checks if the given object is currently in the success state
25875  */
25876 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
25877
25878 /**
25879  * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
25880  */
25881 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
25882
25883 /**
25884  * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
25885  * but with all dynamically-allocated buffers duplicated in new buffers.
25886  */
25887 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
25888
25889 /**
25890  * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
25891  */
25892 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
25893
25894 /**
25895  * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
25896  */
25897 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
25898
25899 /**
25900  * Checks if the given object is currently in the success state
25901  */
25902 bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
25903
25904 /**
25905  * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
25906  */
25907 void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
25908
25909 /**
25910  * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
25911  * but with all dynamically-allocated buffers duplicated in new buffers.
25912  */
25913 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
25914
25915 /**
25916  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
25917  */
25918 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
25919
25920 /**
25921  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
25922  */
25923 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
25924
25925 /**
25926  * Checks if the given object is currently in the success state
25927  */
25928 bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
25929
25930 /**
25931  * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
25932  */
25933 void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
25934
25935 /**
25936  * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
25937  * but with all dynamically-allocated buffers duplicated in new buffers.
25938  */
25939 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
25940
25941 /**
25942  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
25943  */
25944 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
25945
25946 /**
25947  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
25948  */
25949 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
25950
25951 /**
25952  * Checks if the given object is currently in the success state
25953  */
25954 bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
25955
25956 /**
25957  * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
25958  */
25959 void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
25960
25961 /**
25962  * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
25963  * but with all dynamically-allocated buffers duplicated in new buffers.
25964  */
25965 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
25966
25967 /**
25968  * Creates a new tuple which has the same data as `orig`
25969  * but with all dynamically-allocated buffers duplicated in new buffers.
25970  */
25971 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
25972
25973 /**
25974  * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
25975  */
25976 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
25977
25978 /**
25979  * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
25980  */
25981 void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
25982
25983 /**
25984  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
25985  */
25986 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_ok(struct LDKPayeePubKey o);
25987
25988 /**
25989  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
25990  */
25991 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
25992
25993 /**
25994  * Checks if the given object is currently in the success state
25995  */
25996 bool CResult_PayeePubKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR o);
25997
25998 /**
25999  * Frees any resources used by the CResult_PayeePubKeySecp256k1ErrorZ.
26000  */
26001 void CResult_PayeePubKeySecp256k1ErrorZ_free(struct LDKCResult_PayeePubKeySecp256k1ErrorZ _res);
26002
26003 /**
26004  * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
26005  * but with all dynamically-allocated buffers duplicated in new buffers.
26006  */
26007 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_clone(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR orig);
26008
26009 /**
26010  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26011  */
26012 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
26013
26014 /**
26015  * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
26016  */
26017 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
26018
26019 /**
26020  * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
26021  */
26022 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
26023
26024 /**
26025  * Checks if the given object is currently in the success state
26026  */
26027 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
26028
26029 /**
26030  * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
26031  */
26032 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
26033
26034 /**
26035  * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
26036  * but with all dynamically-allocated buffers duplicated in new buffers.
26037  */
26038 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
26039
26040 /**
26041  * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
26042  */
26043 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
26044
26045 /**
26046  * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
26047  */
26048 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
26049
26050 /**
26051  * Checks if the given object is currently in the success state
26052  */
26053 bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
26054
26055 /**
26056  * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
26057  */
26058 void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
26059
26060 /**
26061  * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
26062  * but with all dynamically-allocated buffers duplicated in new buffers.
26063  */
26064 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
26065
26066 /**
26067  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
26068  */
26069 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
26070
26071 /**
26072  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
26073  */
26074 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
26075
26076 /**
26077  * Checks if the given object is currently in the success state
26078  */
26079 bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
26080
26081 /**
26082  * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
26083  */
26084 void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
26085
26086 /**
26087  * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
26088  * but with all dynamically-allocated buffers duplicated in new buffers.
26089  */
26090 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
26091
26092 /**
26093  * Creates a new CResult_DescriptionCreationErrorZ in the success state.
26094  */
26095 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
26096
26097 /**
26098  * Creates a new CResult_DescriptionCreationErrorZ in the error state.
26099  */
26100 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
26101
26102 /**
26103  * Checks if the given object is currently in the success state
26104  */
26105 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
26106
26107 /**
26108  * Frees any resources used by the CResult_DescriptionCreationErrorZ.
26109  */
26110 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
26111
26112 /**
26113  * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
26114  * but with all dynamically-allocated buffers duplicated in new buffers.
26115  */
26116 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
26117
26118 /**
26119  * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
26120  */
26121 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
26122
26123 /**
26124  * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
26125  */
26126 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
26127
26128 /**
26129  * Checks if the given object is currently in the success state
26130  */
26131 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
26132
26133 /**
26134  * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
26135  */
26136 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
26137
26138 /**
26139  * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
26140  * but with all dynamically-allocated buffers duplicated in new buffers.
26141  */
26142 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
26143
26144 /**
26145  * Creates a new CResult_OutPointDecodeErrorZ in the success state.
26146  */
26147 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
26148
26149 /**
26150  * Creates a new CResult_OutPointDecodeErrorZ in the error state.
26151  */
26152 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
26153
26154 /**
26155  * Checks if the given object is currently in the success state
26156  */
26157 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
26158
26159 /**
26160  * Frees any resources used by the CResult_OutPointDecodeErrorZ.
26161  */
26162 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
26163
26164 /**
26165  * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
26166  * but with all dynamically-allocated buffers duplicated in new buffers.
26167  */
26168 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
26169
26170 /**
26171  * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
26172  */
26173 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
26174
26175 /**
26176  * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
26177  */
26178 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
26179
26180 /**
26181  * Checks if the given object is currently in the success state
26182  */
26183 bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
26184
26185 /**
26186  * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
26187  */
26188 void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
26189
26190 /**
26191  * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
26192  * but with all dynamically-allocated buffers duplicated in new buffers.
26193  */
26194 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
26195
26196 /**
26197  * Creates a new CResult_HostnameDecodeErrorZ in the success state.
26198  */
26199 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
26200
26201 /**
26202  * Creates a new CResult_HostnameDecodeErrorZ in the error state.
26203  */
26204 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
26205
26206 /**
26207  * Checks if the given object is currently in the success state
26208  */
26209 bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
26210
26211 /**
26212  * Frees any resources used by the CResult_HostnameDecodeErrorZ.
26213  */
26214 void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
26215
26216 /**
26217  * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
26218  * but with all dynamically-allocated buffers duplicated in new buffers.
26219  */
26220 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
26221
26222 /**
26223  * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
26224  */
26225 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
26226
26227 /**
26228  * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
26229  */
26230 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
26231
26232 /**
26233  * Checks if the given object is currently in the success state
26234  */
26235 bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
26236
26237 /**
26238  * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
26239  */
26240 void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
26241
26242 /**
26243  * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
26244  * but with all dynamically-allocated buffers duplicated in new buffers.
26245  */
26246 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
26247
26248 /**
26249  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
26250  */
26251 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
26252
26253 /**
26254  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
26255  */
26256 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
26257
26258 /**
26259  * Checks if the given object is currently in the success state
26260  */
26261 bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
26262
26263 /**
26264  * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
26265  */
26266 void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
26267
26268 /**
26269  * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
26270  * but with all dynamically-allocated buffers duplicated in new buffers.
26271  */
26272 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
26273
26274 /**
26275  * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
26276  */
26277 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
26278
26279 /**
26280  * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
26281  */
26282 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
26283
26284 /**
26285  * Checks if the given object is currently in the success state
26286  */
26287 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
26288
26289 /**
26290  * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
26291  */
26292 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
26293
26294 /**
26295  * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
26296  * but with all dynamically-allocated buffers duplicated in new buffers.
26297  */
26298 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
26299
26300 /**
26301  * Creates a new CResult_ReceiveTlvsDecodeErrorZ in the success state.
26302  */
26303 struct LDKCResult_ReceiveTlvsDecodeErrorZ CResult_ReceiveTlvsDecodeErrorZ_ok(struct LDKReceiveTlvs o);
26304
26305 /**
26306  * Creates a new CResult_ReceiveTlvsDecodeErrorZ in the error state.
26307  */
26308 struct LDKCResult_ReceiveTlvsDecodeErrorZ CResult_ReceiveTlvsDecodeErrorZ_err(struct LDKDecodeError e);
26309
26310 /**
26311  * Checks if the given object is currently in the success state
26312  */
26313 bool CResult_ReceiveTlvsDecodeErrorZ_is_ok(const struct LDKCResult_ReceiveTlvsDecodeErrorZ *NONNULL_PTR o);
26314
26315 /**
26316  * Frees any resources used by the CResult_ReceiveTlvsDecodeErrorZ.
26317  */
26318 void CResult_ReceiveTlvsDecodeErrorZ_free(struct LDKCResult_ReceiveTlvsDecodeErrorZ _res);
26319
26320 /**
26321  * Creates a new CResult_ReceiveTlvsDecodeErrorZ which has the same data as `orig`
26322  * but with all dynamically-allocated buffers duplicated in new buffers.
26323  */
26324 struct LDKCResult_ReceiveTlvsDecodeErrorZ CResult_ReceiveTlvsDecodeErrorZ_clone(const struct LDKCResult_ReceiveTlvsDecodeErrorZ *NONNULL_PTR orig);
26325
26326 /**
26327  * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
26328  */
26329 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o);
26330
26331 /**
26332  * Creates a new CResult_PaymentRelayDecodeErrorZ in the error state.
26333  */
26334 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e);
26335
26336 /**
26337  * Checks if the given object is currently in the success state
26338  */
26339 bool CResult_PaymentRelayDecodeErrorZ_is_ok(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR o);
26340
26341 /**
26342  * Frees any resources used by the CResult_PaymentRelayDecodeErrorZ.
26343  */
26344 void CResult_PaymentRelayDecodeErrorZ_free(struct LDKCResult_PaymentRelayDecodeErrorZ _res);
26345
26346 /**
26347  * Creates a new CResult_PaymentRelayDecodeErrorZ which has the same data as `orig`
26348  * but with all dynamically-allocated buffers duplicated in new buffers.
26349  */
26350 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_clone(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR orig);
26351
26352 /**
26353  * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state.
26354  */
26355 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_ok(struct LDKPaymentConstraints o);
26356
26357 /**
26358  * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the error state.
26359  */
26360 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_err(struct LDKDecodeError e);
26361
26362 /**
26363  * Checks if the given object is currently in the success state
26364  */
26365 bool CResult_PaymentConstraintsDecodeErrorZ_is_ok(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR o);
26366
26367 /**
26368  * Frees any resources used by the CResult_PaymentConstraintsDecodeErrorZ.
26369  */
26370 void CResult_PaymentConstraintsDecodeErrorZ_free(struct LDKCResult_PaymentConstraintsDecodeErrorZ _res);
26371
26372 /**
26373  * Creates a new CResult_PaymentConstraintsDecodeErrorZ which has the same data as `orig`
26374  * but with all dynamically-allocated buffers duplicated in new buffers.
26375  */
26376 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig);
26377
26378 /**
26379  * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ in the success state.
26380  */
26381 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ CResult_ThirtyTwoBytesPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
26382
26383 /**
26384  * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ in the error state.
26385  */
26386 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ CResult_ThirtyTwoBytesPaymentErrorZ_err(struct LDKPaymentError e);
26387
26388 /**
26389  * Checks if the given object is currently in the success state
26390  */
26391 bool CResult_ThirtyTwoBytesPaymentErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentErrorZ *NONNULL_PTR o);
26392
26393 /**
26394  * Frees any resources used by the CResult_ThirtyTwoBytesPaymentErrorZ.
26395  */
26396 void CResult_ThirtyTwoBytesPaymentErrorZ_free(struct LDKCResult_ThirtyTwoBytesPaymentErrorZ _res);
26397
26398 /**
26399  * Creates a new CResult_ThirtyTwoBytesPaymentErrorZ which has the same data as `orig`
26400  * but with all dynamically-allocated buffers duplicated in new buffers.
26401  */
26402 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ CResult_ThirtyTwoBytesPaymentErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentErrorZ *NONNULL_PTR orig);
26403
26404 /**
26405  * Creates a new CResult_NonePaymentErrorZ in the success state.
26406  */
26407 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_ok(void);
26408
26409 /**
26410  * Creates a new CResult_NonePaymentErrorZ in the error state.
26411  */
26412 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_err(struct LDKPaymentError e);
26413
26414 /**
26415  * Checks if the given object is currently in the success state
26416  */
26417 bool CResult_NonePaymentErrorZ_is_ok(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR o);
26418
26419 /**
26420  * Frees any resources used by the CResult_NonePaymentErrorZ.
26421  */
26422 void CResult_NonePaymentErrorZ_free(struct LDKCResult_NonePaymentErrorZ _res);
26423
26424 /**
26425  * Creates a new CResult_NonePaymentErrorZ which has the same data as `orig`
26426  * but with all dynamically-allocated buffers duplicated in new buffers.
26427  */
26428 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_clone(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR orig);
26429
26430 /**
26431  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ in the success state.
26432  */
26433 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
26434
26435 /**
26436  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ in the error state.
26437  */
26438 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_err(struct LDKProbingError e);
26439
26440 /**
26441  * Checks if the given object is currently in the success state
26442  */
26443 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ *NONNULL_PTR o);
26444
26445 /**
26446  * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ.
26447  */
26448 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ _res);
26449
26450 /**
26451  * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ which has the same data as `orig`
26452  * but with all dynamically-allocated buffers duplicated in new buffers.
26453  */
26454 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ *NONNULL_PTR orig);
26455
26456 /**
26457  * Creates a new CResult_StrSecp256k1ErrorZ in the success state.
26458  */
26459 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o);
26460
26461 /**
26462  * Creates a new CResult_StrSecp256k1ErrorZ in the error state.
26463  */
26464 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
26465
26466 /**
26467  * Checks if the given object is currently in the success state
26468  */
26469 bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o);
26470
26471 /**
26472  * Frees any resources used by the CResult_StrSecp256k1ErrorZ.
26473  */
26474 void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res);
26475
26476 /**
26477  * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig`
26478  * but with all dynamically-allocated buffers duplicated in new buffers.
26479  */
26480 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig);
26481
26482 /**
26483  * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
26484  */
26485 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
26486
26487 /**
26488  * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
26489  */
26490 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
26491
26492 /**
26493  * Checks if the given object is currently in the success state
26494  */
26495 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
26496
26497 /**
26498  * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
26499  */
26500 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
26501
26502 /**
26503  * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
26504  * but with all dynamically-allocated buffers duplicated in new buffers.
26505  */
26506 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
26507
26508 /**
26509  * Creates a new CResult_OnionMessagePathNoneZ in the success state.
26510  */
26511 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
26512
26513 /**
26514  * Creates a new CResult_OnionMessagePathNoneZ in the error state.
26515  */
26516 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
26517
26518 /**
26519  * Checks if the given object is currently in the success state
26520  */
26521 bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
26522
26523 /**
26524  * Frees any resources used by the CResult_OnionMessagePathNoneZ.
26525  */
26526 void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
26527
26528 /**
26529  * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
26530  * but with all dynamically-allocated buffers duplicated in new buffers.
26531  */
26532 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
26533
26534 /**
26535  * Creates a new tuple which has the same data as `orig`
26536  * but with all dynamically-allocated buffers duplicated in new buffers.
26537  */
26538 struct LDKC2Tuple_PublicKeyOnionMessageZ C2Tuple_PublicKeyOnionMessageZ_clone(const struct LDKC2Tuple_PublicKeyOnionMessageZ *NONNULL_PTR orig);
26539
26540 /**
26541  * Creates a new C2Tuple_PublicKeyOnionMessageZ from the contained elements.
26542  */
26543 struct LDKC2Tuple_PublicKeyOnionMessageZ C2Tuple_PublicKeyOnionMessageZ_new(struct LDKPublicKey a, struct LDKOnionMessage b);
26544
26545 /**
26546  * Frees any resources used by the C2Tuple_PublicKeyOnionMessageZ.
26547  */
26548 void C2Tuple_PublicKeyOnionMessageZ_free(struct LDKC2Tuple_PublicKeyOnionMessageZ _res);
26549
26550 /**
26551  * Creates a new CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ in the success state.
26552  */
26553 struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_ok(struct LDKC2Tuple_PublicKeyOnionMessageZ o);
26554
26555 /**
26556  * Creates a new CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ in the error state.
26557  */
26558 struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_err(struct LDKSendError e);
26559
26560 /**
26561  * Checks if the given object is currently in the success state
26562  */
26563 bool CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_is_ok(const struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ *NONNULL_PTR o);
26564
26565 /**
26566  * Frees any resources used by the CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ.
26567  */
26568 void CResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ_free(struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ _res);
26569
26570 /**
26571  * Creates a new CResult_NoneSendErrorZ in the success state.
26572  */
26573 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void);
26574
26575 /**
26576  * Creates a new CResult_NoneSendErrorZ in the error state.
26577  */
26578 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e);
26579
26580 /**
26581  * Checks if the given object is currently in the success state
26582  */
26583 bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o);
26584
26585 /**
26586  * Frees any resources used by the CResult_NoneSendErrorZ.
26587  */
26588 void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res);
26589
26590 /**
26591  * Creates a new CResult_BlindedPathNoneZ in the success state.
26592  */
26593 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
26594
26595 /**
26596  * Creates a new CResult_BlindedPathNoneZ in the error state.
26597  */
26598 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
26599
26600 /**
26601  * Checks if the given object is currently in the success state
26602  */
26603 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
26604
26605 /**
26606  * Frees any resources used by the CResult_BlindedPathNoneZ.
26607  */
26608 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
26609
26610 /**
26611  * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
26612  * but with all dynamically-allocated buffers duplicated in new buffers.
26613  */
26614 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
26615
26616 /**
26617  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
26618  */
26619 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o);
26620
26621 /**
26622  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
26623  */
26624 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void);
26625
26626 /**
26627  * Checks if the given object is currently in the success state
26628  */
26629 bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o);
26630
26631 /**
26632  * Frees any resources used by the CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.
26633  */
26634 void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res);
26635
26636 /**
26637  * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
26638  * but with all dynamically-allocated buffers duplicated in new buffers.
26639  */
26640 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig);
26641
26642 /**
26643  * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
26644  */
26645 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
26646
26647 /**
26648  * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
26649  */
26650 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
26651
26652 /**
26653  * Checks if the given object is currently in the success state
26654  */
26655 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
26656
26657 /**
26658  * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
26659  */
26660 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
26661
26662 /**
26663  * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
26664  * but with all dynamically-allocated buffers duplicated in new buffers.
26665  */
26666 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
26667
26668 /**
26669  * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
26670  */
26671 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
26672
26673 /**
26674  * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
26675  */
26676 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
26677
26678 /**
26679  * Checks if the given object is currently in the success state
26680  */
26681 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
26682
26683 /**
26684  * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
26685  */
26686 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
26687
26688 /**
26689  * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
26690  * but with all dynamically-allocated buffers duplicated in new buffers.
26691  */
26692 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
26693
26694 /**
26695  * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
26696  */
26697 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
26698
26699 /**
26700  * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
26701  */
26702 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
26703
26704 /**
26705  * Checks if the given object is currently in the success state
26706  */
26707 bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
26708
26709 /**
26710  * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
26711  */
26712 void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
26713
26714 /**
26715  * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
26716  * but with all dynamically-allocated buffers duplicated in new buffers.
26717  */
26718 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
26719
26720 /**
26721  * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
26722  */
26723 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
26724
26725 /**
26726  * Constructs a new COption_FilterZ containing nothing
26727  */
26728 struct LDKCOption_FilterZ COption_FilterZ_none(void);
26729
26730 /**
26731  * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
26732  */
26733 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
26734
26735 /**
26736  * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
26737  */
26738 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
26739
26740 /**
26741  * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
26742  */
26743 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
26744
26745 /**
26746  * Checks if the given object is currently in the success state
26747  */
26748 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
26749
26750 /**
26751  * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
26752  */
26753 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
26754
26755 /**
26756  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26757  */
26758 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
26759
26760 /**
26761  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26762  */
26763 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
26764
26765 /**
26766  * Creates a new tuple which has the same data as `orig`
26767  * but with all dynamically-allocated buffers duplicated in new buffers.
26768  */
26769 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
26770
26771 /**
26772  * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
26773  */
26774 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
26775
26776 /**
26777  * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
26778  */
26779 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
26780
26781 /**
26782  * Frees the buffer pointed to by `data` if `datalen` is non-0.
26783  */
26784 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
26785
26786 /**
26787  * Frees any resources used by the APIError
26788  */
26789 void APIError_free(struct LDKAPIError this_ptr);
26790
26791 /**
26792  * Creates a copy of the APIError
26793  */
26794 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
26795
26796 /**
26797  * Utility method to constructs a new APIMisuseError-variant APIError
26798  */
26799 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
26800
26801 /**
26802  * Utility method to constructs a new FeeRateTooHigh-variant APIError
26803  */
26804 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
26805
26806 /**
26807  * Utility method to constructs a new InvalidRoute-variant APIError
26808  */
26809 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
26810
26811 /**
26812  * Utility method to constructs a new ChannelUnavailable-variant APIError
26813  */
26814 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
26815
26816 /**
26817  * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
26818  */
26819 struct LDKAPIError APIError_monitor_update_in_progress(void);
26820
26821 /**
26822  * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
26823  */
26824 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
26825
26826 /**
26827  * Checks if two APIErrors contain equal inner contents.
26828  * This ignores pointers and is_owned flags and looks at the values in fields.
26829  */
26830 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
26831
26832 /**
26833  * Serialize the APIError object into a byte array which can be read by APIError_read
26834  */
26835 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
26836
26837 /**
26838  * Read a APIError from a byte array, created by APIError_write
26839  */
26840 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
26841
26842 /**
26843  * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
26844  */
26845 void BigSize_free(struct LDKBigSize this_obj);
26846
26847 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
26848
26849 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
26850
26851 /**
26852  * Constructs a new BigSize given each field
26853  */
26854 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
26855
26856 /**
26857  * Creates a copy of the BigSize
26858  */
26859 struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
26860
26861 /**
26862  * Generates a non-cryptographic 64-bit hash of the BigSize.
26863  */
26864 uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
26865
26866 /**
26867  * Checks if two BigSizes contain equal inner contents.
26868  * This ignores pointers and is_owned flags and looks at the values in fields.
26869  * Two objects with NULL inner values will be considered "equal" here.
26870  */
26871 bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
26872
26873 /**
26874  * Serialize the BigSize object into a byte array which can be read by BigSize_read
26875  */
26876 struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
26877
26878 /**
26879  * Read a BigSize from a byte array, created by BigSize_write
26880  */
26881 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
26882
26883 /**
26884  * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
26885  */
26886 void Hostname_free(struct LDKHostname this_obj);
26887
26888 /**
26889  * Creates a copy of the Hostname
26890  */
26891 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
26892
26893 /**
26894  * Checks if two Hostnames contain equal inner contents.
26895  * This ignores pointers and is_owned flags and looks at the values in fields.
26896  * Two objects with NULL inner values will be considered "equal" here.
26897  */
26898 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
26899
26900 /**
26901  * Returns the length of the hostname.
26902  */
26903 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
26904
26905 /**
26906  * Serialize the Hostname object into a byte array which can be read by Hostname_read
26907  */
26908 struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
26909
26910 /**
26911  * Read a Hostname from a byte array, created by Hostname_write
26912  */
26913 struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
26914
26915 /**
26916  * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
26917  */
26918 void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
26919
26920 /**
26921  * Creates a copy of the TransactionU16LenLimited
26922  */
26923 struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
26924
26925 /**
26926  * Checks if two TransactionU16LenLimiteds contain equal inner contents.
26927  * This ignores pointers and is_owned flags and looks at the values in fields.
26928  * Two objects with NULL inner values will be considered "equal" here.
26929  */
26930 bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
26931
26932 /**
26933  * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
26934  * serialized length is <= u16::MAX.
26935  */
26936 MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
26937
26938 /**
26939  * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
26940  */
26941 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
26942
26943 /**
26944  * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
26945  */
26946 struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
26947
26948 /**
26949  * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
26950  */
26951 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
26952
26953 /**
26954  * Creates a digital signature of a message given a SecretKey, like the node's secret.
26955  * 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.
26956  * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
26957  */
26958 struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
26959
26960 /**
26961  * Recovers the PublicKey of the signer of the message given the message and the signature.
26962  */
26963 struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
26964
26965 /**
26966  * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
26967  * and the PublicKey.
26968  */
26969 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
26970
26971 /**
26972  * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
26973  */
26974 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
26975
26976 /**
26977  * Calls the free function if one is set
26978  */
26979 void KVStore_free(struct LDKKVStore this_ptr);
26980
26981 /**
26982  * Calls the free function if one is set
26983  */
26984 void Persister_free(struct LDKPersister this_ptr);
26985
26986 /**
26987  * Read previously persisted [`ChannelMonitor`]s from the store.
26988  */
26989 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
26990
26991 /**
26992  * Frees any resources used by the MonitorUpdatingPersister, if is_owned is set and inner is non-NULL.
26993  */
26994 void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
26995
26996 /**
26997  * Constructs a new [`MonitorUpdatingPersister`].
26998  *
26999  * The `maximum_pending_updates` parameter controls how many updates may be stored before a
27000  * [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
27001  * consolidation will frequently occur with fewer updates than what you set here; this number
27002  * is merely the maximum that may be stored. When setting this value, consider that for higher
27003  * values of `maximum_pending_updates`:
27004  *
27005  *   - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
27006  * [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
27007  * `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
27008  *   - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
27009  * \"waves\" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
27010  * less frequent \"waves.\"
27011  *   - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
27012  * [`MonitorUpdatingPersister::cleanup_stale_updates`].
27013  */
27014 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);
27015
27016 /**
27017  * Reads all stored channel monitors, along with any stored updates for them.
27018  *
27019  * It is extremely important that your [`KVStore::read`] implementation uses the
27020  * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
27021  * documentation for [`MonitorUpdatingPersister`].
27022  */
27023 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);
27024
27025 /**
27026  * Read a single channel monitor, along with any stored updates for it.
27027  *
27028  * It is extremely important that your [`KVStore::read`] implementation uses the
27029  * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
27030  * documentation for [`MonitorUpdatingPersister`].
27031  *
27032  * For `monitor_key`, channel storage keys be the channel's transaction ID and index, or
27033  * [`OutPoint`], with an underscore `_` between them. For example, given:
27034  *
27035  *   - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
27036  *   - Index: `1`
27037  *
27038  * The correct `monitor_key` would be:
27039  * `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
27040  *
27041  * Loading a large number of monitors will be faster if done in parallel. You can use this
27042  * function to accomplish this. Take care to limit the number of parallel readers.
27043  */
27044 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);
27045
27046 /**
27047  * Cleans up stale updates for all monitors.
27048  *
27049  * This function works by first listing all monitors, and then for each of them, listing all
27050  * updates. The updates that have an `update_id` less than or equal to than the stored monitor
27051  * are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
27052  * be passed to [`KVStore::remove`].
27053  */
27054 MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy);
27055
27056 /**
27057  * Constructs a new Persist which calls the relevant methods on this_arg.
27058  * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
27059  */
27060 struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
27061
27062 /**
27063  * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
27064  */
27065 void UntrustedString_free(struct LDKUntrustedString this_obj);
27066
27067 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
27068
27069 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
27070
27071 /**
27072  * Constructs a new UntrustedString given each field
27073  */
27074 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
27075
27076 /**
27077  * Creates a copy of the UntrustedString
27078  */
27079 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
27080
27081 /**
27082  * Checks if two UntrustedStrings contain equal inner contents.
27083  * This ignores pointers and is_owned flags and looks at the values in fields.
27084  * Two objects with NULL inner values will be considered "equal" here.
27085  */
27086 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
27087
27088 /**
27089  * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
27090  */
27091 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
27092
27093 /**
27094  * Read a UntrustedString from a byte array, created by UntrustedString_write
27095  */
27096 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
27097
27098 /**
27099  * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
27100  */
27101 void PrintableString_free(struct LDKPrintableString this_obj);
27102
27103 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
27104
27105 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
27106
27107 /**
27108  * Constructs a new PrintableString given each field
27109  */
27110 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
27111
27112 /**
27113  * Calls the free function if one is set
27114  */
27115 void FutureCallback_free(struct LDKFutureCallback this_ptr);
27116
27117 /**
27118  * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
27119  */
27120 void Future_free(struct LDKFuture this_obj);
27121
27122 /**
27123  * Creates a copy of the Future
27124  */
27125 struct LDKFuture Future_clone(const struct LDKFuture *NONNULL_PTR orig);
27126
27127 /**
27128  * Registers a callback to be called upon completion of this future. If the future has already
27129  * completed, the callback will be called immediately.
27130  */
27131 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
27132
27133 /**
27134  * Waits until this [`Future`] completes.
27135  */
27136 void Future_wait(struct LDKFuture this_arg);
27137
27138 /**
27139  * Waits until this [`Future`] completes or the given amount of time has elapsed.
27140  *
27141  * Returns true if the [`Future`] completed, false if the time elapsed.
27142  */
27143 MUST_USE_RES bool Future_wait_timeout(struct LDKFuture this_arg, uint64_t max_wait);
27144
27145 /**
27146  * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
27147  */
27148 void Sleeper_free(struct LDKSleeper this_obj);
27149
27150 /**
27151  * Constructs a new sleeper from one future, allowing blocking on it.
27152  */
27153 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(struct LDKFuture future);
27154
27155 /**
27156  * Constructs a new sleeper from two futures, allowing blocking on both at once.
27157  */
27158 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(struct LDKFuture fut_a, struct LDKFuture fut_b);
27159
27160 /**
27161  * Constructs a new sleeper on many futures, allowing blocking on all at once.
27162  */
27163 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
27164
27165 /**
27166  * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
27167  */
27168 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
27169
27170 /**
27171  * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
27172  * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
27173  * elapsed.
27174  */
27175 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
27176
27177 /**
27178  * Creates a copy of the Level
27179  */
27180 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
27181
27182 /**
27183  * Utility method to constructs a new Gossip-variant Level
27184  */
27185 enum LDKLevel Level_gossip(void);
27186
27187 /**
27188  * Utility method to constructs a new Trace-variant Level
27189  */
27190 enum LDKLevel Level_trace(void);
27191
27192 /**
27193  * Utility method to constructs a new Debug-variant Level
27194  */
27195 enum LDKLevel Level_debug(void);
27196
27197 /**
27198  * Utility method to constructs a new Info-variant Level
27199  */
27200 enum LDKLevel Level_info(void);
27201
27202 /**
27203  * Utility method to constructs a new Warn-variant Level
27204  */
27205 enum LDKLevel Level_warn(void);
27206
27207 /**
27208  * Utility method to constructs a new Error-variant Level
27209  */
27210 enum LDKLevel Level_error(void);
27211
27212 /**
27213  * Checks if two Levels contain equal inner contents.
27214  * This ignores pointers and is_owned flags and looks at the values in fields.
27215  */
27216 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
27217
27218 /**
27219  * Generates a non-cryptographic 64-bit hash of the Level.
27220  */
27221 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
27222
27223 /**
27224  * Returns the most verbose logging level.
27225  */
27226 MUST_USE_RES enum LDKLevel Level_max(void);
27227
27228 /**
27229  * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
27230  */
27231 void Record_free(struct LDKRecord this_obj);
27232
27233 /**
27234  * The verbosity level of the message.
27235  */
27236 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
27237
27238 /**
27239  * The verbosity level of the message.
27240  */
27241 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
27242
27243 /**
27244  * The message body.
27245  */
27246 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
27247
27248 /**
27249  * The message body.
27250  */
27251 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
27252
27253 /**
27254  * The module path of the message.
27255  */
27256 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
27257
27258 /**
27259  * The module path of the message.
27260  */
27261 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
27262
27263 /**
27264  * The source file containing the message.
27265  */
27266 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
27267
27268 /**
27269  * The source file containing the message.
27270  */
27271 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
27272
27273 /**
27274  * The line containing the message.
27275  */
27276 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
27277
27278 /**
27279  * The line containing the message.
27280  */
27281 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
27282
27283 /**
27284  * Creates a copy of the Record
27285  */
27286 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
27287
27288 /**
27289  * Calls the free function if one is set
27290  */
27291 void Logger_free(struct LDKLogger this_ptr);
27292
27293 /**
27294  * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
27295  */
27296 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
27297
27298 /**
27299  * Confirmations we will wait for before considering the channel locked in.
27300  * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
27301  * equivalent limit applied to outbound channels).
27302  *
27303  * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
27304  * transaction before operation. If you wish to accept channels with zero confirmations, see
27305  * [`UserConfig::manually_accept_inbound_channels`] and
27306  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
27307  *
27308  * Default value: 6.
27309  *
27310  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
27311  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
27312  */
27313 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27314
27315 /**
27316  * Confirmations we will wait for before considering the channel locked in.
27317  * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
27318  * equivalent limit applied to outbound channels).
27319  *
27320  * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
27321  * transaction before operation. If you wish to accept channels with zero confirmations, see
27322  * [`UserConfig::manually_accept_inbound_channels`] and
27323  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
27324  *
27325  * Default value: 6.
27326  *
27327  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
27328  * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
27329  */
27330 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
27331
27332 /**
27333  * Set to the number of blocks we require our counterparty to wait to claim their money (ie
27334  * the number of blocks we have to punish our counterparty if they broadcast a revoked
27335  * transaction).
27336  *
27337  * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
27338  * be online to check for revoked transactions on-chain at least once every our_to_self_delay
27339  * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
27340  * possibly with time in between to RBF the spending transaction).
27341  *
27342  * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
27343  * case of an honest unilateral channel close, which implicitly decrease the economic value of
27344  * our channel.
27345  *
27346  * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
27347  * can tweak config to ask for more security, not less.
27348  */
27349 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27350
27351 /**
27352  * Set to the number of blocks we require our counterparty to wait to claim their money (ie
27353  * the number of blocks we have to punish our counterparty if they broadcast a revoked
27354  * transaction).
27355  *
27356  * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
27357  * be online to check for revoked transactions on-chain at least once every our_to_self_delay
27358  * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
27359  * possibly with time in between to RBF the spending transaction).
27360  *
27361  * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
27362  * case of an honest unilateral channel close, which implicitly decrease the economic value of
27363  * our channel.
27364  *
27365  * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
27366  * can tweak config to ask for more security, not less.
27367  */
27368 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
27369
27370 /**
27371  * Set to the smallest value HTLC we will accept to process.
27372  *
27373  * This value is sent to our counterparty on channel-open and we close the channel any time
27374  * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
27375  *
27376  * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
27377  * by the protocol.
27378  */
27379 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27380
27381 /**
27382  * Set to the smallest value HTLC we will accept to process.
27383  *
27384  * This value is sent to our counterparty on channel-open and we close the channel any time
27385  * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
27386  *
27387  * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
27388  * by the protocol.
27389  */
27390 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
27391
27392 /**
27393  * Sets the percentage of the channel value we will cap the total value of outstanding inbound
27394  * HTLCs to.
27395  *
27396  * This can be set to a value between 1-100, where the value corresponds to the percent of the
27397  * channel value in whole percentages.
27398  *
27399  * Note that:
27400  * * If configured to another value than the default value 10, any new channels created with
27401  * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
27402  * `ChannelManager`.
27403  *
27404  * * This caps the total value for inbound HTLCs in-flight only, and there's currently
27405  * no way to configure the cap for the total value of outbound HTLCs in-flight.
27406  *
27407  * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
27408  * are different from the non-HTLC-encumbered funds. This makes this an important knob to
27409  * restrict exposure to loss due to being offline for too long.
27410  * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
27411  * for more information.
27412  *
27413  * Default value: 10.
27414  * Minimum value: 1, any values less than 1 will be treated as 1 instead.
27415  * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
27416  */
27417 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27418
27419 /**
27420  * Sets the percentage of the channel value we will cap the total value of outstanding inbound
27421  * HTLCs to.
27422  *
27423  * This can be set to a value between 1-100, where the value corresponds to the percent of the
27424  * channel value in whole percentages.
27425  *
27426  * Note that:
27427  * * If configured to another value than the default value 10, any new channels created with
27428  * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
27429  * `ChannelManager`.
27430  *
27431  * * This caps the total value for inbound HTLCs in-flight only, and there's currently
27432  * no way to configure the cap for the total value of outbound HTLCs in-flight.
27433  *
27434  * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
27435  * are different from the non-HTLC-encumbered funds. This makes this an important knob to
27436  * restrict exposure to loss due to being offline for too long.
27437  * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
27438  * for more information.
27439  *
27440  * Default value: 10.
27441  * Minimum value: 1, any values less than 1 will be treated as 1 instead.
27442  * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
27443  */
27444 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
27445
27446 /**
27447  * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
27448  * BOLTs) option for outbound private channels. This provides better privacy by not including
27449  * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
27450  * relay HTLCs to us using the channel's SCID alias.
27451  *
27452  * If this option is set, channels may be created that will not be readable by LDK versions
27453  * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
27454  * [`DecodeError::InvalidValue`].
27455  *
27456  * Note that setting this to true does *not* prevent us from opening channels with
27457  * counterparties that do not support the `scid_alias` option; we will simply fall back to a
27458  * private channel without that option.
27459  *
27460  * Ignored if the channel is negotiated to be announced, see
27461  * [`ChannelHandshakeConfig::announced_channel`] and
27462  * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
27463  *
27464  * Default value: false. This value is likely to change to true in the future.
27465  *
27466  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27467  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
27468  */
27469 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27470
27471 /**
27472  * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
27473  * BOLTs) option for outbound private channels. This provides better privacy by not including
27474  * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
27475  * relay HTLCs to us using the channel's SCID alias.
27476  *
27477  * If this option is set, channels may be created that will not be readable by LDK versions
27478  * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
27479  * [`DecodeError::InvalidValue`].
27480  *
27481  * Note that setting this to true does *not* prevent us from opening channels with
27482  * counterparties that do not support the `scid_alias` option; we will simply fall back to a
27483  * private channel without that option.
27484  *
27485  * Ignored if the channel is negotiated to be announced, see
27486  * [`ChannelHandshakeConfig::announced_channel`] and
27487  * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
27488  *
27489  * Default value: false. This value is likely to change to true in the future.
27490  *
27491  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27492  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
27493  */
27494 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27495
27496 /**
27497  * Set to announce the channel publicly and notify all nodes that they can route via this
27498  * channel.
27499  *
27500  * This should only be set to true for nodes which expect to be online reliably.
27501  *
27502  * As the node which funds a channel picks this value this will only apply for new outbound
27503  * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
27504  *
27505  * Default value: false.
27506  */
27507 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27508
27509 /**
27510  * Set to announce the channel publicly and notify all nodes that they can route via this
27511  * channel.
27512  *
27513  * This should only be set to true for nodes which expect to be online reliably.
27514  *
27515  * As the node which funds a channel picks this value this will only apply for new outbound
27516  * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
27517  *
27518  * Default value: false.
27519  */
27520 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27521
27522 /**
27523  * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
27524  * supports it, they will then enforce the mutual-close output to us matches what we provided
27525  * at intialization, preventing us from closing to an alternate pubkey.
27526  *
27527  * This is set to true by default to provide a slight increase in security, though ultimately
27528  * any attacker who is able to take control of a channel can just as easily send the funds via
27529  * lightning payments, so we never require that our counterparties support this option.
27530  *
27531  * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
27532  *
27533  * Default value: true.
27534  *
27535  * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
27536  */
27537 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27538
27539 /**
27540  * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
27541  * supports it, they will then enforce the mutual-close output to us matches what we provided
27542  * at intialization, preventing us from closing to an alternate pubkey.
27543  *
27544  * This is set to true by default to provide a slight increase in security, though ultimately
27545  * any attacker who is able to take control of a channel can just as easily send the funds via
27546  * lightning payments, so we never require that our counterparties support this option.
27547  *
27548  * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
27549  *
27550  * Default value: true.
27551  *
27552  * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
27553  */
27554 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27555
27556 /**
27557  * The Proportion of the channel value to configure as counterparty's channel reserve,
27558  * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
27559  *
27560  * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
27561  * on their side, at all times.
27562  * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
27563  * claiming at least this value on chain.
27564  *
27565  * Channel reserve values greater than 30% could be considered highly unreasonable, since that
27566  * amount can never be used for payments.
27567  * Also, if our selected channel reserve for counterparty and counterparty's selected
27568  * channel reserve for us sum up to equal or greater than channel value, channel negotiations
27569  * will fail.
27570  *
27571  * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
27572  * other than the default value.
27573  *
27574  * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
27575  * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
27576  *                as 1000 sats instead, which is a safe implementation-specific lower bound.
27577  * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
27578  *                instead, although channel negotiations will fail in that case.
27579  */
27580 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27581
27582 /**
27583  * The Proportion of the channel value to configure as counterparty's channel reserve,
27584  * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
27585  *
27586  * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
27587  * on their side, at all times.
27588  * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
27589  * claiming at least this value on chain.
27590  *
27591  * Channel reserve values greater than 30% could be considered highly unreasonable, since that
27592  * amount can never be used for payments.
27593  * Also, if our selected channel reserve for counterparty and counterparty's selected
27594  * channel reserve for us sum up to equal or greater than channel value, channel negotiations
27595  * will fail.
27596  *
27597  * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
27598  * other than the default value.
27599  *
27600  * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
27601  * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
27602  *                as 1000 sats instead, which is a safe implementation-specific lower bound.
27603  * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
27604  *                instead, although channel negotiations will fail in that case.
27605  */
27606 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
27607
27608 /**
27609  * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
27610  * channels. This feature requires having a reserve of onchain funds readily available to bump
27611  * transactions in the event of a channel force close to avoid the possibility of losing funds.
27612  *
27613  * Note that if you wish accept inbound channels with anchor outputs, you must enable
27614  * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
27615  * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
27616  * whether your reserve of onchain funds is enough to cover the fees for all existing and new
27617  * channels featuring anchor outputs in the event of a force close.
27618  *
27619  * If this option is set, channels may be created that will not be readable by LDK versions
27620  * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
27621  * [`DecodeError::InvalidValue`].
27622  *
27623  * Note that setting this to true does *not* prevent us from opening channels with
27624  * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
27625  * fall back to a `static_remote_key` channel.
27626  *
27627  * LDK will not support the legacy `option_anchors` commitment version due to a discovered
27628  * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
27629  * Considered Harmful`] mailing list post.
27630  *
27631  * Default value: false. This value is likely to change to true in the future.
27632  *
27633  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27634  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
27635  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
27636  * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
27637  */
27638 bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27639
27640 /**
27641  * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
27642  * channels. This feature requires having a reserve of onchain funds readily available to bump
27643  * transactions in the event of a channel force close to avoid the possibility of losing funds.
27644  *
27645  * Note that if you wish accept inbound channels with anchor outputs, you must enable
27646  * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
27647  * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
27648  * whether your reserve of onchain funds is enough to cover the fees for all existing and new
27649  * channels featuring anchor outputs in the event of a force close.
27650  *
27651  * If this option is set, channels may be created that will not be readable by LDK versions
27652  * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
27653  * [`DecodeError::InvalidValue`].
27654  *
27655  * Note that setting this to true does *not* prevent us from opening channels with
27656  * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
27657  * fall back to a `static_remote_key` channel.
27658  *
27659  * LDK will not support the legacy `option_anchors` commitment version due to a discovered
27660  * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
27661  * Considered Harmful`] mailing list post.
27662  *
27663  * Default value: false. This value is likely to change to true in the future.
27664  *
27665  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27666  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
27667  * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
27668  * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
27669  */
27670 void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
27671
27672 /**
27673  * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
27674  *
27675  * Increasing the value can help improve liquidity and stability in
27676  * routing at the cost of higher long term disk / DB usage.
27677  *
27678  * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
27679  * other than the default value.
27680  *
27681  * Default value: 50
27682  * Maximum value: 483, any values larger will be treated as 483.
27683  *                     This is the BOLT #2 spec limit on `max_accepted_htlcs`.
27684  */
27685 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
27686
27687 /**
27688  * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
27689  *
27690  * Increasing the value can help improve liquidity and stability in
27691  * routing at the cost of higher long term disk / DB usage.
27692  *
27693  * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
27694  * other than the default value.
27695  *
27696  * Default value: 50
27697  * Maximum value: 483, any values larger will be treated as 483.
27698  *                     This is the BOLT #2 spec limit on `max_accepted_htlcs`.
27699  */
27700 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
27701
27702 /**
27703  * Constructs a new ChannelHandshakeConfig given each field
27704  */
27705 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);
27706
27707 /**
27708  * Creates a copy of the ChannelHandshakeConfig
27709  */
27710 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
27711
27712 /**
27713  * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
27714  */
27715 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
27716
27717 /**
27718  * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
27719  */
27720 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
27721
27722 /**
27723  * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
27724  * only applies to inbound channels.
27725  *
27726  * Default value: 0.
27727  */
27728 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27729
27730 /**
27731  * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
27732  * only applies to inbound channels.
27733  *
27734  * Default value: 0.
27735  */
27736 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
27737
27738 /**
27739  * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
27740  * only applies to inbound channels.
27741  *
27742  * Default value: 2^24 - 1.
27743  */
27744 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27745
27746 /**
27747  * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
27748  * only applies to inbound channels.
27749  *
27750  * Default value: 2^24 - 1.
27751  */
27752 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
27753
27754 /**
27755  * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
27756  * you to limit the maximum minimum-size they can require.
27757  *
27758  * Default value: u64::max_value.
27759  */
27760 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27761
27762 /**
27763  * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
27764  * you to limit the maximum minimum-size they can require.
27765  *
27766  * Default value: u64::max_value.
27767  */
27768 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
27769
27770 /**
27771  * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
27772  * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
27773  *
27774  * Default value: 0.
27775  */
27776 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27777
27778 /**
27779  * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
27780  * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
27781  *
27782  * Default value: 0.
27783  */
27784 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
27785
27786 /**
27787  * The remote node will require we keep a certain amount in direct payment to ourselves at all
27788  * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
27789  * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
27790  *
27791  * Default value: u64::max_value.
27792  */
27793 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27794
27795 /**
27796  * The remote node will require we keep a certain amount in direct payment to ourselves at all
27797  * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
27798  * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
27799  *
27800  * Default value: u64::max_value.
27801  */
27802 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
27803
27804 /**
27805  * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
27806  * time. This allows you to set a minimum such value.
27807  *
27808  * Default value: 0.
27809  */
27810 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27811
27812 /**
27813  * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
27814  * time. This allows you to set a minimum such value.
27815  *
27816  * Default value: 0.
27817  */
27818 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
27819
27820 /**
27821  * Before a channel is usable the funding transaction will need to be confirmed by at least a
27822  * certain number of blocks, specified by the node which is not the funder (as the funder can
27823  * assume they aren't going to double-spend themselves).
27824  * This config allows you to set a limit on the maximum amount of time to wait.
27825  *
27826  * Default value: 144, or roughly one day and only applies to outbound channels.
27827  */
27828 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27829
27830 /**
27831  * Before a channel is usable the funding transaction will need to be confirmed by at least a
27832  * certain number of blocks, specified by the node which is not the funder (as the funder can
27833  * assume they aren't going to double-spend themselves).
27834  * This config allows you to set a limit on the maximum amount of time to wait.
27835  *
27836  * Default value: 144, or roughly one day and only applies to outbound channels.
27837  */
27838 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
27839
27840 /**
27841  * Whether we implicitly trust funding transactions generated by us for our own outbound
27842  * channels to not be double-spent.
27843  *
27844  * If this is set, we assume that our own funding transactions are *never* double-spent, and
27845  * thus we can trust them without any confirmations. This is generally a reasonable
27846  * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
27847  * control of the signing keys).
27848  *
27849  * You may wish to un-set this if you allow the user to (or do in an automated fashion)
27850  * double-spend the funding transaction to RBF with an alternative channel open.
27851  *
27852  * This only applies if our counterparty set their confirmations-required value to 0, and we
27853  * always trust our own funding transaction at 1 confirmation irrespective of this value.
27854  * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
27855  * `true` (0) and `false` (1).
27856  *
27857  * Default value: true
27858  */
27859 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27860
27861 /**
27862  * Whether we implicitly trust funding transactions generated by us for our own outbound
27863  * channels to not be double-spent.
27864  *
27865  * If this is set, we assume that our own funding transactions are *never* double-spent, and
27866  * thus we can trust them without any confirmations. This is generally a reasonable
27867  * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
27868  * control of the signing keys).
27869  *
27870  * You may wish to un-set this if you allow the user to (or do in an automated fashion)
27871  * double-spend the funding transaction to RBF with an alternative channel open.
27872  *
27873  * This only applies if our counterparty set their confirmations-required value to 0, and we
27874  * always trust our own funding transaction at 1 confirmation irrespective of this value.
27875  * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
27876  * `true` (0) and `false` (1).
27877  *
27878  * Default value: true
27879  */
27880 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
27881
27882 /**
27883  * Set to force an incoming channel to match our announced channel preference in
27884  * [`ChannelHandshakeConfig::announced_channel`].
27885  *
27886  * For a node which is not online reliably, this should be set to true and
27887  * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
27888  * channels will ever be opened.
27889  *
27890  * Default value: true.
27891  */
27892 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27893
27894 /**
27895  * Set to force an incoming channel to match our announced channel preference in
27896  * [`ChannelHandshakeConfig::announced_channel`].
27897  *
27898  * For a node which is not online reliably, this should be set to true and
27899  * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
27900  * channels will ever be opened.
27901  *
27902  * Default value: true.
27903  */
27904 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
27905
27906 /**
27907  * Set to the amount of time we're willing to wait to claim money back to us.
27908  *
27909  * Not checking this value would be a security issue, as our peer would be able to set it to
27910  * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
27911  *
27912  * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
27913  * reduce the loss of having useless locked funds (if your peer accepts)
27914  */
27915 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
27916
27917 /**
27918  * Set to the amount of time we're willing to wait to claim money back to us.
27919  *
27920  * Not checking this value would be a security issue, as our peer would be able to set it to
27921  * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
27922  *
27923  * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
27924  * reduce the loss of having useless locked funds (if your peer accepts)
27925  */
27926 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
27927
27928 /**
27929  * Constructs a new ChannelHandshakeLimits given each field
27930  */
27931 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);
27932
27933 /**
27934  * Creates a copy of the ChannelHandshakeLimits
27935  */
27936 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
27937
27938 /**
27939  * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
27940  */
27941 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
27942
27943 /**
27944  * Frees any resources used by the MaxDustHTLCExposure
27945  */
27946 void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
27947
27948 /**
27949  * Creates a copy of the MaxDustHTLCExposure
27950  */
27951 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
27952
27953 /**
27954  * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
27955  */
27956 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
27957
27958 /**
27959  * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
27960  */
27961 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
27962
27963 /**
27964  * Checks if two MaxDustHTLCExposures contain equal inner contents.
27965  * This ignores pointers and is_owned flags and looks at the values in fields.
27966  */
27967 bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
27968
27969 /**
27970  * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
27971  */
27972 struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
27973
27974 /**
27975  * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
27976  */
27977 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
27978
27979 /**
27980  * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
27981  */
27982 void ChannelConfig_free(struct LDKChannelConfig this_obj);
27983
27984 /**
27985  * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
27986  * over the channel.
27987  * This may be allowed to change at runtime in a later update, however doing so must result in
27988  * update messages sent to notify all nodes of our updated relay fee.
27989  *
27990  * Default value: 0.
27991  */
27992 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
27993
27994 /**
27995  * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
27996  * over the channel.
27997  * This may be allowed to change at runtime in a later update, however doing so must result in
27998  * update messages sent to notify all nodes of our updated relay fee.
27999  *
28000  * Default value: 0.
28001  */
28002 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
28003
28004 /**
28005  * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
28006  * excess of [`forwarding_fee_proportional_millionths`].
28007  * This may be allowed to change at runtime in a later update, however doing so must result in
28008  * update messages sent to notify all nodes of our updated relay fee.
28009  *
28010  * The default value of a single satoshi roughly matches the market rate on many routing nodes
28011  * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
28012  * this node.
28013  *
28014  * Default value: 1000.
28015  *
28016  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
28017  */
28018 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28019
28020 /**
28021  * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
28022  * excess of [`forwarding_fee_proportional_millionths`].
28023  * This may be allowed to change at runtime in a later update, however doing so must result in
28024  * update messages sent to notify all nodes of our updated relay fee.
28025  *
28026  * The default value of a single satoshi roughly matches the market rate on many routing nodes
28027  * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
28028  * this node.
28029  *
28030  * Default value: 1000.
28031  *
28032  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
28033  */
28034 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
28035
28036 /**
28037  * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
28038  * the channel this config applies to.
28039  *
28040  * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
28041  * HTLC balance when a channel appears on-chain whereas
28042  * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
28043  * (non-HTLC-encumbered) balance.
28044  *
28045  * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
28046  * we (or one of our watchtowers) MUST be online to check for broadcast of the current
28047  * commitment transaction at least once per this many blocks (minus some margin to allow us
28048  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
28049  * the spending transaction).
28050  *
28051  * Default value: 72 (12 hours at an average of 6 blocks/hour).
28052  * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
28053  *                [`MIN_CLTV_EXPIRY_DELTA`] instead.
28054  *
28055  * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
28056  */
28057 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28058
28059 /**
28060  * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
28061  * the channel this config applies to.
28062  *
28063  * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
28064  * HTLC balance when a channel appears on-chain whereas
28065  * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
28066  * (non-HTLC-encumbered) balance.
28067  *
28068  * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
28069  * we (or one of our watchtowers) MUST be online to check for broadcast of the current
28070  * commitment transaction at least once per this many blocks (minus some margin to allow us
28071  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
28072  * the spending transaction).
28073  *
28074  * Default value: 72 (12 hours at an average of 6 blocks/hour).
28075  * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
28076  *                [`MIN_CLTV_EXPIRY_DELTA`] instead.
28077  *
28078  * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
28079  */
28080 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
28081
28082 /**
28083  * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
28084  * small to claim on-chain.
28085  *
28086  * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
28087  * not be claimable on-chain, instead being turned into additional miner fees if either
28088  * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
28089  * to such payments may be sustantial if there are many dust HTLCs present when the
28090  * channel is force-closed.
28091  *
28092  * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
28093  * channel negotiated throughout the channel open process, along with the fees required to have
28094  * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
28095  * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
28096  * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
28097  * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
28098  * variant is primarily intended for use with pre-anchor channels.
28099  *
28100  * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
28101  * exposure across all three types per-channel.
28102  *
28103  * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
28104  */
28105 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28106
28107 /**
28108  * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
28109  * small to claim on-chain.
28110  *
28111  * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
28112  * not be claimable on-chain, instead being turned into additional miner fees if either
28113  * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
28114  * to such payments may be sustantial if there are many dust HTLCs present when the
28115  * channel is force-closed.
28116  *
28117  * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
28118  * channel negotiated throughout the channel open process, along with the fees required to have
28119  * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
28120  * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
28121  * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
28122  * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
28123  * variant is primarily intended for use with pre-anchor channels.
28124  *
28125  * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
28126  * exposure across all three types per-channel.
28127  *
28128  * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
28129  */
28130 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
28131
28132 /**
28133  * The additional fee we're willing to pay to avoid waiting for the counterparty's
28134  * `to_self_delay` to reclaim funds.
28135  *
28136  * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
28137  * closing transaction which both sides find acceptable, ultimately paid by the channel
28138  * funder/initiator.
28139  *
28140  * When we are the funder, because we have to pay the channel closing fee, we bound the
28141  * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
28142  * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
28143  * [`Normal`] feerate during normal operation, this value represents the additional fee we're
28144  * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
28145  * funds.
28146  *
28147  * When we are not the funder, we require the closing transaction fee pay at least our
28148  * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
28149  * Thus, this value is ignored when we are not the funder.
28150  *
28151  * Default value: 1000 satoshis.
28152  *
28153  * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
28154  * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
28155  */
28156 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28157
28158 /**
28159  * The additional fee we're willing to pay to avoid waiting for the counterparty's
28160  * `to_self_delay` to reclaim funds.
28161  *
28162  * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
28163  * closing transaction which both sides find acceptable, ultimately paid by the channel
28164  * funder/initiator.
28165  *
28166  * When we are the funder, because we have to pay the channel closing fee, we bound the
28167  * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
28168  * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
28169  * [`Normal`] feerate during normal operation, this value represents the additional fee we're
28170  * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
28171  * funds.
28172  *
28173  * When we are not the funder, we require the closing transaction fee pay at least our
28174  * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
28175  * Thus, this value is ignored when we are not the funder.
28176  *
28177  * Default value: 1000 satoshis.
28178  *
28179  * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
28180  * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
28181  */
28182 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
28183
28184 /**
28185  * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
28186  * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
28187  *
28188  * Usage:
28189  * - The payee will set this option and set its invoice route hints to use [intercept scids]
28190  *   generated by this channel's counterparty.
28191  * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
28192  *   [`forward_intercepted_htlc`] with less than the amount provided in
28193  *   [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
28194  *   actual forward amounts is their fee.
28195  *
28196  * # Note
28197  * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
28198  * as-expected if this feature is activated, otherwise they may lose money!
28199  * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
28200  * counterparty.
28201  *
28202  * # Note
28203  * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
28204  * Unsetting this flag between restarts may lead to payment receive failures.
28205  *
28206  * Default value: false.
28207  *
28208  * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28209  * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
28210  * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28211  * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
28212  * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
28213  * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
28214  */
28215 bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
28216
28217 /**
28218  * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
28219  * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
28220  *
28221  * Usage:
28222  * - The payee will set this option and set its invoice route hints to use [intercept scids]
28223  *   generated by this channel's counterparty.
28224  * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
28225  *   [`forward_intercepted_htlc`] with less than the amount provided in
28226  *   [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
28227  *   actual forward amounts is their fee.
28228  *
28229  * # Note
28230  * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
28231  * as-expected if this feature is activated, otherwise they may lose money!
28232  * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
28233  * counterparty.
28234  *
28235  * # Note
28236  * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
28237  * Unsetting this flag between restarts may lead to payment receive failures.
28238  *
28239  * Default value: false.
28240  *
28241  * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28242  * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
28243  * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28244  * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
28245  * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
28246  * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
28247  */
28248 void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
28249
28250 /**
28251  * Constructs a new ChannelConfig given each field
28252  */
28253 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);
28254
28255 /**
28256  * Creates a copy of the ChannelConfig
28257  */
28258 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
28259
28260 /**
28261  * Checks if two ChannelConfigs contain equal inner contents.
28262  * This ignores pointers and is_owned flags and looks at the values in fields.
28263  * Two objects with NULL inner values will be considered "equal" here.
28264  */
28265 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
28266
28267 /**
28268  * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
28269  */
28270 void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
28271
28272 /**
28273  * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
28274  */
28275 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
28276
28277 /**
28278  * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
28279  */
28280 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
28281
28282 /**
28283  * Read a ChannelConfig from a byte array, created by ChannelConfig_write
28284  */
28285 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
28286
28287 /**
28288  * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
28289  */
28290 void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
28291
28292 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28293
28294 void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
28295
28296 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28297
28298 void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
28299
28300 struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28301
28302 void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
28303
28304 /**
28305  *
28306  * Returns a copy of the field.
28307  */
28308 struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28309
28310 void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
28311
28312 struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
28313
28314 void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
28315
28316 /**
28317  * Constructs a new ChannelConfigUpdate given each field
28318  */
28319 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);
28320
28321 /**
28322  * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
28323  */
28324 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
28325
28326 /**
28327  * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
28328  */
28329 void UserConfig_free(struct LDKUserConfig this_obj);
28330
28331 /**
28332  * Channel handshake config that we propose to our counterparty.
28333  */
28334 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28335
28336 /**
28337  * Channel handshake config that we propose to our counterparty.
28338  */
28339 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
28340
28341 /**
28342  * Limits applied to our counterparty's proposed channel handshake config settings.
28343  */
28344 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28345
28346 /**
28347  * Limits applied to our counterparty's proposed channel handshake config settings.
28348  */
28349 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
28350
28351 /**
28352  * Channel config which affects behavior during channel lifetime.
28353  */
28354 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28355
28356 /**
28357  * Channel config which affects behavior during channel lifetime.
28358  */
28359 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
28360
28361 /**
28362  * If this is set to false, we will reject any HTLCs which were to be forwarded over private
28363  * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
28364  * node which is not online reliably.
28365  *
28366  * For nodes which are not online reliably, you should set all channels to *not* be announced
28367  * (using [`ChannelHandshakeConfig::announced_channel`] and
28368  * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
28369  * ensure you are not exposed to any forwarding risk.
28370  *
28371  * Note that because you cannot change a channel's announced state after creation, there is no
28372  * way to disable forwarding on public channels retroactively. Thus, in order to change a node
28373  * from a publicly-announced forwarding node to a private non-forwarding node you must close
28374  * all your channels and open new ones. For privacy, you should also change your node_id
28375  * (swapping all private and public key material for new ones) at that time.
28376  *
28377  * Default value: false.
28378  */
28379 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28380
28381 /**
28382  * If this is set to false, we will reject any HTLCs which were to be forwarded over private
28383  * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
28384  * node which is not online reliably.
28385  *
28386  * For nodes which are not online reliably, you should set all channels to *not* be announced
28387  * (using [`ChannelHandshakeConfig::announced_channel`] and
28388  * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
28389  * ensure you are not exposed to any forwarding risk.
28390  *
28391  * Note that because you cannot change a channel's announced state after creation, there is no
28392  * way to disable forwarding on public channels retroactively. Thus, in order to change a node
28393  * from a publicly-announced forwarding node to a private non-forwarding node you must close
28394  * all your channels and open new ones. For privacy, you should also change your node_id
28395  * (swapping all private and public key material for new ones) at that time.
28396  *
28397  * Default value: false.
28398  */
28399 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28400
28401 /**
28402  * If this is set to false, we do not accept inbound requests to open a new channel.
28403  * Default value: true.
28404  */
28405 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28406
28407 /**
28408  * If this is set to false, we do not accept inbound requests to open a new channel.
28409  * Default value: true.
28410  */
28411 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28412
28413 /**
28414  * If this is set to true, the user needs to manually accept inbound requests to open a new
28415  * channel.
28416  *
28417  * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
28418  * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
28419  * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
28420  * user explicitly chooses to accept the request.
28421  *
28422  * Default value: false.
28423  *
28424  * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
28425  * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
28426  * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
28427  */
28428 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28429
28430 /**
28431  * If this is set to true, the user needs to manually accept inbound requests to open a new
28432  * channel.
28433  *
28434  * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
28435  * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
28436  * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
28437  * user explicitly chooses to accept the request.
28438  *
28439  * Default value: false.
28440  *
28441  * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
28442  * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
28443  * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
28444  */
28445 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28446
28447 /**
28448  *  If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
28449  *  fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
28450  *  intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
28451  *
28452  *  Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
28453  *
28454  *  Default value: false.
28455  *
28456  * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28457  * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28458  */
28459 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28460
28461 /**
28462  *  If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
28463  *  fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
28464  *  intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
28465  *
28466  *  Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
28467  *
28468  *  Default value: false.
28469  *
28470  * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
28471  * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
28472  */
28473 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28474
28475 /**
28476  * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
28477  * parts. If this is set to true, we'll accept the payment.
28478  *
28479  * Setting this to true will break backwards compatibility upon downgrading to an LDK
28480  * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
28481  * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
28482  *
28483  * Default value: false.
28484  *
28485  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28486  */
28487 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
28488
28489 /**
28490  * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
28491  * parts. If this is set to true, we'll accept the payment.
28492  *
28493  * Setting this to true will break backwards compatibility upon downgrading to an LDK
28494  * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
28495  * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
28496  *
28497  * Default value: false.
28498  *
28499  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28500  */
28501 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
28502
28503 /**
28504  * Constructs a new UserConfig given each field
28505  */
28506 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);
28507
28508 /**
28509  * Creates a copy of the UserConfig
28510  */
28511 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
28512
28513 /**
28514  * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
28515  */
28516 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
28517
28518 /**
28519  * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
28520  */
28521 void BestBlock_free(struct LDKBestBlock this_obj);
28522
28523 /**
28524  * Creates a copy of the BestBlock
28525  */
28526 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
28527
28528 /**
28529  * Checks if two BestBlocks contain equal inner contents.
28530  * This ignores pointers and is_owned flags and looks at the values in fields.
28531  * Two objects with NULL inner values will be considered "equal" here.
28532  */
28533 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
28534
28535 /**
28536  * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
28537  * network.
28538  */
28539 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
28540
28541 /**
28542  * Returns a `BestBlock` as identified by the given block hash and height.
28543  */
28544 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
28545
28546 /**
28547  * Returns the best block hash.
28548  */
28549 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
28550
28551 /**
28552  * Returns the best block height.
28553  */
28554 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
28555
28556 /**
28557  * Calls the free function if one is set
28558  */
28559 void Listen_free(struct LDKListen this_ptr);
28560
28561 /**
28562  * Calls the free function if one is set
28563  */
28564 void Confirm_free(struct LDKConfirm this_ptr);
28565
28566 /**
28567  * Creates a copy of the ChannelMonitorUpdateStatus
28568  */
28569 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
28570
28571 /**
28572  * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
28573  */
28574 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
28575
28576 /**
28577  * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
28578  */
28579 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
28580
28581 /**
28582  * Utility method to constructs a new UnrecoverableError-variant ChannelMonitorUpdateStatus
28583  */
28584 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_unrecoverable_error(void);
28585
28586 /**
28587  * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
28588  * This ignores pointers and is_owned flags and looks at the values in fields.
28589  */
28590 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
28591
28592 /**
28593  * Calls the free function if one is set
28594  */
28595 void Watch_free(struct LDKWatch this_ptr);
28596
28597 /**
28598  * Calls the free function if one is set
28599  */
28600 void Filter_free(struct LDKFilter this_ptr);
28601
28602 /**
28603  * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
28604  */
28605 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
28606
28607 /**
28608  * First block where the transaction output may have been spent.
28609  */
28610 struct LDKCOption_ThirtyTwoBytesZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
28611
28612 /**
28613  * First block where the transaction output may have been spent.
28614  */
28615 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
28616
28617 /**
28618  * Outpoint identifying the transaction output.
28619  */
28620 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
28621
28622 /**
28623  * Outpoint identifying the transaction output.
28624  */
28625 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
28626
28627 /**
28628  * Spending condition of the transaction output.
28629  */
28630 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
28631
28632 /**
28633  * Spending condition of the transaction output.
28634  */
28635 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
28636
28637 /**
28638  * Constructs a new WatchedOutput given each field
28639  */
28640 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_ThirtyTwoBytesZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
28641
28642 /**
28643  * Creates a copy of the WatchedOutput
28644  */
28645 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
28646
28647 /**
28648  * Checks if two WatchedOutputs contain equal inner contents.
28649  * This ignores pointers and is_owned flags and looks at the values in fields.
28650  * Two objects with NULL inner values will be considered "equal" here.
28651  */
28652 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
28653
28654 /**
28655  * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
28656  */
28657 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
28658
28659 /**
28660  * Calls the free function if one is set
28661  */
28662 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
28663
28664 /**
28665  * Creates a copy of the ConfirmationTarget
28666  */
28667 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
28668
28669 /**
28670  * Utility method to constructs a new MempoolMinimum-variant ConfirmationTarget
28671  */
28672 enum LDKConfirmationTarget ConfirmationTarget_mempool_minimum(void);
28673
28674 /**
28675  * Utility method to constructs a new Background-variant ConfirmationTarget
28676  */
28677 enum LDKConfirmationTarget ConfirmationTarget_background(void);
28678
28679 /**
28680  * Utility method to constructs a new Normal-variant ConfirmationTarget
28681  */
28682 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
28683
28684 /**
28685  * Utility method to constructs a new HighPriority-variant ConfirmationTarget
28686  */
28687 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
28688
28689 /**
28690  * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
28691  */
28692 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
28693
28694 /**
28695  * Checks if two ConfirmationTargets contain equal inner contents.
28696  * This ignores pointers and is_owned flags and looks at the values in fields.
28697  */
28698 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
28699
28700 /**
28701  * Calls the free function if one is set
28702  */
28703 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
28704
28705 /**
28706  * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
28707  */
28708 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
28709
28710 /**
28711  * Creates a copy of the MonitorUpdateId
28712  */
28713 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
28714
28715 /**
28716  * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
28717  */
28718 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
28719
28720 /**
28721  * Checks if two MonitorUpdateIds contain equal inner contents.
28722  * This ignores pointers and is_owned flags and looks at the values in fields.
28723  * Two objects with NULL inner values will be considered "equal" here.
28724  */
28725 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
28726
28727 /**
28728  * Calls the free function if one is set
28729  */
28730 void Persist_free(struct LDKPersist this_ptr);
28731
28732 /**
28733  * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
28734  */
28735 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
28736
28737 /**
28738  * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
28739  */
28740 void ChainMonitor_free(struct LDKChainMonitor this_obj);
28741
28742 /**
28743  * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
28744  *
28745  * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
28746  * will call back to it indicating transactions and outputs of interest. This allows clients to
28747  * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
28748  * always need to fetch full blocks absent another means for determining which blocks contain
28749  * transactions relevant to the watched channels.
28750  */
28751 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
28752
28753 /**
28754  * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
28755  * claims which are awaiting confirmation.
28756  *
28757  * Includes the balances from each [`ChannelMonitor`] *except* those included in
28758  * `ignored_channels`, allowing you to filter out balances from channels which are still open
28759  * (and whose balance should likely be pulled from the [`ChannelDetails`]).
28760  *
28761  * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
28762  * inclusion in the return value.
28763  */
28764 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
28765
28766 /**
28767  * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
28768  * such [`ChannelMonitor`] is currently being monitored for.
28769  *
28770  * Note that the result holds a mutex over our monitor set, and should not be held
28771  * indefinitely.
28772  */
28773 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
28774
28775 /**
28776  * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
28777  *
28778  * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
28779  * monitoring for on-chain state resolutions.
28780  */
28781 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28782
28783 /**
28784  * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
28785  */
28786 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28787
28788 /**
28789  * Indicates the persistence of a [`ChannelMonitor`] has completed after
28790  * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
28791  *
28792  * Thus, the anticipated use is, at a high level:
28793  *  1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
28794  *     update to disk and begins updating any remote (e.g. watchtower/backup) copies,
28795  *     returning [`ChannelMonitorUpdateStatus::InProgress`],
28796  *  2) once all remote copies are updated, you call this function with the
28797  *     `completed_update_id` that completed, and once all pending updates have completed the
28798  *     channel will be re-enabled.
28799  *
28800  * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
28801  * registered [`ChannelMonitor`]s.
28802  */
28803 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);
28804
28805 /**
28806  * Gets a [`Future`] that completes when an event is available either via
28807  * [`chain::Watch::release_pending_monitor_events`] or
28808  * [`EventsProvider::process_pending_events`].
28809  *
28810  * Note that callbacks registered on the [`Future`] MUST NOT call back into this
28811  * [`ChainMonitor`] and should instead register actions to be taken later.
28812  *
28813  * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
28814  */
28815 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28816
28817 /**
28818  * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
28819  * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
28820  * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
28821  * invoking this every 30 seconds, or lower if running in an environment with spotty
28822  * connections, like on mobile.
28823  */
28824 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28825
28826 /**
28827  * Constructs a new Listen which calls the relevant methods on this_arg.
28828  * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
28829  */
28830 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28831
28832 /**
28833  * Constructs a new Confirm which calls the relevant methods on this_arg.
28834  * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
28835  */
28836 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28837
28838 /**
28839  * Constructs a new Watch which calls the relevant methods on this_arg.
28840  * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
28841  */
28842 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28843
28844 /**
28845  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
28846  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
28847  */
28848 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
28849
28850 /**
28851  * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
28852  */
28853 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
28854
28855 /**
28856  * The sequence number of this update. Updates *must* be replayed in-order according to this
28857  * sequence number (and updates may panic if they are not). The update_id values are strictly
28858  * increasing and increase by one for each new update, with two exceptions specified below.
28859  *
28860  * This sequence number is also used to track up to which points updates which returned
28861  * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
28862  * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
28863  *
28864  * The only instances we allow where update_id values are not strictly increasing have a
28865  * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
28866  * will force close the channel by broadcasting the latest commitment transaction or
28867  * special post-force-close updates, like providing preimages necessary to claim outputs on the
28868  * broadcast commitment transaction. See its docs for more details.
28869  *
28870  * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
28871  */
28872 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
28873
28874 /**
28875  * The sequence number of this update. Updates *must* be replayed in-order according to this
28876  * sequence number (and updates may panic if they are not). The update_id values are strictly
28877  * increasing and increase by one for each new update, with two exceptions specified below.
28878  *
28879  * This sequence number is also used to track up to which points updates which returned
28880  * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
28881  * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
28882  *
28883  * The only instances we allow where update_id values are not strictly increasing have a
28884  * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
28885  * will force close the channel by broadcasting the latest commitment transaction or
28886  * special post-force-close updates, like providing preimages necessary to claim outputs on the
28887  * broadcast commitment transaction. See its docs for more details.
28888  *
28889  * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
28890  */
28891 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
28892
28893 /**
28894  * Creates a copy of the ChannelMonitorUpdate
28895  */
28896 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
28897
28898 /**
28899  * Checks if two ChannelMonitorUpdates contain equal inner contents.
28900  * This ignores pointers and is_owned flags and looks at the values in fields.
28901  * Two objects with NULL inner values will be considered "equal" here.
28902  */
28903 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
28904
28905 /**
28906  * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
28907  */
28908 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
28909
28910 /**
28911  * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
28912  */
28913 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
28914
28915 /**
28916  * Frees any resources used by the MonitorEvent
28917  */
28918 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
28919
28920 /**
28921  * Creates a copy of the MonitorEvent
28922  */
28923 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
28924
28925 /**
28926  * Utility method to constructs a new HTLCEvent-variant MonitorEvent
28927  */
28928 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
28929
28930 /**
28931  * Utility method to constructs a new HolderForceClosed-variant MonitorEvent
28932  */
28933 struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a);
28934
28935 /**
28936  * Utility method to constructs a new Completed-variant MonitorEvent
28937  */
28938 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
28939
28940 /**
28941  * Checks if two MonitorEvents contain equal inner contents.
28942  * This ignores pointers and is_owned flags and looks at the values in fields.
28943  */
28944 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
28945
28946 /**
28947  * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
28948  */
28949 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
28950
28951 /**
28952  * Read a MonitorEvent from a byte array, created by MonitorEvent_write
28953  */
28954 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
28955
28956 /**
28957  * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
28958  */
28959 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
28960
28961 /**
28962  * Creates a copy of the HTLCUpdate
28963  */
28964 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
28965
28966 /**
28967  * Checks if two HTLCUpdates contain equal inner contents.
28968  * This ignores pointers and is_owned flags and looks at the values in fields.
28969  * Two objects with NULL inner values will be considered "equal" here.
28970  */
28971 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
28972
28973 /**
28974  * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
28975  */
28976 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
28977
28978 /**
28979  * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
28980  */
28981 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
28982
28983 /**
28984  * Frees any resources used by the Balance
28985  */
28986 void Balance_free(struct LDKBalance this_ptr);
28987
28988 /**
28989  * Creates a copy of the Balance
28990  */
28991 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
28992
28993 /**
28994  * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
28995  */
28996 struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis);
28997
28998 /**
28999  * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
29000  */
29001 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height);
29002
29003 /**
29004  * Utility method to constructs a new ContentiousClaimable-variant Balance
29005  */
29006 struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
29007
29008 /**
29009  * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
29010  */
29011 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
29012
29013 /**
29014  * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
29015  */
29016 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
29017
29018 /**
29019  * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
29020  */
29021 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis);
29022
29023 /**
29024  * Checks if two Balances contain equal inner contents.
29025  * This ignores pointers and is_owned flags and looks at the values in fields.
29026  */
29027 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
29028
29029 /**
29030  * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
29031  * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
29032  * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
29033  * [`Balance::MaybePreimageClaimableHTLC`].
29034  *
29035  * On-chain fees required to claim the balance are not included in this amount.
29036  */
29037 MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
29038
29039 /**
29040  * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
29041  */
29042 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
29043
29044 /**
29045  * Creates a copy of the ChannelMonitor
29046  */
29047 struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
29048
29049 /**
29050  * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
29051  */
29052 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
29053
29054 /**
29055  * Updates a ChannelMonitor on the basis of some new information provided by the Channel
29056  * itself.
29057  *
29058  * panics if the given update is not the next update by update_id.
29059  */
29060 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);
29061
29062 /**
29063  * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
29064  * ChannelMonitor.
29065  */
29066 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29067
29068 /**
29069  * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
29070  */
29071 MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29072
29073 /**
29074  * Gets a list of txids, with their output scripts (in the order they appear in the
29075  * transaction), which we must learn about spends of via block_connected().
29076  */
29077 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29078
29079 /**
29080  * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
29081  * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
29082  * have been registered.
29083  */
29084 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
29085
29086 /**
29087  * Get the list of HTLCs who's status has been updated on chain. This should be called by
29088  * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
29089  */
29090 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29091
29092 /**
29093  * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
29094  *
29095  * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
29096  * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
29097  * within each channel. As the confirmation of a commitment transaction may be critical to the
29098  * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
29099  * environment with spotty connections, like on mobile.
29100  *
29101  * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
29102  * order to handle these events.
29103  *
29104  * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
29105  * [`BumpTransaction`]: crate::events::Event::BumpTransaction
29106  */
29107 void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
29108
29109 /**
29110  * Gets the counterparty's initial commitment transaction. The returned commitment
29111  * transaction is unsigned. This is intended to be called during the initial persistence of
29112  * the monitor (inside an implementation of [`Persist::persist_new_channel`]), to allow for
29113  * watchtowers in the persistence pipeline to have enough data to form justice transactions.
29114  *
29115  * This is similar to [`Self::counterparty_commitment_txs_from_update`], except
29116  * that for the initial commitment transaction, we don't have a corresponding update.
29117  *
29118  * This will only return `Some` for channel monitors that have been created after upgrading
29119  * to LDK 0.0.117+.
29120  *
29121  * [`Persist::persist_new_channel`]: crate::chain::chainmonitor::Persist::persist_new_channel
29122  *
29123  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29124  */
29125 MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29126
29127 /**
29128  * Gets all of the counterparty commitment transactions provided by the given update. This
29129  * may be empty if the update doesn't include any new counterparty commitments. Returned
29130  * commitment transactions are unsigned.
29131  *
29132  * This is provided so that watchtower clients in the persistence pipeline are able to build
29133  * justice transactions for each counterparty commitment upon each update. It's intended to be
29134  * used within an implementation of [`Persist::update_persisted_channel`], which is provided
29135  * with a monitor and an update. Once revoked, signing a justice transaction can be done using
29136  * [`Self::sign_to_local_justice_tx`].
29137  *
29138  * It is expected that a watchtower client may use this method to retrieve the latest counterparty
29139  * commitment transaction(s), and then hold the necessary data until a later update in which
29140  * the monitor has been updated with the corresponding revocation data, at which point the
29141  * monitor can sign the justice transaction.
29142  *
29143  * This will only return a non-empty list for monitor updates that have been created after
29144  * upgrading to LDK 0.0.117+. Note that no restriction lies on the monitors themselves, which
29145  * may have been created prior to upgrading.
29146  *
29147  * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel
29148  */
29149 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);
29150
29151 /**
29152  * Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
29153  * signing the justice transaction easier for implementors of
29154  * [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
29155  * signing the input at `input_idx`. This method will only produce a valid signature for
29156  * a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
29157  * be used for revoked HTLC outputs.
29158  *
29159  * `Value` is the value of the output being spent by the input at `input_idx`, committed
29160  * in the BIP 143 signature.
29161  *
29162  * This method will only succeed if this monitor has received the revocation secret for the
29163  * provided `commitment_number`. If a commitment number is provided that does not correspond
29164  * to the commitment transaction being revoked, this will return a signed transaction, but
29165  * the signature will not be valid.
29166  *
29167  * [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::EcdsaChannelSigner::sign_justice_revoked_output
29168  * [`Persist`]: crate::chain::chainmonitor::Persist
29169  */
29170 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);
29171
29172 /**
29173  * Gets the `node_id` of the counterparty for this channel.
29174  *
29175  * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
29176  * otherwise.
29177  *
29178  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29179  */
29180 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29181
29182 /**
29183  * Used by [`ChannelManager`] deserialization to broadcast the latest holder state if its copy
29184  * of the channel state was out-of-date.
29185  *
29186  * You may also use this to broadcast the latest local commitment transaction, either because
29187  * a monitor update failed or because we've fallen behind (i.e. we've received proof that our
29188  * counterparty side knows a revocation secret we gave them that they shouldn't know).
29189  *
29190  * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
29191  * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
29192  * close channel with their commitment transaction after a substantial amount of time. Best
29193  * may be to contact the other node operator out-of-band to coordinate other options available
29194  * to you.
29195  *
29196  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
29197  */
29198 MUST_USE_RES struct LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger);
29199
29200 /**
29201  * Processes transactions in a newly connected block, which may result in any of the following:
29202  * - update the monitor's state against resolved HTLCs
29203  * - punish the counterparty in the case of seeing a revoked commitment transaction
29204  * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
29205  * - detect settled outputs for later spending
29206  * - schedule and bump any in-flight claims
29207  *
29208  * Returns any new outputs to watch from `txdata`; after called, these are also included in
29209  * [`get_outputs_to_watch`].
29210  *
29211  * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
29212  */
29213 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_block_connected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29214
29215 /**
29216  * Determines if the disconnected block contained any transactions of interest and updates
29217  * appropriately.
29218  */
29219 void ChannelMonitor_block_disconnected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29220
29221 /**
29222  * Processes transactions confirmed in a block with the given header and height, returning new
29223  * outputs to watch. See [`block_connected`] for details.
29224  *
29225  * Used instead of [`block_connected`] by clients that are notified of transactions rather than
29226  * blocks. See [`chain::Confirm`] for calling expectations.
29227  *
29228  * [`block_connected`]: Self::block_connected
29229  */
29230 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_transactions_confirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29231
29232 /**
29233  * Processes a transaction that was reorganized out of the chain.
29234  *
29235  * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
29236  * than blocks. See [`chain::Confirm`] for calling expectations.
29237  *
29238  * [`block_disconnected`]: Self::block_disconnected
29239  */
29240 void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29241
29242 /**
29243  * Updates the monitor with the current best chain tip, returning new outputs to watch. See
29244  * [`block_connected`] for details.
29245  *
29246  * Used instead of [`block_connected`] by clients that are notified of transactions rather than
29247  * blocks. See [`chain::Confirm`] for calling expectations.
29248  *
29249  * [`block_connected`]: Self::block_connected
29250  */
29251 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_best_block_updated(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29252
29253 /**
29254  * Returns the set of txids that should be monitored for re-organization out of the chain.
29255  */
29256 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCOption_ThirtyTwoBytesZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29257
29258 /**
29259  * Gets the latest best block which was connected either via the [`chain::Listen`] or
29260  * [`chain::Confirm`] interfaces.
29261  */
29262 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29263
29264 /**
29265  * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
29266  * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
29267  * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
29268  * invoking this every 30 seconds, or lower if running in an environment with spotty
29269  * connections, like on mobile.
29270  */
29271 void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
29272
29273 /**
29274  * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the
29275  * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`]
29276  * confirmations. For [`SpendableOutputDescriptor::DelayedPaymentOutput`] descriptors to be
29277  * returned, the transaction must have at least `max(ANTI_REORG_DELAY, to_self_delay)`
29278  * confirmations.
29279  *
29280  * Descriptors returned by this method are primarily exposed via [`Event::SpendableOutputs`]
29281  * once they are no longer under reorg risk. This method serves as a way to retrieve these
29282  * descriptors at a later time, either for historical purposes, or to replay any
29283  * missed/unhandled descriptors. For the purpose of gathering historical records, if the
29284  * channel close has fully resolved (i.e., [`ChannelMonitor::get_claimable_balances`] returns
29285  * an empty set), you can retrieve all spendable outputs by providing all descendant spending
29286  * transactions starting from the channel's funding transaction and going down three levels.
29287  *
29288  * `tx` is a transaction we'll scan the outputs of. Any transaction can be provided. If any
29289  * outputs which can be spent by us are found, at least one descriptor is returned.
29290  *
29291  * `confirmation_height` must be the height of the block in which `tx` was included in.
29292  */
29293 MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height);
29294
29295 /**
29296  * Gets the balances in this channel which are either claimable by us if we were to
29297  * force-close the channel now or which are claimable on-chain (possibly awaiting
29298  * confirmation).
29299  *
29300  * Any balances in the channel which are available on-chain (excluding on-chain fees) are
29301  * included here until an [`Event::SpendableOutputs`] event has been generated for the
29302  * balance, or until our counterparty has claimed the balance and accrued several
29303  * confirmations on the claim transaction.
29304  *
29305  * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
29306  * LDK prior to 0.0.111, not all or excess balances may be included.
29307  *
29308  * See [`Balance`] for additional details on the types of claimable balances which
29309  * may be returned here and their meanings.
29310  */
29311 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
29312
29313 /**
29314  * Read a C2Tuple_ThirtyTwoBytesChannelMonitorZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelMonitorZ_write
29315  */
29316 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
29317
29318 /**
29319  * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
29320  */
29321 void OutPoint_free(struct LDKOutPoint this_obj);
29322
29323 /**
29324  * The referenced transaction's txid.
29325  */
29326 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
29327
29328 /**
29329  * The referenced transaction's txid.
29330  */
29331 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29332
29333 /**
29334  * The index of the referenced output in its transaction's vout.
29335  */
29336 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
29337
29338 /**
29339  * The index of the referenced output in its transaction's vout.
29340  */
29341 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
29342
29343 /**
29344  * Constructs a new OutPoint given each field
29345  */
29346 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
29347
29348 /**
29349  * Creates a copy of the OutPoint
29350  */
29351 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
29352
29353 /**
29354  * Checks if two OutPoints contain equal inner contents.
29355  * This ignores pointers and is_owned flags and looks at the values in fields.
29356  * Two objects with NULL inner values will be considered "equal" here.
29357  */
29358 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
29359
29360 /**
29361  * Generates a non-cryptographic 64-bit hash of the OutPoint.
29362  */
29363 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
29364
29365 /**
29366  * Convert an `OutPoint` to a lightning channel id.
29367  */
29368 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
29369
29370 /**
29371  * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
29372  */
29373 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
29374
29375 /**
29376  * Read a OutPoint from a byte array, created by OutPoint_write
29377  */
29378 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
29379
29380 /**
29381  * Frees any resources used by the FailureCode
29382  */
29383 void FailureCode_free(struct LDKFailureCode this_ptr);
29384
29385 /**
29386  * Creates a copy of the FailureCode
29387  */
29388 struct LDKFailureCode FailureCode_clone(const struct LDKFailureCode *NONNULL_PTR orig);
29389
29390 /**
29391  * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
29392  */
29393 struct LDKFailureCode FailureCode_temporary_node_failure(void);
29394
29395 /**
29396  * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
29397  */
29398 struct LDKFailureCode FailureCode_required_node_feature_missing(void);
29399
29400 /**
29401  * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
29402  */
29403 struct LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
29404
29405 /**
29406  * Utility method to constructs a new InvalidOnionPayload-variant FailureCode
29407  */
29408 struct LDKFailureCode FailureCode_invalid_onion_payload(struct LDKCOption_C2Tuple_u64u16ZZ a);
29409
29410 /**
29411  * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
29412  */
29413 void ChannelManager_free(struct LDKChannelManager this_obj);
29414
29415 /**
29416  * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
29417  */
29418 void ChainParameters_free(struct LDKChainParameters this_obj);
29419
29420 /**
29421  * The network for determining the `chain_hash` in Lightning messages.
29422  */
29423 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
29424
29425 /**
29426  * The network for determining the `chain_hash` in Lightning messages.
29427  */
29428 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
29429
29430 /**
29431  * The hash and height of the latest block successfully connected.
29432  *
29433  * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
29434  */
29435 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
29436
29437 /**
29438  * The hash and height of the latest block successfully connected.
29439  *
29440  * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
29441  */
29442 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
29443
29444 /**
29445  * Constructs a new ChainParameters given each field
29446  */
29447 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
29448
29449 /**
29450  * Creates a copy of the ChainParameters
29451  */
29452 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
29453
29454 /**
29455  * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
29456  */
29457 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
29458
29459 /**
29460  * Base routing fee in millisatoshis.
29461  */
29462 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
29463
29464 /**
29465  * Base routing fee in millisatoshis.
29466  */
29467 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
29468
29469 /**
29470  * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
29471  */
29472 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
29473
29474 /**
29475  * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
29476  */
29477 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
29478
29479 /**
29480  * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
29481  * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
29482  * `cltv_expiry_delta` for more details.
29483  */
29484 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
29485
29486 /**
29487  * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
29488  * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
29489  * `cltv_expiry_delta` for more details.
29490  */
29491 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
29492
29493 /**
29494  * Constructs a new CounterpartyForwardingInfo given each field
29495  */
29496 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);
29497
29498 /**
29499  * Creates a copy of the CounterpartyForwardingInfo
29500  */
29501 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
29502
29503 /**
29504  * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
29505  */
29506 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
29507
29508 /**
29509  * The node_id of our counterparty
29510  */
29511 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29512
29513 /**
29514  * The node_id of our counterparty
29515  */
29516 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29517
29518 /**
29519  * The Features the channel counterparty provided upon last connection.
29520  * Useful for routing as it is the most up-to-date copy of the counterparty's features and
29521  * many routing-relevant features are present in the init context.
29522  */
29523 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29524
29525 /**
29526  * The Features the channel counterparty provided upon last connection.
29527  * Useful for routing as it is the most up-to-date copy of the counterparty's features and
29528  * many routing-relevant features are present in the init context.
29529  */
29530 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
29531
29532 /**
29533  * The value, in satoshis, that must always be held in the channel for our counterparty. This
29534  * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
29535  * claiming at least this value on chain.
29536  *
29537  * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
29538  *
29539  * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
29540  */
29541 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29542
29543 /**
29544  * The value, in satoshis, that must always be held in the channel for our counterparty. This
29545  * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
29546  * claiming at least this value on chain.
29547  *
29548  * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
29549  *
29550  * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
29551  */
29552 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
29553
29554 /**
29555  * Information on the fees and requirements that the counterparty requires when forwarding
29556  * payments to us through this channel.
29557  *
29558  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29559  */
29560 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29561
29562 /**
29563  * Information on the fees and requirements that the counterparty requires when forwarding
29564  * payments to us through this channel.
29565  *
29566  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29567  */
29568 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
29569
29570 /**
29571  * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
29572  * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
29573  * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
29574  */
29575 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29576
29577 /**
29578  * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
29579  * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
29580  * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
29581  */
29582 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29583
29584 /**
29585  * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
29586  */
29587 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
29588
29589 /**
29590  * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
29591  */
29592 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29593
29594 /**
29595  * Constructs a new ChannelCounterparty given each field
29596  *
29597  * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
29598  */
29599 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);
29600
29601 /**
29602  * Creates a copy of the ChannelCounterparty
29603  */
29604 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
29605
29606 /**
29607  * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
29608  */
29609 void ChannelDetails_free(struct LDKChannelDetails this_obj);
29610
29611 /**
29612  * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
29613  * thereafter this is the txid of the funding transaction xor the funding transaction output).
29614  * Note that this means this value is *not* persistent - it can change once during the
29615  * lifetime of the channel.
29616  */
29617 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
29618
29619 /**
29620  * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
29621  * thereafter this is the txid of the funding transaction xor the funding transaction output).
29622  * Note that this means this value is *not* persistent - it can change once during the
29623  * lifetime of the channel.
29624  */
29625 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29626
29627 /**
29628  * Parameters which apply to our counterparty. See individual fields for more information.
29629  */
29630 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29631
29632 /**
29633  * Parameters which apply to our counterparty. See individual fields for more information.
29634  */
29635 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
29636
29637 /**
29638  * The Channel's funding transaction output, if we've negotiated the funding transaction with
29639  * our counterparty already.
29640  *
29641  * Note that, if this has been set, `channel_id` will be equivalent to
29642  * `funding_txo.unwrap().to_channel_id()`.
29643  *
29644  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29645  */
29646 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29647
29648 /**
29649  * The Channel's funding transaction output, if we've negotiated the funding transaction with
29650  * our counterparty already.
29651  *
29652  * Note that, if this has been set, `channel_id` will be equivalent to
29653  * `funding_txo.unwrap().to_channel_id()`.
29654  *
29655  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29656  */
29657 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
29658
29659 /**
29660  * The features which this channel operates with. See individual features for more info.
29661  *
29662  * `None` until negotiation completes and the channel type is finalized.
29663  *
29664  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29665  */
29666 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29667
29668 /**
29669  * The features which this channel operates with. See individual features for more info.
29670  *
29671  * `None` until negotiation completes and the channel type is finalized.
29672  *
29673  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29674  */
29675 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
29676
29677 /**
29678  * The position of the funding transaction in the chain. None if the funding transaction has
29679  * not yet been confirmed and the channel fully opened.
29680  *
29681  * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
29682  * payments instead of this. See [`get_inbound_payment_scid`].
29683  *
29684  * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
29685  * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
29686  *
29687  * [`inbound_scid_alias`]: Self::inbound_scid_alias
29688  * [`outbound_scid_alias`]: Self::outbound_scid_alias
29689  * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
29690  * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
29691  * [`confirmations_required`]: Self::confirmations_required
29692  */
29693 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29694
29695 /**
29696  * The position of the funding transaction in the chain. None if the funding transaction has
29697  * not yet been confirmed and the channel fully opened.
29698  *
29699  * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
29700  * payments instead of this. See [`get_inbound_payment_scid`].
29701  *
29702  * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
29703  * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
29704  *
29705  * [`inbound_scid_alias`]: Self::inbound_scid_alias
29706  * [`outbound_scid_alias`]: Self::outbound_scid_alias
29707  * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
29708  * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
29709  * [`confirmations_required`]: Self::confirmations_required
29710  */
29711 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29712
29713 /**
29714  * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
29715  * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
29716  * the channel has not yet been confirmed (as long as [`confirmations_required`] is
29717  * `Some(0)`).
29718  *
29719  * This will be `None` as long as the channel is not available for routing outbound payments.
29720  *
29721  * [`short_channel_id`]: Self::short_channel_id
29722  * [`confirmations_required`]: Self::confirmations_required
29723  */
29724 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29725
29726 /**
29727  * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
29728  * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
29729  * the channel has not yet been confirmed (as long as [`confirmations_required`] is
29730  * `Some(0)`).
29731  *
29732  * This will be `None` as long as the channel is not available for routing outbound payments.
29733  *
29734  * [`short_channel_id`]: Self::short_channel_id
29735  * [`confirmations_required`]: Self::confirmations_required
29736  */
29737 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29738
29739 /**
29740  * An optional [`short_channel_id`] alias for this channel, randomly generated by our
29741  * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
29742  * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
29743  * when they see a payment to be routed to us.
29744  *
29745  * Our counterparty may choose to rotate this value at any time, though will always recognize
29746  * previous values for inbound payment forwarding.
29747  *
29748  * [`short_channel_id`]: Self::short_channel_id
29749  */
29750 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29751
29752 /**
29753  * An optional [`short_channel_id`] alias for this channel, randomly generated by our
29754  * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
29755  * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
29756  * when they see a payment to be routed to us.
29757  *
29758  * Our counterparty may choose to rotate this value at any time, though will always recognize
29759  * previous values for inbound payment forwarding.
29760  *
29761  * [`short_channel_id`]: Self::short_channel_id
29762  */
29763 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29764
29765 /**
29766  * The value, in satoshis, of this channel as appears in the funding output
29767  */
29768 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29769
29770 /**
29771  * The value, in satoshis, of this channel as appears in the funding output
29772  */
29773 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
29774
29775 /**
29776  * The value, in satoshis, that must always be held in the channel for us. This value ensures
29777  * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
29778  * this value on chain.
29779  *
29780  * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
29781  *
29782  * This value will be `None` for outbound channels until the counterparty accepts the channel.
29783  *
29784  * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
29785  */
29786 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29787
29788 /**
29789  * The value, in satoshis, that must always be held in the channel for us. This value ensures
29790  * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
29791  * this value on chain.
29792  *
29793  * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
29794  *
29795  * This value will be `None` for outbound channels until the counterparty accepts the channel.
29796  *
29797  * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
29798  */
29799 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
29800
29801 /**
29802  * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
29803  * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
29804  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
29805  * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
29806  * serialized with LDK versions prior to 0.0.113.
29807  *
29808  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
29809  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
29810  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
29811  */
29812 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29813
29814 /**
29815  * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
29816  * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
29817  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
29818  * `user_channel_id` will be randomized for an inbound channel.  This may be zero for objects
29819  * serialized with LDK versions prior to 0.0.113.
29820  *
29821  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
29822  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
29823  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
29824  */
29825 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
29826
29827 /**
29828  * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
29829  * which is applied to commitment and HTLC transactions.
29830  *
29831  * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
29832  */
29833 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29834
29835 /**
29836  * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
29837  * which is applied to commitment and HTLC transactions.
29838  *
29839  * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
29840  */
29841 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
29842
29843 /**
29844  * Our total balance.  This is the amount we would get if we close the channel.
29845  * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
29846  * amount is not likely to be recoverable on close.
29847  *
29848  * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
29849  * balance is not available for inclusion in new outbound HTLCs). This further does not include
29850  * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
29851  * This does not consider any on-chain fees.
29852  *
29853  * See also [`ChannelDetails::outbound_capacity_msat`]
29854  */
29855 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29856
29857 /**
29858  * Our total balance.  This is the amount we would get if we close the channel.
29859  * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
29860  * amount is not likely to be recoverable on close.
29861  *
29862  * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
29863  * balance is not available for inclusion in new outbound HTLCs). This further does not include
29864  * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
29865  * This does not consider any on-chain fees.
29866  *
29867  * See also [`ChannelDetails::outbound_capacity_msat`]
29868  */
29869 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
29870
29871 /**
29872  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
29873  * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
29874  * available for inclusion in new outbound HTLCs). This further does not include any pending
29875  * outgoing HTLCs which are awaiting some other resolution to be sent.
29876  *
29877  * See also [`ChannelDetails::balance_msat`]
29878  *
29879  * This value is not exact. Due to various in-flight changes, feerate changes, and our
29880  * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
29881  * should be able to spend nearly this amount.
29882  */
29883 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29884
29885 /**
29886  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
29887  * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
29888  * available for inclusion in new outbound HTLCs). This further does not include any pending
29889  * outgoing HTLCs which are awaiting some other resolution to be sent.
29890  *
29891  * See also [`ChannelDetails::balance_msat`]
29892  *
29893  * This value is not exact. Due to various in-flight changes, feerate changes, and our
29894  * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
29895  * should be able to spend nearly this amount.
29896  */
29897 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
29898
29899 /**
29900  * The available outbound capacity for sending a single HTLC to the remote peer. This is
29901  * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
29902  * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
29903  * to use a limit as close as possible to the HTLC limit we can currently send.
29904  *
29905  * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
29906  * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
29907  */
29908 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29909
29910 /**
29911  * The available outbound capacity for sending a single HTLC to the remote peer. This is
29912  * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
29913  * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
29914  * to use a limit as close as possible to the HTLC limit we can currently send.
29915  *
29916  * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
29917  * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
29918  */
29919 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
29920
29921 /**
29922  * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
29923  * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
29924  * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
29925  * route which is valid.
29926  */
29927 uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29928
29929 /**
29930  * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
29931  * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
29932  * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
29933  * route which is valid.
29934  */
29935 void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
29936
29937 /**
29938  * The available inbound capacity for the remote peer to send HTLCs to us. This does not
29939  * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
29940  * available for inclusion in new inbound HTLCs).
29941  * Note that there are some corner cases not fully handled here, so the actual available
29942  * inbound capacity may be slightly higher than this.
29943  *
29944  * This value is not exact. Due to various in-flight changes, feerate changes, and our
29945  * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
29946  * However, our counterparty should be able to spend nearly this amount.
29947  */
29948 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29949
29950 /**
29951  * The available inbound capacity for the remote peer to send HTLCs to us. This does not
29952  * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
29953  * available for inclusion in new inbound HTLCs).
29954  * Note that there are some corner cases not fully handled here, so the actual available
29955  * inbound capacity may be slightly higher than this.
29956  *
29957  * This value is not exact. Due to various in-flight changes, feerate changes, and our
29958  * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
29959  * However, our counterparty should be able to spend nearly this amount.
29960  */
29961 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
29962
29963 /**
29964  * The number of required confirmations on the funding transaction before the funding will be
29965  * considered \"locked\". This number is selected by the channel fundee (i.e. us if
29966  * [`is_outbound`] is *not* set), and can be selected for inbound channels with
29967  * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
29968  * [`ChannelHandshakeLimits::max_minimum_depth`].
29969  *
29970  * This value will be `None` for outbound channels until the counterparty accepts the channel.
29971  *
29972  * [`is_outbound`]: ChannelDetails::is_outbound
29973  * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
29974  * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
29975  */
29976 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29977
29978 /**
29979  * The number of required confirmations on the funding transaction before the funding will be
29980  * considered \"locked\". This number is selected by the channel fundee (i.e. us if
29981  * [`is_outbound`] is *not* set), and can be selected for inbound channels with
29982  * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
29983  * [`ChannelHandshakeLimits::max_minimum_depth`].
29984  *
29985  * This value will be `None` for outbound channels until the counterparty accepts the channel.
29986  *
29987  * [`is_outbound`]: ChannelDetails::is_outbound
29988  * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
29989  * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
29990  */
29991 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
29992
29993 /**
29994  * The current number of confirmations on the funding transaction.
29995  *
29996  * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
29997  */
29998 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
29999
30000 /**
30001  * The current number of confirmations on the funding transaction.
30002  *
30003  * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
30004  */
30005 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
30006
30007 /**
30008  * The number of blocks (after our commitment transaction confirms) that we will need to wait
30009  * until we can claim our funds after we force-close the channel. During this time our
30010  * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
30011  * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
30012  * time to claim our non-HTLC-encumbered funds.
30013  *
30014  * This value will be `None` for outbound channels until the counterparty accepts the channel.
30015  */
30016 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30017
30018 /**
30019  * The number of blocks (after our commitment transaction confirms) that we will need to wait
30020  * until we can claim our funds after we force-close the channel. During this time our
30021  * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
30022  * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
30023  * time to claim our non-HTLC-encumbered funds.
30024  *
30025  * This value will be `None` for outbound channels until the counterparty accepts the channel.
30026  */
30027 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
30028
30029 /**
30030  * True if the channel was initiated (and thus funded) by us.
30031  */
30032 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30033
30034 /**
30035  * True if the channel was initiated (and thus funded) by us.
30036  */
30037 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30038
30039 /**
30040  * True if the channel is confirmed, channel_ready messages have been exchanged, and the
30041  * channel is not currently being shut down. `channel_ready` message exchange implies the
30042  * required confirmation count has been reached (and we were connected to the peer at some
30043  * point after the funding transaction received enough confirmations). The required
30044  * confirmation count is provided in [`confirmations_required`].
30045  *
30046  * [`confirmations_required`]: ChannelDetails::confirmations_required
30047  */
30048 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30049
30050 /**
30051  * True if the channel is confirmed, channel_ready messages have been exchanged, and the
30052  * channel is not currently being shut down. `channel_ready` message exchange implies the
30053  * required confirmation count has been reached (and we were connected to the peer at some
30054  * point after the funding transaction received enough confirmations). The required
30055  * confirmation count is provided in [`confirmations_required`].
30056  *
30057  * [`confirmations_required`]: ChannelDetails::confirmations_required
30058  */
30059 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30060
30061 /**
30062  * The stage of the channel's shutdown.
30063  * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
30064  *
30065  * Returns a copy of the field.
30066  */
30067 struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30068
30069 /**
30070  * The stage of the channel's shutdown.
30071  * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
30072  */
30073 void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
30074
30075 /**
30076  * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
30077  * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
30078  *
30079  * This is a strict superset of `is_channel_ready`.
30080  */
30081 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30082
30083 /**
30084  * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
30085  * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
30086  *
30087  * This is a strict superset of `is_channel_ready`.
30088  */
30089 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30090
30091 /**
30092  * True if this channel is (or will be) publicly-announced.
30093  */
30094 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30095
30096 /**
30097  * True if this channel is (or will be) publicly-announced.
30098  */
30099 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
30100
30101 /**
30102  * The smallest value HTLC (in msat) we will accept, for this channel. This field
30103  * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
30104  */
30105 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30106
30107 /**
30108  * The smallest value HTLC (in msat) we will accept, for this channel. This field
30109  * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
30110  */
30111 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30112
30113 /**
30114  * The largest value HTLC (in msat) we currently will accept, for this channel.
30115  */
30116 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30117
30118 /**
30119  * The largest value HTLC (in msat) we currently will accept, for this channel.
30120  */
30121 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30122
30123 /**
30124  * Set of configurable parameters that affect channel operation.
30125  *
30126  * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
30127  *
30128  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30129  */
30130 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
30131
30132 /**
30133  * Set of configurable parameters that affect channel operation.
30134  *
30135  * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
30136  *
30137  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30138  */
30139 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
30140
30141 /**
30142  * Constructs a new ChannelDetails given each field
30143  *
30144  * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30145  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30146  * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
30147  */
30148 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, struct LDKU128 user_channel_id_arg, struct LDKCOption_u32Z feerate_sat_per_1000_weight_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t next_outbound_htlc_minimum_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u32Z confirmations_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, struct LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg, bool is_usable_arg, bool is_public_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg, struct LDKChannelConfig config_arg);
30149
30150 /**
30151  * Creates a copy of the ChannelDetails
30152  */
30153 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
30154
30155 /**
30156  * Gets the current SCID which should be used to identify this channel for inbound payments.
30157  * This should be used for providing invoice hints or in any other context where our
30158  * counterparty will forward a payment to us.
30159  *
30160  * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
30161  * [`ChannelDetails::short_channel_id`]. See those for more information.
30162  */
30163 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
30164
30165 /**
30166  * Gets the current SCID which should be used to identify this channel for outbound payments.
30167  * This should be used in [`Route`]s to describe the first hop or in other contexts where
30168  * we're sending or forwarding a payment outbound over this channel.
30169  *
30170  * This is either the [`ChannelDetails::short_channel_id`], if set, or the
30171  * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
30172  */
30173 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
30174
30175 /**
30176  * Creates a copy of the ChannelShutdownState
30177  */
30178 enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
30179
30180 /**
30181  * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
30182  */
30183 enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
30184
30185 /**
30186  * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
30187  */
30188 enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
30189
30190 /**
30191  * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
30192  */
30193 enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
30194
30195 /**
30196  * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
30197  */
30198 enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
30199
30200 /**
30201  * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
30202  */
30203 enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
30204
30205 /**
30206  * Checks if two ChannelShutdownStates contain equal inner contents.
30207  * This ignores pointers and is_owned flags and looks at the values in fields.
30208  */
30209 bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
30210
30211 /**
30212  * Frees any resources used by the RecentPaymentDetails
30213  */
30214 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
30215
30216 /**
30217  * Creates a copy of the RecentPaymentDetails
30218  */
30219 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
30220
30221 /**
30222  * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
30223  */
30224 struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
30225
30226 /**
30227  * Utility method to constructs a new Pending-variant RecentPaymentDetails
30228  */
30229 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
30230
30231 /**
30232  * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
30233  */
30234 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
30235
30236 /**
30237  * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
30238  */
30239 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
30240
30241 /**
30242  * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
30243  */
30244 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
30245
30246 /**
30247  * The list of channels to be included in the invoice route hints.
30248  */
30249 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
30250
30251 /**
30252  * The list of channels to be included in the invoice route hints.
30253  */
30254 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
30255
30256 /**
30257  * A fake scid used for representing the phantom node's fake channel in generating the invoice
30258  * route hints.
30259  */
30260 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
30261
30262 /**
30263  * A fake scid used for representing the phantom node's fake channel in generating the invoice
30264  * route hints.
30265  */
30266 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
30267
30268 /**
30269  * The pubkey of the real backing node that would ultimately receive the payment.
30270  */
30271 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
30272
30273 /**
30274  * The pubkey of the real backing node that would ultimately receive the payment.
30275  */
30276 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30277
30278 /**
30279  * Constructs a new PhantomRouteHints given each field
30280  */
30281 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
30282
30283 /**
30284  * Creates a copy of the PhantomRouteHints
30285  */
30286 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
30287
30288 /**
30289  * Constructs a new `ChannelManager` to hold several channels and route between them.
30290  *
30291  * The current time or latest block header time can be provided as the `current_timestamp`.
30292  *
30293  * This is the main \"logic hub\" for all channel-related actions, and implements
30294  * [`ChannelMessageHandler`].
30295  *
30296  * Non-proportional fees are fixed according to our risk using the provided fee estimator.
30297  *
30298  * Users need to notify the new `ChannelManager` when a new block is connected or
30299  * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
30300  * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
30301  * more details.
30302  *
30303  * [`block_connected`]: chain::Listen::block_connected
30304  * [`block_disconnected`]: chain::Listen::block_disconnected
30305  * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
30306  */
30307 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);
30308
30309 /**
30310  * Gets the current configuration applied to all new channels.
30311  */
30312 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
30313
30314 /**
30315  * Creates a new outbound channel to the given remote node and with the given value.
30316  *
30317  * `user_channel_id` will be provided back as in
30318  * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
30319  * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
30320  * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
30321  * is simply copied to events and otherwise ignored.
30322  *
30323  * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
30324  * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
30325  *
30326  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
30327  * generate a shutdown scriptpubkey or destination script set by
30328  * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
30329  *
30330  * Note that we do not check if you are currently connected to the given peer. If no
30331  * connection is available, the outbound `open_channel` message may fail to send, resulting in
30332  * the channel eventually being silently forgotten (dropped on reload).
30333  *
30334  * Returns the new Channel's temporary `channel_id`. This ID will appear as
30335  * [`Event::FundingGenerationReady::temporary_channel_id`] and in
30336  * [`ChannelDetails::channel_id`] until after
30337  * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
30338  * one derived from the funding transaction's TXID. If the counterparty rejects the channel
30339  * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
30340  *
30341  * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
30342  * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
30343  * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
30344  *
30345  * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
30346  */
30347 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, struct LDKU128 user_channel_id, struct LDKUserConfig override_config);
30348
30349 /**
30350  * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
30351  * more information.
30352  */
30353 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
30354
30355 /**
30356  * Gets the list of usable channels, in random order. Useful as an argument to
30357  * [`Router::find_route`] to ensure non-announced channels are used.
30358  *
30359  * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
30360  * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
30361  * are.
30362  */
30363 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
30364
30365 /**
30366  * Gets the list of channels we have with a given counterparty, in random order.
30367  */
30368 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
30369
30370 /**
30371  * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
30372  * successful path, or have unresolved HTLCs.
30373  *
30374  * This can be useful for payments that may have been prepared, but ultimately not sent, as a
30375  * result of a crash. If such a payment exists, is not listed here, and an
30376  * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
30377  *
30378  * [`Event::PaymentSent`]: events::Event::PaymentSent
30379  */
30380 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
30381
30382 /**
30383  * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
30384  * will be accepted on the given channel, and after additional timeout/the closing of all
30385  * pending HTLCs, the channel will be closed on chain.
30386  *
30387  *  * If we are the channel initiator, we will pay between our [`Background`] and
30388  *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
30389  *    estimate.
30390  *  * If our counterparty is the channel initiator, we will require a channel closing
30391  *    transaction feerate of at least our [`Background`] feerate or the feerate which
30392  *    would appear on a force-closure transaction, whichever is lower. We will allow our
30393  *    counterparty to pay as much fee as they'd like, however.
30394  *
30395  * May generate a [`SendShutdown`] message event on success, which should be relayed.
30396  *
30397  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
30398  * generate a shutdown scriptpubkey or destination script set by
30399  * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
30400  * channel.
30401  *
30402  * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
30403  * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
30404  * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
30405  * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
30406  */
30407 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
30408
30409 /**
30410  * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
30411  * will be accepted on the given channel, and after additional timeout/the closing of all
30412  * pending HTLCs, the channel will be closed on chain.
30413  *
30414  * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
30415  * the channel being closed or not:
30416  *  * If we are the channel initiator, we will pay at least this feerate on the closing
30417  *    transaction. The upper-bound is set by
30418  *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
30419  *    estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
30420  *  * If our counterparty is the channel initiator, we will refuse to accept a channel closure
30421  *    transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
30422  *    will appear on a force-closure transaction, whichever is lower).
30423  *
30424  * The `shutdown_script` provided  will be used as the `scriptPubKey` for the closing transaction.
30425  * Will fail if a shutdown script has already been set for this channel by
30426  * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
30427  * also be compatible with our and the counterparty's features.
30428  *
30429  * May generate a [`SendShutdown`] message event on success, which should be relayed.
30430  *
30431  * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
30432  * generate a shutdown scriptpubkey or destination script set by
30433  * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
30434  * channel.
30435  *
30436  * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
30437  * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
30438  * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
30439  * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
30440  *
30441  * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
30442  */
30443 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script);
30444
30445 /**
30446  * Force closes a channel, immediately broadcasting the latest local transaction(s) and
30447  * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
30448  * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
30449  * channel.
30450  */
30451 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
30452
30453 /**
30454  * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
30455  * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
30456  * `counterparty_node_id` isn't the counterparty of the corresponding channel.
30457  *
30458  * You can always get the latest local transaction(s) to broadcast from
30459  * [`ChannelMonitor::get_latest_holder_commitment_txn`].
30460  */
30461 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
30462
30463 /**
30464  * Force close all channels, immediately broadcasting the latest local commitment transaction
30465  * for each to the chain and rejecting new HTLCs on each.
30466  */
30467 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
30468
30469 /**
30470  * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
30471  * local transaction(s).
30472  */
30473 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
30474
30475 /**
30476  * Sends a payment along a given route.
30477  *
30478  * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
30479  * fields for more info.
30480  *
30481  * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
30482  * [`PeerManager::process_events`]).
30483  *
30484  * # Avoiding Duplicate Payments
30485  *
30486  * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
30487  * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
30488  * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
30489  * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
30490  * second payment with the same [`PaymentId`].
30491  *
30492  * Thus, in order to ensure duplicate payments are not sent, you should implement your own
30493  * tracking of payments, including state to indicate once a payment has completed. Because you
30494  * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
30495  * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
30496  * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
30497  *
30498  * Additionally, in the scenario where we begin the process of sending a payment, but crash
30499  * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
30500  * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
30501  * [`ChannelManager::list_recent_payments`] for more information.
30502  *
30503  * # Possible Error States on [`PaymentSendFailure`]
30504  *
30505  * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
30506  * each entry matching the corresponding-index entry in the route paths, see
30507  * [`PaymentSendFailure`] for more info.
30508  *
30509  * In general, a path may raise:
30510  *  * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
30511  *    node public key) is specified.
30512  *  * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
30513  *    closed, doesn't exist, or the peer is currently disconnected.
30514  *  * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
30515  *    relevant updates.
30516  *
30517  * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
30518  * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
30519  * different route unless you intend to pay twice!
30520  *
30521  * [`RouteHop`]: crate::routing::router::RouteHop
30522  * [`Event::PaymentSent`]: events::Event::PaymentSent
30523  * [`Event::PaymentFailed`]: events::Event::PaymentFailed
30524  * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
30525  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
30526  * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
30527  */
30528 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);
30529
30530 /**
30531  * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
30532  * `route_params` and retry failed payment paths based on `retry_strategy`.
30533  */
30534 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);
30535
30536 /**
30537  * Signals that no further attempts for the given payment should occur. Useful if you have a
30538  * pending outbound payment with retries remaining, but wish to stop retrying the payment before
30539  * retries are exhausted.
30540  *
30541  * # Event Generation
30542  *
30543  * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
30544  * as there are no remaining pending HTLCs for this payment.
30545  *
30546  * Note that calling this method does *not* prevent a payment from succeeding. You must still
30547  * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
30548  * determine the ultimate status of a payment.
30549  *
30550  * # Restart Behavior
30551  *
30552  * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
30553  * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated.
30554  */
30555 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
30556
30557 /**
30558  * Send a spontaneous payment, which is a payment that does not require the recipient to have
30559  * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
30560  * the preimage, it must be a cryptographically secure random value that no intermediate node
30561  * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
30562  * never reach the recipient.
30563  *
30564  * See [`send_payment`] documentation for more details on the return value of this function
30565  * and idempotency guarantees provided by the [`PaymentId`] key.
30566  *
30567  * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
30568  * [`send_payment`] for more information about the risks of duplicate preimage usage.
30569  *
30570  * [`send_payment`]: Self::send_payment
30571  */
30572 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);
30573
30574 /**
30575  * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
30576  * based on `route_params` and retry failed payment paths based on `retry_strategy`.
30577  *
30578  * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
30579  * payments.
30580  *
30581  * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
30582  */
30583 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);
30584
30585 /**
30586  * Send a payment that is probing the given route for liquidity. We calculate the
30587  * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
30588  * us to easily discern them from real payments.
30589  */
30590 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
30591
30592 /**
30593  * Sends payment probes over all paths of a route that would be used to pay the given
30594  * amount to the given `node_id`.
30595  *
30596  * See [`ChannelManager::send_preflight_probes`] for more information.
30597  */
30598 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);
30599
30600 /**
30601  * Sends payment probes over all paths of a route that would be used to pay a route found
30602  * according to the given [`RouteParameters`].
30603  *
30604  * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
30605  * the actual payment. Note this is only useful if there likely is sufficient time for the
30606  * probe to settle before sending out the actual payment, e.g., when waiting for user
30607  * confirmation in a wallet UI.
30608  *
30609  * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
30610  * actual payment. Users should therefore be cautious and might avoid sending probes if
30611  * liquidity is scarce and/or they don't expect the probe to return before they send the
30612  * payment. To mitigate this issue, channels with available liquidity less than the required
30613  * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
30614  * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
30615  */
30616 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);
30617
30618 /**
30619  * Call this upon creation of a funding transaction for the given channel.
30620  *
30621  * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
30622  * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
30623  *
30624  * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
30625  * across the p2p network.
30626  *
30627  * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
30628  * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
30629  *
30630  * May panic if the output found in the funding transaction is duplicative with some other
30631  * channel (note that this should be trivially prevented by using unique funding transaction
30632  * keys per-channel).
30633  *
30634  * Do NOT broadcast the funding transaction yourself. When we have safely received our
30635  * counterparty's signature the funding transaction will automatically be broadcast via the
30636  * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
30637  *
30638  * Note that this includes RBF or similar transaction replacement strategies - lightning does
30639  * not currently support replacing a funding transaction on an existing channel. Instead,
30640  * create a new channel with a conflicting funding transaction.
30641  *
30642  * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
30643  * the wallet software generating the funding transaction to apply anti-fee sniping as
30644  * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
30645  * for more details.
30646  *
30647  * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
30648  * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
30649  */
30650 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction);
30651
30652 /**
30653  * Call this upon creation of a batch funding transaction for the given channels.
30654  *
30655  * Return values are identical to [`Self::funding_transaction_generated`], respective to
30656  * each individual channel and transaction output.
30657  *
30658  * Do NOT broadcast the funding transaction yourself. This batch funding transcaction
30659  * will only be broadcast when we have safely received and persisted the counterparty's
30660  * signature for each channel.
30661  *
30662  * If there is an error, all channels in the batch are to be considered closed.
30663  */
30664 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_batch_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ temporary_channels, struct LDKTransaction funding_transaction);
30665
30666 /**
30667  * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
30668  *
30669  * Once the updates are applied, each eligible channel (advertised with a known short channel
30670  * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
30671  * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
30672  * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
30673  *
30674  * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
30675  * `counterparty_node_id` is provided.
30676  *
30677  * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
30678  * below [`MIN_CLTV_EXPIRY_DELTA`].
30679  *
30680  * If an error is returned, none of the updates should be considered applied.
30681  *
30682  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
30683  * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
30684  * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
30685  * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
30686  * [`ChannelUpdate`]: msgs::ChannelUpdate
30687  * [`ChannelUnavailable`]: APIError::ChannelUnavailable
30688  * [`APIMisuseError`]: APIError::APIMisuseError
30689  */
30690 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_partial_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update);
30691
30692 /**
30693  * Atomically updates the [`ChannelConfig`] for the given channels.
30694  *
30695  * Once the updates are applied, each eligible channel (advertised with a known short channel
30696  * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
30697  * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
30698  * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
30699  *
30700  * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
30701  * `counterparty_node_id` is provided.
30702  *
30703  * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
30704  * below [`MIN_CLTV_EXPIRY_DELTA`].
30705  *
30706  * If an error is returned, none of the updates should be considered applied.
30707  *
30708  * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
30709  * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
30710  * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
30711  * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
30712  * [`ChannelUpdate`]: msgs::ChannelUpdate
30713  * [`ChannelUnavailable`]: APIError::ChannelUnavailable
30714  * [`APIMisuseError`]: APIError::APIMisuseError
30715  */
30716 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config);
30717
30718 /**
30719  * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
30720  * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
30721  *
30722  * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
30723  * channel to a receiving node if the node lacks sufficient inbound liquidity.
30724  *
30725  * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
30726  * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
30727  * receiver's invoice route hints. These route hints will signal to LDK to generate an
30728  * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
30729  * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
30730  *
30731  * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
30732  * you from forwarding more than you received. See
30733  * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
30734  * than expected.
30735  *
30736  * Errors if the event was not handled in time, in which case the HTLC was automatically failed
30737  * backwards.
30738  *
30739  * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
30740  * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
30741  * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
30742  */
30743 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const uint8_t (*next_hop_channel_id)[32], struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat);
30744
30745 /**
30746  * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
30747  * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
30748  *
30749  * Errors if the event was not handled in time, in which case the HTLC was automatically failed
30750  * backwards.
30751  *
30752  * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
30753  */
30754 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
30755
30756 /**
30757  * Processes HTLCs which are pending waiting on random forward delay.
30758  *
30759  * Should only really ever be called in response to a PendingHTLCsForwardable event.
30760  * Will likely generate further events.
30761  */
30762 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
30763
30764 /**
30765  * Performs actions which should happen on startup and roughly once per minute thereafter.
30766  *
30767  * This currently includes:
30768  *  * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
30769  *  * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
30770  *    than a minute, informing the network that they should no longer attempt to route over
30771  *    the channel.
30772  *  * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
30773  *    with the current [`ChannelConfig`].
30774  *  * Removing peers which have disconnected but and no longer have any channels.
30775  *  * Force-closing and removing channels which have not completed establishment in a timely manner.
30776  *
30777  * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
30778  * estimate fetches.
30779  *
30780  * [`ChannelUpdate`]: msgs::ChannelUpdate
30781  * [`ChannelConfig`]: crate::util::config::ChannelConfig
30782  */
30783 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
30784
30785 /**
30786  * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
30787  * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
30788  * along the path (including in our own channel on which we received it).
30789  *
30790  * Note that in some cases around unclean shutdown, it is possible the payment may have
30791  * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
30792  * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
30793  * may have already been failed automatically by LDK if it was nearing its expiration time.
30794  *
30795  * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
30796  * [`ChannelManager::claim_funds`]), you should still monitor for
30797  * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
30798  * startup during which time claims that were in-progress at shutdown may be replayed.
30799  */
30800 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
30801
30802 /**
30803  * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
30804  * reason for the failure.
30805  *
30806  * See [`FailureCode`] for valid failure codes.
30807  */
30808 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
30809
30810 /**
30811  * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
30812  * [`MessageSendEvent`]s needed to claim the payment.
30813  *
30814  * This method is guaranteed to ensure the payment has been claimed but only if the current
30815  * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
30816  * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
30817  * successful. It will generally be available in the next [`process_pending_events`] call.
30818  *
30819  * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
30820  * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
30821  * event matches your expectation. If you fail to do so and call this method, you may provide
30822  * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
30823  *
30824  * This function will fail the payment if it has custom TLVs with even type numbers, as we
30825  * will assume they are unknown. If you intend to accept even custom TLVs, you should use
30826  * [`claim_funds_with_known_custom_tlvs`].
30827  *
30828  * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
30829  * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
30830  * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
30831  * [`process_pending_events`]: EventsProvider::process_pending_events
30832  * [`create_inbound_payment`]: Self::create_inbound_payment
30833  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
30834  * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
30835  */
30836 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
30837
30838 /**
30839  * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
30840  * even type numbers.
30841  *
30842  * # Note
30843  *
30844  * You MUST check you've understood all even TLVs before using this to
30845  * claim, otherwise you may unintentionally agree to some protocol you do not understand.
30846  *
30847  * [`claim_funds`]: Self::claim_funds
30848  */
30849 void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
30850
30851 /**
30852  * Gets the node_id held by this ChannelManager
30853  */
30854 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
30855
30856 /**
30857  * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
30858  *
30859  * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
30860  * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
30861  * the channel.
30862  *
30863  * The `user_channel_id` parameter will be provided back in
30864  * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
30865  * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
30866  *
30867  * Note that this method will return an error and reject the channel, if it requires support
30868  * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
30869  * used to accept such channels.
30870  *
30871  * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
30872  * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
30873  */
30874 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
30875
30876 /**
30877  * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
30878  * it as confirmed immediately.
30879  *
30880  * The `user_channel_id` parameter will be provided back in
30881  * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
30882  * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
30883  *
30884  * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
30885  * and (if the counterparty agrees), enables forwarding of payments immediately.
30886  *
30887  * This fully trusts that the counterparty has honestly and correctly constructed the funding
30888  * transaction and blindly assumes that it will eventually confirm.
30889  *
30890  * If it does not confirm before we decide to close the channel, or if the funding transaction
30891  * does not pay to the correct script the correct amount, *you will lose funds*.
30892  *
30893  * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
30894  * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
30895  */
30896 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
30897
30898 /**
30899  * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
30900  * to pay us.
30901  *
30902  * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
30903  * [`PaymentHash`] and [`PaymentPreimage`] for you.
30904  *
30905  * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
30906  * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with
30907  * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be
30908  * passed directly to [`claim_funds`].
30909  *
30910  * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
30911  *
30912  * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
30913  * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
30914  *
30915  * # Note
30916  *
30917  * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
30918  * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
30919  *
30920  * Errors if `min_value_msat` is greater than total bitcoin supply.
30921  *
30922  * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
30923  * on versions of LDK prior to 0.0.114.
30924  *
30925  * [`claim_funds`]: Self::claim_funds
30926  * [`PaymentClaimable`]: events::Event::PaymentClaimable
30927  * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
30928  * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment
30929  * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage
30930  * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
30931  */
30932 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);
30933
30934 /**
30935  * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
30936  * stored external to LDK.
30937  *
30938  * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
30939  * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
30940  * the `min_value_msat` provided here, if one is provided.
30941  *
30942  * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
30943  * note that LDK will not stop you from registering duplicate payment hashes for inbound
30944  * payments.
30945  *
30946  * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
30947  * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
30948  * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
30949  * sender \"proof-of-payment\" unless they have paid the required amount.
30950  *
30951  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
30952  * in excess of the current time. This should roughly match the expiry time set in the invoice.
30953  * After this many seconds, we will remove the inbound payment, resulting in any attempts to
30954  * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
30955  * invoices when no timeout is set.
30956  *
30957  * Note that we use block header time to time-out pending inbound payments (with some margin
30958  * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
30959  * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
30960  * If you need exact expiry semantics, you should enforce them upon receipt of
30961  * [`PaymentClaimable`].
30962  *
30963  * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
30964  * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
30965  *
30966  * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
30967  * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
30968  *
30969  * # Note
30970  *
30971  * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
30972  * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
30973  *
30974  * Errors if `min_value_msat` is greater than total bitcoin supply.
30975  *
30976  * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
30977  * on versions of LDK prior to 0.0.114.
30978  *
30979  * [`create_inbound_payment`]: Self::create_inbound_payment
30980  * [`PaymentClaimable`]: events::Event::PaymentClaimable
30981  */
30982 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);
30983
30984 /**
30985  * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
30986  * previously returned from [`create_inbound_payment`].
30987  *
30988  * [`create_inbound_payment`]: Self::create_inbound_payment
30989  */
30990 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);
30991
30992 /**
30993  * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
30994  * are used when constructing the phantom invoice's route hints.
30995  *
30996  * [phantom node payments]: crate::sign::PhantomKeysManager
30997  */
30998 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
30999
31000 /**
31001  * Gets route hints for use in receiving [phantom node payments].
31002  *
31003  * [phantom node payments]: crate::sign::PhantomKeysManager
31004  */
31005 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
31006
31007 /**
31008  * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
31009  * used when constructing the route hints for HTLCs intended to be intercepted. See
31010  * [`ChannelManager::forward_intercepted_htlc`].
31011  *
31012  * Note that this method is not guaranteed to return unique values, you may need to call it a few
31013  * times to get a unique scid.
31014  */
31015 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
31016
31017 /**
31018  * Gets inflight HTLC information by processing pending outbound payments that are in
31019  * our channels. May be used during pathfinding to account for in-use channel liquidity.
31020  */
31021 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
31022
31023 /**
31024  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
31025  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
31026  */
31027 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
31028
31029 /**
31030  * Constructs a new EventsProvider which calls the relevant methods on this_arg.
31031  * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
31032  */
31033 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
31034
31035 /**
31036  * Constructs a new Listen which calls the relevant methods on this_arg.
31037  * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
31038  */
31039 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
31040
31041 /**
31042  * Constructs a new Confirm which calls the relevant methods on this_arg.
31043  * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
31044  */
31045 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
31046
31047 /**
31048  * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
31049  * may have events that need processing.
31050  *
31051  * In order to check if this [`ChannelManager`] needs persisting, call
31052  * [`Self::get_and_clear_needs_persistence`].
31053  *
31054  * Note that callbacks registered on the [`Future`] MUST NOT call back into this
31055  * [`ChannelManager`] and should instead register actions to be taken later.
31056  */
31057 MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
31058
31059 /**
31060  * Returns true if this [`ChannelManager`] needs to be persisted.
31061  */
31062 MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
31063
31064 /**
31065  * Gets the latest best block which was connected either via the [`chain::Listen`] or
31066  * [`chain::Confirm`] interfaces.
31067  */
31068 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
31069
31070 /**
31071  * Fetches the set of [`NodeFeatures`] flags which are provided by or required by
31072  * [`ChannelManager`].
31073  */
31074 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31075
31076 /**
31077  * Fetches the set of [`ChannelFeatures`] flags which are provided by or required by
31078  * [`ChannelManager`].
31079  */
31080 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31081
31082 /**
31083  * Fetches the set of [`ChannelTypeFeatures`] flags which are provided by or required by
31084  * [`ChannelManager`].
31085  */
31086 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31087
31088 /**
31089  * Fetches the set of [`InitFeatures`] flags which are provided by or required by
31090  * [`ChannelManager`].
31091  */
31092 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
31093
31094 /**
31095  * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
31096  * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
31097  */
31098 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
31099
31100 /**
31101  * Fetches the set of [`InitFeatures`] flags which are provided by or required by
31102  * [`ChannelManager`].
31103  */
31104 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
31105
31106 /**
31107  * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
31108  */
31109 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
31110
31111 /**
31112  * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
31113  */
31114 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
31115
31116 /**
31117  * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
31118  */
31119 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
31120
31121 /**
31122  * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
31123  */
31124 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
31125
31126 /**
31127  * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
31128  */
31129 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
31130
31131 /**
31132  * Read a ChannelDetails from a byte array, created by ChannelDetails_write
31133  */
31134 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
31135
31136 /**
31137  * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
31138  */
31139 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
31140
31141 /**
31142  * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
31143  */
31144 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
31145
31146 /**
31147  * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
31148  */
31149 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
31150
31151 /**
31152  * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
31153  */
31154 struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
31155
31156 /**
31157  * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
31158  */
31159 struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
31160
31161 /**
31162  * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
31163  */
31164 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
31165
31166 /**
31167  * A cryptographically secure source of entropy.
31168  */
31169 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31170
31171 /**
31172  * A cryptographically secure source of entropy.
31173  */
31174 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
31175
31176 /**
31177  * A signer that is able to perform node-scoped cryptographic operations.
31178  */
31179 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31180
31181 /**
31182  * A signer that is able to perform node-scoped cryptographic operations.
31183  */
31184 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
31185
31186 /**
31187  * The keys provider which will give us relevant keys. Some keys will be loaded during
31188  * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
31189  * signing data.
31190  */
31191 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31192
31193 /**
31194  * The keys provider which will give us relevant keys. Some keys will be loaded during
31195  * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
31196  * signing data.
31197  */
31198 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
31199
31200 /**
31201  * The fee_estimator for use in the ChannelManager in the future.
31202  *
31203  * No calls to the FeeEstimator will be made during deserialization.
31204  */
31205 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31206
31207 /**
31208  * The fee_estimator for use in the ChannelManager in the future.
31209  *
31210  * No calls to the FeeEstimator will be made during deserialization.
31211  */
31212 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
31213
31214 /**
31215  * The chain::Watch for use in the ChannelManager in the future.
31216  *
31217  * No calls to the chain::Watch will be made during deserialization. It is assumed that
31218  * you have deserialized ChannelMonitors separately and will add them to your
31219  * chain::Watch after deserializing this ChannelManager.
31220  */
31221 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31222
31223 /**
31224  * The chain::Watch for use in the ChannelManager in the future.
31225  *
31226  * No calls to the chain::Watch will be made during deserialization. It is assumed that
31227  * you have deserialized ChannelMonitors separately and will add them to your
31228  * chain::Watch after deserializing this ChannelManager.
31229  */
31230 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
31231
31232 /**
31233  * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
31234  * used to broadcast the latest local commitment transactions of channels which must be
31235  * force-closed during deserialization.
31236  */
31237 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31238
31239 /**
31240  * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
31241  * used to broadcast the latest local commitment transactions of channels which must be
31242  * force-closed during deserialization.
31243  */
31244 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
31245
31246 /**
31247  * The router which will be used in the ChannelManager in the future for finding routes
31248  * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
31249  *
31250  * No calls to the router will be made during deserialization.
31251  */
31252 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31253
31254 /**
31255  * The router which will be used in the ChannelManager in the future for finding routes
31256  * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
31257  *
31258  * No calls to the router will be made during deserialization.
31259  */
31260 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
31261
31262 /**
31263  * The Logger for use in the ChannelManager and which may be used to log information during
31264  * deserialization.
31265  */
31266 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31267
31268 /**
31269  * The Logger for use in the ChannelManager and which may be used to log information during
31270  * deserialization.
31271  */
31272 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
31273
31274 /**
31275  * Default settings used for new channels. Any existing channels will continue to use the
31276  * runtime settings which were stored when the ChannelManager was serialized.
31277  */
31278 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
31279
31280 /**
31281  * Default settings used for new channels. Any existing channels will continue to use the
31282  * runtime settings which were stored when the ChannelManager was serialized.
31283  */
31284 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
31285
31286 /**
31287  * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
31288  * HashMap for you. This is primarily useful for C bindings where it is not practical to
31289  * populate a HashMap directly from C.
31290  */
31291 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);
31292
31293 /**
31294  * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
31295  */
31296 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
31297
31298 /**
31299  * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
31300  */
31301 void ExpandedKey_free(struct LDKExpandedKey this_obj);
31302
31303 /**
31304  * Create a  new [`ExpandedKey`] for generating an inbound payment hash and secret.
31305  *
31306  * It is recommended to cache this value and not regenerate it for each new inbound payment.
31307  */
31308 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
31309
31310 /**
31311  * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
31312  * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
31313  * a `ChannelManager`.
31314  *
31315  * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
31316  * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
31317  * regenerate it for each new inbound payment.
31318  *
31319  * `current_time` is a Unix timestamp representing the current time.
31320  *
31321  * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
31322  * on versions of LDK prior to 0.0.114.
31323  *
31324  * [phantom node payments]: crate::sign::PhantomKeysManager
31325  * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
31326  */
31327 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);
31328
31329 /**
31330  * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
31331  * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
31332  * without a `ChannelManager`.
31333  *
31334  * See [`create`] for information on the `keys` and `current_time` parameters.
31335  *
31336  * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
31337  * on versions of LDK prior to 0.0.114.
31338  *
31339  * [phantom node payments]: crate::sign::PhantomKeysManager
31340  */
31341 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);
31342
31343 /**
31344  * Frees any resources used by the DecodeError
31345  */
31346 void DecodeError_free(struct LDKDecodeError this_ptr);
31347
31348 /**
31349  * Creates a copy of the DecodeError
31350  */
31351 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
31352
31353 /**
31354  * Utility method to constructs a new UnknownVersion-variant DecodeError
31355  */
31356 struct LDKDecodeError DecodeError_unknown_version(void);
31357
31358 /**
31359  * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
31360  */
31361 struct LDKDecodeError DecodeError_unknown_required_feature(void);
31362
31363 /**
31364  * Utility method to constructs a new InvalidValue-variant DecodeError
31365  */
31366 struct LDKDecodeError DecodeError_invalid_value(void);
31367
31368 /**
31369  * Utility method to constructs a new ShortRead-variant DecodeError
31370  */
31371 struct LDKDecodeError DecodeError_short_read(void);
31372
31373 /**
31374  * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
31375  */
31376 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
31377
31378 /**
31379  * Utility method to constructs a new Io-variant DecodeError
31380  */
31381 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
31382
31383 /**
31384  * Utility method to constructs a new UnsupportedCompression-variant DecodeError
31385  */
31386 struct LDKDecodeError DecodeError_unsupported_compression(void);
31387
31388 /**
31389  * Checks if two DecodeErrors contain equal inner contents.
31390  * This ignores pointers and is_owned flags and looks at the values in fields.
31391  */
31392 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
31393
31394 /**
31395  * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
31396  */
31397 void Init_free(struct LDKInit this_obj);
31398
31399 /**
31400  * The relevant features which the sender supports.
31401  */
31402 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
31403
31404 /**
31405  * The relevant features which the sender supports.
31406  */
31407 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
31408
31409 /**
31410  * Indicates chains the sender is interested in.
31411  *
31412  * If there are no common chains, the connection will be closed.
31413  *
31414  * Returns a copy of the field.
31415  */
31416 struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
31417
31418 /**
31419  * Indicates chains the sender is interested in.
31420  *
31421  * If there are no common chains, the connection will be closed.
31422  */
31423 void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
31424
31425 /**
31426  * The receipient's network address.
31427  *
31428  * This adds the option to report a remote IP address back to a connecting peer using the init
31429  * message. A node can decide to use that information to discover a potential update to its
31430  * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
31431  * the new address.
31432  */
31433 struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
31434
31435 /**
31436  * The receipient's network address.
31437  *
31438  * This adds the option to report a remote IP address back to a connecting peer using the init
31439  * message. A node can decide to use that information to discover a potential update to its
31440  * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
31441  * the new address.
31442  */
31443 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
31444
31445 /**
31446  * Constructs a new Init given each field
31447  */
31448 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
31449
31450 /**
31451  * Creates a copy of the Init
31452  */
31453 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
31454
31455 /**
31456  * Checks if two Inits contain equal inner contents.
31457  * This ignores pointers and is_owned flags and looks at the values in fields.
31458  * Two objects with NULL inner values will be considered "equal" here.
31459  */
31460 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
31461
31462 /**
31463  * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
31464  */
31465 void ErrorMessage_free(struct LDKErrorMessage this_obj);
31466
31467 /**
31468  * The channel ID involved in the error.
31469  *
31470  * All-0s indicates a general error unrelated to a specific channel, after which all channels
31471  * with the sending peer should be closed.
31472  */
31473 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
31474
31475 /**
31476  * The channel ID involved in the error.
31477  *
31478  * All-0s indicates a general error unrelated to a specific channel, after which all channels
31479  * with the sending peer should be closed.
31480  */
31481 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31482
31483 /**
31484  * A possibly human-readable error description.
31485  *
31486  * The string should be sanitized before it is used (e.g., emitted to logs or printed to
31487  * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
31488  * the terminal emulator or the logging subsystem.
31489  */
31490 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
31491
31492 /**
31493  * A possibly human-readable error description.
31494  *
31495  * The string should be sanitized before it is used (e.g., emitted to logs or printed to
31496  * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
31497  * the terminal emulator or the logging subsystem.
31498  */
31499 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
31500
31501 /**
31502  * Constructs a new ErrorMessage given each field
31503  */
31504 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
31505
31506 /**
31507  * Creates a copy of the ErrorMessage
31508  */
31509 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
31510
31511 /**
31512  * Checks if two ErrorMessages contain equal inner contents.
31513  * This ignores pointers and is_owned flags and looks at the values in fields.
31514  * Two objects with NULL inner values will be considered "equal" here.
31515  */
31516 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
31517
31518 /**
31519  * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
31520  */
31521 void WarningMessage_free(struct LDKWarningMessage this_obj);
31522
31523 /**
31524  * The channel ID involved in the warning.
31525  *
31526  * All-0s indicates a warning unrelated to a specific channel.
31527  */
31528 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
31529
31530 /**
31531  * The channel ID involved in the warning.
31532  *
31533  * All-0s indicates a warning unrelated to a specific channel.
31534  */
31535 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31536
31537 /**
31538  * A possibly human-readable warning description.
31539  *
31540  * The string should be sanitized before it is used (e.g. emitted to logs or printed to
31541  * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
31542  * the terminal emulator or the logging subsystem.
31543  */
31544 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
31545
31546 /**
31547  * A possibly human-readable warning description.
31548  *
31549  * The string should be sanitized before it is used (e.g. emitted to logs or printed to
31550  * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
31551  * the terminal emulator or the logging subsystem.
31552  */
31553 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
31554
31555 /**
31556  * Constructs a new WarningMessage given each field
31557  */
31558 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
31559
31560 /**
31561  * Creates a copy of the WarningMessage
31562  */
31563 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
31564
31565 /**
31566  * Checks if two WarningMessages contain equal inner contents.
31567  * This ignores pointers and is_owned flags and looks at the values in fields.
31568  * Two objects with NULL inner values will be considered "equal" here.
31569  */
31570 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
31571
31572 /**
31573  * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
31574  */
31575 void Ping_free(struct LDKPing this_obj);
31576
31577 /**
31578  * The desired response length.
31579  */
31580 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
31581
31582 /**
31583  * The desired response length.
31584  */
31585 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
31586
31587 /**
31588  * The ping packet size.
31589  *
31590  * This field is not sent on the wire. byteslen zeros are sent.
31591  */
31592 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
31593
31594 /**
31595  * The ping packet size.
31596  *
31597  * This field is not sent on the wire. byteslen zeros are sent.
31598  */
31599 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
31600
31601 /**
31602  * Constructs a new Ping given each field
31603  */
31604 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
31605
31606 /**
31607  * Creates a copy of the Ping
31608  */
31609 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
31610
31611 /**
31612  * Checks if two Pings contain equal inner contents.
31613  * This ignores pointers and is_owned flags and looks at the values in fields.
31614  * Two objects with NULL inner values will be considered "equal" here.
31615  */
31616 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
31617
31618 /**
31619  * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
31620  */
31621 void Pong_free(struct LDKPong this_obj);
31622
31623 /**
31624  * The pong packet size.
31625  *
31626  * This field is not sent on the wire. byteslen zeros are sent.
31627  */
31628 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
31629
31630 /**
31631  * The pong packet size.
31632  *
31633  * This field is not sent on the wire. byteslen zeros are sent.
31634  */
31635 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
31636
31637 /**
31638  * Constructs a new Pong given each field
31639  */
31640 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
31641
31642 /**
31643  * Creates a copy of the Pong
31644  */
31645 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
31646
31647 /**
31648  * Checks if two Pongs contain equal inner contents.
31649  * This ignores pointers and is_owned flags and looks at the values in fields.
31650  * Two objects with NULL inner values will be considered "equal" here.
31651  */
31652 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
31653
31654 /**
31655  * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
31656  */
31657 void OpenChannel_free(struct LDKOpenChannel this_obj);
31658
31659 /**
31660  * The genesis hash of the blockchain where the channel is to be opened
31661  */
31662 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
31663
31664 /**
31665  * The genesis hash of the blockchain where the channel is to be opened
31666  */
31667 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31668
31669 /**
31670  * A temporary channel ID, until the funding outpoint is announced
31671  */
31672 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
31673
31674 /**
31675  * A temporary channel ID, until the funding outpoint is announced
31676  */
31677 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31678
31679 /**
31680  * The channel value
31681  */
31682 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31683
31684 /**
31685  * The channel value
31686  */
31687 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
31688
31689 /**
31690  * The amount to push to the counterparty as part of the open, in milli-satoshi
31691  */
31692 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31693
31694 /**
31695  * The amount to push to the counterparty as part of the open, in milli-satoshi
31696  */
31697 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
31698
31699 /**
31700  * The threshold below which outputs on transactions broadcast by sender will be omitted
31701  */
31702 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31703
31704 /**
31705  * The threshold below which outputs on transactions broadcast by sender will be omitted
31706  */
31707 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
31708
31709 /**
31710  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
31711  */
31712 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31713
31714 /**
31715  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
31716  */
31717 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
31718
31719 /**
31720  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
31721  */
31722 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31723
31724 /**
31725  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
31726  */
31727 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
31728
31729 /**
31730  * The minimum HTLC size incoming to sender, in milli-satoshi
31731  */
31732 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31733
31734 /**
31735  * The minimum HTLC size incoming to sender, in milli-satoshi
31736  */
31737 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
31738
31739 /**
31740  * The feerate per 1000-weight of sender generated transactions, until updated by
31741  * [`UpdateFee`]
31742  */
31743 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31744
31745 /**
31746  * The feerate per 1000-weight of sender generated transactions, until updated by
31747  * [`UpdateFee`]
31748  */
31749 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
31750
31751 /**
31752  * The number of blocks which the counterparty will have to wait to claim on-chain funds if
31753  * they broadcast a commitment transaction
31754  */
31755 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31756
31757 /**
31758  * The number of blocks which the counterparty will have to wait to claim on-chain funds if
31759  * they broadcast a commitment transaction
31760  */
31761 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
31762
31763 /**
31764  * The maximum number of inbound HTLCs towards sender
31765  */
31766 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31767
31768 /**
31769  * The maximum number of inbound HTLCs towards sender
31770  */
31771 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
31772
31773 /**
31774  * The sender's key controlling the funding transaction
31775  */
31776 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31777
31778 /**
31779  * The sender's key controlling the funding transaction
31780  */
31781 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31782
31783 /**
31784  * Used to derive a revocation key for transactions broadcast by counterparty
31785  */
31786 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31787
31788 /**
31789  * Used to derive a revocation key for transactions broadcast by counterparty
31790  */
31791 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31792
31793 /**
31794  * A payment key to sender for transactions broadcast by counterparty
31795  */
31796 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31797
31798 /**
31799  * A payment key to sender for transactions broadcast by counterparty
31800  */
31801 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31802
31803 /**
31804  * Used to derive a payment key to sender for transactions broadcast by sender
31805  */
31806 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31807
31808 /**
31809  * Used to derive a payment key to sender for transactions broadcast by sender
31810  */
31811 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31812
31813 /**
31814  * Used to derive an HTLC payment key to sender
31815  */
31816 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31817
31818 /**
31819  * Used to derive an HTLC payment key to sender
31820  */
31821 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31822
31823 /**
31824  * The first to-be-broadcast-by-sender transaction's per commitment point
31825  */
31826 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31827
31828 /**
31829  * The first to-be-broadcast-by-sender transaction's per commitment point
31830  */
31831 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31832
31833 /**
31834  * The channel flags to be used
31835  */
31836 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31837
31838 /**
31839  * The channel flags to be used
31840  */
31841 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
31842
31843 /**
31844  * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
31845  */
31846 struct LDKCOption_CVec_u8ZZ OpenChannel_get_shutdown_scriptpubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31847
31848 /**
31849  * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
31850  */
31851 void OpenChannel_set_shutdown_scriptpubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
31852
31853 /**
31854  * The channel type that this channel will represent
31855  *
31856  * If this is `None`, we derive the channel type from the intersection of our
31857  * feature bits with our counterparty's feature bits from the [`Init`] message.
31858  *
31859  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31860  */
31861 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
31862
31863 /**
31864  * The channel type that this channel will represent
31865  *
31866  * If this is `None`, we derive the channel type from the intersection of our
31867  * feature bits with our counterparty's feature bits from the [`Init`] message.
31868  *
31869  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
31870  */
31871 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
31872
31873 /**
31874  * Constructs a new OpenChannel given each field
31875  *
31876  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
31877  */
31878 MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t push_msat_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t channel_reserve_satoshis_arg, uint64_t htlc_minimum_msat_arg, uint32_t feerate_per_kw_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
31879
31880 /**
31881  * Creates a copy of the OpenChannel
31882  */
31883 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
31884
31885 /**
31886  * Checks if two OpenChannels contain equal inner contents.
31887  * This ignores pointers and is_owned flags and looks at the values in fields.
31888  * Two objects with NULL inner values will be considered "equal" here.
31889  */
31890 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
31891
31892 /**
31893  * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
31894  */
31895 void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
31896
31897 /**
31898  * The genesis hash of the blockchain where the channel is to be opened
31899  */
31900 const uint8_t (*OpenChannelV2_get_chain_hash(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
31901
31902 /**
31903  * The genesis hash of the blockchain where the channel is to be opened
31904  */
31905 void OpenChannelV2_set_chain_hash(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31906
31907 /**
31908  * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
31909  */
31910 const uint8_t (*OpenChannelV2_get_temporary_channel_id(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
31911
31912 /**
31913  * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
31914  */
31915 void OpenChannelV2_set_temporary_channel_id(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31916
31917 /**
31918  * The feerate for the funding transaction set by the channel initiator
31919  */
31920 uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31921
31922 /**
31923  * The feerate for the funding transaction set by the channel initiator
31924  */
31925 void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
31926
31927 /**
31928  * The feerate for the commitment transaction set by the channel initiator
31929  */
31930 uint32_t OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31931
31932 /**
31933  * The feerate for the commitment transaction set by the channel initiator
31934  */
31935 void OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
31936
31937 /**
31938  * Part of the channel value contributed by the channel initiator
31939  */
31940 uint64_t OpenChannelV2_get_funding_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31941
31942 /**
31943  * Part of the channel value contributed by the channel initiator
31944  */
31945 void OpenChannelV2_set_funding_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
31946
31947 /**
31948  * The threshold below which outputs on transactions broadcast by the channel initiator will be
31949  * omitted
31950  */
31951 uint64_t OpenChannelV2_get_dust_limit_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31952
31953 /**
31954  * The threshold below which outputs on transactions broadcast by the channel initiator will be
31955  * omitted
31956  */
31957 void OpenChannelV2_set_dust_limit_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
31958
31959 /**
31960  * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
31961  */
31962 uint64_t OpenChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31963
31964 /**
31965  * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
31966  */
31967 void OpenChannelV2_set_max_htlc_value_in_flight_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
31968
31969 /**
31970  * The minimum HTLC size incoming to channel initiator, in milli-satoshi
31971  */
31972 uint64_t OpenChannelV2_get_htlc_minimum_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31973
31974 /**
31975  * The minimum HTLC size incoming to channel initiator, in milli-satoshi
31976  */
31977 void OpenChannelV2_set_htlc_minimum_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
31978
31979 /**
31980  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
31981  * broadcast a commitment transaction
31982  */
31983 uint16_t OpenChannelV2_get_to_self_delay(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31984
31985 /**
31986  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
31987  * broadcast a commitment transaction
31988  */
31989 void OpenChannelV2_set_to_self_delay(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
31990
31991 /**
31992  * The maximum number of inbound HTLCs towards channel initiator
31993  */
31994 uint16_t OpenChannelV2_get_max_accepted_htlcs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
31995
31996 /**
31997  * The maximum number of inbound HTLCs towards channel initiator
31998  */
31999 void OpenChannelV2_set_max_accepted_htlcs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32000
32001 /**
32002  * The locktime for the funding transaction
32003  */
32004 uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32005
32006 /**
32007  * The locktime for the funding transaction
32008  */
32009 void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
32010
32011 /**
32012  * The channel initiator's key controlling the funding transaction
32013  */
32014 struct LDKPublicKey OpenChannelV2_get_funding_pubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32015
32016 /**
32017  * The channel initiator's key controlling the funding transaction
32018  */
32019 void OpenChannelV2_set_funding_pubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32020
32021 /**
32022  * Used to derive a revocation key for transactions broadcast by counterparty
32023  */
32024 struct LDKPublicKey OpenChannelV2_get_revocation_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32025
32026 /**
32027  * Used to derive a revocation key for transactions broadcast by counterparty
32028  */
32029 void OpenChannelV2_set_revocation_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32030
32031 /**
32032  * A payment key to channel initiator for transactions broadcast by counterparty
32033  */
32034 struct LDKPublicKey OpenChannelV2_get_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32035
32036 /**
32037  * A payment key to channel initiator for transactions broadcast by counterparty
32038  */
32039 void OpenChannelV2_set_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32040
32041 /**
32042  * Used to derive a payment key to channel initiator for transactions broadcast by channel
32043  * initiator
32044  */
32045 struct LDKPublicKey OpenChannelV2_get_delayed_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32046
32047 /**
32048  * Used to derive a payment key to channel initiator for transactions broadcast by channel
32049  * initiator
32050  */
32051 void OpenChannelV2_set_delayed_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32052
32053 /**
32054  * Used to derive an HTLC payment key to channel initiator
32055  */
32056 struct LDKPublicKey OpenChannelV2_get_htlc_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32057
32058 /**
32059  * Used to derive an HTLC payment key to channel initiator
32060  */
32061 void OpenChannelV2_set_htlc_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32062
32063 /**
32064  * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
32065  */
32066 struct LDKPublicKey OpenChannelV2_get_first_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32067
32068 /**
32069  * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
32070  */
32071 void OpenChannelV2_set_first_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32072
32073 /**
32074  * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
32075  */
32076 struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32077
32078 /**
32079  * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
32080  */
32081 void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32082
32083 /**
32084  * Channel flags
32085  */
32086 uint8_t OpenChannelV2_get_channel_flags(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32087
32088 /**
32089  * Channel flags
32090  */
32091 void OpenChannelV2_set_channel_flags(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint8_t val);
32092
32093 /**
32094  * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
32095  * collaboratively close
32096  */
32097 struct LDKCOption_CVec_u8ZZ OpenChannelV2_get_shutdown_scriptpubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32098
32099 /**
32100  * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
32101  * collaboratively close
32102  */
32103 void OpenChannelV2_set_shutdown_scriptpubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
32104
32105 /**
32106  * The channel type that this channel will represent. If none is set, we derive the channel
32107  * type from the intersection of our feature bits with our counterparty's feature bits from
32108  * the Init message.
32109  *
32110  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32111  */
32112 struct LDKChannelTypeFeatures OpenChannelV2_get_channel_type(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32113
32114 /**
32115  * The channel type that this channel will represent. If none is set, we derive the channel
32116  * type from the intersection of our feature bits with our counterparty's feature bits from
32117  * the Init message.
32118  *
32119  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32120  */
32121 void OpenChannelV2_set_channel_type(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32122
32123 /**
32124  * Optionally, a requirement that only confirmed inputs can be added
32125  */
32126 enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
32127
32128 /**
32129  * Optionally, a requirement that only confirmed inputs can be added
32130  */
32131 void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
32132
32133 /**
32134  * Constructs a new OpenChannelV2 given each field
32135  *
32136  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32137  */
32138 MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKThirtyTwoBytes temporary_channel_id_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKPublicKey second_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
32139
32140 /**
32141  * Creates a copy of the OpenChannelV2
32142  */
32143 struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
32144
32145 /**
32146  * Checks if two OpenChannelV2s contain equal inner contents.
32147  * This ignores pointers and is_owned flags and looks at the values in fields.
32148  * Two objects with NULL inner values will be considered "equal" here.
32149  */
32150 bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
32151
32152 /**
32153  * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
32154  */
32155 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
32156
32157 /**
32158  * A temporary channel ID, until the funding outpoint is announced
32159  */
32160 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
32161
32162 /**
32163  * A temporary channel ID, until the funding outpoint is announced
32164  */
32165 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32166
32167 /**
32168  * The threshold below which outputs on transactions broadcast by sender will be omitted
32169  */
32170 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32171
32172 /**
32173  * The threshold below which outputs on transactions broadcast by sender will be omitted
32174  */
32175 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32176
32177 /**
32178  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
32179  */
32180 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32181
32182 /**
32183  * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
32184  */
32185 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32186
32187 /**
32188  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
32189  */
32190 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32191
32192 /**
32193  * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
32194  */
32195 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32196
32197 /**
32198  * The minimum HTLC size incoming to sender, in milli-satoshi
32199  */
32200 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32201
32202 /**
32203  * The minimum HTLC size incoming to sender, in milli-satoshi
32204  */
32205 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
32206
32207 /**
32208  * Minimum depth of the funding transaction before the channel is considered open
32209  */
32210 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32211
32212 /**
32213  * Minimum depth of the funding transaction before the channel is considered open
32214  */
32215 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
32216
32217 /**
32218  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
32219  */
32220 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32221
32222 /**
32223  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
32224  */
32225 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
32226
32227 /**
32228  * The maximum number of inbound HTLCs towards sender
32229  */
32230 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32231
32232 /**
32233  * The maximum number of inbound HTLCs towards sender
32234  */
32235 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
32236
32237 /**
32238  * The sender's key controlling the funding transaction
32239  */
32240 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32241
32242 /**
32243  * The sender's key controlling the funding transaction
32244  */
32245 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32246
32247 /**
32248  * Used to derive a revocation key for transactions broadcast by counterparty
32249  */
32250 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32251
32252 /**
32253  * Used to derive a revocation key for transactions broadcast by counterparty
32254  */
32255 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32256
32257 /**
32258  * A payment key to sender for transactions broadcast by counterparty
32259  */
32260 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32261
32262 /**
32263  * A payment key to sender for transactions broadcast by counterparty
32264  */
32265 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32266
32267 /**
32268  * Used to derive a payment key to sender for transactions broadcast by sender
32269  */
32270 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32271
32272 /**
32273  * Used to derive a payment key to sender for transactions broadcast by sender
32274  */
32275 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32276
32277 /**
32278  * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
32279  */
32280 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32281
32282 /**
32283  * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
32284  */
32285 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32286
32287 /**
32288  * The first to-be-broadcast-by-sender transaction's per commitment point
32289  */
32290 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32291
32292 /**
32293  * The first to-be-broadcast-by-sender transaction's per commitment point
32294  */
32295 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32296
32297 /**
32298  * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
32299  */
32300 struct LDKCOption_CVec_u8ZZ AcceptChannel_get_shutdown_scriptpubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32301
32302 /**
32303  * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
32304  */
32305 void AcceptChannel_set_shutdown_scriptpubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
32306
32307 /**
32308  * The channel type that this channel will represent.
32309  *
32310  * If this is `None`, we derive the channel type from the intersection of
32311  * our feature bits with our counterparty's feature bits from the [`Init`] message.
32312  * This is required to match the equivalent field in [`OpenChannel::channel_type`].
32313  *
32314  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32315  */
32316 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
32317
32318 /**
32319  * The channel type that this channel will represent.
32320  *
32321  * If this is `None`, we derive the channel type from the intersection of
32322  * our feature bits with our counterparty's feature bits from the [`Init`] message.
32323  * This is required to match the equivalent field in [`OpenChannel::channel_type`].
32324  *
32325  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32326  */
32327 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32328
32329 /**
32330  * Constructs a new AcceptChannel given each field
32331  *
32332  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32333  */
32334 MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t channel_reserve_satoshis_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
32335
32336 /**
32337  * Creates a copy of the AcceptChannel
32338  */
32339 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
32340
32341 /**
32342  * Checks if two AcceptChannels contain equal inner contents.
32343  * This ignores pointers and is_owned flags and looks at the values in fields.
32344  * Two objects with NULL inner values will be considered "equal" here.
32345  */
32346 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
32347
32348 /**
32349  * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
32350  */
32351 void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
32352
32353 /**
32354  * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
32355  */
32356 const uint8_t (*AcceptChannelV2_get_temporary_channel_id(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr))[32];
32357
32358 /**
32359  * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
32360  */
32361 void AcceptChannelV2_set_temporary_channel_id(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32362
32363 /**
32364  * Part of the channel value contributed by the channel acceptor
32365  */
32366 uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32367
32368 /**
32369  * Part of the channel value contributed by the channel acceptor
32370  */
32371 void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32372
32373 /**
32374  * The threshold below which outputs on transactions broadcast by the channel acceptor will be
32375  * omitted
32376  */
32377 uint64_t AcceptChannelV2_get_dust_limit_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32378
32379 /**
32380  * The threshold below which outputs on transactions broadcast by the channel acceptor will be
32381  * omitted
32382  */
32383 void AcceptChannelV2_set_dust_limit_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32384
32385 /**
32386  * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
32387  */
32388 uint64_t AcceptChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32389
32390 /**
32391  * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
32392  */
32393 void AcceptChannelV2_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32394
32395 /**
32396  * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
32397  */
32398 uint64_t AcceptChannelV2_get_htlc_minimum_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32399
32400 /**
32401  * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
32402  */
32403 void AcceptChannelV2_set_htlc_minimum_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
32404
32405 /**
32406  * Minimum depth of the funding transaction before the channel is considered open
32407  */
32408 uint32_t AcceptChannelV2_get_minimum_depth(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32409
32410 /**
32411  * Minimum depth of the funding transaction before the channel is considered open
32412  */
32413 void AcceptChannelV2_set_minimum_depth(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
32414
32415 /**
32416  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
32417  * broadcast a commitment transaction
32418  */
32419 uint16_t AcceptChannelV2_get_to_self_delay(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32420
32421 /**
32422  * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
32423  * broadcast a commitment transaction
32424  */
32425 void AcceptChannelV2_set_to_self_delay(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32426
32427 /**
32428  * The maximum number of inbound HTLCs towards channel acceptor
32429  */
32430 uint16_t AcceptChannelV2_get_max_accepted_htlcs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32431
32432 /**
32433  * The maximum number of inbound HTLCs towards channel acceptor
32434  */
32435 void AcceptChannelV2_set_max_accepted_htlcs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
32436
32437 /**
32438  * The channel acceptor's key controlling the funding transaction
32439  */
32440 struct LDKPublicKey AcceptChannelV2_get_funding_pubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32441
32442 /**
32443  * The channel acceptor's key controlling the funding transaction
32444  */
32445 void AcceptChannelV2_set_funding_pubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32446
32447 /**
32448  * Used to derive a revocation key for transactions broadcast by counterparty
32449  */
32450 struct LDKPublicKey AcceptChannelV2_get_revocation_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32451
32452 /**
32453  * Used to derive a revocation key for transactions broadcast by counterparty
32454  */
32455 void AcceptChannelV2_set_revocation_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32456
32457 /**
32458  * A payment key to channel acceptor for transactions broadcast by counterparty
32459  */
32460 struct LDKPublicKey AcceptChannelV2_get_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32461
32462 /**
32463  * A payment key to channel acceptor for transactions broadcast by counterparty
32464  */
32465 void AcceptChannelV2_set_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32466
32467 /**
32468  * Used to derive a payment key to channel acceptor for transactions broadcast by channel
32469  * acceptor
32470  */
32471 struct LDKPublicKey AcceptChannelV2_get_delayed_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32472
32473 /**
32474  * Used to derive a payment key to channel acceptor for transactions broadcast by channel
32475  * acceptor
32476  */
32477 void AcceptChannelV2_set_delayed_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32478
32479 /**
32480  * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
32481  */
32482 struct LDKPublicKey AcceptChannelV2_get_htlc_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32483
32484 /**
32485  * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
32486  */
32487 void AcceptChannelV2_set_htlc_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32488
32489 /**
32490  * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
32491  */
32492 struct LDKPublicKey AcceptChannelV2_get_first_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32493
32494 /**
32495  * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
32496  */
32497 void AcceptChannelV2_set_first_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32498
32499 /**
32500  * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
32501  */
32502 struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32503
32504 /**
32505  * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
32506  */
32507 void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32508
32509 /**
32510  * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
32511  * collaboratively close
32512  */
32513 struct LDKCOption_CVec_u8ZZ AcceptChannelV2_get_shutdown_scriptpubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32514
32515 /**
32516  * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
32517  * collaboratively close
32518  */
32519 void AcceptChannelV2_set_shutdown_scriptpubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
32520
32521 /**
32522  * The channel type that this channel will represent. If none is set, we derive the channel
32523  * type from the intersection of our feature bits with our counterparty's feature bits from
32524  * the Init message.
32525  *
32526  * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
32527  *
32528  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32529  */
32530 struct LDKChannelTypeFeatures AcceptChannelV2_get_channel_type(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32531
32532 /**
32533  * The channel type that this channel will represent. If none is set, we derive the channel
32534  * type from the intersection of our feature bits with our counterparty's feature bits from
32535  * the Init message.
32536  *
32537  * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
32538  *
32539  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32540  */
32541 void AcceptChannelV2_set_channel_type(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32542
32543 /**
32544  * Optionally, a requirement that only confirmed inputs can be added
32545  */
32546 enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
32547
32548 /**
32549  * Optionally, a requirement that only confirmed inputs can be added
32550  */
32551 void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
32552
32553 /**
32554  * Constructs a new AcceptChannelV2 given each field
32555  *
32556  * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32557  */
32558 MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKPublicKey second_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
32559
32560 /**
32561  * Creates a copy of the AcceptChannelV2
32562  */
32563 struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
32564
32565 /**
32566  * Checks if two AcceptChannelV2s contain equal inner contents.
32567  * This ignores pointers and is_owned flags and looks at the values in fields.
32568  * Two objects with NULL inner values will be considered "equal" here.
32569  */
32570 bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
32571
32572 /**
32573  * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
32574  */
32575 void FundingCreated_free(struct LDKFundingCreated this_obj);
32576
32577 /**
32578  * A temporary channel ID, until the funding is established
32579  */
32580 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
32581
32582 /**
32583  * A temporary channel ID, until the funding is established
32584  */
32585 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32586
32587 /**
32588  * The funding transaction ID
32589  */
32590 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
32591
32592 /**
32593  * The funding transaction ID
32594  */
32595 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32596
32597 /**
32598  * The specific output index funding this channel
32599  */
32600 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
32601
32602 /**
32603  * The specific output index funding this channel
32604  */
32605 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
32606
32607 /**
32608  * The signature of the channel initiator (funder) on the initial commitment transaction
32609  */
32610 struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
32611
32612 /**
32613  * The signature of the channel initiator (funder) on the initial commitment transaction
32614  */
32615 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
32616
32617 /**
32618  * Constructs a new FundingCreated given each field
32619  */
32620 MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKECDSASignature signature_arg);
32621
32622 /**
32623  * Creates a copy of the FundingCreated
32624  */
32625 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
32626
32627 /**
32628  * Checks if two FundingCreateds contain equal inner contents.
32629  * This ignores pointers and is_owned flags and looks at the values in fields.
32630  * Two objects with NULL inner values will be considered "equal" here.
32631  */
32632 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
32633
32634 /**
32635  * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
32636  */
32637 void FundingSigned_free(struct LDKFundingSigned this_obj);
32638
32639 /**
32640  * The channel ID
32641  */
32642 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
32643
32644 /**
32645  * The channel ID
32646  */
32647 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32648
32649 /**
32650  * The signature of the channel acceptor (fundee) on the initial commitment transaction
32651  */
32652 struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
32653
32654 /**
32655  * The signature of the channel acceptor (fundee) on the initial commitment transaction
32656  */
32657 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
32658
32659 /**
32660  * Constructs a new FundingSigned given each field
32661  */
32662 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg);
32663
32664 /**
32665  * Creates a copy of the FundingSigned
32666  */
32667 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
32668
32669 /**
32670  * Checks if two FundingSigneds contain equal inner contents.
32671  * This ignores pointers and is_owned flags and looks at the values in fields.
32672  * Two objects with NULL inner values will be considered "equal" here.
32673  */
32674 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
32675
32676 /**
32677  * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
32678  */
32679 void ChannelReady_free(struct LDKChannelReady this_obj);
32680
32681 /**
32682  * The channel ID
32683  */
32684 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
32685
32686 /**
32687  * The channel ID
32688  */
32689 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32690
32691 /**
32692  * The per-commitment point of the second commitment transaction
32693  */
32694 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
32695
32696 /**
32697  * The per-commitment point of the second commitment transaction
32698  */
32699 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32700
32701 /**
32702  * If set, provides a `short_channel_id` alias for this channel.
32703  *
32704  * The sender will accept payments to be forwarded over this SCID and forward them to this
32705  * messages' recipient.
32706  */
32707 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
32708
32709 /**
32710  * If set, provides a `short_channel_id` alias for this channel.
32711  *
32712  * The sender will accept payments to be forwarded over this SCID and forward them to this
32713  * messages' recipient.
32714  */
32715 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32716
32717 /**
32718  * Constructs a new ChannelReady given each field
32719  */
32720 MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg);
32721
32722 /**
32723  * Creates a copy of the ChannelReady
32724  */
32725 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
32726
32727 /**
32728  * Checks if two ChannelReadys contain equal inner contents.
32729  * This ignores pointers and is_owned flags and looks at the values in fields.
32730  * Two objects with NULL inner values will be considered "equal" here.
32731  */
32732 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
32733
32734 /**
32735  * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
32736  */
32737 void TxAddInput_free(struct LDKTxAddInput this_obj);
32738
32739 /**
32740  * The channel ID
32741  */
32742 const uint8_t (*TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr))[32];
32743
32744 /**
32745  * The channel ID
32746  */
32747 void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32748
32749 /**
32750  * A randomly chosen unique identifier for this input, which is even for initiators and odd for
32751  * non-initiators.
32752  */
32753 uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
32754
32755 /**
32756  * A randomly chosen unique identifier for this input, which is even for initiators and odd for
32757  * non-initiators.
32758  */
32759 void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
32760
32761 /**
32762  * Serialized transaction that contains the output this input spends to verify that it is non
32763  * malleable.
32764  */
32765 struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
32766
32767 /**
32768  * Serialized transaction that contains the output this input spends to verify that it is non
32769  * malleable.
32770  */
32771 void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
32772
32773 /**
32774  * The index of the output being spent
32775  */
32776 uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
32777
32778 /**
32779  * The index of the output being spent
32780  */
32781 void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
32782
32783 /**
32784  * The sequence number of this input
32785  */
32786 uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
32787
32788 /**
32789  * The sequence number of this input
32790  */
32791 void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
32792
32793 /**
32794  * Constructs a new TxAddInput given each field
32795  */
32796 MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg);
32797
32798 /**
32799  * Creates a copy of the TxAddInput
32800  */
32801 struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
32802
32803 /**
32804  * Checks if two TxAddInputs 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 TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
32809
32810 /**
32811  * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
32812  */
32813 void TxAddOutput_free(struct LDKTxAddOutput this_obj);
32814
32815 /**
32816  * The channel ID
32817  */
32818 const uint8_t (*TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr))[32];
32819
32820 /**
32821  * The channel ID
32822  */
32823 void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32824
32825 /**
32826  * A randomly chosen unique identifier for this output, which is even for initiators and odd for
32827  * non-initiators.
32828  */
32829 uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
32830
32831 /**
32832  * A randomly chosen unique identifier for this output, which is even for initiators and odd for
32833  * non-initiators.
32834  */
32835 void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
32836
32837 /**
32838  * The satoshi value of the output
32839  */
32840 uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
32841
32842 /**
32843  * The satoshi value of the output
32844  */
32845 void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
32846
32847 /**
32848  * The scriptPubKey for the output
32849  */
32850 struct LDKu8slice TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
32851
32852 /**
32853  * The scriptPubKey for the output
32854  */
32855 void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
32856
32857 /**
32858  * Constructs a new TxAddOutput given each field
32859  */
32860 MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg);
32861
32862 /**
32863  * Creates a copy of the TxAddOutput
32864  */
32865 struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
32866
32867 /**
32868  * Checks if two TxAddOutputs contain equal inner contents.
32869  * This ignores pointers and is_owned flags and looks at the values in fields.
32870  * Two objects with NULL inner values will be considered "equal" here.
32871  */
32872 bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
32873
32874 /**
32875  * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
32876  */
32877 void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
32878
32879 /**
32880  * The channel ID
32881  */
32882 const uint8_t (*TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr))[32];
32883
32884 /**
32885  * The channel ID
32886  */
32887 void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32888
32889 /**
32890  * The serial ID of the input to be removed
32891  */
32892 uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
32893
32894 /**
32895  * The serial ID of the input to be removed
32896  */
32897 void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
32898
32899 /**
32900  * Constructs a new TxRemoveInput given each field
32901  */
32902 MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
32903
32904 /**
32905  * Creates a copy of the TxRemoveInput
32906  */
32907 struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
32908
32909 /**
32910  * Checks if two TxRemoveInputs contain equal inner contents.
32911  * This ignores pointers and is_owned flags and looks at the values in fields.
32912  * Two objects with NULL inner values will be considered "equal" here.
32913  */
32914 bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
32915
32916 /**
32917  * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
32918  */
32919 void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
32920
32921 /**
32922  * The channel ID
32923  */
32924 const uint8_t (*TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr))[32];
32925
32926 /**
32927  * The channel ID
32928  */
32929 void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32930
32931 /**
32932  * The serial ID of the output to be removed
32933  */
32934 uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
32935
32936 /**
32937  * The serial ID of the output to be removed
32938  */
32939 void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
32940
32941 /**
32942  * Constructs a new TxRemoveOutput given each field
32943  */
32944 MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
32945
32946 /**
32947  * Creates a copy of the TxRemoveOutput
32948  */
32949 struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
32950
32951 /**
32952  * Checks if two TxRemoveOutputs contain equal inner contents.
32953  * This ignores pointers and is_owned flags and looks at the values in fields.
32954  * Two objects with NULL inner values will be considered "equal" here.
32955  */
32956 bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
32957
32958 /**
32959  * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
32960  */
32961 void TxComplete_free(struct LDKTxComplete this_obj);
32962
32963 /**
32964  * The channel ID
32965  */
32966 const uint8_t (*TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr))[32];
32967
32968 /**
32969  * The channel ID
32970  */
32971 void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32972
32973 /**
32974  * Constructs a new TxComplete given each field
32975  */
32976 MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKThirtyTwoBytes channel_id_arg);
32977
32978 /**
32979  * Creates a copy of the TxComplete
32980  */
32981 struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
32982
32983 /**
32984  * Checks if two TxCompletes contain equal inner contents.
32985  * This ignores pointers and is_owned flags and looks at the values in fields.
32986  * Two objects with NULL inner values will be considered "equal" here.
32987  */
32988 bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
32989
32990 /**
32991  * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
32992  */
32993 void TxSignatures_free(struct LDKTxSignatures this_obj);
32994
32995 /**
32996  * The channel ID
32997  */
32998 const uint8_t (*TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
32999
33000 /**
33001  * The channel ID
33002  */
33003 void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33004
33005 /**
33006  * The TXID
33007  */
33008 const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
33009
33010 /**
33011  * The TXID
33012  */
33013 void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33014
33015 /**
33016  * The list of witnesses
33017  *
33018  * Returns a copy of the field.
33019  */
33020 struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
33021
33022 /**
33023  * The list of witnesses
33024  */
33025 void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
33026
33027 /**
33028  * Constructs a new TxSignatures given each field
33029  */
33030 MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg);
33031
33032 /**
33033  * Creates a copy of the TxSignatures
33034  */
33035 struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
33036
33037 /**
33038  * Checks if two TxSignaturess contain equal inner contents.
33039  * This ignores pointers and is_owned flags and looks at the values in fields.
33040  * Two objects with NULL inner values will be considered "equal" here.
33041  */
33042 bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
33043
33044 /**
33045  * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
33046  */
33047 void TxInitRbf_free(struct LDKTxInitRbf this_obj);
33048
33049 /**
33050  * The channel ID
33051  */
33052 const uint8_t (*TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr))[32];
33053
33054 /**
33055  * The channel ID
33056  */
33057 void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33058
33059 /**
33060  * The locktime of the transaction
33061  */
33062 uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
33063
33064 /**
33065  * The locktime of the transaction
33066  */
33067 void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
33068
33069 /**
33070  * The feerate of the transaction
33071  */
33072 uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
33073
33074 /**
33075  * The feerate of the transaction
33076  */
33077 void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
33078
33079 /**
33080  * The number of satoshis the sender will contribute to or, if negative, remove from
33081  * (e.g. splice-out) the funding output of the transaction
33082  */
33083 struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
33084
33085 /**
33086  * The number of satoshis the sender will contribute to or, if negative, remove from
33087  * (e.g. splice-out) the funding output of the transaction
33088  */
33089 void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
33090
33091 /**
33092  * Constructs a new TxInitRbf given each field
33093  */
33094 MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
33095
33096 /**
33097  * Creates a copy of the TxInitRbf
33098  */
33099 struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
33100
33101 /**
33102  * Checks if two TxInitRbfs contain equal inner contents.
33103  * This ignores pointers and is_owned flags and looks at the values in fields.
33104  * Two objects with NULL inner values will be considered "equal" here.
33105  */
33106 bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
33107
33108 /**
33109  * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
33110  */
33111 void TxAckRbf_free(struct LDKTxAckRbf this_obj);
33112
33113 /**
33114  * The channel ID
33115  */
33116 const uint8_t (*TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr))[32];
33117
33118 /**
33119  * The channel ID
33120  */
33121 void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33122
33123 /**
33124  * The number of satoshis the sender will contribute to or, if negative, remove from
33125  * (e.g. splice-out) the funding output of the transaction
33126  */
33127 struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
33128
33129 /**
33130  * The number of satoshis the sender will contribute to or, if negative, remove from
33131  * (e.g. splice-out) the funding output of the transaction
33132  */
33133 void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
33134
33135 /**
33136  * Constructs a new TxAckRbf given each field
33137  */
33138 MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
33139
33140 /**
33141  * Creates a copy of the TxAckRbf
33142  */
33143 struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
33144
33145 /**
33146  * Checks if two TxAckRbfs contain equal inner contents.
33147  * This ignores pointers and is_owned flags and looks at the values in fields.
33148  * Two objects with NULL inner values will be considered "equal" here.
33149  */
33150 bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
33151
33152 /**
33153  * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
33154  */
33155 void TxAbort_free(struct LDKTxAbort this_obj);
33156
33157 /**
33158  * The channel ID
33159  */
33160 const uint8_t (*TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr))[32];
33161
33162 /**
33163  * The channel ID
33164  */
33165 void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33166
33167 /**
33168  * Message data
33169  *
33170  * Returns a copy of the field.
33171  */
33172 struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
33173
33174 /**
33175  * Message data
33176  */
33177 void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
33178
33179 /**
33180  * Constructs a new TxAbort given each field
33181  */
33182 MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
33183
33184 /**
33185  * Creates a copy of the TxAbort
33186  */
33187 struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
33188
33189 /**
33190  * Checks if two TxAborts contain equal inner contents.
33191  * This ignores pointers and is_owned flags and looks at the values in fields.
33192  * Two objects with NULL inner values will be considered "equal" here.
33193  */
33194 bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
33195
33196 /**
33197  * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
33198  */
33199 void Shutdown_free(struct LDKShutdown this_obj);
33200
33201 /**
33202  * The channel ID
33203  */
33204 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
33205
33206 /**
33207  * The channel ID
33208  */
33209 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33210
33211 /**
33212  * The destination of this peer's funds on closing.
33213  *
33214  * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
33215  */
33216 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
33217
33218 /**
33219  * The destination of this peer's funds on closing.
33220  *
33221  * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
33222  */
33223 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
33224
33225 /**
33226  * Constructs a new Shutdown given each field
33227  */
33228 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
33229
33230 /**
33231  * Creates a copy of the Shutdown
33232  */
33233 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
33234
33235 /**
33236  * Checks if two Shutdowns contain equal inner contents.
33237  * This ignores pointers and is_owned flags and looks at the values in fields.
33238  * Two objects with NULL inner values will be considered "equal" here.
33239  */
33240 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
33241
33242 /**
33243  * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
33244  */
33245 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
33246
33247 /**
33248  * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
33249  * transaction.
33250  */
33251 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
33252
33253 /**
33254  * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
33255  * transaction.
33256  */
33257 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
33258
33259 /**
33260  * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
33261  * transaction.
33262  */
33263 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
33264
33265 /**
33266  * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
33267  * transaction.
33268  */
33269 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
33270
33271 /**
33272  * Constructs a new ClosingSignedFeeRange given each field
33273  */
33274 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
33275
33276 /**
33277  * Creates a copy of the ClosingSignedFeeRange
33278  */
33279 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
33280
33281 /**
33282  * Checks if two ClosingSignedFeeRanges contain equal inner contents.
33283  * This ignores pointers and is_owned flags and looks at the values in fields.
33284  * Two objects with NULL inner values will be considered "equal" here.
33285  */
33286 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
33287
33288 /**
33289  * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
33290  */
33291 void ClosingSigned_free(struct LDKClosingSigned this_obj);
33292
33293 /**
33294  * The channel ID
33295  */
33296 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
33297
33298 /**
33299  * The channel ID
33300  */
33301 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33302
33303 /**
33304  * The proposed total fee for the closing transaction
33305  */
33306 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
33307
33308 /**
33309  * The proposed total fee for the closing transaction
33310  */
33311 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
33312
33313 /**
33314  * A signature on the closing transaction
33315  */
33316 struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
33317
33318 /**
33319  * A signature on the closing transaction
33320  */
33321 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33322
33323 /**
33324  * The minimum and maximum fees which the sender is willing to accept, provided only by new
33325  * nodes.
33326  *
33327  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33328  */
33329 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
33330
33331 /**
33332  * The minimum and maximum fees which the sender is willing to accept, provided only by new
33333  * nodes.
33334  *
33335  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33336  */
33337 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
33338
33339 /**
33340  * Constructs a new ClosingSigned given each field
33341  *
33342  * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
33343  */
33344 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKECDSASignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
33345
33346 /**
33347  * Creates a copy of the ClosingSigned
33348  */
33349 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
33350
33351 /**
33352  * Checks if two ClosingSigneds contain equal inner contents.
33353  * This ignores pointers and is_owned flags and looks at the values in fields.
33354  * Two objects with NULL inner values will be considered "equal" here.
33355  */
33356 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
33357
33358 /**
33359  * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
33360  */
33361 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
33362
33363 /**
33364  * The channel ID
33365  */
33366 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
33367
33368 /**
33369  * The channel ID
33370  */
33371 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33372
33373 /**
33374  * The HTLC ID
33375  */
33376 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33377
33378 /**
33379  * The HTLC ID
33380  */
33381 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
33382
33383 /**
33384  * The HTLC value in milli-satoshi
33385  */
33386 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33387
33388 /**
33389  * The HTLC value in milli-satoshi
33390  */
33391 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
33392
33393 /**
33394  * The payment hash, the pre-image of which controls HTLC redemption
33395  */
33396 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
33397
33398 /**
33399  * The payment hash, the pre-image of which controls HTLC redemption
33400  */
33401 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33402
33403 /**
33404  * The expiry height of the HTLC
33405  */
33406 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33407
33408 /**
33409  * The expiry height of the HTLC
33410  */
33411 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
33412
33413 /**
33414  * The extra fee skimmed by the sender of this message. See
33415  * [`ChannelConfig::accept_underpaying_htlcs`].
33416  *
33417  * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
33418  */
33419 struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
33420
33421 /**
33422  * The extra fee skimmed by the sender of this message. See
33423  * [`ChannelConfig::accept_underpaying_htlcs`].
33424  *
33425  * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
33426  */
33427 void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
33428
33429 /**
33430  * Creates a copy of the UpdateAddHTLC
33431  */
33432 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
33433
33434 /**
33435  * Checks if two UpdateAddHTLCs contain equal inner contents.
33436  * This ignores pointers and is_owned flags and looks at the values in fields.
33437  * Two objects with NULL inner values will be considered "equal" here.
33438  */
33439 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
33440
33441 /**
33442  * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
33443  */
33444 void OnionMessage_free(struct LDKOnionMessage this_obj);
33445
33446 /**
33447  * Used in decrypting the onion packet's payload.
33448  */
33449 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
33450
33451 /**
33452  * Used in decrypting the onion packet's payload.
33453  */
33454 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33455
33456 /**
33457  * The full onion packet including hop data, pubkey, and hmac
33458  */
33459 struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
33460
33461 /**
33462  * The full onion packet including hop data, pubkey, and hmac
33463  */
33464 void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
33465
33466 /**
33467  * Constructs a new OnionMessage given each field
33468  */
33469 MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
33470
33471 /**
33472  * Creates a copy of the OnionMessage
33473  */
33474 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
33475
33476 /**
33477  * Checks if two OnionMessages contain equal inner contents.
33478  * This ignores pointers and is_owned flags and looks at the values in fields.
33479  * Two objects with NULL inner values will be considered "equal" here.
33480  */
33481 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
33482
33483 /**
33484  * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
33485  */
33486 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
33487
33488 /**
33489  * The channel ID
33490  */
33491 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
33492
33493 /**
33494  * The channel ID
33495  */
33496 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33497
33498 /**
33499  * The HTLC ID
33500  */
33501 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
33502
33503 /**
33504  * The HTLC ID
33505  */
33506 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
33507
33508 /**
33509  * The pre-image of the payment hash, allowing HTLC redemption
33510  */
33511 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
33512
33513 /**
33514  * The pre-image of the payment hash, allowing HTLC redemption
33515  */
33516 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33517
33518 /**
33519  * Constructs a new UpdateFulfillHTLC given each field
33520  */
33521 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
33522
33523 /**
33524  * Creates a copy of the UpdateFulfillHTLC
33525  */
33526 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
33527
33528 /**
33529  * Checks if two UpdateFulfillHTLCs contain equal inner contents.
33530  * This ignores pointers and is_owned flags and looks at the values in fields.
33531  * Two objects with NULL inner values will be considered "equal" here.
33532  */
33533 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
33534
33535 /**
33536  * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
33537  */
33538 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
33539
33540 /**
33541  * The channel ID
33542  */
33543 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
33544
33545 /**
33546  * The channel ID
33547  */
33548 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33549
33550 /**
33551  * The HTLC ID
33552  */
33553 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
33554
33555 /**
33556  * The HTLC ID
33557  */
33558 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
33559
33560 /**
33561  * Creates a copy of the UpdateFailHTLC
33562  */
33563 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
33564
33565 /**
33566  * Checks if two UpdateFailHTLCs contain equal inner contents.
33567  * This ignores pointers and is_owned flags and looks at the values in fields.
33568  * Two objects with NULL inner values will be considered "equal" here.
33569  */
33570 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
33571
33572 /**
33573  * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
33574  */
33575 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
33576
33577 /**
33578  * The channel ID
33579  */
33580 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
33581
33582 /**
33583  * The channel ID
33584  */
33585 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33586
33587 /**
33588  * The HTLC ID
33589  */
33590 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
33591
33592 /**
33593  * The HTLC ID
33594  */
33595 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
33596
33597 /**
33598  * The failure code
33599  */
33600 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
33601
33602 /**
33603  * The failure code
33604  */
33605 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
33606
33607 /**
33608  * Creates a copy of the UpdateFailMalformedHTLC
33609  */
33610 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
33611
33612 /**
33613  * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
33614  * This ignores pointers and is_owned flags and looks at the values in fields.
33615  * Two objects with NULL inner values will be considered "equal" here.
33616  */
33617 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
33618
33619 /**
33620  * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
33621  */
33622 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
33623
33624 /**
33625  * The channel ID
33626  */
33627 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
33628
33629 /**
33630  * The channel ID
33631  */
33632 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33633
33634 /**
33635  * A signature on the commitment transaction
33636  */
33637 struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
33638
33639 /**
33640  * A signature on the commitment transaction
33641  */
33642 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33643
33644 /**
33645  * Signatures on the HTLC transactions
33646  *
33647  * Returns a copy of the field.
33648  */
33649 struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
33650
33651 /**
33652  * Signatures on the HTLC transactions
33653  */
33654 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
33655
33656 /**
33657  * Constructs a new CommitmentSigned given each field
33658  */
33659 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg);
33660
33661 /**
33662  * Creates a copy of the CommitmentSigned
33663  */
33664 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
33665
33666 /**
33667  * Checks if two CommitmentSigneds contain equal inner contents.
33668  * This ignores pointers and is_owned flags and looks at the values in fields.
33669  * Two objects with NULL inner values will be considered "equal" here.
33670  */
33671 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
33672
33673 /**
33674  * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
33675  */
33676 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
33677
33678 /**
33679  * The channel ID
33680  */
33681 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
33682
33683 /**
33684  * The channel ID
33685  */
33686 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33687
33688 /**
33689  * The secret corresponding to the per-commitment point
33690  */
33691 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
33692
33693 /**
33694  * The secret corresponding to the per-commitment point
33695  */
33696 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33697
33698 /**
33699  * The next sender-broadcast commitment transaction's per-commitment point
33700  */
33701 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
33702
33703 /**
33704  * The next sender-broadcast commitment transaction's per-commitment point
33705  */
33706 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33707
33708 /**
33709  * Constructs a new RevokeAndACK given each field
33710  */
33711 MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg);
33712
33713 /**
33714  * Creates a copy of the RevokeAndACK
33715  */
33716 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
33717
33718 /**
33719  * Checks if two RevokeAndACKs contain equal inner contents.
33720  * This ignores pointers and is_owned flags and looks at the values in fields.
33721  * Two objects with NULL inner values will be considered "equal" here.
33722  */
33723 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
33724
33725 /**
33726  * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
33727  */
33728 void UpdateFee_free(struct LDKUpdateFee this_obj);
33729
33730 /**
33731  * The channel ID
33732  */
33733 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
33734
33735 /**
33736  * The channel ID
33737  */
33738 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33739
33740 /**
33741  * Fee rate per 1000-weight of the transaction
33742  */
33743 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
33744
33745 /**
33746  * Fee rate per 1000-weight of the transaction
33747  */
33748 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
33749
33750 /**
33751  * Constructs a new UpdateFee given each field
33752  */
33753 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
33754
33755 /**
33756  * Creates a copy of the UpdateFee
33757  */
33758 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
33759
33760 /**
33761  * Checks if two UpdateFees contain equal inner contents.
33762  * This ignores pointers and is_owned flags and looks at the values in fields.
33763  * Two objects with NULL inner values will be considered "equal" here.
33764  */
33765 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
33766
33767 /**
33768  * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
33769  */
33770 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
33771
33772 /**
33773  * The channel ID
33774  */
33775 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
33776
33777 /**
33778  * The channel ID
33779  */
33780 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33781
33782 /**
33783  * The next commitment number for the sender
33784  */
33785 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
33786
33787 /**
33788  * The next commitment number for the sender
33789  */
33790 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
33791
33792 /**
33793  * The next commitment number for the recipient
33794  */
33795 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
33796
33797 /**
33798  * The next commitment number for the recipient
33799  */
33800 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
33801
33802 /**
33803  * Proof that the sender knows the per-commitment secret of a specific commitment transaction
33804  * belonging to the recipient
33805  */
33806 const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
33807
33808 /**
33809  * Proof that the sender knows the per-commitment secret of a specific commitment transaction
33810  * belonging to the recipient
33811  */
33812 void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33813
33814 /**
33815  * The sender's per-commitment point for their current commitment transaction
33816  */
33817 struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
33818
33819 /**
33820  * The sender's per-commitment point for their current commitment transaction
33821  */
33822 void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33823
33824 /**
33825  * The next funding transaction ID
33826  */
33827 struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
33828
33829 /**
33830  * The next funding transaction ID
33831  */
33832 void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
33833
33834 /**
33835  * Constructs a new ChannelReestablish given each field
33836  */
33837 MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t next_local_commitment_number_arg, uint64_t next_remote_commitment_number_arg, struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg, struct LDKCOption_ThirtyTwoBytesZ next_funding_txid_arg);
33838
33839 /**
33840  * Creates a copy of the ChannelReestablish
33841  */
33842 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
33843
33844 /**
33845  * Checks if two ChannelReestablishs contain equal inner contents.
33846  * This ignores pointers and is_owned flags and looks at the values in fields.
33847  * Two objects with NULL inner values will be considered "equal" here.
33848  */
33849 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
33850
33851 /**
33852  * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
33853  */
33854 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
33855
33856 /**
33857  * The channel ID
33858  */
33859 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
33860
33861 /**
33862  * The channel ID
33863  */
33864 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
33865
33866 /**
33867  * The short channel ID
33868  */
33869 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
33870
33871 /**
33872  * The short channel ID
33873  */
33874 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
33875
33876 /**
33877  * A signature by the node key
33878  */
33879 struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
33880
33881 /**
33882  * A signature by the node key
33883  */
33884 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33885
33886 /**
33887  * A signature by the funding key
33888  */
33889 struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
33890
33891 /**
33892  * A signature by the funding key
33893  */
33894 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
33895
33896 /**
33897  * Constructs a new AnnouncementSignatures given each field
33898  */
33899 MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKECDSASignature node_signature_arg, struct LDKECDSASignature bitcoin_signature_arg);
33900
33901 /**
33902  * Creates a copy of the AnnouncementSignatures
33903  */
33904 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
33905
33906 /**
33907  * Checks if two AnnouncementSignaturess contain equal inner contents.
33908  * This ignores pointers and is_owned flags and looks at the values in fields.
33909  * Two objects with NULL inner values will be considered "equal" here.
33910  */
33911 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
33912
33913 /**
33914  * Frees any resources used by the SocketAddress
33915  */
33916 void SocketAddress_free(struct LDKSocketAddress this_ptr);
33917
33918 /**
33919  * Creates a copy of the SocketAddress
33920  */
33921 struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
33922
33923 /**
33924  * Utility method to constructs a new TcpIpV4-variant SocketAddress
33925  */
33926 struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
33927
33928 /**
33929  * Utility method to constructs a new TcpIpV6-variant SocketAddress
33930  */
33931 struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
33932
33933 /**
33934  * Utility method to constructs a new OnionV2-variant SocketAddress
33935  */
33936 struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
33937
33938 /**
33939  * Utility method to constructs a new OnionV3-variant SocketAddress
33940  */
33941 struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
33942
33943 /**
33944  * Utility method to constructs a new Hostname-variant SocketAddress
33945  */
33946 struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
33947
33948 /**
33949  * Checks if two SocketAddresss contain equal inner contents.
33950  * This ignores pointers and is_owned flags and looks at the values in fields.
33951  */
33952 bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
33953
33954 /**
33955  * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
33956  */
33957 struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
33958
33959 /**
33960  * Read a SocketAddress from a byte array, created by SocketAddress_write
33961  */
33962 struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
33963
33964 /**
33965  * Creates a copy of the SocketAddressParseError
33966  */
33967 enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
33968
33969 /**
33970  * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
33971  */
33972 enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
33973
33974 /**
33975  * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
33976  */
33977 enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
33978
33979 /**
33980  * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
33981  */
33982 enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
33983
33984 /**
33985  * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
33986  */
33987 enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
33988
33989 /**
33990  * Checks if two SocketAddressParseErrors contain equal inner contents.
33991  * This ignores pointers and is_owned flags and looks at the values in fields.
33992  */
33993 bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
33994
33995 /**
33996  * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
33997  *
33998  * The host part must end with \".onion\".
33999  */
34000 struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
34001
34002 /**
34003  * Read a SocketAddress object from a string
34004  */
34005 struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
34006
34007 /**
34008  * Frees any resources used by the UnsignedGossipMessage
34009  */
34010 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
34011
34012 /**
34013  * Creates a copy of the UnsignedGossipMessage
34014  */
34015 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
34016
34017 /**
34018  * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
34019  */
34020 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
34021
34022 /**
34023  * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
34024  */
34025 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
34026
34027 /**
34028  * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
34029  */
34030 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
34031
34032 /**
34033  * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
34034  */
34035 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
34036
34037 /**
34038  * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
34039  */
34040 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
34041
34042 /**
34043  * The advertised features
34044  */
34045 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34046
34047 /**
34048  * The advertised features
34049  */
34050 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
34051
34052 /**
34053  * A strictly monotonic announcement counter, with gaps allowed
34054  */
34055 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34056
34057 /**
34058  * A strictly monotonic announcement counter, with gaps allowed
34059  */
34060 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
34061
34062 /**
34063  * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
34064  * to this node).
34065  */
34066 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34067
34068 /**
34069  * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
34070  * to this node).
34071  */
34072 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34073
34074 /**
34075  * An RGB color for UI purposes
34076  */
34077 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
34078
34079 /**
34080  * An RGB color for UI purposes
34081  */
34082 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
34083
34084 /**
34085  * An alias, for UI purposes.
34086  *
34087  * This should be sanitized before use. There is no guarantee of uniqueness.
34088  */
34089 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34090
34091 /**
34092  * An alias, for UI purposes.
34093  *
34094  * This should be sanitized before use. There is no guarantee of uniqueness.
34095  */
34096 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
34097
34098 /**
34099  * List of addresses on which this node is reachable
34100  *
34101  * Returns a copy of the field.
34102  */
34103 struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
34104
34105 /**
34106  * List of addresses on which this node is reachable
34107  */
34108 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
34109
34110 /**
34111  * Creates a copy of the UnsignedNodeAnnouncement
34112  */
34113 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
34114
34115 /**
34116  * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
34117  * This ignores pointers and is_owned flags and looks at the values in fields.
34118  * Two objects with NULL inner values will be considered "equal" here.
34119  */
34120 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
34121
34122 /**
34123  * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
34124  */
34125 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
34126
34127 /**
34128  * The signature by the node key
34129  */
34130 struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
34131
34132 /**
34133  * The signature by the node key
34134  */
34135 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34136
34137 /**
34138  * The actual content of the announcement
34139  */
34140 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
34141
34142 /**
34143  * The actual content of the announcement
34144  */
34145 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
34146
34147 /**
34148  * Constructs a new NodeAnnouncement given each field
34149  */
34150 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
34151
34152 /**
34153  * Creates a copy of the NodeAnnouncement
34154  */
34155 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
34156
34157 /**
34158  * Checks if two NodeAnnouncements contain equal inner contents.
34159  * This ignores pointers and is_owned flags and looks at the values in fields.
34160  * Two objects with NULL inner values will be considered "equal" here.
34161  */
34162 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
34163
34164 /**
34165  * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
34166  */
34167 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
34168
34169 /**
34170  * The advertised channel features
34171  */
34172 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34173
34174 /**
34175  * The advertised channel features
34176  */
34177 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
34178
34179 /**
34180  * The genesis hash of the blockchain where the channel is to be opened
34181  */
34182 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
34183
34184 /**
34185  * The genesis hash of the blockchain where the channel is to be opened
34186  */
34187 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34188
34189 /**
34190  * The short channel ID
34191  */
34192 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34193
34194 /**
34195  * The short channel ID
34196  */
34197 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
34198
34199 /**
34200  * One of the two `node_id`s which are endpoints of this channel
34201  */
34202 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34203
34204 /**
34205  * One of the two `node_id`s which are endpoints of this channel
34206  */
34207 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34208
34209 /**
34210  * The other of the two `node_id`s which are endpoints of this channel
34211  */
34212 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34213
34214 /**
34215  * The other of the two `node_id`s which are endpoints of this channel
34216  */
34217 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34218
34219 /**
34220  * The funding key for the first node
34221  */
34222 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34223
34224 /**
34225  * The funding key for the first node
34226  */
34227 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34228
34229 /**
34230  * The funding key for the second node
34231  */
34232 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34233
34234 /**
34235  * The funding key for the second node
34236  */
34237 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
34238
34239 /**
34240  * Excess data which was signed as a part of the message which we do not (yet) understand how
34241  * to decode.
34242  *
34243  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34244  *
34245  * Returns a copy of the field.
34246  */
34247 struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
34248
34249 /**
34250  * Excess data which was signed as a part of the message which we do not (yet) understand how
34251  * to decode.
34252  *
34253  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34254  */
34255 void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
34256
34257 /**
34258  * Constructs a new UnsignedChannelAnnouncement given each field
34259  */
34260 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);
34261
34262 /**
34263  * Creates a copy of the UnsignedChannelAnnouncement
34264  */
34265 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
34266
34267 /**
34268  * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
34269  * This ignores pointers and is_owned flags and looks at the values in fields.
34270  * Two objects with NULL inner values will be considered "equal" here.
34271  */
34272 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
34273
34274 /**
34275  * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
34276  */
34277 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
34278
34279 /**
34280  * Authentication of the announcement by the first public node
34281  */
34282 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34283
34284 /**
34285  * Authentication of the announcement by the first public node
34286  */
34287 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34288
34289 /**
34290  * Authentication of the announcement by the second public node
34291  */
34292 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34293
34294 /**
34295  * Authentication of the announcement by the second public node
34296  */
34297 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34298
34299 /**
34300  * Proof of funding UTXO ownership by the first public node
34301  */
34302 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34303
34304 /**
34305  * Proof of funding UTXO ownership by the first public node
34306  */
34307 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34308
34309 /**
34310  * Proof of funding UTXO ownership by the second public node
34311  */
34312 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34313
34314 /**
34315  * Proof of funding UTXO ownership by the second public node
34316  */
34317 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34318
34319 /**
34320  * The actual announcement
34321  */
34322 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
34323
34324 /**
34325  * The actual announcement
34326  */
34327 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
34328
34329 /**
34330  * Constructs a new ChannelAnnouncement given each field
34331  */
34332 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);
34333
34334 /**
34335  * Creates a copy of the ChannelAnnouncement
34336  */
34337 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
34338
34339 /**
34340  * Checks if two ChannelAnnouncements contain equal inner contents.
34341  * This ignores pointers and is_owned flags and looks at the values in fields.
34342  * Two objects with NULL inner values will be considered "equal" here.
34343  */
34344 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
34345
34346 /**
34347  * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
34348  */
34349 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
34350
34351 /**
34352  * The genesis hash of the blockchain where the channel is to be opened
34353  */
34354 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
34355
34356 /**
34357  * The genesis hash of the blockchain where the channel is to be opened
34358  */
34359 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34360
34361 /**
34362  * The short channel ID
34363  */
34364 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34365
34366 /**
34367  * The short channel ID
34368  */
34369 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
34370
34371 /**
34372  * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
34373  */
34374 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34375
34376 /**
34377  * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
34378  */
34379 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
34380
34381 /**
34382  * Channel flags
34383  */
34384 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34385
34386 /**
34387  * Channel flags
34388  */
34389 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
34390
34391 /**
34392  * The number of blocks such that if:
34393  * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
34394  * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
34395  * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
34396  * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
34397  * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
34398  * forwarding. Note that the HTLC sender is the one who originally sets this value when
34399  * constructing the route.
34400  */
34401 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34402
34403 /**
34404  * The number of blocks such that if:
34405  * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
34406  * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
34407  * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
34408  * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
34409  * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
34410  * forwarding. Note that the HTLC sender is the one who originally sets this value when
34411  * constructing the route.
34412  */
34413 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
34414
34415 /**
34416  * The minimum HTLC size incoming to sender, in milli-satoshi
34417  */
34418 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34419
34420 /**
34421  * The minimum HTLC size incoming to sender, in milli-satoshi
34422  */
34423 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
34424
34425 /**
34426  * The maximum HTLC value incoming to sender, in milli-satoshi.
34427  *
34428  * This used to be optional.
34429  */
34430 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34431
34432 /**
34433  * The maximum HTLC value incoming to sender, in milli-satoshi.
34434  *
34435  * This used to be optional.
34436  */
34437 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
34438
34439 /**
34440  * The base HTLC fee charged by sender, in milli-satoshi
34441  */
34442 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34443
34444 /**
34445  * The base HTLC fee charged by sender, in milli-satoshi
34446  */
34447 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
34448
34449 /**
34450  * The amount to fee multiplier, in micro-satoshi
34451  */
34452 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34453
34454 /**
34455  * The amount to fee multiplier, in micro-satoshi
34456  */
34457 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
34458
34459 /**
34460  * Excess data which was signed as a part of the message which we do not (yet) understand how
34461  * to decode.
34462  *
34463  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34464  *
34465  * Returns a copy of the field.
34466  */
34467 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
34468
34469 /**
34470  * Excess data which was signed as a part of the message which we do not (yet) understand how
34471  * to decode.
34472  *
34473  * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
34474  */
34475 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
34476
34477 /**
34478  * Constructs a new UnsignedChannelUpdate given each field
34479  */
34480 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);
34481
34482 /**
34483  * Creates a copy of the UnsignedChannelUpdate
34484  */
34485 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
34486
34487 /**
34488  * Checks if two UnsignedChannelUpdates contain equal inner contents.
34489  * This ignores pointers and is_owned flags and looks at the values in fields.
34490  * Two objects with NULL inner values will be considered "equal" here.
34491  */
34492 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
34493
34494 /**
34495  * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
34496  */
34497 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
34498
34499 /**
34500  * A signature of the channel update
34501  */
34502 struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
34503
34504 /**
34505  * A signature of the channel update
34506  */
34507 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
34508
34509 /**
34510  * The actual channel update
34511  */
34512 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
34513
34514 /**
34515  * The actual channel update
34516  */
34517 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
34518
34519 /**
34520  * Constructs a new ChannelUpdate given each field
34521  */
34522 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
34523
34524 /**
34525  * Creates a copy of the ChannelUpdate
34526  */
34527 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
34528
34529 /**
34530  * Checks if two ChannelUpdates contain equal inner contents.
34531  * This ignores pointers and is_owned flags and looks at the values in fields.
34532  * Two objects with NULL inner values will be considered "equal" here.
34533  */
34534 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
34535
34536 /**
34537  * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
34538  */
34539 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
34540
34541 /**
34542  * The genesis hash of the blockchain being queried
34543  */
34544 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
34545
34546 /**
34547  * The genesis hash of the blockchain being queried
34548  */
34549 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34550
34551 /**
34552  * The height of the first block for the channel UTXOs being queried
34553  */
34554 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
34555
34556 /**
34557  * The height of the first block for the channel UTXOs being queried
34558  */
34559 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
34560
34561 /**
34562  * The number of blocks to include in the query results
34563  */
34564 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
34565
34566 /**
34567  * The number of blocks to include in the query results
34568  */
34569 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
34570
34571 /**
34572  * Constructs a new QueryChannelRange given each field
34573  */
34574 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
34575
34576 /**
34577  * Creates a copy of the QueryChannelRange
34578  */
34579 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
34580
34581 /**
34582  * Checks if two QueryChannelRanges contain equal inner contents.
34583  * This ignores pointers and is_owned flags and looks at the values in fields.
34584  * Two objects with NULL inner values will be considered "equal" here.
34585  */
34586 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
34587
34588 /**
34589  * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
34590  */
34591 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
34592
34593 /**
34594  * The genesis hash of the blockchain being queried
34595  */
34596 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
34597
34598 /**
34599  * The genesis hash of the blockchain being queried
34600  */
34601 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34602
34603 /**
34604  * The height of the first block in the range of the reply
34605  */
34606 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
34607
34608 /**
34609  * The height of the first block in the range of the reply
34610  */
34611 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
34612
34613 /**
34614  * The number of blocks included in the range of the reply
34615  */
34616 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
34617
34618 /**
34619  * The number of blocks included in the range of the reply
34620  */
34621 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
34622
34623 /**
34624  * True when this is the final reply for a query
34625  */
34626 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
34627
34628 /**
34629  * True when this is the final reply for a query
34630  */
34631 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
34632
34633 /**
34634  * The `short_channel_id`s in the channel range
34635  *
34636  * Returns a copy of the field.
34637  */
34638 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
34639
34640 /**
34641  * The `short_channel_id`s in the channel range
34642  */
34643 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
34644
34645 /**
34646  * Constructs a new ReplyChannelRange given each field
34647  */
34648 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);
34649
34650 /**
34651  * Creates a copy of the ReplyChannelRange
34652  */
34653 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
34654
34655 /**
34656  * Checks if two ReplyChannelRanges contain equal inner contents.
34657  * This ignores pointers and is_owned flags and looks at the values in fields.
34658  * Two objects with NULL inner values will be considered "equal" here.
34659  */
34660 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
34661
34662 /**
34663  * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
34664  */
34665 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
34666
34667 /**
34668  * The genesis hash of the blockchain being queried
34669  */
34670 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
34671
34672 /**
34673  * The genesis hash of the blockchain being queried
34674  */
34675 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34676
34677 /**
34678  * The short_channel_ids that are being queried
34679  *
34680  * Returns a copy of the field.
34681  */
34682 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
34683
34684 /**
34685  * The short_channel_ids that are being queried
34686  */
34687 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
34688
34689 /**
34690  * Constructs a new QueryShortChannelIds given each field
34691  */
34692 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
34693
34694 /**
34695  * Creates a copy of the QueryShortChannelIds
34696  */
34697 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
34698
34699 /**
34700  * Checks if two QueryShortChannelIdss contain equal inner contents.
34701  * This ignores pointers and is_owned flags and looks at the values in fields.
34702  * Two objects with NULL inner values will be considered "equal" here.
34703  */
34704 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
34705
34706 /**
34707  * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
34708  */
34709 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
34710
34711 /**
34712  * The genesis hash of the blockchain that was queried
34713  */
34714 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
34715
34716 /**
34717  * The genesis hash of the blockchain that was queried
34718  */
34719 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34720
34721 /**
34722  * Indicates if the query recipient maintains up-to-date channel
34723  * information for the `chain_hash`
34724  */
34725 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
34726
34727 /**
34728  * Indicates if the query recipient maintains up-to-date channel
34729  * information for the `chain_hash`
34730  */
34731 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
34732
34733 /**
34734  * Constructs a new ReplyShortChannelIdsEnd given each field
34735  */
34736 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
34737
34738 /**
34739  * Creates a copy of the ReplyShortChannelIdsEnd
34740  */
34741 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
34742
34743 /**
34744  * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
34745  * This ignores pointers and is_owned flags and looks at the values in fields.
34746  * Two objects with NULL inner values will be considered "equal" here.
34747  */
34748 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
34749
34750 /**
34751  * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
34752  */
34753 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
34754
34755 /**
34756  * The genesis hash of the blockchain for channel and node information
34757  */
34758 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
34759
34760 /**
34761  * The genesis hash of the blockchain for channel and node information
34762  */
34763 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34764
34765 /**
34766  * The starting unix timestamp
34767  */
34768 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
34769
34770 /**
34771  * The starting unix timestamp
34772  */
34773 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
34774
34775 /**
34776  * The range of information in seconds
34777  */
34778 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
34779
34780 /**
34781  * The range of information in seconds
34782  */
34783 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
34784
34785 /**
34786  * Constructs a new GossipTimestampFilter given each field
34787  */
34788 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
34789
34790 /**
34791  * Creates a copy of the GossipTimestampFilter
34792  */
34793 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
34794
34795 /**
34796  * Checks if two GossipTimestampFilters contain equal inner contents.
34797  * This ignores pointers and is_owned flags and looks at the values in fields.
34798  * Two objects with NULL inner values will be considered "equal" here.
34799  */
34800 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
34801
34802 /**
34803  * Frees any resources used by the ErrorAction
34804  */
34805 void ErrorAction_free(struct LDKErrorAction this_ptr);
34806
34807 /**
34808  * Creates a copy of the ErrorAction
34809  */
34810 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
34811
34812 /**
34813  * Utility method to constructs a new DisconnectPeer-variant ErrorAction
34814  */
34815 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
34816
34817 /**
34818  * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
34819  */
34820 struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
34821
34822 /**
34823  * Utility method to constructs a new IgnoreError-variant ErrorAction
34824  */
34825 struct LDKErrorAction ErrorAction_ignore_error(void);
34826
34827 /**
34828  * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
34829  */
34830 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
34831
34832 /**
34833  * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
34834  */
34835 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
34836
34837 /**
34838  * Utility method to constructs a new SendErrorMessage-variant ErrorAction
34839  */
34840 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
34841
34842 /**
34843  * Utility method to constructs a new SendWarningMessage-variant ErrorAction
34844  */
34845 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
34846
34847 /**
34848  * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
34849  */
34850 void LightningError_free(struct LDKLightningError this_obj);
34851
34852 /**
34853  * A human-readable message describing the error
34854  */
34855 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
34856
34857 /**
34858  * A human-readable message describing the error
34859  */
34860 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
34861
34862 /**
34863  * The action which should be taken against the offending peer.
34864  */
34865 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
34866
34867 /**
34868  * The action which should be taken against the offending peer.
34869  */
34870 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
34871
34872 /**
34873  * Constructs a new LightningError given each field
34874  */
34875 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
34876
34877 /**
34878  * Creates a copy of the LightningError
34879  */
34880 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
34881
34882 /**
34883  * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
34884  */
34885 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
34886
34887 /**
34888  * `update_add_htlc` messages which should be sent
34889  */
34890 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
34891
34892 /**
34893  * `update_add_htlc` messages which should be sent
34894  */
34895 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
34896
34897 /**
34898  * `update_fulfill_htlc` messages which should be sent
34899  */
34900 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
34901
34902 /**
34903  * `update_fulfill_htlc` messages which should be sent
34904  */
34905 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
34906
34907 /**
34908  * `update_fail_htlc` messages which should be sent
34909  */
34910 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
34911
34912 /**
34913  * `update_fail_htlc` messages which should be sent
34914  */
34915 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
34916
34917 /**
34918  * `update_fail_malformed_htlc` messages which should be sent
34919  */
34920 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
34921
34922 /**
34923  * `update_fail_malformed_htlc` messages which should be sent
34924  */
34925 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
34926
34927 /**
34928  * An `update_fee` message which should be sent
34929  *
34930  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
34931  */
34932 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
34933
34934 /**
34935  * An `update_fee` message which should be sent
34936  *
34937  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
34938  */
34939 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
34940
34941 /**
34942  * A `commitment_signed` message which should be sent
34943  */
34944 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
34945
34946 /**
34947  * A `commitment_signed` message which should be sent
34948  */
34949 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
34950
34951 /**
34952  * Constructs a new CommitmentUpdate given each field
34953  *
34954  * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
34955  */
34956 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);
34957
34958 /**
34959  * Creates a copy of the CommitmentUpdate
34960  */
34961 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
34962
34963 /**
34964  * Checks if two CommitmentUpdates contain equal inner contents.
34965  * This ignores pointers and is_owned flags and looks at the values in fields.
34966  * Two objects with NULL inner values will be considered "equal" here.
34967  */
34968 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
34969
34970 /**
34971  * Calls the free function if one is set
34972  */
34973 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
34974
34975 /**
34976  * Calls the free function if one is set
34977  */
34978 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
34979
34980 /**
34981  * Calls the free function if one is set
34982  */
34983 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
34984
34985 /**
34986  * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
34987  */
34988 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
34989
34990 /**
34991  * Read a AcceptChannel from a byte array, created by AcceptChannel_write
34992  */
34993 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
34994
34995 /**
34996  * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
34997  */
34998 struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
34999
35000 /**
35001  * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
35002  */
35003 struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
35004
35005 /**
35006  * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
35007  */
35008 struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
35009
35010 /**
35011  * Read a TxAddInput from a byte array, created by TxAddInput_write
35012  */
35013 struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
35014
35015 /**
35016  * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
35017  */
35018 struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
35019
35020 /**
35021  * Read a TxAddOutput from a byte array, created by TxAddOutput_write
35022  */
35023 struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
35024
35025 /**
35026  * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
35027  */
35028 struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
35029
35030 /**
35031  * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
35032  */
35033 struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
35034
35035 /**
35036  * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
35037  */
35038 struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
35039
35040 /**
35041  * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
35042  */
35043 struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
35044
35045 /**
35046  * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
35047  */
35048 struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
35049
35050 /**
35051  * Read a TxComplete from a byte array, created by TxComplete_write
35052  */
35053 struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
35054
35055 /**
35056  * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
35057  */
35058 struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
35059
35060 /**
35061  * Read a TxSignatures from a byte array, created by TxSignatures_write
35062  */
35063 struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
35064
35065 /**
35066  * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
35067  */
35068 struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
35069
35070 /**
35071  * Read a TxInitRbf from a byte array, created by TxInitRbf_write
35072  */
35073 struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
35074
35075 /**
35076  * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
35077  */
35078 struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
35079
35080 /**
35081  * Read a TxAckRbf from a byte array, created by TxAckRbf_write
35082  */
35083 struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
35084
35085 /**
35086  * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
35087  */
35088 struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
35089
35090 /**
35091  * Read a TxAbort from a byte array, created by TxAbort_write
35092  */
35093 struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
35094
35095 /**
35096  * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
35097  */
35098 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
35099
35100 /**
35101  * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
35102  */
35103 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
35104
35105 /**
35106  * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
35107  */
35108 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
35109
35110 /**
35111  * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
35112  */
35113 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
35114
35115 /**
35116  * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
35117  */
35118 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
35119
35120 /**
35121  * Read a ClosingSigned from a byte array, created by ClosingSigned_write
35122  */
35123 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
35124
35125 /**
35126  * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
35127  */
35128 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
35129
35130 /**
35131  * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
35132  */
35133 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
35134
35135 /**
35136  * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
35137  */
35138 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
35139
35140 /**
35141  * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
35142  */
35143 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
35144
35145 /**
35146  * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
35147  */
35148 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
35149
35150 /**
35151  * Read a FundingCreated from a byte array, created by FundingCreated_write
35152  */
35153 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
35154
35155 /**
35156  * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
35157  */
35158 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
35159
35160 /**
35161  * Read a FundingSigned from a byte array, created by FundingSigned_write
35162  */
35163 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
35164
35165 /**
35166  * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
35167  */
35168 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
35169
35170 /**
35171  * Read a ChannelReady from a byte array, created by ChannelReady_write
35172  */
35173 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
35174
35175 /**
35176  * Serialize the Init object into a byte array which can be read by Init_read
35177  */
35178 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
35179
35180 /**
35181  * Read a Init from a byte array, created by Init_write
35182  */
35183 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
35184
35185 /**
35186  * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
35187  */
35188 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
35189
35190 /**
35191  * Read a OpenChannel from a byte array, created by OpenChannel_write
35192  */
35193 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
35194
35195 /**
35196  * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
35197  */
35198 struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
35199
35200 /**
35201  * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
35202  */
35203 struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
35204
35205 /**
35206  * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
35207  */
35208 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
35209
35210 /**
35211  * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
35212  */
35213 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
35214
35215 /**
35216  * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
35217  */
35218 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
35219
35220 /**
35221  * Read a Shutdown from a byte array, created by Shutdown_write
35222  */
35223 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
35224
35225 /**
35226  * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
35227  */
35228 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
35229
35230 /**
35231  * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
35232  */
35233 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
35234
35235 /**
35236  * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
35237  */
35238 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
35239
35240 /**
35241  * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
35242  */
35243 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
35244
35245 /**
35246  * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
35247  */
35248 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
35249
35250 /**
35251  * Read a UpdateFee from a byte array, created by UpdateFee_write
35252  */
35253 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
35254
35255 /**
35256  * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
35257  */
35258 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
35259
35260 /**
35261  * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
35262  */
35263 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
35264
35265 /**
35266  * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
35267  */
35268 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
35269
35270 /**
35271  * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
35272  */
35273 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
35274
35275 /**
35276  * Read a OnionMessage from a byte array, created by OnionMessage_write
35277  */
35278 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
35279
35280 /**
35281  * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
35282  */
35283 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
35284
35285 /**
35286  * Serialize the Ping object into a byte array which can be read by Ping_read
35287  */
35288 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
35289
35290 /**
35291  * Read a Ping from a byte array, created by Ping_write
35292  */
35293 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
35294
35295 /**
35296  * Serialize the Pong object into a byte array which can be read by Pong_read
35297  */
35298 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
35299
35300 /**
35301  * Read a Pong from a byte array, created by Pong_write
35302  */
35303 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
35304
35305 /**
35306  * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
35307  */
35308 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
35309
35310 /**
35311  * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
35312  */
35313 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
35314
35315 /**
35316  * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
35317  */
35318 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
35319
35320 /**
35321  * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
35322  */
35323 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
35324
35325 /**
35326  * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
35327  */
35328 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
35329
35330 /**
35331  * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
35332  */
35333 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
35334
35335 /**
35336  * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
35337  */
35338 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
35339
35340 /**
35341  * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
35342  */
35343 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
35344
35345 /**
35346  * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
35347  */
35348 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
35349
35350 /**
35351  * Read a ErrorMessage from a byte array, created by ErrorMessage_write
35352  */
35353 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
35354
35355 /**
35356  * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
35357  */
35358 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
35359
35360 /**
35361  * Read a WarningMessage from a byte array, created by WarningMessage_write
35362  */
35363 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
35364
35365 /**
35366  * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
35367  */
35368 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
35369
35370 /**
35371  * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
35372  */
35373 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
35374
35375 /**
35376  * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
35377  */
35378 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
35379
35380 /**
35381  * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
35382  */
35383 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
35384
35385 /**
35386  * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
35387  */
35388 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
35389
35390 /**
35391  * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
35392  */
35393 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
35394
35395 /**
35396  * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
35397  */
35398 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
35399
35400 /**
35401  * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
35402  */
35403 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
35404
35405 /**
35406  * Calculates the overflow safe ending block height for the query.
35407  *
35408  * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
35409  */
35410 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
35411
35412 /**
35413  * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
35414  */
35415 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
35416
35417 /**
35418  * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
35419  */
35420 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
35421
35422 /**
35423  * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
35424  */
35425 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
35426
35427 /**
35428  * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
35429  */
35430 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
35431
35432 /**
35433  * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
35434  */
35435 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
35436
35437 /**
35438  * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
35439  */
35440 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
35441
35442 /**
35443  * Calls the free function if one is set
35444  */
35445 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
35446
35447 /**
35448  * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
35449  */
35450 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
35451
35452 /**
35453  * Constructs a new IgnoringMessageHandler given each field
35454  */
35455 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
35456
35457 /**
35458  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
35459  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
35460  */
35461 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35462
35463 /**
35464  * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
35465  * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
35466  */
35467 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35468
35469 /**
35470  * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
35471  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
35472  */
35473 struct LDKOnionMessageProvider IgnoringMessageHandler_as_OnionMessageProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35474
35475 /**
35476  * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
35477  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
35478  */
35479 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35480
35481 /**
35482  * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
35483  * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
35484  */
35485 struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35486
35487 /**
35488  * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
35489  * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
35490  */
35491 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35492
35493 /**
35494  * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
35495  * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
35496  */
35497 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35498
35499 /**
35500  * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
35501  * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
35502  */
35503 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
35504
35505 /**
35506  * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
35507  */
35508 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
35509
35510 /**
35511  * Constructs a new ErroringMessageHandler
35512  */
35513 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
35514
35515 /**
35516  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
35517  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
35518  */
35519 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
35520
35521 /**
35522  * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
35523  * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
35524  */
35525 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
35526
35527 /**
35528  * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
35529  */
35530 void MessageHandler_free(struct LDKMessageHandler this_obj);
35531
35532 /**
35533  * A message handler which handles messages specific to channels. Usually this is just a
35534  * [`ChannelManager`] object or an [`ErroringMessageHandler`].
35535  *
35536  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
35537  */
35538 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
35539
35540 /**
35541  * A message handler which handles messages specific to channels. Usually this is just a
35542  * [`ChannelManager`] object or an [`ErroringMessageHandler`].
35543  *
35544  * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
35545  */
35546 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
35547
35548 /**
35549  * A message handler which handles messages updating our knowledge of the network channel
35550  * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
35551  *
35552  * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
35553  */
35554 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
35555
35556 /**
35557  * A message handler which handles messages updating our knowledge of the network channel
35558  * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
35559  *
35560  * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
35561  */
35562 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
35563
35564 /**
35565  * A message handler which handles onion messages. This should generally be an
35566  * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
35567  *
35568  * [`OnionMessenger`]: crate::onion_message::OnionMessenger
35569  */
35570 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
35571
35572 /**
35573  * A message handler which handles onion messages. This should generally be an
35574  * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
35575  *
35576  * [`OnionMessenger`]: crate::onion_message::OnionMessenger
35577  */
35578 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
35579
35580 /**
35581  * A message handler which handles custom messages. The only LDK-provided implementation is
35582  * [`IgnoringMessageHandler`].
35583  */
35584 const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
35585
35586 /**
35587  * A message handler which handles custom messages. The only LDK-provided implementation is
35588  * [`IgnoringMessageHandler`].
35589  */
35590 void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
35591
35592 /**
35593  * Constructs a new MessageHandler given each field
35594  */
35595 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);
35596
35597 /**
35598  * Creates a copy of a SocketDescriptor
35599  */
35600 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
35601
35602 /**
35603  * Calls the free function if one is set
35604  */
35605 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
35606
35607 /**
35608  * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
35609  */
35610 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
35611
35612 /**
35613  * Constructs a new PeerHandleError given each field
35614  */
35615 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
35616
35617 /**
35618  * Creates a copy of the PeerHandleError
35619  */
35620 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
35621
35622 /**
35623  * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
35624  */
35625 void PeerManager_free(struct LDKPeerManager this_obj);
35626
35627 /**
35628  * Constructs a new `PeerManager` with the given message handlers.
35629  *
35630  * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
35631  * cryptographically secure random bytes.
35632  *
35633  * `current_time` is used as an always-increasing counter that survives across restarts and is
35634  * incremented irregularly internally. In general it is best to simply use the current UNIX
35635  * timestamp, however if it is not available a persistent counter that increases once per
35636  * minute should suffice.
35637  */
35638 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);
35639
35640 /**
35641  * Get a list of tuples mapping from node id to network addresses for peers which have
35642  * completed the initial handshake.
35643  *
35644  * For outbound connections, the [`PublicKey`] will be the same as the `their_node_id` parameter
35645  * passed in to [`Self::new_outbound_connection`], however entries will only appear once the initial
35646  * handshake has completed and we are sure the remote peer has the private key for the given
35647  * [`PublicKey`].
35648  *
35649  * The returned `Option`s will only be `Some` if an address had been previously given via
35650  * [`Self::new_outbound_connection`] or [`Self::new_inbound_connection`].
35651  */
35652 MUST_USE_RES struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
35653
35654 /**
35655  * Indicates a new outbound connection has been established to a node with the given `node_id`
35656  * and an optional remote network address.
35657  *
35658  * The remote network address adds the option to report a remote IP address back to a connecting
35659  * peer using the init message.
35660  * The user should pass the remote network address of the host they are connected to.
35661  *
35662  * If an `Err` is returned here you must disconnect the connection immediately.
35663  *
35664  * Returns a small number of bytes to send to the remote node (currently always 50).
35665  *
35666  * Panics if descriptor is duplicative with some other descriptor which has not yet been
35667  * [`socket_disconnected`].
35668  *
35669  * [`socket_disconnected`]: PeerManager::socket_disconnected
35670  */
35671 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);
35672
35673 /**
35674  * Indicates a new inbound connection has been established to a node with an optional remote
35675  * network address.
35676  *
35677  * The remote network address adds the option to report a remote IP address back to a connecting
35678  * peer using the init message.
35679  * The user should pass the remote network address of the host they are connected to.
35680  *
35681  * May refuse the connection by returning an Err, but will never write bytes to the remote end
35682  * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
35683  * the connection immediately.
35684  *
35685  * Panics if descriptor is duplicative with some other descriptor which has not yet been
35686  * [`socket_disconnected`].
35687  *
35688  * [`socket_disconnected`]: PeerManager::socket_disconnected
35689  */
35690 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);
35691
35692 /**
35693  * Indicates that there is room to write data to the given socket descriptor.
35694  *
35695  * May return an Err to indicate that the connection should be closed.
35696  *
35697  * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
35698  * returning. Thus, be very careful with reentrancy issues! The invariants around calling
35699  * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
35700  * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
35701  * sufficient!
35702  *
35703  * [`send_data`]: SocketDescriptor::send_data
35704  * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
35705  */
35706 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
35707
35708 /**
35709  * Indicates that data was read from the given socket descriptor.
35710  *
35711  * May return an Err to indicate that the connection should be closed.
35712  *
35713  * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
35714  * Thus, however, you should call [`process_events`] after any `read_event` to generate
35715  * [`send_data`] calls to handle responses.
35716  *
35717  * If `Ok(true)` is returned, further read_events should not be triggered until a
35718  * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
35719  * send buffer).
35720  *
35721  * In order to avoid processing too many messages at once per peer, `data` should be on the
35722  * order of 4KiB.
35723  *
35724  * [`send_data`]: SocketDescriptor::send_data
35725  * [`process_events`]: PeerManager::process_events
35726  */
35727 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);
35728
35729 /**
35730  * Checks for any events generated by our handlers and processes them. Includes sending most
35731  * response messages as well as messages generated by calls to handler functions directly (eg
35732  * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
35733  *
35734  * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
35735  * issues!
35736  *
35737  * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
35738  * or one of the other clients provided in our language bindings.
35739  *
35740  * Note that if there are any other calls to this function waiting on lock(s) this may return
35741  * without doing any work. All available events that need handling will be handled before the
35742  * other calls return.
35743  *
35744  * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
35745  * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
35746  * [`send_data`]: SocketDescriptor::send_data
35747  */
35748 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
35749
35750 /**
35751  * Indicates that the given socket descriptor's connection is now closed.
35752  */
35753 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
35754
35755 /**
35756  * Disconnect a peer given its node id.
35757  *
35758  * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
35759  * peer. Thus, be very careful about reentrancy issues.
35760  *
35761  * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
35762  */
35763 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
35764
35765 /**
35766  * Disconnects all currently-connected peers. This is useful on platforms where there may be
35767  * an indication that TCP sockets have stalled even if we weren't around to time them out
35768  * using regular ping/pongs.
35769  */
35770 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
35771
35772 /**
35773  * Send pings to each peer and disconnect those which did not respond to the last round of
35774  * pings.
35775  *
35776  * This may be called on any timescale you want, however, roughly once every ten seconds is
35777  * preferred. The call rate determines both how often we send a ping to our peers and how much
35778  * time they have to respond before we disconnect them.
35779  *
35780  * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
35781  * issues!
35782  *
35783  * [`send_data`]: SocketDescriptor::send_data
35784  */
35785 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
35786
35787 /**
35788  * Generates a signed node_announcement from the given arguments, sending it to all connected
35789  * peers. Note that peers will likely ignore this message unless we have at least one public
35790  * channel which has at least six confirmations on-chain.
35791  *
35792  * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
35793  * node to humans. They carry no in-protocol meaning.
35794  *
35795  * `addresses` represent the set (possibly empty) of socket addresses on which this node
35796  * accepts incoming connections. These will be included in the node_announcement, publicly
35797  * tying these addresses together and to this node. If you wish to preserve user privacy,
35798  * addresses should likely contain only Tor Onion addresses.
35799  *
35800  * Panics if `addresses` is absurdly large (more than 100).
35801  *
35802  * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
35803  */
35804 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
35805
35806 /**
35807  * Gets the weight for an HTLC-Success transaction.
35808  */
35809 uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
35810
35811 /**
35812  * Gets the weight for an HTLC-Timeout transaction.
35813  */
35814 uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
35815
35816 /**
35817  * Creates a copy of the HTLCClaim
35818  */
35819 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
35820
35821 /**
35822  * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
35823  */
35824 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
35825
35826 /**
35827  * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
35828  */
35829 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
35830
35831 /**
35832  * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
35833  */
35834 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
35835
35836 /**
35837  * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
35838  */
35839 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
35840
35841 /**
35842  * Utility method to constructs a new Revocation-variant HTLCClaim
35843  */
35844 enum LDKHTLCClaim HTLCClaim_revocation(void);
35845
35846 /**
35847  * Checks if two HTLCClaims contain equal inner contents.
35848  * This ignores pointers and is_owned flags and looks at the values in fields.
35849  */
35850 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
35851
35852 /**
35853  * Check if a given input witness attempts to claim a HTLC.
35854  */
35855 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
35856
35857 /**
35858  * Build the commitment secret from the seed and the commitment number
35859  */
35860 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
35861
35862 /**
35863  * Build a closing transaction
35864  */
35865 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);
35866
35867 /**
35868  * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
35869  */
35870 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
35871
35872 /**
35873  * Creates a copy of the CounterpartyCommitmentSecrets
35874  */
35875 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
35876
35877 /**
35878  * Creates a new empty `CounterpartyCommitmentSecrets` structure.
35879  */
35880 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
35881
35882 /**
35883  * Returns the minimum index of all stored secrets. Note that indexes start
35884  * at 1 << 48 and get decremented by one for each new secret.
35885  */
35886 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
35887
35888 /**
35889  * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
35890  * was generated in accordance with BOLT 3 and is consistent with previous secrets.
35891  */
35892 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
35893
35894 /**
35895  * Returns the secret at `idx`.
35896  * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
35897  *
35898  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35899  */
35900 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
35901
35902 /**
35903  * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
35904  */
35905 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
35906
35907 /**
35908  * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
35909  */
35910 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
35911
35912 /**
35913  * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
35914  * from the base secret and the per_commitment_point.
35915  */
35916 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
35917
35918 /**
35919  * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
35920  * from the base point and the per_commitment_key. This is the public equivalent of
35921  * derive_private_key - using only public keys to derive a public key instead of private keys.
35922  */
35923 struct LDKPublicKey derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
35924
35925 /**
35926  * Derives a per-commitment-transaction revocation key from its constituent parts.
35927  *
35928  * Only the cheating participant owns a valid witness to propagate a revoked
35929  * commitment transaction, thus per_commitment_secret always come from cheater
35930  * and revocation_base_secret always come from punisher, which is the broadcaster
35931  * of the transaction spending with this key knowledge.
35932  */
35933 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
35934
35935 /**
35936  * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
35937  * the public equivalend of derive_private_revocation_key - using only public keys to derive a
35938  * public key instead of private keys.
35939  *
35940  * Only the cheating participant owns a valid witness to propagate a revoked
35941  * commitment transaction, thus per_commitment_point always come from cheater
35942  * and revocation_base_point always come from punisher, which is the broadcaster
35943  * of the transaction spending with this key knowledge.
35944  *
35945  * Note that this is infallible iff we trust that at least one of the two input keys are randomly
35946  * generated (ie our own).
35947  */
35948 struct LDKPublicKey derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
35949
35950 /**
35951  * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
35952  */
35953 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
35954
35955 /**
35956  * The broadcaster's per-commitment public key which was used to derive the other keys.
35957  */
35958 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
35959
35960 /**
35961  * The broadcaster's per-commitment public key which was used to derive the other keys.
35962  */
35963 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35964
35965 /**
35966  * The revocation key which is used to allow the broadcaster of the commitment
35967  * transaction to provide their counterparty the ability to punish them if they broadcast
35968  * an old state.
35969  */
35970 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
35971
35972 /**
35973  * The revocation key which is used to allow the broadcaster of the commitment
35974  * transaction to provide their counterparty the ability to punish them if they broadcast
35975  * an old state.
35976  */
35977 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35978
35979 /**
35980  * Broadcaster's HTLC Key
35981  */
35982 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
35983
35984 /**
35985  * Broadcaster's HTLC Key
35986  */
35987 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35988
35989 /**
35990  * Countersignatory's HTLC Key
35991  */
35992 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
35993
35994 /**
35995  * Countersignatory's HTLC Key
35996  */
35997 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35998
35999 /**
36000  * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
36001  */
36002 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
36003
36004 /**
36005  * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
36006  */
36007 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36008
36009 /**
36010  * Constructs a new TxCreationKeys given each field
36011  */
36012 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg);
36013
36014 /**
36015  * Checks if two TxCreationKeyss contain equal inner contents.
36016  * This ignores pointers and is_owned flags and looks at the values in fields.
36017  * Two objects with NULL inner values will be considered "equal" here.
36018  */
36019 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
36020
36021 /**
36022  * Creates a copy of the TxCreationKeys
36023  */
36024 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
36025
36026 /**
36027  * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
36028  */
36029 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
36030
36031 /**
36032  * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
36033  */
36034 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
36035
36036 /**
36037  * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
36038  */
36039 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
36040
36041 /**
36042  * The public key which is used to sign all commitment transactions, as it appears in the
36043  * on-chain channel lock-in 2-of-2 multisig output.
36044  */
36045 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36046
36047 /**
36048  * The public key which is used to sign all commitment transactions, as it appears in the
36049  * on-chain channel lock-in 2-of-2 multisig output.
36050  */
36051 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36052
36053 /**
36054  * The base point which is used (with derive_public_revocation_key) to derive per-commitment
36055  * revocation keys. This is combined with the per-commitment-secret generated by the
36056  * counterparty to create a secret which the counterparty can reveal to revoke previous
36057  * states.
36058  */
36059 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36060
36061 /**
36062  * The base point which is used (with derive_public_revocation_key) to derive per-commitment
36063  * revocation keys. This is combined with the per-commitment-secret generated by the
36064  * counterparty to create a secret which the counterparty can reveal to revoke previous
36065  * states.
36066  */
36067 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36068
36069 /**
36070  * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
36071  * spendable primary channel balance on the broadcaster's commitment transaction. This key is
36072  * static across every commitment transaction.
36073  */
36074 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36075
36076 /**
36077  * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
36078  * spendable primary channel balance on the broadcaster's commitment transaction. This key is
36079  * static across every commitment transaction.
36080  */
36081 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36082
36083 /**
36084  * The base point which is used (with derive_public_key) to derive a per-commitment payment
36085  * public key which receives non-HTLC-encumbered funds which are only available for spending
36086  * after some delay (or can be claimed via the revocation path).
36087  */
36088 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36089
36090 /**
36091  * The base point which is used (with derive_public_key) to derive a per-commitment payment
36092  * public key which receives non-HTLC-encumbered funds which are only available for spending
36093  * after some delay (or can be claimed via the revocation path).
36094  */
36095 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36096
36097 /**
36098  * The base point which is used (with derive_public_key) to derive a per-commitment public key
36099  * which is used to encumber HTLC-in-flight outputs.
36100  */
36101 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
36102
36103 /**
36104  * The base point which is used (with derive_public_key) to derive a per-commitment public key
36105  * which is used to encumber HTLC-in-flight outputs.
36106  */
36107 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36108
36109 /**
36110  * Constructs a new ChannelPublicKeys given each field
36111  */
36112 MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg);
36113
36114 /**
36115  * Creates a copy of the ChannelPublicKeys
36116  */
36117 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
36118
36119 /**
36120  * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
36121  */
36122 uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
36123
36124 /**
36125  * Checks if two ChannelPublicKeyss contain equal inner contents.
36126  * This ignores pointers and is_owned flags and looks at the values in fields.
36127  * Two objects with NULL inner values will be considered "equal" here.
36128  */
36129 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
36130
36131 /**
36132  * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
36133  */
36134 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
36135
36136 /**
36137  * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
36138  */
36139 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
36140
36141 /**
36142  * Create per-state keys from channel base points and the per-commitment point.
36143  * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
36144  */
36145 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base);
36146
36147 /**
36148  * Generate per-state keys from channel static keys.
36149  * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
36150  */
36151 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);
36152
36153 /**
36154  * A script either spendable by the revocation
36155  * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
36156  * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
36157  */
36158 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
36159
36160 /**
36161  * Returns the script for the counterparty's output on a holder's commitment transaction based on
36162  * the channel type.
36163  */
36164 struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
36165
36166 /**
36167  * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
36168  */
36169 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
36170
36171 /**
36172  * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
36173  * Note that this is not the same as whether it is ountbound *from us*. To determine that you
36174  * need to compare this value to whether the commitment transaction in question is that of
36175  * the counterparty or our own.
36176  */
36177 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36178
36179 /**
36180  * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
36181  * Note that this is not the same as whether it is ountbound *from us*. To determine that you
36182  * need to compare this value to whether the commitment transaction in question is that of
36183  * the counterparty or our own.
36184  */
36185 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
36186
36187 /**
36188  * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
36189  * this divided by 1000.
36190  */
36191 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36192
36193 /**
36194  * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
36195  * this divided by 1000.
36196  */
36197 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
36198
36199 /**
36200  * The CLTV lock-time at which this HTLC expires.
36201  */
36202 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36203
36204 /**
36205  * The CLTV lock-time at which this HTLC expires.
36206  */
36207 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
36208
36209 /**
36210  * The hash of the preimage which unlocks this HTLC.
36211  */
36212 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
36213
36214 /**
36215  * The hash of the preimage which unlocks this HTLC.
36216  */
36217 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36218
36219 /**
36220  * The position within the commitment transactions' outputs. This may be None if the value is
36221  * below the dust limit (in which case no output appears in the commitment transaction and the
36222  * value is spent to additional transaction fees).
36223  */
36224 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
36225
36226 /**
36227  * The position within the commitment transactions' outputs. This may be None if the value is
36228  * below the dust limit (in which case no output appears in the commitment transaction and the
36229  * value is spent to additional transaction fees).
36230  */
36231 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
36232
36233 /**
36234  * Constructs a new HTLCOutputInCommitment given each field
36235  */
36236 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);
36237
36238 /**
36239  * Creates a copy of the HTLCOutputInCommitment
36240  */
36241 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
36242
36243 /**
36244  * Checks if two HTLCOutputInCommitments contain equal inner contents.
36245  * This ignores pointers and is_owned flags and looks at the values in fields.
36246  * Two objects with NULL inner values will be considered "equal" here.
36247  */
36248 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
36249
36250 /**
36251  * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
36252  */
36253 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
36254
36255 /**
36256  * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
36257  */
36258 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
36259
36260 /**
36261  * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
36262  * does not need to have its previous_output_index filled.
36263  */
36264 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);
36265
36266 /**
36267  * Gets the redeemscript for a funding output from the two funding public keys.
36268  * Note that the order of funding public keys does not matter.
36269  */
36270 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
36271
36272 /**
36273  * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
36274  * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
36275  * transaction which needs signing, and can be used to construct an HTLC transaction which is
36276  * broadcastable given a counterparty HTLC signature.
36277  *
36278  * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
36279  * commitment transaction).
36280  */
36281 struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
36282
36283 /**
36284  * Returns the witness required to satisfy and spend a HTLC input.
36285  */
36286 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);
36287
36288 /**
36289  * Gets the witnessScript for the to_remote output when anchors are enabled.
36290  */
36291 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
36292
36293 /**
36294  * Gets the witnessScript for an anchor output from the funding public key.
36295  * The witness in the spending input must be:
36296  * <BIP 143 funding_signature>
36297  * After 16 blocks of confirmation, an alternative satisfying witness could be:
36298  * <>
36299  * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
36300  */
36301 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
36302
36303 /**
36304  * Returns the witness required to satisfy and spend an anchor input.
36305  */
36306 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
36307
36308 /**
36309  * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
36310  */
36311 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
36312
36313 /**
36314  * Holder public keys
36315  */
36316 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36317
36318 /**
36319  * Holder public keys
36320  */
36321 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
36322
36323 /**
36324  * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
36325  */
36326 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36327
36328 /**
36329  * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
36330  */
36331 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
36332
36333 /**
36334  * Whether the holder is the initiator of this channel.
36335  * This is an input to the commitment number obscure factor computation.
36336  */
36337 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36338
36339 /**
36340  * Whether the holder is the initiator of this channel.
36341  * This is an input to the commitment number obscure factor computation.
36342  */
36343 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
36344
36345 /**
36346  * The late-bound counterparty channel transaction parameters.
36347  * These parameters are populated at the point in the protocol where the counterparty provides them.
36348  *
36349  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36350  */
36351 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36352
36353 /**
36354  * The late-bound counterparty channel transaction parameters.
36355  * These parameters are populated at the point in the protocol where the counterparty provides them.
36356  *
36357  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36358  */
36359 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
36360
36361 /**
36362  * The late-bound funding outpoint
36363  *
36364  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36365  */
36366 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36367
36368 /**
36369  * The late-bound funding outpoint
36370  *
36371  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36372  */
36373 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
36374
36375 /**
36376  * This channel's type, as negotiated during channel open. For old objects where this field
36377  * wasn't serialized, it will default to static_remote_key at deserialization.
36378  */
36379 struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
36380
36381 /**
36382  * This channel's type, as negotiated during channel open. For old objects where this field
36383  * wasn't serialized, it will default to static_remote_key at deserialization.
36384  */
36385 void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
36386
36387 /**
36388  * Constructs a new ChannelTransactionParameters given each field
36389  *
36390  * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36391  * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36392  */
36393 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);
36394
36395 /**
36396  * Creates a copy of the ChannelTransactionParameters
36397  */
36398 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
36399
36400 /**
36401  * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
36402  */
36403 uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
36404
36405 /**
36406  * Checks if two ChannelTransactionParameterss contain equal inner contents.
36407  * This ignores pointers and is_owned flags and looks at the values in fields.
36408  * Two objects with NULL inner values will be considered "equal" here.
36409  */
36410 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
36411
36412 /**
36413  * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
36414  */
36415 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
36416
36417 /**
36418  * Counter-party public keys
36419  */
36420 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
36421
36422 /**
36423  * Counter-party public keys
36424  */
36425 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
36426
36427 /**
36428  * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
36429  */
36430 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
36431
36432 /**
36433  * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
36434  */
36435 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
36436
36437 /**
36438  * Constructs a new CounterpartyChannelTransactionParameters given each field
36439  */
36440 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
36441
36442 /**
36443  * Creates a copy of the CounterpartyChannelTransactionParameters
36444  */
36445 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
36446
36447 /**
36448  * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
36449  */
36450 uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
36451
36452 /**
36453  * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
36454  * This ignores pointers and is_owned flags and looks at the values in fields.
36455  * Two objects with NULL inner values will be considered "equal" here.
36456  */
36457 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
36458
36459 /**
36460  * Whether the late bound parameters are populated.
36461  */
36462 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
36463
36464 /**
36465  * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
36466  * given that the holder is the broadcaster.
36467  *
36468  * self.is_populated() must be true before calling this function.
36469  */
36470 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
36471
36472 /**
36473  * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
36474  * given that the counterparty is the broadcaster.
36475  *
36476  * self.is_populated() must be true before calling this function.
36477  */
36478 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
36479
36480 /**
36481  * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
36482  */
36483 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
36484
36485 /**
36486  * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
36487  */
36488 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
36489
36490 /**
36491  * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
36492  */
36493 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
36494
36495 /**
36496  * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
36497  */
36498 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
36499
36500 /**
36501  * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
36502  */
36503 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
36504
36505 /**
36506  * Get the channel pubkeys for the broadcaster
36507  */
36508 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
36509
36510 /**
36511  * Get the channel pubkeys for the countersignatory
36512  */
36513 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
36514
36515 /**
36516  * Get the contest delay applicable to the transactions.
36517  * Note that the contest delay was selected by the countersignatory.
36518  */
36519 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
36520
36521 /**
36522  * Whether the channel is outbound from the broadcaster.
36523  *
36524  * The boolean representing the side that initiated the channel is
36525  * an input to the commitment number obscure factor computation.
36526  */
36527 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
36528
36529 /**
36530  * The funding outpoint
36531  */
36532 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
36533
36534 /**
36535  * Whether to use anchors for this channel
36536  */
36537 MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
36538
36539 /**
36540  * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
36541  */
36542 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
36543
36544 /**
36545  * Our counterparty's signature for the transaction
36546  */
36547 struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
36548
36549 /**
36550  * Our counterparty's signature for the transaction
36551  */
36552 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
36553
36554 /**
36555  * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
36556  *
36557  * Returns a copy of the field.
36558  */
36559 struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
36560
36561 /**
36562  * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
36563  */
36564 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
36565
36566 /**
36567  * Creates a copy of the HolderCommitmentTransaction
36568  */
36569 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
36570
36571 /**
36572  * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
36573  */
36574 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
36575
36576 /**
36577  * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
36578  */
36579 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
36580
36581 /**
36582  * Create a new holder transaction with the given counterparty signatures.
36583  * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
36584  */
36585 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);
36586
36587 /**
36588  * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
36589  */
36590 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
36591
36592 /**
36593  * The commitment transaction
36594  */
36595 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
36596
36597 /**
36598  * The commitment transaction
36599  */
36600 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
36601
36602 /**
36603  * The txid for the commitment transaction.
36604  *
36605  * This is provided as a performance optimization, instead of calling transaction.txid()
36606  * multiple times.
36607  */
36608 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
36609
36610 /**
36611  * The txid for the commitment transaction.
36612  *
36613  * This is provided as a performance optimization, instead of calling transaction.txid()
36614  * multiple times.
36615  */
36616 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36617
36618 /**
36619  * Constructs a new BuiltCommitmentTransaction given each field
36620  */
36621 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
36622
36623 /**
36624  * Creates a copy of the BuiltCommitmentTransaction
36625  */
36626 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
36627
36628 /**
36629  * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
36630  */
36631 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
36632
36633 /**
36634  * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
36635  */
36636 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
36637
36638 /**
36639  * Get the SIGHASH_ALL sighash value of the transaction.
36640  *
36641  * This can be used to verify a signature.
36642  */
36643 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);
36644
36645 /**
36646  * Signs the counterparty's commitment transaction.
36647  */
36648 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);
36649
36650 /**
36651  * Signs the holder commitment transaction because we are about to broadcast it.
36652  */
36653 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);
36654
36655 /**
36656  * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
36657  */
36658 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
36659
36660 /**
36661  * Creates a copy of the ClosingTransaction
36662  */
36663 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
36664
36665 /**
36666  * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
36667  */
36668 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
36669
36670 /**
36671  * Checks if two ClosingTransactions contain equal inner contents.
36672  * This ignores pointers and is_owned flags and looks at the values in fields.
36673  * Two objects with NULL inner values will be considered "equal" here.
36674  */
36675 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
36676
36677 /**
36678  * Construct an object of the class
36679  */
36680 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);
36681
36682 /**
36683  * Trust our pre-built transaction.
36684  *
36685  * Applies a wrapper which allows access to the transaction.
36686  *
36687  * This should only be used if you fully trust the builder of this object. It should not
36688  * be used by an external signer - instead use the verify function.
36689  */
36690 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
36691
36692 /**
36693  * Verify our pre-built transaction.
36694  *
36695  * Applies a wrapper which allows access to the transaction.
36696  *
36697  * An external validating signer must call this method before signing
36698  * or using the built transaction.
36699  */
36700 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
36701
36702 /**
36703  * The value to be sent to the holder, or zero if the output will be omitted
36704  */
36705 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
36706
36707 /**
36708  * The value to be sent to the counterparty, or zero if the output will be omitted
36709  */
36710 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
36711
36712 /**
36713  * The destination of the holder's output
36714  */
36715 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
36716
36717 /**
36718  * The destination of the counterparty's output
36719  */
36720 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
36721
36722 /**
36723  * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
36724  */
36725 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
36726
36727 /**
36728  * The pre-built Bitcoin commitment transaction
36729  */
36730 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
36731
36732 /**
36733  * Get the SIGHASH_ALL sighash value of the transaction.
36734  *
36735  * This can be used to verify a signature.
36736  */
36737 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);
36738
36739 /**
36740  * Sign a transaction, either because we are counter-signing the counterparty's transaction or
36741  * because we are about to broadcast a holder transaction.
36742  */
36743 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);
36744
36745 /**
36746  * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
36747  */
36748 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
36749
36750 /**
36751  * Creates a copy of the CommitmentTransaction
36752  */
36753 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
36754
36755 /**
36756  * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
36757  */
36758 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
36759
36760 /**
36761  * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
36762  */
36763 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
36764
36765 /**
36766  * The backwards-counting commitment number
36767  */
36768 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
36769
36770 /**
36771  * The value to be sent to the broadcaster
36772  */
36773 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
36774
36775 /**
36776  * The value to be sent to the counterparty
36777  */
36778 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
36779
36780 /**
36781  * The feerate paid per 1000-weight-unit in this commitment transaction.
36782  */
36783 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
36784
36785 /**
36786  * Trust our pre-built transaction and derived transaction creation public keys.
36787  *
36788  * Applies a wrapper which allows access to these fields.
36789  *
36790  * This should only be used if you fully trust the builder of this object.  It should not
36791  * be used by an external signer - instead use the verify function.
36792  */
36793 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
36794
36795 /**
36796  * Verify our pre-built transaction and derived transaction creation public keys.
36797  *
36798  * Applies a wrapper which allows access to these fields.
36799  *
36800  * An external validating signer must call this method before signing
36801  * or using the built transaction.
36802  */
36803 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);
36804
36805 /**
36806  * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
36807  */
36808 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
36809
36810 /**
36811  * The transaction ID of the built Bitcoin transaction
36812  */
36813 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
36814
36815 /**
36816  * The pre-built Bitcoin commitment transaction
36817  */
36818 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
36819
36820 /**
36821  * The pre-calculated transaction creation public keys.
36822  */
36823 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
36824
36825 /**
36826  * Should anchors be used.
36827  */
36828 MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
36829
36830 /**
36831  * Get a signature for each HTLC which was included in the commitment transaction (ie for
36832  * which HTLCOutputInCommitment::transaction_output_index.is_some()).
36833  *
36834  * The returned Vec has one entry for each HTLC, and in the same order.
36835  *
36836  * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
36837  */
36838 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);
36839
36840 /**
36841  * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
36842  * the broadcaster, in the built transaction, if any exists.
36843  *
36844  * There are two cases where this may return `None`:
36845  * - The balance of the revokeable output is below the dust limit (only found on commitments
36846  * early in the channel's lifetime, i.e. before the channel reserve is met).
36847  * - This commitment was created before LDK 0.0.117. In this case, the
36848  * commitment transaction previously didn't contain enough information to locate the
36849  * revokeable output.
36850  */
36851 MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
36852
36853 /**
36854  * Helper method to build an unsigned justice transaction spending the revokeable
36855  * `to_local` output to a destination script. Fee estimation accounts for the expected
36856  * revocation witness data that will be added when signed.
36857  *
36858  * This method will error if the given fee rate results in a fee greater than the value
36859  * of the output being spent, or if there exists no revokeable `to_local` output on this
36860  * commitment transaction. See [`Self::revokeable_output_index`] for more details.
36861  *
36862  * The built transaction will allow fee bumping with RBF, and this method takes
36863  * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
36864  * fee rates may be built.
36865  */
36866 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);
36867
36868 /**
36869  * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
36870  * shared secret first. This prevents on-chain observers from discovering how many commitment
36871  * transactions occurred in a channel before it was closed.
36872  *
36873  * This function gets the shared secret from relevant channel public keys and can be used to
36874  * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
36875  */
36876 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
36877
36878 /**
36879  * Checks if two InitFeaturess contain equal inner contents.
36880  * This ignores pointers and is_owned flags and looks at the values in fields.
36881  * Two objects with NULL inner values will be considered "equal" here.
36882  */
36883 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
36884
36885 /**
36886  * Checks if two NodeFeaturess contain equal inner contents.
36887  * This ignores pointers and is_owned flags and looks at the values in fields.
36888  * Two objects with NULL inner values will be considered "equal" here.
36889  */
36890 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
36891
36892 /**
36893  * Checks if two ChannelFeaturess contain equal inner contents.
36894  * This ignores pointers and is_owned flags and looks at the values in fields.
36895  * Two objects with NULL inner values will be considered "equal" here.
36896  */
36897 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
36898
36899 /**
36900  * Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
36901  * This ignores pointers and is_owned flags and looks at the values in fields.
36902  * Two objects with NULL inner values will be considered "equal" here.
36903  */
36904 bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
36905
36906 /**
36907  * Checks if two OfferFeaturess contain equal inner contents.
36908  * This ignores pointers and is_owned flags and looks at the values in fields.
36909  * Two objects with NULL inner values will be considered "equal" here.
36910  */
36911 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
36912
36913 /**
36914  * Checks if two InvoiceRequestFeaturess contain equal inner contents.
36915  * This ignores pointers and is_owned flags and looks at the values in fields.
36916  * Two objects with NULL inner values will be considered "equal" here.
36917  */
36918 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
36919
36920 /**
36921  * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
36922  * This ignores pointers and is_owned flags and looks at the values in fields.
36923  * Two objects with NULL inner values will be considered "equal" here.
36924  */
36925 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
36926
36927 /**
36928  * Checks if two BlindedHopFeaturess contain equal inner contents.
36929  * This ignores pointers and is_owned flags and looks at the values in fields.
36930  * Two objects with NULL inner values will be considered "equal" here.
36931  */
36932 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
36933
36934 /**
36935  * Checks if two ChannelTypeFeaturess contain equal inner contents.
36936  * This ignores pointers and is_owned flags and looks at the values in fields.
36937  * Two objects with NULL inner values will be considered "equal" here.
36938  */
36939 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
36940
36941 /**
36942  * Creates a copy of the InitFeatures
36943  */
36944 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
36945
36946 /**
36947  * Creates a copy of the NodeFeatures
36948  */
36949 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
36950
36951 /**
36952  * Creates a copy of the ChannelFeatures
36953  */
36954 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
36955
36956 /**
36957  * Creates a copy of the Bolt11InvoiceFeatures
36958  */
36959 struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
36960
36961 /**
36962  * Creates a copy of the OfferFeatures
36963  */
36964 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
36965
36966 /**
36967  * Creates a copy of the InvoiceRequestFeatures
36968  */
36969 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
36970
36971 /**
36972  * Creates a copy of the Bolt12InvoiceFeatures
36973  */
36974 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
36975
36976 /**
36977  * Creates a copy of the BlindedHopFeatures
36978  */
36979 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
36980
36981 /**
36982  * Creates a copy of the ChannelTypeFeatures
36983  */
36984 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
36985
36986 /**
36987  * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
36988  */
36989 void InitFeatures_free(struct LDKInitFeatures this_obj);
36990
36991 /**
36992  * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
36993  */
36994 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
36995
36996 /**
36997  * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
36998  */
36999 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
37000
37001 /**
37002  * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
37003  */
37004 void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
37005
37006 /**
37007  * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
37008  */
37009 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
37010
37011 /**
37012  * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
37013  */
37014 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
37015
37016 /**
37017  * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
37018  */
37019 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
37020
37021 /**
37022  * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
37023  */
37024 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
37025
37026 /**
37027  * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
37028  */
37029 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
37030
37031 /**
37032  * Create a blank Features with no features set
37033  */
37034 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
37035
37036 /**
37037  * Returns true if this `Features` object contains required features unknown by `other`.
37038  */
37039 MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
37040
37041 /**
37042  * Returns true if this `Features` object contains unknown feature flags which are set as
37043  * \"required\".
37044  */
37045 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37046
37047 /**
37048  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37049  * by [BOLT 9].
37050  *
37051  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37052  * be set instead (i.e., `bit - 1`).
37053  *
37054  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37055  */
37056 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37057
37058 /**
37059  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37060  * by [BOLT 9].
37061  *
37062  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37063  * set instead (i.e., `bit + 1`).
37064  *
37065  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37066  */
37067 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37068
37069 /**
37070  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37071  * by [bLIP 2] or if it is a known `T` feature.
37072  *
37073  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37074  * be set instead (i.e., `bit - 1`).
37075  *
37076  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37077  */
37078 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37079
37080 /**
37081  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37082  * by [bLIP 2] or if it is a known `T` feature.
37083  *
37084  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37085  * set instead (i.e., `bit + 1`).
37086  *
37087  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37088  */
37089 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37090
37091 /**
37092  * Create a blank Features with no features set
37093  */
37094 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
37095
37096 /**
37097  * Returns true if this `Features` object contains required features unknown by `other`.
37098  */
37099 MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
37100
37101 /**
37102  * Returns true if this `Features` object contains unknown feature flags which are set as
37103  * \"required\".
37104  */
37105 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37106
37107 /**
37108  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37109  * by [BOLT 9].
37110  *
37111  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37112  * be set instead (i.e., `bit - 1`).
37113  *
37114  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37115  */
37116 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37117
37118 /**
37119  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37120  * by [BOLT 9].
37121  *
37122  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37123  * set instead (i.e., `bit + 1`).
37124  *
37125  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37126  */
37127 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37128
37129 /**
37130  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37131  * by [bLIP 2] or if it is a known `T` feature.
37132  *
37133  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37134  * be set instead (i.e., `bit - 1`).
37135  *
37136  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37137  */
37138 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37139
37140 /**
37141  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37142  * by [bLIP 2] or if it is a known `T` feature.
37143  *
37144  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37145  * set instead (i.e., `bit + 1`).
37146  *
37147  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37148  */
37149 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37150
37151 /**
37152  * Create a blank Features with no features set
37153  */
37154 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
37155
37156 /**
37157  * Returns true if this `Features` object contains required features unknown by `other`.
37158  */
37159 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
37160
37161 /**
37162  * Returns true if this `Features` object contains unknown feature flags which are set as
37163  * \"required\".
37164  */
37165 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
37166
37167 /**
37168  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37169  * by [BOLT 9].
37170  *
37171  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37172  * be set instead (i.e., `bit - 1`).
37173  *
37174  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37175  */
37176 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37177
37178 /**
37179  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37180  * by [BOLT 9].
37181  *
37182  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37183  * set instead (i.e., `bit + 1`).
37184  *
37185  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37186  */
37187 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37188
37189 /**
37190  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37191  * by [bLIP 2] or if it is a known `T` feature.
37192  *
37193  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37194  * be set instead (i.e., `bit - 1`).
37195  *
37196  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37197  */
37198 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37199
37200 /**
37201  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37202  * by [bLIP 2] or if it is a known `T` feature.
37203  *
37204  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37205  * set instead (i.e., `bit + 1`).
37206  *
37207  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37208  */
37209 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37210
37211 /**
37212  * Create a blank Features with no features set
37213  */
37214 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
37215
37216 /**
37217  * Returns true if this `Features` object contains required features unknown by `other`.
37218  */
37219 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
37220
37221 /**
37222  * Returns true if this `Features` object contains unknown feature flags which are set as
37223  * \"required\".
37224  */
37225 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37226
37227 /**
37228  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37229  * by [BOLT 9].
37230  *
37231  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37232  * be set instead (i.e., `bit - 1`).
37233  *
37234  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37235  */
37236 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37237
37238 /**
37239  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37240  * by [BOLT 9].
37241  *
37242  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37243  * set instead (i.e., `bit + 1`).
37244  *
37245  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37246  */
37247 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37248
37249 /**
37250  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37251  * by [bLIP 2] or if it is a known `T` feature.
37252  *
37253  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37254  * be set instead (i.e., `bit - 1`).
37255  *
37256  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37257  */
37258 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37259
37260 /**
37261  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37262  * by [bLIP 2] or if it is a known `T` feature.
37263  *
37264  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37265  * set instead (i.e., `bit + 1`).
37266  *
37267  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37268  */
37269 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37270
37271 /**
37272  * Create a blank Features with no features set
37273  */
37274 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
37275
37276 /**
37277  * Returns true if this `Features` object contains required features unknown by `other`.
37278  */
37279 MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
37280
37281 /**
37282  * Returns true if this `Features` object contains unknown feature flags which are set as
37283  * \"required\".
37284  */
37285 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
37286
37287 /**
37288  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37289  * by [BOLT 9].
37290  *
37291  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37292  * be set instead (i.e., `bit - 1`).
37293  *
37294  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37295  */
37296 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37297
37298 /**
37299  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37300  * by [BOLT 9].
37301  *
37302  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37303  * set instead (i.e., `bit + 1`).
37304  *
37305  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37306  */
37307 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37308
37309 /**
37310  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37311  * by [bLIP 2] or if it is a known `T` feature.
37312  *
37313  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37314  * be set instead (i.e., `bit - 1`).
37315  *
37316  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37317  */
37318 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37319
37320 /**
37321  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37322  * by [bLIP 2] or if it is a known `T` feature.
37323  *
37324  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37325  * set instead (i.e., `bit + 1`).
37326  *
37327  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37328  */
37329 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37330
37331 /**
37332  * Create a blank Features with no features set
37333  */
37334 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
37335
37336 /**
37337  * Returns true if this `Features` object contains required features unknown by `other`.
37338  */
37339 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
37340
37341 /**
37342  * Returns true if this `Features` object contains unknown feature flags which are set as
37343  * \"required\".
37344  */
37345 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
37346
37347 /**
37348  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37349  * by [BOLT 9].
37350  *
37351  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37352  * be set instead (i.e., `bit - 1`).
37353  *
37354  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37355  */
37356 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37357
37358 /**
37359  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37360  * by [BOLT 9].
37361  *
37362  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37363  * set instead (i.e., `bit + 1`).
37364  *
37365  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37366  */
37367 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37368
37369 /**
37370  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37371  * by [bLIP 2] or if it is a known `T` feature.
37372  *
37373  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37374  * be set instead (i.e., `bit - 1`).
37375  *
37376  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37377  */
37378 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37379
37380 /**
37381  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37382  * by [bLIP 2] or if it is a known `T` feature.
37383  *
37384  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37385  * set instead (i.e., `bit + 1`).
37386  *
37387  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37388  */
37389 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37390
37391 /**
37392  * Create a blank Features with no features set
37393  */
37394 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
37395
37396 /**
37397  * Returns true if this `Features` object contains required features unknown by `other`.
37398  */
37399 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
37400
37401 /**
37402  * Returns true if this `Features` object contains unknown feature flags which are set as
37403  * \"required\".
37404  */
37405 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
37406
37407 /**
37408  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37409  * by [BOLT 9].
37410  *
37411  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37412  * be set instead (i.e., `bit - 1`).
37413  *
37414  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37415  */
37416 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37417
37418 /**
37419  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37420  * by [BOLT 9].
37421  *
37422  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37423  * set instead (i.e., `bit + 1`).
37424  *
37425  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37426  */
37427 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37428
37429 /**
37430  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37431  * by [bLIP 2] or if it is a known `T` feature.
37432  *
37433  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37434  * be set instead (i.e., `bit - 1`).
37435  *
37436  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37437  */
37438 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37439
37440 /**
37441  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37442  * by [bLIP 2] or if it is a known `T` feature.
37443  *
37444  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37445  * set instead (i.e., `bit + 1`).
37446  *
37447  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37448  */
37449 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37450
37451 /**
37452  * Create a blank Features with no features set
37453  */
37454 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
37455
37456 /**
37457  * Returns true if this `Features` object contains required features unknown by `other`.
37458  */
37459 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
37460
37461 /**
37462  * Returns true if this `Features` object contains unknown feature flags which are set as
37463  * \"required\".
37464  */
37465 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
37466
37467 /**
37468  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37469  * by [BOLT 9].
37470  *
37471  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37472  * be set instead (i.e., `bit - 1`).
37473  *
37474  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37475  */
37476 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37477
37478 /**
37479  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37480  * by [BOLT 9].
37481  *
37482  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37483  * set instead (i.e., `bit + 1`).
37484  *
37485  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37486  */
37487 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37488
37489 /**
37490  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37491  * by [bLIP 2] or if it is a known `T` feature.
37492  *
37493  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37494  * be set instead (i.e., `bit - 1`).
37495  *
37496  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37497  */
37498 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37499
37500 /**
37501  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37502  * by [bLIP 2] or if it is a known `T` feature.
37503  *
37504  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37505  * set instead (i.e., `bit + 1`).
37506  *
37507  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37508  */
37509 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37510
37511 /**
37512  * Create a blank Features with no features set
37513  */
37514 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
37515
37516 /**
37517  * Returns true if this `Features` object contains required features unknown by `other`.
37518  */
37519 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
37520
37521 /**
37522  * Returns true if this `Features` object contains unknown feature flags which are set as
37523  * \"required\".
37524  */
37525 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
37526
37527 /**
37528  * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
37529  * by [BOLT 9].
37530  *
37531  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37532  * be set instead (i.e., `bit - 1`).
37533  *
37534  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37535  */
37536 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37537
37538 /**
37539  * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
37540  * by [BOLT 9].
37541  *
37542  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37543  * set instead (i.e., `bit + 1`).
37544  *
37545  * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
37546  */
37547 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37548
37549 /**
37550  * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
37551  * by [bLIP 2] or if it is a known `T` feature.
37552  *
37553  * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
37554  * be set instead (i.e., `bit - 1`).
37555  *
37556  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37557  */
37558 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37559
37560 /**
37561  * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
37562  * by [bLIP 2] or if it is a known `T` feature.
37563  *
37564  * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
37565  * set instead (i.e., `bit + 1`).
37566  *
37567  * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
37568  */
37569 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
37570
37571 /**
37572  * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
37573  */
37574 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
37575
37576 /**
37577  * Read a InitFeatures from a byte array, created by InitFeatures_write
37578  */
37579 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
37580
37581 /**
37582  * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
37583  */
37584 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
37585
37586 /**
37587  * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
37588  */
37589 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
37590
37591 /**
37592  * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
37593  */
37594 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
37595
37596 /**
37597  * Read a NodeFeatures from a byte array, created by NodeFeatures_write
37598  */
37599 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
37600
37601 /**
37602  * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
37603  */
37604 struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
37605
37606 /**
37607  * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
37608  */
37609 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
37610
37611 /**
37612  * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
37613  */
37614 struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
37615
37616 /**
37617  * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
37618  */
37619 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
37620
37621 /**
37622  * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
37623  */
37624 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
37625
37626 /**
37627  * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
37628  */
37629 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
37630
37631 /**
37632  * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
37633  */
37634 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
37635
37636 /**
37637  * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
37638  */
37639 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
37640
37641 /**
37642  * Set this feature as optional.
37643  */
37644 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37645
37646 /**
37647  * Set this feature as required.
37648  */
37649 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37650
37651 /**
37652  * Checks if this feature is supported.
37653  */
37654 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37655
37656 /**
37657  * Set this feature as optional.
37658  */
37659 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37660
37661 /**
37662  * Set this feature as required.
37663  */
37664 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37665
37666 /**
37667  * Checks if this feature is supported.
37668  */
37669 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37670
37671 /**
37672  * Checks if this feature is required.
37673  */
37674 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37675
37676 /**
37677  * Checks if this feature is required.
37678  */
37679 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37680
37681 /**
37682  * Set this feature as optional.
37683  */
37684 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37685
37686 /**
37687  * Set this feature as required.
37688  */
37689 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37690
37691 /**
37692  * Checks if this feature is supported.
37693  */
37694 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37695
37696 /**
37697  * Set this feature as optional.
37698  */
37699 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37700
37701 /**
37702  * Set this feature as required.
37703  */
37704 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37705
37706 /**
37707  * Checks if this feature is supported.
37708  */
37709 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37710
37711 /**
37712  * Set this feature as optional.
37713  */
37714 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37715
37716 /**
37717  * Set this feature as required.
37718  */
37719 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37720
37721 /**
37722  * Checks if this feature is supported.
37723  */
37724 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37725
37726 /**
37727  * Checks if this feature is required.
37728  */
37729 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37730
37731 /**
37732  * Checks if this feature is required.
37733  */
37734 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37735
37736 /**
37737  * Set this feature as optional.
37738  */
37739 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37740
37741 /**
37742  * Set this feature as required.
37743  */
37744 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37745
37746 /**
37747  * Checks if this feature is supported.
37748  */
37749 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37750
37751 /**
37752  * Set this feature as optional.
37753  */
37754 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37755
37756 /**
37757  * Set this feature as required.
37758  */
37759 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37760
37761 /**
37762  * Checks if this feature is supported.
37763  */
37764 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37765
37766 /**
37767  * Checks if this feature is required.
37768  */
37769 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37770
37771 /**
37772  * Checks if this feature is required.
37773  */
37774 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37775
37776 /**
37777  * Set this feature as optional.
37778  */
37779 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37780
37781 /**
37782  * Set this feature as required.
37783  */
37784 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37785
37786 /**
37787  * Checks if this feature is supported.
37788  */
37789 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37790
37791 /**
37792  * Set this feature as optional.
37793  */
37794 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37795
37796 /**
37797  * Set this feature as required.
37798  */
37799 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37800
37801 /**
37802  * Checks if this feature is supported.
37803  */
37804 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37805
37806 /**
37807  * Set this feature as optional.
37808  */
37809 void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37810
37811 /**
37812  * Set this feature as required.
37813  */
37814 void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37815
37816 /**
37817  * Checks if this feature is supported.
37818  */
37819 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37820
37821 /**
37822  * Checks if this feature is required.
37823  */
37824 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37825
37826 /**
37827  * Checks if this feature is required.
37828  */
37829 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37830
37831 /**
37832  * Checks if this feature is required.
37833  */
37834 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37835
37836 /**
37837  * Set this feature as optional.
37838  */
37839 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37840
37841 /**
37842  * Set this feature as required.
37843  */
37844 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37845
37846 /**
37847  * Checks if this feature is supported.
37848  */
37849 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37850
37851 /**
37852  * Set this feature as optional.
37853  */
37854 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37855
37856 /**
37857  * Set this feature as required.
37858  */
37859 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37860
37861 /**
37862  * Checks if this feature is supported.
37863  */
37864 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37865
37866 /**
37867  * Set this feature as optional.
37868  */
37869 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
37870
37871 /**
37872  * Set this feature as required.
37873  */
37874 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
37875
37876 /**
37877  * Checks if this feature is supported.
37878  */
37879 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
37880
37881 /**
37882  * Checks if this feature is required.
37883  */
37884 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37885
37886 /**
37887  * Checks if this feature is required.
37888  */
37889 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37890
37891 /**
37892  * Checks if this feature is required.
37893  */
37894 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
37895
37896 /**
37897  * Set this feature as optional.
37898  */
37899 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37900
37901 /**
37902  * Set this feature as required.
37903  */
37904 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37905
37906 /**
37907  * Checks if this feature is supported.
37908  */
37909 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37910
37911 /**
37912  * Set this feature as optional.
37913  */
37914 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37915
37916 /**
37917  * Set this feature as required.
37918  */
37919 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37920
37921 /**
37922  * Checks if this feature is supported.
37923  */
37924 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37925
37926 /**
37927  * Set this feature as optional.
37928  */
37929 void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37930
37931 /**
37932  * Set this feature as required.
37933  */
37934 void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37935
37936 /**
37937  * Checks if this feature is supported.
37938  */
37939 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37940
37941 /**
37942  * Checks if this feature is required.
37943  */
37944 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37945
37946 /**
37947  * Checks if this feature is required.
37948  */
37949 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37950
37951 /**
37952  * Checks if this feature is required.
37953  */
37954 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37955
37956 /**
37957  * Set this feature as optional.
37958  */
37959 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
37960
37961 /**
37962  * Set this feature as required.
37963  */
37964 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
37965
37966 /**
37967  * Checks if this feature is supported.
37968  */
37969 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
37970
37971 /**
37972  * Set this feature as optional.
37973  */
37974 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37975
37976 /**
37977  * Set this feature as required.
37978  */
37979 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
37980
37981 /**
37982  * Checks if this feature is supported.
37983  */
37984 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
37985
37986 /**
37987  * Set this feature as optional.
37988  */
37989 void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37990
37991 /**
37992  * Set this feature as required.
37993  */
37994 void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
37995
37996 /**
37997  * Checks if this feature is supported.
37998  */
37999 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38000
38001 /**
38002  * Set this feature as optional.
38003  */
38004 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38005
38006 /**
38007  * Set this feature as required.
38008  */
38009 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38010
38011 /**
38012  * Checks if this feature is supported.
38013  */
38014 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38015
38016 /**
38017  * Checks if this feature is required.
38018  */
38019 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38020
38021 /**
38022  * Checks if this feature is required.
38023  */
38024 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38025
38026 /**
38027  * Checks if this feature is required.
38028  */
38029 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38030
38031 /**
38032  * Checks if this feature is required.
38033  */
38034 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
38035
38036 /**
38037  * Set this feature as optional.
38038  */
38039 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38040
38041 /**
38042  * Set this feature as required.
38043  */
38044 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38045
38046 /**
38047  * Checks if this feature is supported.
38048  */
38049 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38050
38051 /**
38052  * Set this feature as optional.
38053  */
38054 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38055
38056 /**
38057  * Set this feature as required.
38058  */
38059 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38060
38061 /**
38062  * Checks if this feature is supported.
38063  */
38064 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38065
38066 /**
38067  * Checks if this feature is required.
38068  */
38069 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38070
38071 /**
38072  * Checks if this feature is required.
38073  */
38074 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38075
38076 /**
38077  * Set this feature as optional.
38078  */
38079 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38080
38081 /**
38082  * Set this feature as required.
38083  */
38084 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38085
38086 /**
38087  * Checks if this feature is supported.
38088  */
38089 MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38090
38091 /**
38092  * Set this feature as optional.
38093  */
38094 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38095
38096 /**
38097  * Set this feature as required.
38098  */
38099 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38100
38101 /**
38102  * Checks if this feature is supported.
38103  */
38104 MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38105
38106 /**
38107  * Set this feature as optional.
38108  */
38109 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38110
38111 /**
38112  * Set this feature as required.
38113  */
38114 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38115
38116 /**
38117  * Checks if this feature is supported.
38118  */
38119 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38120
38121 /**
38122  * Checks if this feature is required.
38123  */
38124 MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38125
38126 /**
38127  * Checks if this feature is required.
38128  */
38129 MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38130
38131 /**
38132  * Checks if this feature is required.
38133  */
38134 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38135
38136 /**
38137  * Set this feature as optional.
38138  */
38139 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38140
38141 /**
38142  * Set this feature as required.
38143  */
38144 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38145
38146 /**
38147  * Checks if this feature is supported.
38148  */
38149 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38150
38151 /**
38152  * Set this feature as optional.
38153  */
38154 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38155
38156 /**
38157  * Set this feature as required.
38158  */
38159 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38160
38161 /**
38162  * Checks if this feature is supported.
38163  */
38164 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38165
38166 /**
38167  * Set this feature as optional.
38168  */
38169 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38170
38171 /**
38172  * Set this feature as required.
38173  */
38174 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38175
38176 /**
38177  * Checks if this feature is supported.
38178  */
38179 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38180
38181 /**
38182  * Checks if this feature is required.
38183  */
38184 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38185
38186 /**
38187  * Checks if this feature is required.
38188  */
38189 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38190
38191 /**
38192  * Checks if this feature is required.
38193  */
38194 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38195
38196 /**
38197  * Set this feature as optional.
38198  */
38199 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38200
38201 /**
38202  * Set this feature as required.
38203  */
38204 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38205
38206 /**
38207  * Checks if this feature is supported.
38208  */
38209 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38210
38211 /**
38212  * Set this feature as optional.
38213  */
38214 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38215
38216 /**
38217  * Set this feature as required.
38218  */
38219 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38220
38221 /**
38222  * Checks if this feature is supported.
38223  */
38224 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38225
38226 /**
38227  * Checks if this feature is required.
38228  */
38229 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38230
38231 /**
38232  * Checks if this feature is required.
38233  */
38234 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38235
38236 /**
38237  * Set this feature as optional.
38238  */
38239 void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38240
38241 /**
38242  * Set this feature as required.
38243  */
38244 void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38245
38246 /**
38247  * Checks if this feature is supported.
38248  */
38249 MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38250
38251 /**
38252  * Set this feature as optional.
38253  */
38254 void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38255
38256 /**
38257  * Set this feature as required.
38258  */
38259 void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38260
38261 /**
38262  * Checks if this feature is supported.
38263  */
38264 MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38265
38266 /**
38267  * Set this feature as optional.
38268  */
38269 void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38270
38271 /**
38272  * Set this feature as required.
38273  */
38274 void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38275
38276 /**
38277  * Checks if this feature is supported.
38278  */
38279 MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38280
38281 /**
38282  * Checks if this feature is required.
38283  */
38284 MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38285
38286 /**
38287  * Checks if this feature is required.
38288  */
38289 MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38290
38291 /**
38292  * Checks if this feature is required.
38293  */
38294 MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38295
38296 /**
38297  * Set this feature as optional.
38298  */
38299 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38300
38301 /**
38302  * Set this feature as required.
38303  */
38304 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38305
38306 /**
38307  * Checks if this feature is supported.
38308  */
38309 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38310
38311 /**
38312  * Set this feature as optional.
38313  */
38314 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38315
38316 /**
38317  * Set this feature as required.
38318  */
38319 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38320
38321 /**
38322  * Checks if this feature is supported.
38323  */
38324 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38325
38326 /**
38327  * Checks if this feature is required.
38328  */
38329 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38330
38331 /**
38332  * Checks if this feature is required.
38333  */
38334 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38335
38336 /**
38337  * Set this feature as optional.
38338  */
38339 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38340
38341 /**
38342  * Set this feature as required.
38343  */
38344 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38345
38346 /**
38347  * Checks if this feature is supported.
38348  */
38349 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38350
38351 /**
38352  * Set this feature as optional.
38353  */
38354 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38355
38356 /**
38357  * Set this feature as required.
38358  */
38359 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38360
38361 /**
38362  * Checks if this feature is supported.
38363  */
38364 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38365
38366 /**
38367  * Checks if this feature is required.
38368  */
38369 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38370
38371 /**
38372  * Checks if this feature is required.
38373  */
38374 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38375
38376 /**
38377  * Set this feature as optional.
38378  */
38379 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38380
38381 /**
38382  * Set this feature as required.
38383  */
38384 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38385
38386 /**
38387  * Checks if this feature is supported.
38388  */
38389 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38390
38391 /**
38392  * Set this feature as optional.
38393  */
38394 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38395
38396 /**
38397  * Set this feature as required.
38398  */
38399 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38400
38401 /**
38402  * Checks if this feature is supported.
38403  */
38404 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38405
38406 /**
38407  * Set this feature as optional.
38408  */
38409 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38410
38411 /**
38412  * Set this feature as required.
38413  */
38414 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38415
38416 /**
38417  * Checks if this feature is supported.
38418  */
38419 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38420
38421 /**
38422  * Checks if this feature is required.
38423  */
38424 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38425
38426 /**
38427  * Checks if this feature is required.
38428  */
38429 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38430
38431 /**
38432  * Checks if this feature is required.
38433  */
38434 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38435
38436 /**
38437  * Set this feature as optional.
38438  */
38439 void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38440
38441 /**
38442  * Set this feature as required.
38443  */
38444 void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38445
38446 /**
38447  * Checks if this feature is supported.
38448  */
38449 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38450
38451 /**
38452  * Checks if this feature is required.
38453  */
38454 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
38455
38456 /**
38457  * Set this feature as optional.
38458  */
38459 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
38460
38461 /**
38462  * Set this feature as required.
38463  */
38464 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
38465
38466 /**
38467  * Checks if this feature is supported.
38468  */
38469 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38470
38471 /**
38472  * Set this feature as optional.
38473  */
38474 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38475
38476 /**
38477  * Set this feature as required.
38478  */
38479 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38480
38481 /**
38482  * Checks if this feature is supported.
38483  */
38484 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38485
38486 /**
38487  * Set this feature as optional.
38488  */
38489 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38490
38491 /**
38492  * Set this feature as required.
38493  */
38494 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38495
38496 /**
38497  * Checks if this feature is supported.
38498  */
38499 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38500
38501 /**
38502  * Checks if this feature is required.
38503  */
38504 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
38505
38506 /**
38507  * Checks if this feature is required.
38508  */
38509 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38510
38511 /**
38512  * Checks if this feature is required.
38513  */
38514 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
38515
38516 /**
38517  * Set this feature as optional.
38518  */
38519 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38520
38521 /**
38522  * Set this feature as required.
38523  */
38524 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
38525
38526 /**
38527  * Checks if this feature is supported.
38528  */
38529 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38530
38531 /**
38532  * Checks if this feature is required.
38533  */
38534 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
38535
38536 /**
38537  * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
38538  */
38539 void ShutdownScript_free(struct LDKShutdownScript this_obj);
38540
38541 /**
38542  * Creates a copy of the ShutdownScript
38543  */
38544 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
38545
38546 /**
38547  * Checks if two ShutdownScripts contain equal inner contents.
38548  * This ignores pointers and is_owned flags and looks at the values in fields.
38549  * Two objects with NULL inner values will be considered "equal" here.
38550  */
38551 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
38552
38553 /**
38554  * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
38555  */
38556 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
38557
38558 /**
38559  * The script that did not meet the requirements from [BOLT #2].
38560  *
38561  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
38562  */
38563 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
38564
38565 /**
38566  * The script that did not meet the requirements from [BOLT #2].
38567  *
38568  * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
38569  */
38570 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
38571
38572 /**
38573  * Constructs a new InvalidShutdownScript given each field
38574  */
38575 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
38576
38577 /**
38578  * Creates a copy of the InvalidShutdownScript
38579  */
38580 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
38581
38582 /**
38583  * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
38584  */
38585 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
38586
38587 /**
38588  * Read a ShutdownScript from a byte array, created by ShutdownScript_write
38589  */
38590 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
38591
38592 /**
38593  * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
38594  */
38595 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
38596
38597 /**
38598  * Generates a P2WSH script pubkey from the given [`WScriptHash`].
38599  */
38600 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
38601
38602 /**
38603  * Generates a witness script pubkey from the given segwit version and program.
38604  *
38605  * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
38606  * [`ShutdownScript::new_p2wsh`] instead.
38607  *
38608  * # Errors
38609  *
38610  * This function may return an error if `program` is invalid for the segwit `version`.
38611  */
38612 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
38613
38614 /**
38615  * Converts the shutdown script into the underlying [`Script`].
38616  */
38617 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
38618
38619 /**
38620  * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
38621  *
38622  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38623  */
38624 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
38625
38626 /**
38627  * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
38628  *
38629  * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
38630  */
38631 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
38632
38633 /**
38634  * Frees any resources used by the Retry
38635  */
38636 void Retry_free(struct LDKRetry this_ptr);
38637
38638 /**
38639  * Creates a copy of the Retry
38640  */
38641 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
38642
38643 /**
38644  * Utility method to constructs a new Attempts-variant Retry
38645  */
38646 struct LDKRetry Retry_attempts(uint32_t a);
38647
38648 /**
38649  * Utility method to constructs a new Timeout-variant Retry
38650  */
38651 struct LDKRetry Retry_timeout(uint64_t a);
38652
38653 /**
38654  * Checks if two Retrys contain equal inner contents.
38655  * This ignores pointers and is_owned flags and looks at the values in fields.
38656  */
38657 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
38658
38659 /**
38660  * Generates a non-cryptographic 64-bit hash of the Retry.
38661  */
38662 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
38663
38664 /**
38665  * Serialize the Retry object into a byte array which can be read by Retry_read
38666  */
38667 struct LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
38668
38669 /**
38670  * Read a Retry from a byte array, created by Retry_write
38671  */
38672 struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
38673
38674 /**
38675  * Creates a copy of the RetryableSendFailure
38676  */
38677 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
38678
38679 /**
38680  * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
38681  */
38682 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
38683
38684 /**
38685  * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
38686  */
38687 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
38688
38689 /**
38690  * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
38691  */
38692 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
38693
38694 /**
38695  * Checks if two RetryableSendFailures contain equal inner contents.
38696  * This ignores pointers and is_owned flags and looks at the values in fields.
38697  */
38698 bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
38699
38700 /**
38701  * Frees any resources used by the PaymentSendFailure
38702  */
38703 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
38704
38705 /**
38706  * Creates a copy of the PaymentSendFailure
38707  */
38708 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
38709
38710 /**
38711  * Utility method to constructs a new ParameterError-variant PaymentSendFailure
38712  */
38713 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
38714
38715 /**
38716  * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
38717  */
38718 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
38719
38720 /**
38721  * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
38722  */
38723 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
38724
38725 /**
38726  * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
38727  */
38728 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
38729
38730 /**
38731  * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
38732  */
38733 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
38734
38735 /**
38736  * Checks if two PaymentSendFailures contain equal inner contents.
38737  * This ignores pointers and is_owned flags and looks at the values in fields.
38738  */
38739 bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
38740
38741 /**
38742  * Frees any resources used by the ProbeSendFailure
38743  */
38744 void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
38745
38746 /**
38747  * Creates a copy of the ProbeSendFailure
38748  */
38749 struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
38750
38751 /**
38752  * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
38753  */
38754 struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
38755
38756 /**
38757  * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
38758  */
38759 struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
38760
38761 /**
38762  * Checks if two ProbeSendFailures contain equal inner contents.
38763  * This ignores pointers and is_owned flags and looks at the values in fields.
38764  */
38765 bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
38766
38767 /**
38768  * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
38769  */
38770 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
38771
38772 /**
38773  * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
38774  * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
38775  * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
38776  * attacks.
38777  *
38778  * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
38779  * multi-path payments require a recipient-provided secret.
38780  *
38781  * Some implementations may reject spontaneous payments with payment secrets, so you may only
38782  * want to provide a secret for a spontaneous payment if MPP is needed and you know your
38783  * recipient will not reject it.
38784  */
38785 struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
38786
38787 /**
38788  * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
38789  * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
38790  * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
38791  * attacks.
38792  *
38793  * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
38794  * multi-path payments require a recipient-provided secret.
38795  *
38796  * Some implementations may reject spontaneous payments with payment secrets, so you may only
38797  * want to provide a secret for a spontaneous payment if MPP is needed and you know your
38798  * recipient will not reject it.
38799  */
38800 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
38801
38802 /**
38803  * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
38804  * arbitrary length. This gives recipients substantially more flexibility to receive
38805  * additional data.
38806  *
38807  * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
38808  * scheme to authenticate received payments against expected payments and invoices, this field
38809  * is not used in LDK for received payments, and can be used to store arbitrary data in
38810  * invoices which will be received with the payment.
38811  *
38812  * Note that this field was added to the lightning specification more recently than
38813  * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
38814  * may not be supported as universally.
38815  *
38816  * Returns a copy of the field.
38817  */
38818 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
38819
38820 /**
38821  * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
38822  * arbitrary length. This gives recipients substantially more flexibility to receive
38823  * additional data.
38824  *
38825  * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
38826  * scheme to authenticate received payments against expected payments and invoices, this field
38827  * is not used in LDK for received payments, and can be used to store arbitrary data in
38828  * invoices which will be received with the payment.
38829  *
38830  * Note that this field was added to the lightning specification more recently than
38831  * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
38832  * may not be supported as universally.
38833  */
38834 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
38835
38836 /**
38837  * Creates a copy of the RecipientOnionFields
38838  */
38839 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
38840
38841 /**
38842  * Checks if two RecipientOnionFieldss contain equal inner contents.
38843  * This ignores pointers and is_owned flags and looks at the values in fields.
38844  * Two objects with NULL inner values will be considered "equal" here.
38845  */
38846 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
38847
38848 /**
38849  * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
38850  */
38851 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
38852
38853 /**
38854  * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
38855  */
38856 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
38857
38858 /**
38859  * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
38860  * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
38861  * but do not require or provide any further data.
38862  */
38863 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
38864
38865 /**
38866  * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
38867  * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
38868  * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
38869  * a spontaneous MPP this will not work as all MPP require payment secrets; you may
38870  * instead want to use [`RecipientOnionFields::secret_only`].
38871  *
38872  * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
38873  * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
38874  */
38875 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
38876
38877 /**
38878  * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
38879  * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
38880  * respectively. TLV type numbers must be unique and within the range
38881  * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
38882  *
38883  * This method will also error for types in the experimental range which have been
38884  * standardized within the protocol, which only includes 5482373484 (keysend) for now.
38885  *
38886  * See [`Self::custom_tlvs`] for more info.
38887  */
38888 MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
38889
38890 /**
38891  * Gets the custom TLVs that will be sent or have been received.
38892  *
38893  * Custom TLVs allow sending extra application-specific data with a payment. They provide
38894  * additional flexibility on top of payment metadata, as while other implementations may
38895  * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
38896  * do not have this restriction.
38897  *
38898  * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
38899  * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
38900  * This is validated when setting this field using [`Self::with_custom_tlvs`].
38901  */
38902 MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
38903
38904 /**
38905  * Calls the free function if one is set
38906  */
38907 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
38908
38909 /**
38910  * Creates a copy of a Type
38911  */
38912 struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
38913
38914 /**
38915  * Calls the free function if one is set
38916  */
38917 void Type_free(struct LDKType this_ptr);
38918
38919 /**
38920  * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
38921  */
38922 void Offer_free(struct LDKOffer this_obj);
38923
38924 /**
38925  * Creates a copy of the Offer
38926  */
38927 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
38928
38929 /**
38930  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
38931  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
38932  * for the selected chain.
38933  */
38934 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
38935
38936 /**
38937  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
38938  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
38939  */
38940 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
38941
38942 /**
38943  * The minimum amount required for a successful payment of a single item.
38944  *
38945  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38946  */
38947 MUST_USE_RES struct LDKAmount Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
38948
38949 /**
38950  * A complete description of the purpose of the payment. Intended to be displayed to the user
38951  * but with the caveat that it has not been verified in any way.
38952  */
38953 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
38954
38955 /**
38956  * Features pertaining to the offer.
38957  */
38958 MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
38959
38960 /**
38961  * Duration since the Unix epoch when an invoice should no longer be requested.
38962  *
38963  * If `None`, the offer does not expire.
38964  */
38965 MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
38966
38967 /**
38968  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
38969  * displayed to the user but with the caveat that it has not been verified in any way.
38970  *
38971  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38972  */
38973 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
38974
38975 /**
38976  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
38977  * recipient privacy by obfuscating its node id.
38978  */
38979 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
38980
38981 /**
38982  * The quantity of items supported.
38983  */
38984 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
38985
38986 /**
38987  * The public key used by the recipient to sign invoices.
38988  */
38989 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
38990
38991 /**
38992  * Returns whether the given chain is supported by the offer.
38993  */
38994 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
38995
38996 /**
38997  * Whether the offer has expired.
38998  */
38999 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
39000
39001 /**
39002  * Returns whether the given quantity is valid for the offer.
39003  */
39004 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
39005
39006 /**
39007  * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
39008  *
39009  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
39010  */
39011 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
39012
39013 /**
39014  * Serialize the Offer object into a byte array which can be read by Offer_read
39015  */
39016 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
39017
39018 /**
39019  * Frees any resources used by the Amount, if is_owned is set and inner is non-NULL.
39020  */
39021 void Amount_free(struct LDKAmount this_obj);
39022
39023 /**
39024  * Creates a copy of the Amount
39025  */
39026 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
39027
39028 /**
39029  * Frees any resources used by the Quantity, if is_owned is set and inner is non-NULL.
39030  */
39031 void Quantity_free(struct LDKQuantity this_obj);
39032
39033 /**
39034  * Creates a copy of the Quantity
39035  */
39036 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
39037
39038 /**
39039  * Read a Offer object from a string
39040  */
39041 struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
39042
39043 /**
39044  * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
39045  */
39046 void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
39047
39048 /**
39049  * Returns the [`TaggedHash`] of the invoice to sign.
39050  */
39051 MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39052
39053 /**
39054  * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
39055  */
39056 void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
39057
39058 /**
39059  * Creates a copy of the Bolt12Invoice
39060  */
39061 struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
39062
39063 /**
39064  * The chains that may be used when paying a requested invoice.
39065  *
39066  * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
39067  *
39068  * [`Offer::chains`]: crate::offers::offer::Offer::chains
39069  */
39070 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39071
39072 /**
39073  * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
39074  * invoice originated from an offer.
39075  *
39076  * From [`InvoiceRequest::chain`] or [`Refund::chain`].
39077  *
39078  * [`offer_chains`]: Self::offer_chains
39079  * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
39080  */
39081 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39082
39083 /**
39084  * Opaque bytes set by the originating [`Offer`].
39085  *
39086  * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
39087  * if the [`Offer`] did not set it.
39088  *
39089  * [`Offer`]: crate::offers::offer::Offer
39090  * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
39091  */
39092 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39093
39094 /**
39095  * The minimum amount required for a successful payment of a single item.
39096  *
39097  * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
39098  * the [`Offer`] did not set it.
39099  *
39100  * [`Offer`]: crate::offers::offer::Offer
39101  * [`Offer::amount`]: crate::offers::offer::Offer::amount
39102  *
39103  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39104  */
39105 MUST_USE_RES struct LDKAmount UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39106
39107 /**
39108  * Features pertaining to the originating [`Offer`].
39109  *
39110  * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
39111  * [`Refund`].
39112  *
39113  * [`Offer`]: crate::offers::offer::Offer
39114  * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
39115  *
39116  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39117  */
39118 MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39119
39120 /**
39121  * A complete description of the purpose of the originating offer or refund.
39122  *
39123  * From [`Offer::description`] or [`Refund::description`].
39124  *
39125  * [`Offer::description`]: crate::offers::offer::Offer::description
39126  */
39127 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39128
39129 /**
39130  * Duration since the Unix epoch when an invoice should no longer be requested.
39131  *
39132  * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
39133  *
39134  * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
39135  */
39136 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39137
39138 /**
39139  * The issuer of the offer or refund.
39140  *
39141  * From [`Offer::issuer`] or [`Refund::issuer`].
39142  *
39143  * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
39144  *
39145  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39146  */
39147 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39148
39149 /**
39150  * Paths to the recipient originating from publicly reachable nodes.
39151  *
39152  * From [`Offer::paths`] or [`Refund::paths`].
39153  *
39154  * [`Offer::paths`]: crate::offers::offer::Offer::paths
39155  */
39156 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39157
39158 /**
39159  * The quantity of items supported.
39160  *
39161  * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
39162  * [`Refund`].
39163  *
39164  * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
39165  *
39166  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39167  */
39168 MUST_USE_RES struct LDKQuantity UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39169
39170 /**
39171  * An unpredictable series of bytes from the payer.
39172  *
39173  * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
39174  */
39175 MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39176
39177 /**
39178  * Features pertaining to requesting an invoice.
39179  *
39180  * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
39181  */
39182 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39183
39184 /**
39185  * The quantity of items requested or refunded for.
39186  *
39187  * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
39188  */
39189 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39190
39191 /**
39192  * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
39193  * refund in case there are no [`message_paths`].
39194  *
39195  * [`message_paths`]: Self::message_paths
39196  */
39197 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39198
39199 /**
39200  * A payer-provided note reflected back in the invoice.
39201  *
39202  * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
39203  *
39204  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39205  */
39206 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39207
39208 /**
39209  * Duration since the Unix epoch when the invoice was created.
39210  */
39211 MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39212
39213 /**
39214  * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
39215  * should no longer be paid.
39216  */
39217 MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39218
39219 /**
39220  * Whether the invoice has expired.
39221  */
39222 MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39223
39224 /**
39225  * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
39226  */
39227 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39228
39229 /**
39230  * The minimum amount required for a successful payment of the invoice.
39231  */
39232 MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39233
39234 /**
39235  * Features pertaining to paying an invoice.
39236  */
39237 MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39238
39239 /**
39240  * The public key corresponding to the key used to sign the invoice.
39241  */
39242 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
39243
39244 /**
39245  * The chains that may be used when paying a requested invoice.
39246  *
39247  * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
39248  *
39249  * [`Offer::chains`]: crate::offers::offer::Offer::chains
39250  */
39251 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39252
39253 /**
39254  * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
39255  * invoice originated from an offer.
39256  *
39257  * From [`InvoiceRequest::chain`] or [`Refund::chain`].
39258  *
39259  * [`offer_chains`]: Self::offer_chains
39260  * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
39261  */
39262 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39263
39264 /**
39265  * Opaque bytes set by the originating [`Offer`].
39266  *
39267  * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
39268  * if the [`Offer`] did not set it.
39269  *
39270  * [`Offer`]: crate::offers::offer::Offer
39271  * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
39272  */
39273 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39274
39275 /**
39276  * The minimum amount required for a successful payment of a single item.
39277  *
39278  * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
39279  * the [`Offer`] did not set it.
39280  *
39281  * [`Offer`]: crate::offers::offer::Offer
39282  * [`Offer::amount`]: crate::offers::offer::Offer::amount
39283  *
39284  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39285  */
39286 MUST_USE_RES struct LDKAmount Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39287
39288 /**
39289  * Features pertaining to the originating [`Offer`].
39290  *
39291  * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
39292  * [`Refund`].
39293  *
39294  * [`Offer`]: crate::offers::offer::Offer
39295  * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
39296  *
39297  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39298  */
39299 MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39300
39301 /**
39302  * A complete description of the purpose of the originating offer or refund.
39303  *
39304  * From [`Offer::description`] or [`Refund::description`].
39305  *
39306  * [`Offer::description`]: crate::offers::offer::Offer::description
39307  */
39308 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39309
39310 /**
39311  * Duration since the Unix epoch when an invoice should no longer be requested.
39312  *
39313  * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
39314  *
39315  * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
39316  */
39317 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39318
39319 /**
39320  * The issuer of the offer or refund.
39321  *
39322  * From [`Offer::issuer`] or [`Refund::issuer`].
39323  *
39324  * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
39325  *
39326  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39327  */
39328 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39329
39330 /**
39331  * Paths to the recipient originating from publicly reachable nodes.
39332  *
39333  * From [`Offer::paths`] or [`Refund::paths`].
39334  *
39335  * [`Offer::paths`]: crate::offers::offer::Offer::paths
39336  */
39337 MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39338
39339 /**
39340  * The quantity of items supported.
39341  *
39342  * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
39343  * [`Refund`].
39344  *
39345  * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
39346  *
39347  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39348  */
39349 MUST_USE_RES struct LDKQuantity Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39350
39351 /**
39352  * An unpredictable series of bytes from the payer.
39353  *
39354  * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
39355  */
39356 MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39357
39358 /**
39359  * Features pertaining to requesting an invoice.
39360  *
39361  * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
39362  */
39363 MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39364
39365 /**
39366  * The quantity of items requested or refunded for.
39367  *
39368  * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
39369  */
39370 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39371
39372 /**
39373  * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
39374  * refund in case there are no [`message_paths`].
39375  *
39376  * [`message_paths`]: Self::message_paths
39377  */
39378 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39379
39380 /**
39381  * A payer-provided note reflected back in the invoice.
39382  *
39383  * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
39384  *
39385  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39386  */
39387 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39388
39389 /**
39390  * Duration since the Unix epoch when the invoice was created.
39391  */
39392 MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39393
39394 /**
39395  * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
39396  * should no longer be paid.
39397  */
39398 MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39399
39400 /**
39401  * Whether the invoice has expired.
39402  */
39403 MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39404
39405 /**
39406  * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
39407  */
39408 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39409
39410 /**
39411  * The minimum amount required for a successful payment of the invoice.
39412  */
39413 MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39414
39415 /**
39416  * Features pertaining to paying an invoice.
39417  */
39418 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39419
39420 /**
39421  * The public key corresponding to the key used to sign the invoice.
39422  */
39423 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39424
39425 /**
39426  * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
39427  */
39428 MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39429
39430 /**
39431  * Hash that was used for signing the invoice.
39432  */
39433 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
39434
39435 /**
39436  * Verifies that the invoice was for a request or refund created using the given key. Returns
39437  * the associated [`PaymentId`] to use when sending the payment.
39438  */
39439 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
39440
39441 /**
39442  * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
39443  */
39444 struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
39445
39446 /**
39447  * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
39448  */
39449 struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
39450
39451 /**
39452  * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
39453  */
39454 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
39455
39456 /**
39457  * Base fee charged (in millisatoshi) for the entire blinded path.
39458  */
39459 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39460
39461 /**
39462  * Base fee charged (in millisatoshi) for the entire blinded path.
39463  */
39464 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
39465
39466 /**
39467  * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
39468  * (i.e., 10,000 is 1%).
39469  */
39470 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39471
39472 /**
39473  * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
39474  * (i.e., 10,000 is 1%).
39475  */
39476 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
39477
39478 /**
39479  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
39480  * path.
39481  */
39482 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39483
39484 /**
39485  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
39486  * path.
39487  */
39488 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
39489
39490 /**
39491  * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
39492  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
39493  * seen by the recipient.
39494  */
39495 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39496
39497 /**
39498  * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
39499  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
39500  * seen by the recipient.
39501  */
39502 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
39503
39504 /**
39505  * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
39506  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
39507  * seen by the recipient.
39508  */
39509 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39510
39511 /**
39512  * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
39513  * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
39514  * seen by the recipient.
39515  */
39516 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
39517
39518 /**
39519  * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
39520  * onion payload.
39521  */
39522 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
39523
39524 /**
39525  * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
39526  * onion payload.
39527  */
39528 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
39529
39530 /**
39531  * Constructs a new BlindedPayInfo given each field
39532  */
39533 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);
39534
39535 /**
39536  * Creates a copy of the BlindedPayInfo
39537  */
39538 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
39539
39540 /**
39541  * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
39542  */
39543 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
39544
39545 /**
39546  * Checks if two BlindedPayInfos contain equal inner contents.
39547  * This ignores pointers and is_owned flags and looks at the values in fields.
39548  * Two objects with NULL inner values will be considered "equal" here.
39549  */
39550 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
39551
39552 /**
39553  * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
39554  */
39555 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
39556
39557 /**
39558  * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
39559  */
39560 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
39561
39562 /**
39563  * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
39564  */
39565 void InvoiceError_free(struct LDKInvoiceError this_obj);
39566
39567 /**
39568  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
39569  *
39570  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
39571  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
39572  *
39573  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39574  */
39575 struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
39576
39577 /**
39578  * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
39579  *
39580  * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
39581  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
39582  *
39583  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
39584  */
39585 void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
39586
39587 /**
39588  * An explanation of the error.
39589  */
39590 struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
39591
39592 /**
39593  * An explanation of the error.
39594  */
39595 void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
39596
39597 /**
39598  * Constructs a new InvoiceError given each field
39599  *
39600  * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
39601  */
39602 MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
39603
39604 /**
39605  * Creates a copy of the InvoiceError
39606  */
39607 struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
39608
39609 /**
39610  * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
39611  */
39612 void ErroneousField_free(struct LDKErroneousField this_obj);
39613
39614 /**
39615  * The type number of the TLV field containing the error.
39616  */
39617 uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
39618
39619 /**
39620  * The type number of the TLV field containing the error.
39621  */
39622 void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
39623
39624 /**
39625  * A value to use for the TLV field to avoid the error.
39626  *
39627  * Returns a copy of the field.
39628  */
39629 struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
39630
39631 /**
39632  * A value to use for the TLV field to avoid the error.
39633  */
39634 void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
39635
39636 /**
39637  * Constructs a new ErroneousField given each field
39638  */
39639 MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
39640
39641 /**
39642  * Creates a copy of the ErroneousField
39643  */
39644 struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
39645
39646 /**
39647  * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
39648  */
39649 struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
39650
39651 /**
39652  * Read a InvoiceError from a byte array, created by InvoiceError_write
39653  */
39654 struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
39655
39656 /**
39657  * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
39658  */
39659 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
39660
39661 /**
39662  * Returns the [`TaggedHash`] of the invoice to sign.
39663  */
39664 MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39665
39666 /**
39667  * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
39668  */
39669 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
39670
39671 /**
39672  * Creates a copy of the InvoiceRequest
39673  */
39674 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
39675
39676 /**
39677  * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
39678  */
39679 void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
39680
39681 /**
39682  * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
39683  *
39684  * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
39685  * [`respond_with`].
39686  *
39687  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
39688  * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
39689  * [`respond_with`]: Self::respond_with
39690  */
39691 struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
39692
39693 /**
39694  * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
39695  *
39696  * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
39697  * [`respond_with`].
39698  *
39699  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
39700  * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
39701  * [`respond_with`]: Self::respond_with
39702  */
39703 void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val);
39704
39705 /**
39706  * Creates a copy of the VerifiedInvoiceRequest
39707  */
39708 struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
39709
39710 /**
39711  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
39712  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
39713  * for the selected chain.
39714  */
39715 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39716
39717 /**
39718  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
39719  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
39720  */
39721 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39722
39723 /**
39724  * The minimum amount required for a successful payment of a single item.
39725  *
39726  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39727  */
39728 MUST_USE_RES struct LDKAmount UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39729
39730 /**
39731  * A complete description of the purpose of the payment. Intended to be displayed to the user
39732  * but with the caveat that it has not been verified in any way.
39733  */
39734 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39735
39736 /**
39737  * Features pertaining to the offer.
39738  */
39739 MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39740
39741 /**
39742  * Duration since the Unix epoch when an invoice should no longer be requested.
39743  *
39744  * If `None`, the offer does not expire.
39745  */
39746 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39747
39748 /**
39749  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
39750  * displayed to the user but with the caveat that it has not been verified in any way.
39751  *
39752  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39753  */
39754 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39755
39756 /**
39757  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
39758  * recipient privacy by obfuscating its node id.
39759  */
39760 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39761
39762 /**
39763  * The quantity of items supported.
39764  */
39765 MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39766
39767 /**
39768  * The public key used by the recipient to sign invoices.
39769  */
39770 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39771
39772 /**
39773  * An unpredictable series of bytes, typically containing information about the derivation of
39774  * [`payer_id`].
39775  *
39776  * [`payer_id`]: Self::payer_id
39777  */
39778 MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39779
39780 /**
39781  * A chain from [`Offer::chains`] that the offer is valid for.
39782  */
39783 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39784
39785 /**
39786  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
39787  * must be greater than or equal to [`Offer::amount`], converted if necessary.
39788  *
39789  * [`chain`]: Self::chain
39790  */
39791 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39792
39793 /**
39794  * Features pertaining to requesting an invoice.
39795  */
39796 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39797
39798 /**
39799  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
39800  */
39801 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39802
39803 /**
39804  * A possibly transient pubkey used to sign the invoice request.
39805  */
39806 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39807
39808 /**
39809  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
39810  * response.
39811  *
39812  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39813  */
39814 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
39815
39816 /**
39817  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
39818  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
39819  * for the selected chain.
39820  */
39821 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39822
39823 /**
39824  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
39825  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
39826  */
39827 MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39828
39829 /**
39830  * The minimum amount required for a successful payment of a single item.
39831  *
39832  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39833  */
39834 MUST_USE_RES struct LDKAmount InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39835
39836 /**
39837  * A complete description of the purpose of the payment. Intended to be displayed to the user
39838  * but with the caveat that it has not been verified in any way.
39839  */
39840 MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39841
39842 /**
39843  * Features pertaining to the offer.
39844  */
39845 MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39846
39847 /**
39848  * Duration since the Unix epoch when an invoice should no longer be requested.
39849  *
39850  * If `None`, the offer does not expire.
39851  */
39852 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39853
39854 /**
39855  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
39856  * displayed to the user but with the caveat that it has not been verified in any way.
39857  *
39858  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39859  */
39860 MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39861
39862 /**
39863  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
39864  * recipient privacy by obfuscating its node id.
39865  */
39866 MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39867
39868 /**
39869  * The quantity of items supported.
39870  */
39871 MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39872
39873 /**
39874  * The public key used by the recipient to sign invoices.
39875  */
39876 MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39877
39878 /**
39879  * An unpredictable series of bytes, typically containing information about the derivation of
39880  * [`payer_id`].
39881  *
39882  * [`payer_id`]: Self::payer_id
39883  */
39884 MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39885
39886 /**
39887  * A chain from [`Offer::chains`] that the offer is valid for.
39888  */
39889 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39890
39891 /**
39892  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
39893  * must be greater than or equal to [`Offer::amount`], converted if necessary.
39894  *
39895  * [`chain`]: Self::chain
39896  */
39897 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39898
39899 /**
39900  * Features pertaining to requesting an invoice.
39901  */
39902 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39903
39904 /**
39905  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
39906  */
39907 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39908
39909 /**
39910  * A possibly transient pubkey used to sign the invoice request.
39911  */
39912 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39913
39914 /**
39915  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
39916  * response.
39917  *
39918  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39919  */
39920 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39921
39922 /**
39923  * Signature of the invoice request using [`payer_id`].
39924  *
39925  * [`payer_id`]: Self::payer_id
39926  */
39927 MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
39928
39929 /**
39930  * Verifies that the request was for an offer created using the given key. Returns the verified
39931  * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request
39932  * if they could be extracted from the metadata.
39933  *
39934  * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
39935  */
39936 MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
39937
39938 /**
39939  * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
39940  * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
39941  * for the selected chain.
39942  */
39943 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39944
39945 /**
39946  * Opaque bytes set by the originator. Useful for authentication and validating fields since it
39947  * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
39948  */
39949 MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39950
39951 /**
39952  * The minimum amount required for a successful payment of a single item.
39953  *
39954  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39955  */
39956 MUST_USE_RES struct LDKAmount VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39957
39958 /**
39959  * A complete description of the purpose of the payment. Intended to be displayed to the user
39960  * but with the caveat that it has not been verified in any way.
39961  */
39962 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39963
39964 /**
39965  * Features pertaining to the offer.
39966  */
39967 MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39968
39969 /**
39970  * Duration since the Unix epoch when an invoice should no longer be requested.
39971  *
39972  * If `None`, the offer does not expire.
39973  */
39974 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39975
39976 /**
39977  * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
39978  * displayed to the user but with the caveat that it has not been verified in any way.
39979  *
39980  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39981  */
39982 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39983
39984 /**
39985  * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
39986  * recipient privacy by obfuscating its node id.
39987  */
39988 MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39989
39990 /**
39991  * The quantity of items supported.
39992  */
39993 MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39994
39995 /**
39996  * The public key used by the recipient to sign invoices.
39997  */
39998 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
39999
40000 /**
40001  * An unpredictable series of bytes, typically containing information about the derivation of
40002  * [`payer_id`].
40003  *
40004  * [`payer_id`]: Self::payer_id
40005  */
40006 MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40007
40008 /**
40009  * A chain from [`Offer::chains`] that the offer is valid for.
40010  */
40011 MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40012
40013 /**
40014  * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
40015  * must be greater than or equal to [`Offer::amount`], converted if necessary.
40016  *
40017  * [`chain`]: Self::chain
40018  */
40019 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40020
40021 /**
40022  * Features pertaining to requesting an invoice.
40023  */
40024 MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40025
40026 /**
40027  * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
40028  */
40029 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40030
40031 /**
40032  * A possibly transient pubkey used to sign the invoice request.
40033  */
40034 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40035
40036 /**
40037  * A payer-provided note which will be seen by the recipient and reflected back in the invoice
40038  * response.
40039  *
40040  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40041  */
40042 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
40043
40044 /**
40045  * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
40046  */
40047 struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
40048
40049 /**
40050  * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
40051  */
40052 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
40053
40054 /**
40055  * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
40056  */
40057 void TaggedHash_free(struct LDKTaggedHash this_obj);
40058
40059 /**
40060  * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
40061  */
40062 void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
40063
40064 /**
40065  * Creates a copy of the Bolt12ParseError
40066  */
40067 struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
40068
40069 /**
40070  * Creates a copy of the Bolt12SemanticError
40071  */
40072 enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
40073
40074 /**
40075  * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
40076  */
40077 enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
40078
40079 /**
40080  * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
40081  */
40082 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
40083
40084 /**
40085  * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
40086  */
40087 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
40088
40089 /**
40090  * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
40091  */
40092 enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
40093
40094 /**
40095  * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
40096  */
40097 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
40098
40099 /**
40100  * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
40101  */
40102 enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
40103
40104 /**
40105  * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
40106  */
40107 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
40108
40109 /**
40110  * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
40111  */
40112 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
40113
40114 /**
40115  * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
40116  */
40117 enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
40118
40119 /**
40120  * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
40121  */
40122 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
40123
40124 /**
40125  * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
40126  */
40127 enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
40128
40129 /**
40130  * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
40131  */
40132 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
40133
40134 /**
40135  * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
40136  */
40137 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
40138
40139 /**
40140  * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
40141  */
40142 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
40143
40144 /**
40145  * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
40146  */
40147 enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
40148
40149 /**
40150  * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
40151  */
40152 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
40153
40154 /**
40155  * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
40156  */
40157 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
40158
40159 /**
40160  * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
40161  */
40162 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
40163
40164 /**
40165  * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
40166  */
40167 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
40168
40169 /**
40170  * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
40171  */
40172 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
40173
40174 /**
40175  * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
40176  */
40177 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
40178
40179 /**
40180  * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
40181  */
40182 enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
40183
40184 /**
40185  * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
40186  */
40187 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
40188
40189 /**
40190  * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
40191  */
40192 enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
40193
40194 /**
40195  * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
40196  */
40197 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
40198
40199 /**
40200  * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
40201  */
40202 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
40203
40204 /**
40205  * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
40206  */
40207 void Refund_free(struct LDKRefund this_obj);
40208
40209 /**
40210  * Creates a copy of the Refund
40211  */
40212 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
40213
40214 /**
40215  * A complete description of the purpose of the refund. Intended to be displayed to the user
40216  * but with the caveat that it has not been verified in any way.
40217  */
40218 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
40219
40220 /**
40221  * Duration since the Unix epoch when an invoice should no longer be sent.
40222  *
40223  * If `None`, the refund does not expire.
40224  */
40225 MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
40226
40227 /**
40228  * Whether the refund has expired.
40229  */
40230 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
40231
40232 /**
40233  * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
40234  * displayed to the user but with the caveat that it has not been verified in any way.
40235  *
40236  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40237  */
40238 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
40239
40240 /**
40241  * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
40242  * privacy by obfuscating its node id.
40243  */
40244 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
40245
40246 /**
40247  * An unpredictable series of bytes, typically containing information about the derivation of
40248  * [`payer_id`].
40249  *
40250  * [`payer_id`]: Self::payer_id
40251  */
40252 MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
40253
40254 /**
40255  * A chain that the refund is valid for.
40256  */
40257 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
40258
40259 /**
40260  * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
40261  *
40262  * [`chain`]: Self::chain
40263  */
40264 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
40265
40266 /**
40267  * Features pertaining to requesting an invoice.
40268  */
40269 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
40270
40271 /**
40272  * The quantity of an item that refund is for.
40273  */
40274 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
40275
40276 /**
40277  * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
40278  * transient pubkey.
40279  *
40280  * [`paths`]: Self::paths
40281  */
40282 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
40283
40284 /**
40285  * Payer provided note to include in the invoice.
40286  *
40287  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40288  */
40289 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
40290
40291 /**
40292  * Serialize the Refund object into a byte array which can be read by Refund_read
40293  */
40294 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
40295
40296 /**
40297  * Read a Refund object from a string
40298  */
40299 struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
40300
40301 /**
40302  * Creates a copy of the UtxoLookupError
40303  */
40304 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
40305
40306 /**
40307  * Utility method to constructs a new UnknownChain-variant UtxoLookupError
40308  */
40309 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
40310
40311 /**
40312  * Utility method to constructs a new UnknownTx-variant UtxoLookupError
40313  */
40314 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
40315
40316 /**
40317  * Frees any resources used by the UtxoResult
40318  */
40319 void UtxoResult_free(struct LDKUtxoResult this_ptr);
40320
40321 /**
40322  * Creates a copy of the UtxoResult
40323  */
40324 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
40325
40326 /**
40327  * Utility method to constructs a new Sync-variant UtxoResult
40328  */
40329 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
40330
40331 /**
40332  * Utility method to constructs a new Async-variant UtxoResult
40333  */
40334 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
40335
40336 /**
40337  * Calls the free function if one is set
40338  */
40339 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
40340
40341 /**
40342  * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
40343  */
40344 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
40345
40346 /**
40347  * Creates a copy of the UtxoFuture
40348  */
40349 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
40350
40351 /**
40352  * Builds a new future for later resolution.
40353  */
40354 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
40355
40356 /**
40357  * Resolves this future against the given `graph` and with the given `result`.
40358  *
40359  * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
40360  * forwarding the validated gossip message onwards to peers.
40361  *
40362  * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
40363  * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
40364  * after this.
40365  *
40366  * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
40367  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
40368  */
40369 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
40370
40371 /**
40372  * Resolves this future against the given `graph` and with the given `result`.
40373  *
40374  * The given `gossip` is used to broadcast any validated messages onwards to all peers which
40375  * have available buffer space.
40376  *
40377  * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
40378  * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
40379  * after this.
40380  *
40381  * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
40382  * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
40383  */
40384 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);
40385
40386 /**
40387  * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
40388  */
40389 void NodeId_free(struct LDKNodeId this_obj);
40390
40391 /**
40392  * Creates a copy of the NodeId
40393  */
40394 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
40395
40396 /**
40397  * Create a new NodeId from a public key
40398  */
40399 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
40400
40401 /**
40402  * Get the public key slice from this NodeId
40403  */
40404 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
40405
40406 /**
40407  * Get the public key from this NodeId
40408  */
40409 MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
40410
40411 /**
40412  * Generates a non-cryptographic 64-bit hash of the NodeId.
40413  */
40414 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
40415
40416 /**
40417  * Serialize the NodeId object into a byte array which can be read by NodeId_read
40418  */
40419 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
40420
40421 /**
40422  * Read a NodeId from a byte array, created by NodeId_write
40423  */
40424 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
40425
40426 /**
40427  * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
40428  */
40429 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
40430
40431 /**
40432  * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
40433  */
40434 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
40435
40436 /**
40437  * Frees any resources used by the NetworkUpdate
40438  */
40439 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
40440
40441 /**
40442  * Creates a copy of the NetworkUpdate
40443  */
40444 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
40445
40446 /**
40447  * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
40448  */
40449 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
40450
40451 /**
40452  * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
40453  */
40454 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
40455
40456 /**
40457  * Utility method to constructs a new NodeFailure-variant NetworkUpdate
40458  */
40459 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
40460
40461 /**
40462  * Checks if two NetworkUpdates contain equal inner contents.
40463  * This ignores pointers and is_owned flags and looks at the values in fields.
40464  */
40465 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
40466
40467 /**
40468  * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
40469  */
40470 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
40471
40472 /**
40473  * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
40474  */
40475 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
40476
40477 /**
40478  * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
40479  */
40480 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
40481
40482 /**
40483  * Creates a new tracker of the actual state of the network of channels and nodes,
40484  * assuming an existing [`NetworkGraph`].
40485  * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
40486  * correct, and the announcement is signed with channel owners' keys.
40487  */
40488 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
40489
40490 /**
40491  * Adds a provider used to check new announcements. Does not affect
40492  * existing announcements unless they are updated.
40493  * Add, update or remove the provider would replace the current one.
40494  */
40495 void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
40496
40497 /**
40498  * Handles any network updates originating from [`Event`]s.
40499  *
40500  * [`Event`]: crate::events::Event
40501  */
40502 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
40503
40504 /**
40505  * Gets the genesis hash for this network graph.
40506  */
40507 MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_genesis_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
40508
40509 /**
40510  * Verifies the signature of a [`NodeAnnouncement`].
40511  *
40512  * Returns an error if it is invalid.
40513  */
40514 struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
40515
40516 /**
40517  * Verifies all signatures included in a [`ChannelAnnouncement`].
40518  *
40519  * Returns an error if one of the signatures is invalid.
40520  */
40521 struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
40522
40523 /**
40524  * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
40525  * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
40526  */
40527 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
40528
40529 /**
40530  * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
40531  * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
40532  */
40533 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
40534
40535 /**
40536  * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
40537  */
40538 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
40539
40540 /**
40541  * When the last update to the channel direction was issued.
40542  * Value is opaque, as set in the announcement.
40543  */
40544 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40545
40546 /**
40547  * When the last update to the channel direction was issued.
40548  * Value is opaque, as set in the announcement.
40549  */
40550 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
40551
40552 /**
40553  * Whether the channel can be currently used for payments (in this one direction).
40554  */
40555 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40556
40557 /**
40558  * Whether the channel can be currently used for payments (in this one direction).
40559  */
40560 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
40561
40562 /**
40563  * The difference in CLTV values that you must have when routing through this channel.
40564  */
40565 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40566
40567 /**
40568  * The difference in CLTV values that you must have when routing through this channel.
40569  */
40570 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
40571
40572 /**
40573  * The minimum value, which must be relayed to the next hop via the channel
40574  */
40575 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40576
40577 /**
40578  * The minimum value, which must be relayed to the next hop via the channel
40579  */
40580 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
40581
40582 /**
40583  * The maximum value which may be relayed to the next hop via the channel.
40584  */
40585 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40586
40587 /**
40588  * The maximum value which may be relayed to the next hop via the channel.
40589  */
40590 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
40591
40592 /**
40593  * Fees charged when the channel is used for routing
40594  */
40595 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40596
40597 /**
40598  * Fees charged when the channel is used for routing
40599  */
40600 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
40601
40602 /**
40603  * Most recent update for the channel received from the network
40604  * Mostly redundant with the data we store in fields explicitly.
40605  * Everything else is useful only for sending out for initial routing sync.
40606  * Not stored if contains excess data to prevent DoS.
40607  *
40608  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40609  */
40610 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
40611
40612 /**
40613  * Most recent update for the channel received from the network
40614  * Mostly redundant with the data we store in fields explicitly.
40615  * Everything else is useful only for sending out for initial routing sync.
40616  * Not stored if contains excess data to prevent DoS.
40617  *
40618  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40619  */
40620 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
40621
40622 /**
40623  * Constructs a new ChannelUpdateInfo given each field
40624  *
40625  * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40626  */
40627 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);
40628
40629 /**
40630  * Creates a copy of the ChannelUpdateInfo
40631  */
40632 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
40633
40634 /**
40635  * Checks if two ChannelUpdateInfos contain equal inner contents.
40636  * This ignores pointers and is_owned flags and looks at the values in fields.
40637  * Two objects with NULL inner values will be considered "equal" here.
40638  */
40639 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
40640
40641 /**
40642  * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
40643  */
40644 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
40645
40646 /**
40647  * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
40648  */
40649 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
40650
40651 /**
40652  * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
40653  */
40654 void ChannelInfo_free(struct LDKChannelInfo this_obj);
40655
40656 /**
40657  * Protocol features of a channel communicated during its announcement
40658  */
40659 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40660
40661 /**
40662  * Protocol features of a channel communicated during its announcement
40663  */
40664 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
40665
40666 /**
40667  * Source node of the first direction of a channel
40668  */
40669 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40670
40671 /**
40672  * Source node of the first direction of a channel
40673  */
40674 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
40675
40676 /**
40677  * Details about the first direction of a channel
40678  *
40679  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40680  */
40681 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40682
40683 /**
40684  * Details about the first direction of a channel
40685  *
40686  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40687  */
40688 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
40689
40690 /**
40691  * Source node of the second direction of a channel
40692  */
40693 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40694
40695 /**
40696  * Source node of the second direction of a channel
40697  */
40698 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
40699
40700 /**
40701  * Details about the second direction of a channel
40702  *
40703  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40704  */
40705 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40706
40707 /**
40708  * Details about the second direction of a channel
40709  *
40710  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40711  */
40712 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
40713
40714 /**
40715  * The channel capacity as seen on-chain, if chain lookup is available.
40716  */
40717 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40718
40719 /**
40720  * The channel capacity as seen on-chain, if chain lookup is available.
40721  */
40722 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
40723
40724 /**
40725  * An initial announcement of the channel
40726  * Mostly redundant with the data we store in fields explicitly.
40727  * Everything else is useful only for sending out for initial routing sync.
40728  * Not stored if contains excess data to prevent DoS.
40729  *
40730  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40731  */
40732 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
40733
40734 /**
40735  * An initial announcement of the channel
40736  * Mostly redundant with the data we store in fields explicitly.
40737  * Everything else is useful only for sending out for initial routing sync.
40738  * Not stored if contains excess data to prevent DoS.
40739  *
40740  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40741  */
40742 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
40743
40744 /**
40745  * Creates a copy of the ChannelInfo
40746  */
40747 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
40748
40749 /**
40750  * Checks if two ChannelInfos contain equal inner contents.
40751  * This ignores pointers and is_owned flags and looks at the values in fields.
40752  * Two objects with NULL inner values will be considered "equal" here.
40753  */
40754 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
40755
40756 /**
40757  * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
40758  *
40759  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40760  */
40761 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
40762
40763 /**
40764  * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
40765  */
40766 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
40767
40768 /**
40769  * Read a ChannelInfo from a byte array, created by ChannelInfo_write
40770  */
40771 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
40772
40773 /**
40774  * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
40775  */
40776 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
40777
40778 /**
40779  * Creates a copy of the DirectedChannelInfo
40780  */
40781 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
40782
40783 /**
40784  * Returns information for the channel.
40785  */
40786 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
40787
40788 /**
40789  * Returns the maximum HTLC amount allowed over the channel in the direction.
40790  */
40791 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
40792
40793 /**
40794  * Returns the [`EffectiveCapacity`] of the channel in the direction.
40795  *
40796  * This is either the total capacity from the funding transaction, if known, or the
40797  * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
40798  * otherwise.
40799  */
40800 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
40801
40802 /**
40803  * Frees any resources used by the EffectiveCapacity
40804  */
40805 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
40806
40807 /**
40808  * Creates a copy of the EffectiveCapacity
40809  */
40810 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
40811
40812 /**
40813  * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
40814  */
40815 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
40816
40817 /**
40818  * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
40819  */
40820 struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
40821
40822 /**
40823  * Utility method to constructs a new Total-variant EffectiveCapacity
40824  */
40825 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
40826
40827 /**
40828  * Utility method to constructs a new Infinite-variant EffectiveCapacity
40829  */
40830 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
40831
40832 /**
40833  * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
40834  */
40835 struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
40836
40837 /**
40838  * Utility method to constructs a new Unknown-variant EffectiveCapacity
40839  */
40840 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
40841
40842 /**
40843  * Returns the effective capacity denominated in millisatoshi.
40844  */
40845 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
40846
40847 /**
40848  * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
40849  */
40850 void RoutingFees_free(struct LDKRoutingFees this_obj);
40851
40852 /**
40853  * Flat routing fee in millisatoshis.
40854  */
40855 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
40856
40857 /**
40858  * Flat routing fee in millisatoshis.
40859  */
40860 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
40861
40862 /**
40863  * Liquidity-based routing fee in millionths of a routed amount.
40864  * In other words, 10000 is 1%.
40865  */
40866 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
40867
40868 /**
40869  * Liquidity-based routing fee in millionths of a routed amount.
40870  * In other words, 10000 is 1%.
40871  */
40872 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
40873
40874 /**
40875  * Constructs a new RoutingFees given each field
40876  */
40877 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
40878
40879 /**
40880  * Checks if two RoutingFeess contain equal inner contents.
40881  * This ignores pointers and is_owned flags and looks at the values in fields.
40882  * Two objects with NULL inner values will be considered "equal" here.
40883  */
40884 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
40885
40886 /**
40887  * Creates a copy of the RoutingFees
40888  */
40889 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
40890
40891 /**
40892  * Generates a non-cryptographic 64-bit hash of the RoutingFees.
40893  */
40894 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
40895
40896 /**
40897  * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
40898  */
40899 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
40900
40901 /**
40902  * Read a RoutingFees from a byte array, created by RoutingFees_write
40903  */
40904 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
40905
40906 /**
40907  * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
40908  */
40909 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
40910
40911 /**
40912  * Protocol features the node announced support for
40913  */
40914 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
40915
40916 /**
40917  * Protocol features the node announced support for
40918  */
40919 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
40920
40921 /**
40922  * When the last known update to the node state was issued.
40923  * Value is opaque, as set in the announcement.
40924  */
40925 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
40926
40927 /**
40928  * When the last known update to the node state was issued.
40929  * Value is opaque, as set in the announcement.
40930  */
40931 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
40932
40933 /**
40934  * Color assigned to the node
40935  */
40936 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
40937
40938 /**
40939  * Color assigned to the node
40940  */
40941 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
40942
40943 /**
40944  * Moniker assigned to the node.
40945  * May be invalid or malicious (eg control chars),
40946  * should not be exposed to the user.
40947  */
40948 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
40949
40950 /**
40951  * Moniker assigned to the node.
40952  * May be invalid or malicious (eg control chars),
40953  * should not be exposed to the user.
40954  */
40955 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
40956
40957 /**
40958  * An initial announcement of the node
40959  * Mostly redundant with the data we store in fields explicitly.
40960  * Everything else is useful only for sending out for initial routing sync.
40961  * Not stored if contains excess data to prevent DoS.
40962  *
40963  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40964  */
40965 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
40966
40967 /**
40968  * An initial announcement of the node
40969  * Mostly redundant with the data we store in fields explicitly.
40970  * Everything else is useful only for sending out for initial routing sync.
40971  * Not stored if contains excess data to prevent DoS.
40972  *
40973  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40974  */
40975 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
40976
40977 /**
40978  * Constructs a new NodeAnnouncementInfo given each field
40979  *
40980  * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40981  */
40982 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);
40983
40984 /**
40985  * Creates a copy of the NodeAnnouncementInfo
40986  */
40987 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
40988
40989 /**
40990  * Checks if two NodeAnnouncementInfos contain equal inner contents.
40991  * This ignores pointers and is_owned flags and looks at the values in fields.
40992  * Two objects with NULL inner values will be considered "equal" here.
40993  */
40994 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
40995
40996 /**
40997  * Internet-level addresses via which one can connect to the node
40998  */
40999 MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
41000
41001 /**
41002  * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
41003  */
41004 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
41005
41006 /**
41007  * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
41008  */
41009 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
41010
41011 /**
41012  * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
41013  */
41014 void NodeAlias_free(struct LDKNodeAlias this_obj);
41015
41016 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
41017
41018 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41019
41020 /**
41021  * Constructs a new NodeAlias given each field
41022  */
41023 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
41024
41025 /**
41026  * Creates a copy of the NodeAlias
41027  */
41028 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
41029
41030 /**
41031  * Checks if two NodeAliass contain equal inner contents.
41032  * This ignores pointers and is_owned flags and looks at the values in fields.
41033  * Two objects with NULL inner values will be considered "equal" here.
41034  */
41035 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
41036
41037 /**
41038  * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
41039  */
41040 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
41041
41042 /**
41043  * Read a NodeAlias from a byte array, created by NodeAlias_write
41044  */
41045 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
41046
41047 /**
41048  * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
41049  */
41050 void NodeInfo_free(struct LDKNodeInfo this_obj);
41051
41052 /**
41053  * All valid channels a node has announced
41054  *
41055  * Returns a copy of the field.
41056  */
41057 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
41058
41059 /**
41060  * All valid channels a node has announced
41061  */
41062 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
41063
41064 /**
41065  * More information about a node from node_announcement.
41066  * Optional because we store a Node entry after learning about it from
41067  * a channel announcement, but before receiving a node announcement.
41068  *
41069  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41070  */
41071 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
41072
41073 /**
41074  * More information about a node from node_announcement.
41075  * Optional because we store a Node entry after learning about it from
41076  * a channel announcement, but before receiving a node announcement.
41077  *
41078  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41079  */
41080 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
41081
41082 /**
41083  * Constructs a new NodeInfo given each field
41084  *
41085  * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41086  */
41087 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
41088
41089 /**
41090  * Creates a copy of the NodeInfo
41091  */
41092 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
41093
41094 /**
41095  * Checks if two NodeInfos contain equal inner contents.
41096  * This ignores pointers and is_owned flags and looks at the values in fields.
41097  * Two objects with NULL inner values will be considered "equal" here.
41098  */
41099 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
41100
41101 /**
41102  * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
41103  */
41104 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
41105
41106 /**
41107  * Read a NodeInfo from a byte array, created by NodeInfo_write
41108  */
41109 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
41110
41111 /**
41112  * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
41113  */
41114 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
41115
41116 /**
41117  * Read a NetworkGraph from a byte array, created by NetworkGraph_write
41118  */
41119 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
41120
41121 /**
41122  * Creates a new, empty, network graph.
41123  */
41124 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
41125
41126 /**
41127  * Returns a read-only view of the network graph.
41128  */
41129 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41130
41131 /**
41132  * The unix timestamp provided by the most recent rapid gossip sync.
41133  * It will be set by the rapid sync process after every sync completion.
41134  */
41135 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41136
41137 /**
41138  * Update the unix timestamp provided by the most recent rapid gossip sync.
41139  * This should be done automatically by the rapid sync process after every sync completion.
41140  */
41141 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
41142
41143 /**
41144  * For an already known node (from channel announcements), update its stored properties from a
41145  * given node announcement.
41146  *
41147  * You probably don't want to call this directly, instead relying on a P2PGossipSync's
41148  * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
41149  * routing messages from a source using a protocol other than the lightning P2P protocol.
41150  */
41151 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
41152
41153 /**
41154  * For an already known node (from channel announcements), update its stored properties from a
41155  * given node announcement without verifying the associated signatures. Because we aren't
41156  * given the associated signatures here we cannot relay the node announcement to any of our
41157  * peers.
41158  */
41159 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);
41160
41161 /**
41162  * Store or update channel info from a channel announcement.
41163  *
41164  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
41165  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
41166  * routing messages from a source using a protocol other than the lightning P2P protocol.
41167  *
41168  * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
41169  * the corresponding UTXO exists on chain and is correctly-formatted.
41170  */
41171 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);
41172
41173 /**
41174  * Store or update channel info from a channel announcement.
41175  *
41176  * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
41177  * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
41178  * routing messages from a source using a protocol other than the lightning P2P protocol.
41179  *
41180  * This will skip verification of if the channel is actually on-chain.
41181  */
41182 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);
41183
41184 /**
41185  * Store or update channel info from a channel announcement without verifying the associated
41186  * signatures. Because we aren't given the associated signatures here we cannot relay the
41187  * channel announcement to any of our peers.
41188  *
41189  * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
41190  * the corresponding UTXO exists on chain and is correctly-formatted.
41191  */
41192 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);
41193
41194 /**
41195  * Update channel from partial announcement data received via rapid gossip sync
41196  *
41197  * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
41198  * rapid gossip sync server)
41199  *
41200  * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
41201  */
41202 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);
41203
41204 /**
41205  * Marks a channel in the graph as failed permanently.
41206  *
41207  * The channel and any node for which this was their last channel are removed from the graph.
41208  */
41209 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
41210
41211 /**
41212  * Marks a node in the graph as permanently failed, effectively removing it and its channels
41213  * from local storage.
41214  */
41215 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
41216
41217 /**
41218  * Removes information about channels that we haven't heard any updates about in some time.
41219  * This can be used regularly to prune the network graph of channels that likely no longer
41220  * exist.
41221  *
41222  * While there is no formal requirement that nodes regularly re-broadcast their channel
41223  * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
41224  * pruning occur for updates which are at least two weeks old, which we implement here.
41225  *
41226  * Note that for users of the `lightning-background-processor` crate this method may be
41227  * automatically called regularly for you.
41228  *
41229  * This method will also cause us to stop tracking removed nodes and channels if they have been
41230  * in the map for a while so that these can be resynced from gossip in the future.
41231  *
41232  * This method is only available with the `std` feature. See
41233  * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
41234  */
41235 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
41236
41237 /**
41238  * Removes information about channels that we haven't heard any updates about in some time.
41239  * This can be used regularly to prune the network graph of channels that likely no longer
41240  * exist.
41241  *
41242  * While there is no formal requirement that nodes regularly re-broadcast their channel
41243  * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
41244  * pruning occur for updates which are at least two weeks old, which we implement here.
41245  *
41246  * This method will also cause us to stop tracking removed nodes and channels if they have been
41247  * in the map for a while so that these can be resynced from gossip in the future.
41248  *
41249  * This function takes the current unix time as an argument. For users with the `std` feature
41250  * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
41251  */
41252 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
41253
41254 /**
41255  * For an already known (from announcement) channel, update info about one of the directions
41256  * of the channel.
41257  *
41258  * You probably don't want to call this directly, instead relying on a P2PGossipSync's
41259  * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
41260  * routing messages from a source using a protocol other than the lightning P2P protocol.
41261  *
41262  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
41263  * materially in the future will be rejected.
41264  */
41265 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
41266
41267 /**
41268  * For an already known (from announcement) channel, update info about one of the directions
41269  * of the channel without verifying the associated signatures. Because we aren't given the
41270  * associated signatures here we cannot relay the channel update to any of our peers.
41271  *
41272  * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
41273  * materially in the future will be rejected.
41274  */
41275 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
41276
41277 /**
41278  * Returns information on a channel with the given id.
41279  *
41280  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41281  */
41282 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
41283
41284 /**
41285  * Returns the list of channels in the graph
41286  */
41287 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
41288
41289 /**
41290  * Returns information on a node with the given id.
41291  *
41292  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41293  */
41294 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
41295
41296 /**
41297  * Returns the list of nodes in the graph
41298  */
41299 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
41300
41301 /**
41302  * Get network addresses by node id.
41303  * Returns None if the requested node is completely unknown,
41304  * or if node announcement for the node was never received.
41305  */
41306 MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
41307
41308 /**
41309  * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
41310  */
41311 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
41312
41313 /**
41314  * Creates a new router.
41315  */
41316 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes, struct LDKLockableScore scorer, struct LDKProbabilisticScoringFeeParameters score_params);
41317
41318 /**
41319  * Constructs a new Router which calls the relevant methods on this_arg.
41320  * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
41321  */
41322 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
41323
41324 /**
41325  * Calls the free function if one is set
41326  */
41327 void Router_free(struct LDKRouter this_ptr);
41328
41329 /**
41330  * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
41331  */
41332 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
41333
41334 /**
41335  * Initialize a new `ScorerAccountingForInFlightHtlcs`.
41336  */
41337 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
41338
41339 /**
41340  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
41341  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
41342  */
41343 struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
41344
41345 /**
41346  * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
41347  */
41348 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
41349
41350 /**
41351  * Creates a copy of the InFlightHtlcs
41352  */
41353 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
41354
41355 /**
41356  * Constructs an empty `InFlightHtlcs`.
41357  */
41358 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
41359
41360 /**
41361  * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
41362  */
41363 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
41364
41365 /**
41366  * Adds a known HTLC given the public key of the HTLC source, target, and short channel
41367  * id.
41368  */
41369 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);
41370
41371 /**
41372  * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
41373  * id.
41374  */
41375 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);
41376
41377 /**
41378  * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
41379  */
41380 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
41381
41382 /**
41383  * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
41384  */
41385 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
41386
41387 /**
41388  * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
41389  */
41390 void RouteHop_free(struct LDKRouteHop this_obj);
41391
41392 /**
41393  * The node_id of the node at this hop.
41394  */
41395 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41396
41397 /**
41398  * The node_id of the node at this hop.
41399  */
41400 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41401
41402 /**
41403  * The node_announcement features of the node at this hop. For the last hop, these may be
41404  * amended to match the features present in the invoice this node generated.
41405  */
41406 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41407
41408 /**
41409  * The node_announcement features of the node at this hop. For the last hop, these may be
41410  * amended to match the features present in the invoice this node generated.
41411  */
41412 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
41413
41414 /**
41415  * The channel that should be used from the previous hop to reach this node.
41416  */
41417 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41418
41419 /**
41420  * The channel that should be used from the previous hop to reach this node.
41421  */
41422 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
41423
41424 /**
41425  * The channel_announcement features of the channel that should be used from the previous hop
41426  * to reach this node.
41427  */
41428 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41429
41430 /**
41431  * The channel_announcement features of the channel that should be used from the previous hop
41432  * to reach this node.
41433  */
41434 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
41435
41436 /**
41437  * The fee taken on this hop (for paying for the use of the *next* channel in the path).
41438  * If this is the last hop in [`Path::hops`]:
41439  * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
41440  * * otherwise, this is the full value of this [`Path`]'s part of the payment
41441  *
41442  * [`BlindedPath`]: crate::blinded_path::BlindedPath
41443  */
41444 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41445
41446 /**
41447  * The fee taken on this hop (for paying for the use of the *next* channel in the path).
41448  * If this is the last hop in [`Path::hops`]:
41449  * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
41450  * * otherwise, this is the full value of this [`Path`]'s part of the payment
41451  *
41452  * [`BlindedPath`]: crate::blinded_path::BlindedPath
41453  */
41454 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
41455
41456 /**
41457  * The CLTV delta added for this hop.
41458  * If this is the last hop in [`Path::hops`]:
41459  * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
41460  * * otherwise, this is the CLTV delta expected at the destination
41461  *
41462  * [`BlindedPath`]: crate::blinded_path::BlindedPath
41463  */
41464 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41465
41466 /**
41467  * The CLTV delta added for this hop.
41468  * If this is the last hop in [`Path::hops`]:
41469  * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
41470  * * otherwise, this is the CLTV delta expected at the destination
41471  *
41472  * [`BlindedPath`]: crate::blinded_path::BlindedPath
41473  */
41474 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
41475
41476 /**
41477  * Indicates whether this hop is possibly announced in the public network graph.
41478  *
41479  * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
41480  * either know for sure it's announced in the public graph, or if any public channels exist
41481  * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
41482  * the channel to be unannounced.
41483  *
41484  * Will be `true` for objects serialized with LDK version 0.0.116 and before.
41485  */
41486 bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
41487
41488 /**
41489  * Indicates whether this hop is possibly announced in the public network graph.
41490  *
41491  * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
41492  * either know for sure it's announced in the public graph, or if any public channels exist
41493  * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
41494  * the channel to be unannounced.
41495  *
41496  * Will be `true` for objects serialized with LDK version 0.0.116 and before.
41497  */
41498 void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
41499
41500 /**
41501  * Constructs a new RouteHop given each field
41502  */
41503 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);
41504
41505 /**
41506  * Creates a copy of the RouteHop
41507  */
41508 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
41509
41510 /**
41511  * Generates a non-cryptographic 64-bit hash of the RouteHop.
41512  */
41513 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
41514
41515 /**
41516  * Checks if two RouteHops contain equal inner contents.
41517  * This ignores pointers and is_owned flags and looks at the values in fields.
41518  * Two objects with NULL inner values will be considered "equal" here.
41519  */
41520 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
41521
41522 /**
41523  * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
41524  */
41525 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
41526
41527 /**
41528  * Read a RouteHop from a byte array, created by RouteHop_write
41529  */
41530 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
41531
41532 /**
41533  * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
41534  */
41535 void BlindedTail_free(struct LDKBlindedTail this_obj);
41536
41537 /**
41538  * The hops of the [`BlindedPath`] provided by the recipient.
41539  *
41540  * [`BlindedPath`]: crate::blinded_path::BlindedPath
41541  */
41542 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
41543
41544 /**
41545  * The hops of the [`BlindedPath`] provided by the recipient.
41546  *
41547  * [`BlindedPath`]: crate::blinded_path::BlindedPath
41548  */
41549 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
41550
41551 /**
41552  * The blinding point of the [`BlindedPath`] provided by the recipient.
41553  *
41554  * [`BlindedPath`]: crate::blinded_path::BlindedPath
41555  */
41556 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
41557
41558 /**
41559  * The blinding point of the [`BlindedPath`] provided by the recipient.
41560  *
41561  * [`BlindedPath`]: crate::blinded_path::BlindedPath
41562  */
41563 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41564
41565 /**
41566  * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
41567  * inferring the destination. May be 0.
41568  */
41569 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
41570
41571 /**
41572  * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
41573  * inferring the destination. May be 0.
41574  */
41575 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
41576
41577 /**
41578  * The total amount paid on this [`Path`], excluding the fees.
41579  */
41580 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
41581
41582 /**
41583  * The total amount paid on this [`Path`], excluding the fees.
41584  */
41585 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
41586
41587 /**
41588  * Constructs a new BlindedTail given each field
41589  */
41590 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);
41591
41592 /**
41593  * Creates a copy of the BlindedTail
41594  */
41595 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
41596
41597 /**
41598  * Generates a non-cryptographic 64-bit hash of the BlindedTail.
41599  */
41600 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
41601
41602 /**
41603  * Checks if two BlindedTails contain equal inner contents.
41604  * This ignores pointers and is_owned flags and looks at the values in fields.
41605  * Two objects with NULL inner values will be considered "equal" here.
41606  */
41607 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
41608
41609 /**
41610  * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
41611  */
41612 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
41613
41614 /**
41615  * Read a BlindedTail from a byte array, created by BlindedTail_write
41616  */
41617 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
41618
41619 /**
41620  * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
41621  */
41622 void Path_free(struct LDKPath this_obj);
41623
41624 /**
41625  * The list of unblinded hops in this [`Path`]. Must be at least length one.
41626  */
41627 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
41628
41629 /**
41630  * The list of unblinded hops in this [`Path`]. Must be at least length one.
41631  */
41632 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
41633
41634 /**
41635  * The blinded path at which this path terminates, if we're sending to one, and its metadata.
41636  *
41637  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41638  */
41639 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
41640
41641 /**
41642  * The blinded path at which this path terminates, if we're sending to one, and its metadata.
41643  *
41644  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41645  */
41646 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
41647
41648 /**
41649  * Constructs a new Path given each field
41650  *
41651  * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41652  */
41653 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
41654
41655 /**
41656  * Creates a copy of the Path
41657  */
41658 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
41659
41660 /**
41661  * Generates a non-cryptographic 64-bit hash of the Path.
41662  */
41663 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
41664
41665 /**
41666  * Checks if two Paths contain equal inner contents.
41667  * This ignores pointers and is_owned flags and looks at the values in fields.
41668  * Two objects with NULL inner values will be considered "equal" here.
41669  */
41670 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
41671
41672 /**
41673  * Gets the fees for a given path, excluding any excess paid to the recipient.
41674  */
41675 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
41676
41677 /**
41678  * Gets the total amount paid on this [`Path`], excluding the fees.
41679  */
41680 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
41681
41682 /**
41683  * Gets the final hop's CLTV expiry delta.
41684  */
41685 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
41686
41687 /**
41688  * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
41689  */
41690 void Route_free(struct LDKRoute this_obj);
41691
41692 /**
41693  * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
41694  * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
41695  * the same.
41696  */
41697 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
41698
41699 /**
41700  * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
41701  * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
41702  * the same.
41703  */
41704 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
41705
41706 /**
41707  * The `route_params` parameter passed to [`find_route`].
41708  *
41709  * This is used by `ChannelManager` to track information which may be required for retries.
41710  *
41711  * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
41712  *
41713  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
41714  */
41715 struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
41716
41717 /**
41718  * The `route_params` parameter passed to [`find_route`].
41719  *
41720  * This is used by `ChannelManager` to track information which may be required for retries.
41721  *
41722  * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
41723  *
41724  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
41725  */
41726 void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
41727
41728 /**
41729  * Constructs a new Route given each field
41730  *
41731  * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
41732  */
41733 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
41734
41735 /**
41736  * Creates a copy of the Route
41737  */
41738 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
41739
41740 /**
41741  * Generates a non-cryptographic 64-bit hash of the Route.
41742  */
41743 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
41744
41745 /**
41746  * Checks if two Routes contain equal inner contents.
41747  * This ignores pointers and is_owned flags and looks at the values in fields.
41748  * Two objects with NULL inner values will be considered "equal" here.
41749  */
41750 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
41751
41752 /**
41753  * Returns the total amount of fees paid on this [`Route`].
41754  *
41755  * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
41756  * the recipient, which can happen in excess of the amount passed to [`find_route`] via
41757  * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
41758  *
41759  * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
41760  */
41761 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
41762
41763 /**
41764  * Returns the total amount paid on this [`Route`], excluding the fees.
41765  *
41766  * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
41767  * we had to reach the [`htlc_minimum_msat`] limits.
41768  *
41769  * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
41770  */
41771 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
41772
41773 /**
41774  * Serialize the Route object into a byte array which can be read by Route_read
41775  */
41776 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
41777
41778 /**
41779  * Read a Route from a byte array, created by Route_write
41780  */
41781 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
41782
41783 /**
41784  * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
41785  */
41786 void RouteParameters_free(struct LDKRouteParameters this_obj);
41787
41788 /**
41789  * The parameters of the failed payment path.
41790  */
41791 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
41792
41793 /**
41794  * The parameters of the failed payment path.
41795  */
41796 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
41797
41798 /**
41799  * The amount in msats sent on the failed payment path.
41800  */
41801 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
41802
41803 /**
41804  * The amount in msats sent on the failed payment path.
41805  */
41806 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
41807
41808 /**
41809  * The maximum total fees, in millisatoshi, that may accrue during route finding.
41810  *
41811  * This limit also applies to the total fees that may arise while retrying failed payment
41812  * paths.
41813  *
41814  * Note that values below a few sats may result in some paths being spuriously ignored.
41815  */
41816 struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
41817
41818 /**
41819  * The maximum total fees, in millisatoshi, that may accrue during route finding.
41820  *
41821  * This limit also applies to the total fees that may arise while retrying failed payment
41822  * paths.
41823  *
41824  * Note that values below a few sats may result in some paths being spuriously ignored.
41825  */
41826 void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
41827
41828 /**
41829  * Constructs a new RouteParameters given each field
41830  */
41831 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);
41832
41833 /**
41834  * Creates a copy of the RouteParameters
41835  */
41836 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
41837
41838 /**
41839  * Generates a non-cryptographic 64-bit hash of the RouteParameters.
41840  */
41841 uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
41842
41843 /**
41844  * Checks if two RouteParameterss contain equal inner contents.
41845  * This ignores pointers and is_owned flags and looks at the values in fields.
41846  * Two objects with NULL inner values will be considered "equal" here.
41847  */
41848 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
41849
41850 /**
41851  * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
41852  *
41853  * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
41854  */
41855 MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
41856
41857 /**
41858  * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
41859  */
41860 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
41861
41862 /**
41863  * Read a RouteParameters from a byte array, created by RouteParameters_write
41864  */
41865 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
41866
41867 /**
41868  * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
41869  */
41870 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
41871
41872 /**
41873  * Information about the payee, such as their features and route hints for their channels.
41874  */
41875 struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
41876
41877 /**
41878  * Information about the payee, such as their features and route hints for their channels.
41879  */
41880 void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
41881
41882 /**
41883  * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
41884  */
41885 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
41886
41887 /**
41888  * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
41889  */
41890 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
41891
41892 /**
41893  * The maximum total CLTV delta we accept for the route.
41894  * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
41895  */
41896 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
41897
41898 /**
41899  * The maximum total CLTV delta we accept for the route.
41900  * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
41901  */
41902 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
41903
41904 /**
41905  * The maximum number of paths that may be used by (MPP) payments.
41906  * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
41907  */
41908 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
41909
41910 /**
41911  * The maximum number of paths that may be used by (MPP) payments.
41912  * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
41913  */
41914 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
41915
41916 /**
41917  * Selects the maximum share of a channel's total capacity which will be sent over a channel,
41918  * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
41919  * a lower value prefers to send larger MPP parts, potentially saturating channels and
41920  * increasing failure probability for those paths.
41921  *
41922  * Note that this restriction will be relaxed during pathfinding after paths which meet this
41923  * restriction have been found. While paths which meet this criteria will be searched for, it
41924  * is ultimately up to the scorer to select them over other paths.
41925  *
41926  * A value of 0 will allow payments up to and including a channel's total announced usable
41927  * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
41928  *
41929  * Default value: 2
41930  */
41931 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
41932
41933 /**
41934  * Selects the maximum share of a channel's total capacity which will be sent over a channel,
41935  * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
41936  * a lower value prefers to send larger MPP parts, potentially saturating channels and
41937  * increasing failure probability for those paths.
41938  *
41939  * Note that this restriction will be relaxed during pathfinding after paths which meet this
41940  * restriction have been found. While paths which meet this criteria will be searched for, it
41941  * is ultimately up to the scorer to select them over other paths.
41942  *
41943  * A value of 0 will allow payments up to and including a channel's total announced usable
41944  * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
41945  *
41946  * Default value: 2
41947  */
41948 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
41949
41950 /**
41951  * A list of SCIDs which this payment was previously attempted over and which caused the
41952  * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
41953  * these SCIDs.
41954  *
41955  * Returns a copy of the field.
41956  */
41957 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
41958
41959 /**
41960  * A list of SCIDs which this payment was previously attempted over and which caused the
41961  * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
41962  * these SCIDs.
41963  */
41964 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
41965
41966 /**
41967  * Constructs a new PaymentParameters given each field
41968  */
41969 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);
41970
41971 /**
41972  * Creates a copy of the PaymentParameters
41973  */
41974 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
41975
41976 /**
41977  * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
41978  */
41979 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
41980
41981 /**
41982  * Checks if two PaymentParameterss contain equal inner contents.
41983  * This ignores pointers and is_owned flags and looks at the values in fields.
41984  * Two objects with NULL inner values will be considered "equal" here.
41985  */
41986 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
41987
41988 /**
41989  * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
41990  */
41991 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
41992
41993 /**
41994  * Read a PaymentParameters from a byte array, created by PaymentParameters_write
41995  */
41996 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
41997
41998 /**
41999  * Creates a payee with the node id of the given `pubkey`.
42000  *
42001  * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
42002  * provided.
42003  */
42004 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
42005
42006 /**
42007  * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
42008  *
42009  * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
42010  * provided.
42011  *
42012  * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
42013  * whether your router will be allowed to find a multi-part route for this payment. If you
42014  * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
42015  * [`RecipientOnionFields::secret_only`].
42016  *
42017  * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
42018  */
42019 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
42020
42021 /**
42022  * Creates parameters for paying to a blinded payee from the provided invoice. Sets
42023  * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
42024  * [`PaymentParameters::expiry_time`].
42025  */
42026 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
42027
42028 /**
42029  * Creates parameters for paying to a blinded payee from the provided blinded route hints.
42030  */
42031 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints);
42032
42033 /**
42034  * Frees any resources used by the Payee
42035  */
42036 void Payee_free(struct LDKPayee this_ptr);
42037
42038 /**
42039  * Creates a copy of the Payee
42040  */
42041 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
42042
42043 /**
42044  * Utility method to constructs a new Blinded-variant Payee
42045  */
42046 struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
42047
42048 /**
42049  * Utility method to constructs a new Clear-variant Payee
42050  */
42051 struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
42052
42053 /**
42054  * Generates a non-cryptographic 64-bit hash of the Payee.
42055  */
42056 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
42057
42058 /**
42059  * Checks if two Payees contain equal inner contents.
42060  * This ignores pointers and is_owned flags and looks at the values in fields.
42061  */
42062 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
42063
42064 /**
42065  * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
42066  */
42067 void RouteHint_free(struct LDKRouteHint this_obj);
42068
42069 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
42070
42071 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
42072
42073 /**
42074  * Constructs a new RouteHint given each field
42075  */
42076 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
42077
42078 /**
42079  * Creates a copy of the RouteHint
42080  */
42081 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
42082
42083 /**
42084  * Generates a non-cryptographic 64-bit hash of the RouteHint.
42085  */
42086 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
42087
42088 /**
42089  * Checks if two RouteHints contain equal inner contents.
42090  * This ignores pointers and is_owned flags and looks at the values in fields.
42091  * Two objects with NULL inner values will be considered "equal" here.
42092  */
42093 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
42094
42095 /**
42096  * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
42097  */
42098 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
42099
42100 /**
42101  * Read a RouteHint from a byte array, created by RouteHint_write
42102  */
42103 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
42104
42105 /**
42106  * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
42107  */
42108 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
42109
42110 /**
42111  * The node_id of the non-target end of the route
42112  */
42113 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42114
42115 /**
42116  * The node_id of the non-target end of the route
42117  */
42118 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42119
42120 /**
42121  * The short_channel_id of this channel
42122  */
42123 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42124
42125 /**
42126  * The short_channel_id of this channel
42127  */
42128 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
42129
42130 /**
42131  * The fees which must be paid to use this channel
42132  */
42133 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42134
42135 /**
42136  * The fees which must be paid to use this channel
42137  */
42138 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
42139
42140 /**
42141  * The difference in CLTV values between this node and the next node.
42142  */
42143 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42144
42145 /**
42146  * The difference in CLTV values between this node and the next node.
42147  */
42148 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
42149
42150 /**
42151  * The minimum value, in msat, which must be relayed to the next hop.
42152  */
42153 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42154
42155 /**
42156  * The minimum value, in msat, which must be relayed to the next hop.
42157  */
42158 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
42159
42160 /**
42161  * The maximum value in msat available for routing with a single HTLC.
42162  */
42163 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
42164
42165 /**
42166  * The maximum value in msat available for routing with a single HTLC.
42167  */
42168 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
42169
42170 /**
42171  * Constructs a new RouteHintHop given each field
42172  */
42173 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);
42174
42175 /**
42176  * Creates a copy of the RouteHintHop
42177  */
42178 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
42179
42180 /**
42181  * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
42182  */
42183 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
42184
42185 /**
42186  * Checks if two RouteHintHops contain equal inner contents.
42187  * This ignores pointers and is_owned flags and looks at the values in fields.
42188  * Two objects with NULL inner values will be considered "equal" here.
42189  */
42190 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
42191
42192 /**
42193  * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
42194  */
42195 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
42196
42197 /**
42198  * Read a RouteHintHop from a byte array, created by RouteHintHop_write
42199  */
42200 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
42201
42202 /**
42203  * Finds a route from us (payer) to the given target node (payee).
42204  *
42205  * If the payee provided features in their invoice, they should be provided via the `payee` field
42206  * in the given [`RouteParameters::payment_params`].
42207  * Without this, MPP will only be used if the payee's features are available in the network graph.
42208  *
42209  * Private routing paths between a public node and the target may be included in the `payee` field
42210  * of [`RouteParameters::payment_params`].
42211  *
42212  * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
42213  * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
42214  * from `network_graph` will be ignored, and only those in `first_hops` will be used.
42215  *
42216  * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
42217  * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
42218  * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
42219  *
42220  * # Panics
42221  *
42222  * Panics if first_hops contains channels without `short_channel_id`s;
42223  * [`ChannelManager::list_usable_channels`] will never include such channels.
42224  *
42225  * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
42226  * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
42227  * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
42228  *
42229  * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
42230  */
42231 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]);
42232
42233 /**
42234  * Construct a route from us (payer) to the target node (payee) via the given hops (which should
42235  * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
42236  *
42237  * Re-uses logic from `find_route`, so the restrictions described there also apply here.
42238  */
42239 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]);
42240
42241 /**
42242  * Calls the free function if one is set
42243  */
42244 void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
42245
42246 /**
42247  * Calls the free function if one is set
42248  */
42249 void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
42250
42251 /**
42252  * Calls the free function if one is set
42253  */
42254 void Score_free(struct LDKScore this_ptr);
42255
42256 /**
42257  * Calls the free function if one is set
42258  */
42259 void LockableScore_free(struct LDKLockableScore this_ptr);
42260
42261 /**
42262  * Calls the free function if one is set
42263  */
42264 void WriteableScore_free(struct LDKWriteableScore this_ptr);
42265
42266 /**
42267  * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
42268  */
42269 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
42270
42271 /**
42272  * Constructs a new LockableScore which calls the relevant methods on this_arg.
42273  * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
42274  */
42275 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
42276
42277 /**
42278  * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
42279  */
42280 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
42281
42282 /**
42283  * Constructs a new WriteableScore which calls the relevant methods on this_arg.
42284  * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
42285  */
42286 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
42287
42288 /**
42289  * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
42290  */
42291 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
42292
42293 /**
42294  * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
42295  */
42296 void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
42297
42298 /**
42299  * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
42300  */
42301 void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
42302
42303 /**
42304  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
42305  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
42306  */
42307 struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
42308
42309 /**
42310  * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
42311  */
42312 struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
42313
42314 /**
42315  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
42316  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
42317  */
42318 struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
42319
42320 /**
42321  * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
42322  */
42323 void ChannelUsage_free(struct LDKChannelUsage this_obj);
42324
42325 /**
42326  * The amount to send through the channel, denominated in millisatoshis.
42327  */
42328 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
42329
42330 /**
42331  * The amount to send through the channel, denominated in millisatoshis.
42332  */
42333 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
42334
42335 /**
42336  * Total amount, denominated in millisatoshis, already allocated to send through the channel
42337  * as part of a multi-path payment.
42338  */
42339 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
42340
42341 /**
42342  * Total amount, denominated in millisatoshis, already allocated to send through the channel
42343  * as part of a multi-path payment.
42344  */
42345 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
42346
42347 /**
42348  * The effective capacity of the channel.
42349  */
42350 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
42351
42352 /**
42353  * The effective capacity of the channel.
42354  */
42355 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
42356
42357 /**
42358  * Constructs a new ChannelUsage given each field
42359  */
42360 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
42361
42362 /**
42363  * Creates a copy of the ChannelUsage
42364  */
42365 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
42366
42367 /**
42368  * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
42369  */
42370 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
42371
42372 /**
42373  * Creates a copy of the FixedPenaltyScorer
42374  */
42375 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
42376
42377 /**
42378  * Creates a new scorer using `penalty_msat`.
42379  */
42380 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
42381
42382 /**
42383  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
42384  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
42385  */
42386 struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
42387
42388 /**
42389  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
42390  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
42391  */
42392 struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
42393
42394 /**
42395  * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
42396  */
42397 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
42398
42399 /**
42400  * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
42401  */
42402 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
42403
42404 /**
42405  * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
42406  */
42407 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
42408
42409 /**
42410  * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
42411  */
42412 void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
42413
42414 /**
42415  * A fixed penalty in msats to apply to each channel.
42416  *
42417  * Default value: 500 msat
42418  */
42419 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42420
42421 /**
42422  * A fixed penalty in msats to apply to each channel.
42423  *
42424  * Default value: 500 msat
42425  */
42426 void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42427
42428 /**
42429  * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
42430  * applied to each channel, in excess of the [`base_penalty_msat`].
42431  *
42432  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
42433  * fees plus penalty) for large payments. The penalty is computed as the product of this
42434  * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
42435  * amount plus the amount of any other HTLCs flowing we sent over the same channel).
42436  *
42437  * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
42438  *
42439  * Default value: 8,192 msat
42440  *
42441  * [`base_penalty_msat`]: Self::base_penalty_msat
42442  */
42443 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42444
42445 /**
42446  * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
42447  * applied to each channel, in excess of the [`base_penalty_msat`].
42448  *
42449  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
42450  * fees plus penalty) for large payments. The penalty is computed as the product of this
42451  * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
42452  * amount plus the amount of any other HTLCs flowing we sent over the same channel).
42453  *
42454  * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
42455  *
42456  * Default value: 8,192 msat
42457  *
42458  * [`base_penalty_msat`]: Self::base_penalty_msat
42459  */
42460 void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42461
42462 /**
42463  * A multiplier used in conjunction with the negative `log10` of the channel's success
42464  * probability for a payment, as determined by our latest estimates of the channel's
42465  * liquidity, to determine the liquidity penalty.
42466  *
42467  * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
42468  * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
42469  * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
42470  * lower bounding the success probability to `0.01`) when the amount falls within the
42471  * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
42472  * result in a `u64::max_value` penalty, however.
42473  *
42474  * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
42475  *
42476  * Default value: 30,000 msat
42477  *
42478  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
42479  */
42480 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42481
42482 /**
42483  * A multiplier used in conjunction with the negative `log10` of the channel's success
42484  * probability for a payment, as determined by our latest estimates of the channel's
42485  * liquidity, to determine the liquidity penalty.
42486  *
42487  * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
42488  * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
42489  * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
42490  * lower bounding the success probability to `0.01`) when the amount falls within the
42491  * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
42492  * result in a `u64::max_value` penalty, however.
42493  *
42494  * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
42495  *
42496  * Default value: 30,000 msat
42497  *
42498  * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
42499  */
42500 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42501
42502 /**
42503  * A multiplier used in conjunction with the total amount flowing over a channel and the
42504  * negative `log10` of the channel's success probability for the payment, as determined by our
42505  * latest estimates of the channel's liquidity, to determine the amount penalty.
42506  *
42507  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
42508  * fees plus penalty) for large payments. The penalty is computed as the product of this
42509  * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
42510  * `log10` of the success probability.
42511  *
42512  * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
42513  *
42514  * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
42515  * the amount will result in a penalty of the multiplier. And, as the success probability
42516  * decreases, the negative `log10` weighting will increase dramatically. For higher success
42517  * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
42518  * fall below `1`.
42519  *
42520  * Default value: 192 msat
42521  */
42522 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42523
42524 /**
42525  * A multiplier used in conjunction with the total amount flowing over a channel and the
42526  * negative `log10` of the channel's success probability for the payment, as determined by our
42527  * latest estimates of the channel's liquidity, to determine the amount penalty.
42528  *
42529  * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
42530  * fees plus penalty) for large payments. The penalty is computed as the product of this
42531  * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
42532  * `log10` of the success probability.
42533  *
42534  * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
42535  *
42536  * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
42537  * the amount will result in a penalty of the multiplier. And, as the success probability
42538  * decreases, the negative `log10` weighting will increase dramatically. For higher success
42539  * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
42540  * fall below `1`.
42541  *
42542  * Default value: 192 msat
42543  */
42544 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42545
42546 /**
42547  * A multiplier used in conjunction with the negative `log10` of the channel's success
42548  * probability for the payment, as determined based on the history of our estimates of the
42549  * channel's available liquidity, to determine a penalty.
42550  *
42551  * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
42552  * only our latest estimate for the current liquidity available in the channel, it estimates
42553  * success probability based on the estimated liquidity available in the channel through
42554  * history. Specifically, every time we update our liquidity bounds on a given channel, we
42555  * track which of several buckets those bounds fall into, exponentially decaying the
42556  * probability of each bucket as new samples are added.
42557  *
42558  * Default value: 10,000 msat
42559  *
42560  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
42561  */
42562 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42563
42564 /**
42565  * A multiplier used in conjunction with the negative `log10` of the channel's success
42566  * probability for the payment, as determined based on the history of our estimates of the
42567  * channel's available liquidity, to determine a penalty.
42568  *
42569  * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
42570  * only our latest estimate for the current liquidity available in the channel, it estimates
42571  * success probability based on the estimated liquidity available in the channel through
42572  * history. Specifically, every time we update our liquidity bounds on a given channel, we
42573  * track which of several buckets those bounds fall into, exponentially decaying the
42574  * probability of each bucket as new samples are added.
42575  *
42576  * Default value: 10,000 msat
42577  *
42578  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
42579  */
42580 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42581
42582 /**
42583  * A multiplier used in conjunction with the total amount flowing over a channel and the
42584  * negative `log10` of the channel's success probability for the payment, as determined based
42585  * on the history of our estimates of the channel's available liquidity, to determine a
42586  * penalty.
42587  *
42588  * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
42589  * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
42590  * of the amount flowing over this channel, weighted by the negative `log10` of the success
42591  * probability.
42592  *
42593  * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
42594  * of using only our latest estimate for the current liquidity available in the channel, it
42595  * estimates success probability based on the estimated liquidity available in the channel
42596  * through history. Specifically, every time we update our liquidity bounds on a given
42597  * channel, we track which of several buckets those bounds fall into, exponentially decaying
42598  * the probability of each bucket as new samples are added.
42599  *
42600  * Default value: 64 msat
42601  *
42602  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
42603  */
42604 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42605
42606 /**
42607  * A multiplier used in conjunction with the total amount flowing over a channel and the
42608  * negative `log10` of the channel's success probability for the payment, as determined based
42609  * on the history of our estimates of the channel's available liquidity, to determine a
42610  * penalty.
42611  *
42612  * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
42613  * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
42614  * of the amount flowing over this channel, weighted by the negative `log10` of the success
42615  * probability.
42616  *
42617  * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
42618  * of using only our latest estimate for the current liquidity available in the channel, it
42619  * estimates success probability based on the estimated liquidity available in the channel
42620  * through history. Specifically, every time we update our liquidity bounds on a given
42621  * channel, we track which of several buckets those bounds fall into, exponentially decaying
42622  * the probability of each bucket as new samples are added.
42623  *
42624  * Default value: 64 msat
42625  *
42626  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
42627  */
42628 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42629
42630 /**
42631  * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
42632  * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
42633  * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
42634  * as this makes balance discovery attacks harder to execute, thereby creating an incentive
42635  * to restrict `htlc_maximum_msat` and improve privacy.
42636  *
42637  * Default value: 250 msat
42638  */
42639 uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42640
42641 /**
42642  * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
42643  * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
42644  * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
42645  * as this makes balance discovery attacks harder to execute, thereby creating an incentive
42646  * to restrict `htlc_maximum_msat` and improve privacy.
42647  *
42648  * Default value: 250 msat
42649  */
42650 void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42651
42652 /**
42653  * This penalty is applied when the total amount flowing over a channel exceeds our current
42654  * estimate of the channel's available liquidity. The total amount is the amount of the
42655  * current HTLC plus any HTLCs which we've sent over the same channel.
42656  *
42657  * Note that in this case all other penalties, including the
42658  * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
42659  * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
42660  * applicable, are still included in the overall penalty.
42661  *
42662  * If you wish to avoid creating paths with such channels entirely, setting this to a value of
42663  * `u64::max_value()` will guarantee that.
42664  *
42665  * Default value: 1_0000_0000_000 msat (1 Bitcoin)
42666  *
42667  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
42668  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
42669  * [`base_penalty_msat`]: Self::base_penalty_msat
42670  * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
42671  */
42672 uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42673
42674 /**
42675  * This penalty is applied when the total amount flowing over a channel exceeds our current
42676  * estimate of the channel's available liquidity. The total amount is the amount of the
42677  * current HTLC plus any HTLCs which we've sent over the same channel.
42678  *
42679  * Note that in this case all other penalties, including the
42680  * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
42681  * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
42682  * applicable, are still included in the overall penalty.
42683  *
42684  * If you wish to avoid creating paths with such channels entirely, setting this to a value of
42685  * `u64::max_value()` will guarantee that.
42686  *
42687  * Default value: 1_0000_0000_000 msat (1 Bitcoin)
42688  *
42689  * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
42690  * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
42691  * [`base_penalty_msat`]: Self::base_penalty_msat
42692  * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
42693  */
42694 void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
42695
42696 /**
42697  * In order to calculate most of the scores above, we must first convert a lower and upper
42698  * bound on the available liquidity in a channel into the probability that we think a payment
42699  * will succeed. That probability is derived from a Probability Density Function for where we
42700  * think the liquidity in a channel likely lies, given such bounds.
42701  *
42702  * If this flag is set, that PDF is simply a constant - we assume that the actual available
42703  * liquidity in a channel is just as likely to be at any point between our lower and upper
42704  * bounds.
42705  *
42706  * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
42707  * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
42708  * matches experimental results - most routing nodes do not aggressively rebalance their
42709  * channels and flows in the network are often unbalanced, leaving liquidity usually
42710  * unavailable.
42711  *
42712  * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
42713  * of floating-point multiplications in the hottest routing code, which may lead to routing
42714  * performance degradation on some machines.
42715  *
42716  * Default value: false
42717  */
42718 bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
42719
42720 /**
42721  * In order to calculate most of the scores above, we must first convert a lower and upper
42722  * bound on the available liquidity in a channel into the probability that we think a payment
42723  * will succeed. That probability is derived from a Probability Density Function for where we
42724  * think the liquidity in a channel likely lies, given such bounds.
42725  *
42726  * If this flag is set, that PDF is simply a constant - we assume that the actual available
42727  * liquidity in a channel is just as likely to be at any point between our lower and upper
42728  * bounds.
42729  *
42730  * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
42731  * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
42732  * matches experimental results - most routing nodes do not aggressively rebalance their
42733  * channels and flows in the network are often unbalanced, leaving liquidity usually
42734  * unavailable.
42735  *
42736  * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
42737  * of floating-point multiplications in the hottest routing code, which may lead to routing
42738  * performance degradation on some machines.
42739  *
42740  * Default value: false
42741  */
42742 void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
42743
42744 /**
42745  * Creates a copy of the ProbabilisticScoringFeeParameters
42746  */
42747 struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
42748
42749 /**
42750  * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
42751  */
42752 MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
42753
42754 /**
42755  * Marks the node with the given `node_id` as banned,
42756  * i.e it will be avoided during path finding.
42757  */
42758 void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
42759
42760 /**
42761  * Marks all nodes in the given list as banned, i.e.,
42762  * they will be avoided during path finding.
42763  */
42764 void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
42765
42766 /**
42767  * Removes the node with the given `node_id` from the list of nodes to avoid.
42768  */
42769 void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
42770
42771 /**
42772  * Sets a manual penalty for the given node.
42773  */
42774 void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
42775
42776 /**
42777  * Removes the node with the given `node_id` from the list of manual penalties.
42778  */
42779 void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
42780
42781 /**
42782  * Clears the list of manual penalties that are applied during path finding.
42783  */
42784 void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
42785
42786 /**
42787  * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
42788  */
42789 void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
42790
42791 /**
42792  * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
42793  * tracking can simply live on with increasingly stale data. Instead, when a channel has not
42794  * seen a liquidity estimate update for this amount of time, the historical datapoints are
42795  * decayed by half.
42796  * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
42797  *
42798  * Note that after 16 or more half lives all historical data will be completely gone.
42799  *
42800  * Default value: 14 days
42801  *
42802  * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorerUsingTime::historical_estimated_channel_liquidity_probabilities
42803  */
42804 uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
42805
42806 /**
42807  * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
42808  * tracking can simply live on with increasingly stale data. Instead, when a channel has not
42809  * seen a liquidity estimate update for this amount of time, the historical datapoints are
42810  * decayed by half.
42811  * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
42812  *
42813  * Note that after 16 or more half lives all historical data will be completely gone.
42814  *
42815  * Default value: 14 days
42816  *
42817  * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorerUsingTime::historical_estimated_channel_liquidity_probabilities
42818  */
42819 void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
42820
42821 /**
42822  * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
42823  * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
42824  * the available liquidity is halved and the upper-bound moves half-way to the channel's total
42825  * capacity.
42826  *
42827  * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
42828  * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
42829  * struct documentation for more info on the way the liquidity bounds are used.
42830  *
42831  * For example, if the channel's capacity is 1 million sats, and the current upper and lower
42832  * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
42833  * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
42834  *
42835  * Default value: 6 hours
42836  *
42837  * # Note
42838  *
42839  * When built with the `no-std` feature, time will never elapse. Therefore, the channel
42840  * liquidity knowledge will never decay except when the bounds cross.
42841  */
42842 uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
42843
42844 /**
42845  * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
42846  * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
42847  * the available liquidity is halved and the upper-bound moves half-way to the channel's total
42848  * capacity.
42849  *
42850  * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
42851  * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
42852  * struct documentation for more info on the way the liquidity bounds are used.
42853  *
42854  * For example, if the channel's capacity is 1 million sats, and the current upper and lower
42855  * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
42856  * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
42857  *
42858  * Default value: 6 hours
42859  *
42860  * # Note
42861  *
42862  * When built with the `no-std` feature, time will never elapse. Therefore, the channel
42863  * liquidity knowledge will never decay except when the bounds cross.
42864  */
42865 void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
42866
42867 /**
42868  * Constructs a new ProbabilisticScoringDecayParameters given each field
42869  */
42870 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
42871
42872 /**
42873  * Creates a copy of the ProbabilisticScoringDecayParameters
42874  */
42875 struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
42876
42877 /**
42878  * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
42879  */
42880 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
42881
42882 /**
42883  * Creates a new scorer using the given scoring parameters for sending payments from a node
42884  * through a network graph.
42885  */
42886 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
42887
42888 /**
42889  * Dump the contents of this scorer into the configured logger.
42890  *
42891  * Note that this writes roughly one line per channel for which we have a liquidity estimate,
42892  * which may be a substantial amount of log output.
42893  */
42894 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
42895
42896 /**
42897  * Query the estimated minimum and maximum liquidity available for sending a payment over the
42898  * channel with `scid` towards the given `target` node.
42899  */
42900 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);
42901
42902 /**
42903  * Query the historical estimated minimum and maximum liquidity available for sending a
42904  * payment over the channel with `scid` towards the given `target` node.
42905  *
42906  * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
42907  * the second set describes the upper-bound liquidity history. Each bucket describes the
42908  * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
42909  * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
42910  * more recent data points are weighted more heavily than older datapoints.
42911  *
42912  * Note that the range of each bucket varies by its location to provide more granular results
42913  * at the edges of a channel's capacity, where it is more likely to sit.
42914  *
42915  * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
42916  * is calculated by dividing that bucket's value with the total value of all buckets.
42917  *
42918  * For example, using a lower bucket count for illustrative purposes, a value of
42919  * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
42920  * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
42921  * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
42922  * in the top and bottom bucket, and roughly with similar (recent) frequency.
42923  *
42924  * Because the datapoints are decayed slowly over time, values will eventually return to
42925  * `Some(([1; 32], [1; 32]))` and then to `None` once no datapoints remain.
42926  *
42927  * In order to fetch a single success probability from the buckets provided here, as used in
42928  * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
42929  */
42930 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);
42931
42932 /**
42933  * Query the probability of payment success sending the given `amount_msat` over the channel
42934  * with `scid` towards the given `target` node, based on the historical estimated liquidity
42935  * bounds.
42936  *
42937  * These are the same bounds as returned by
42938  * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
42939  * [`Self::estimated_channel_liquidity_range`]).
42940  */
42941 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);
42942
42943 /**
42944  * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
42945  * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
42946  */
42947 struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
42948
42949 /**
42950  * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
42951  * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
42952  */
42953 struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
42954
42955 /**
42956  * Constructs a new Score which calls the relevant methods on this_arg.
42957  * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
42958  */
42959 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
42960
42961 /**
42962  * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
42963  */
42964 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
42965
42966 /**
42967  * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
42968  */
42969 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
42970
42971 /**
42972  * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
42973  */
42974 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
42975
42976 /**
42977  * The outpoint which is spendable.
42978  */
42979 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
42980
42981 /**
42982  * The outpoint which is spendable.
42983  */
42984 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
42985
42986 /**
42987  * Per commitment point to derive the delayed payment key by key holder.
42988  */
42989 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
42990
42991 /**
42992  * Per commitment point to derive the delayed payment key by key holder.
42993  */
42994 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42995
42996 /**
42997  * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
42998  * the witness_script.
42999  */
43000 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43001
43002 /**
43003  * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
43004  * the witness_script.
43005  */
43006 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
43007
43008 /**
43009  * The output which is referenced by the given outpoint.
43010  */
43011 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43012
43013 /**
43014  * The output which is referenced by the given outpoint.
43015  */
43016 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
43017
43018 /**
43019  * The revocation point specific to the commitment transaction which was broadcast. Used to
43020  * derive the witnessScript for this output.
43021  */
43022 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43023
43024 /**
43025  * The revocation point specific to the commitment transaction which was broadcast. Used to
43026  * derive the witnessScript for this output.
43027  */
43028 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43029
43030 /**
43031  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43032  * This may be useful in re-deriving keys used in the channel to spend the output.
43033  */
43034 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
43035
43036 /**
43037  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43038  * This may be useful in re-deriving keys used in the channel to spend the output.
43039  */
43040 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43041
43042 /**
43043  * The value of the channel which this output originated from, possibly indirectly.
43044  */
43045 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43046
43047 /**
43048  * The value of the channel which this output originated from, possibly indirectly.
43049  */
43050 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
43051
43052 /**
43053  * Constructs a new DelayedPaymentOutputDescriptor given each field
43054  */
43055 MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKPublicKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
43056
43057 /**
43058  * Creates a copy of the DelayedPaymentOutputDescriptor
43059  */
43060 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
43061
43062 /**
43063  * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
43064  */
43065 uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
43066
43067 /**
43068  * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
43069  * This ignores pointers and is_owned flags and looks at the values in fields.
43070  * Two objects with NULL inner values will be considered "equal" here.
43071  */
43072 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
43073
43074 /**
43075  * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
43076  */
43077 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
43078
43079 /**
43080  * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
43081  */
43082 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
43083
43084 /**
43085  * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
43086  */
43087 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
43088
43089 /**
43090  * The outpoint which is spendable.
43091  */
43092 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43093
43094 /**
43095  * The outpoint which is spendable.
43096  */
43097 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
43098
43099 /**
43100  * The output which is referenced by the given outpoint.
43101  */
43102 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43103
43104 /**
43105  * The output which is referenced by the given outpoint.
43106  */
43107 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
43108
43109 /**
43110  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43111  * This may be useful in re-deriving keys used in the channel to spend the output.
43112  */
43113 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
43114
43115 /**
43116  * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
43117  * This may be useful in re-deriving keys used in the channel to spend the output.
43118  */
43119 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43120
43121 /**
43122  * The value of the channel which this transactions spends.
43123  */
43124 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43125
43126 /**
43127  * The value of the channel which this transactions spends.
43128  */
43129 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
43130
43131 /**
43132  * The necessary channel parameters that need to be provided to the re-derived signer through
43133  * [`ChannelSigner::provide_channel_parameters`].
43134  *
43135  * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
43136  *
43137  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43138  */
43139 struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
43140
43141 /**
43142  * The necessary channel parameters that need to be provided to the re-derived signer through
43143  * [`ChannelSigner::provide_channel_parameters`].
43144  *
43145  * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
43146  *
43147  * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
43148  */
43149 void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
43150
43151 /**
43152  * Constructs a new StaticPaymentOutputDescriptor given each field
43153  *
43154  * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
43155  */
43156 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);
43157
43158 /**
43159  * Creates a copy of the StaticPaymentOutputDescriptor
43160  */
43161 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
43162
43163 /**
43164  * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
43165  */
43166 uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
43167
43168 /**
43169  * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
43170  * This ignores pointers and is_owned flags and looks at the values in fields.
43171  * Two objects with NULL inner values will be considered "equal" here.
43172  */
43173 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
43174
43175 /**
43176  * Returns the `witness_script` of the spendable output.
43177  *
43178  * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
43179  * originated from an anchor outputs channel, as they take the form of a P2WSH script.
43180  */
43181 MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
43182
43183 /**
43184  * The maximum length a well-formed witness spending one of these should have.
43185  * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
43186  * shorter.
43187  */
43188 MUST_USE_RES uintptr_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
43189
43190 /**
43191  * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
43192  */
43193 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
43194
43195 /**
43196  * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
43197  */
43198 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
43199
43200 /**
43201  * Frees any resources used by the SpendableOutputDescriptor
43202  */
43203 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
43204
43205 /**
43206  * Creates a copy of the SpendableOutputDescriptor
43207  */
43208 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
43209
43210 /**
43211  * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
43212  */
43213 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
43214
43215 /**
43216  * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
43217  */
43218 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
43219
43220 /**
43221  * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
43222  */
43223 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
43224
43225 /**
43226  * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
43227  */
43228 uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
43229
43230 /**
43231  * Checks if two SpendableOutputDescriptors contain equal inner contents.
43232  * This ignores pointers and is_owned flags and looks at the values in fields.
43233  */
43234 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
43235
43236 /**
43237  * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
43238  */
43239 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
43240
43241 /**
43242  * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
43243  */
43244 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
43245
43246 /**
43247  * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
43248  * the given outputs, plus an output to the given change destination (if sufficient
43249  * change value remains). The PSBT will have a feerate, at least, of the given value.
43250  *
43251  * The `locktime` argument is used to set the transaction's locktime. If `None`, the
43252  * transaction will have a locktime of 0. It it recommended to set this to the current block
43253  * height to avoid fee sniping, unless you have some specific reason to use a different
43254  * locktime.
43255  *
43256  * Returns the PSBT and expected max transaction weight.
43257  *
43258  * Returns `Err(())` if the output value is greater than the input value minus required fee,
43259  * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
43260  * does not match the one we can spend.
43261  *
43262  * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
43263  */
43264 MUST_USE_RES struct LDKCResult_C2Tuple_CVec_u8ZusizeZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
43265
43266 /**
43267  * Calls the free function if one is set
43268  */
43269 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
43270
43271 /**
43272  * Calls the free function if one is set
43273  */
43274 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
43275
43276 /**
43277  * Creates a copy of a WriteableEcdsaChannelSigner
43278  */
43279 struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig);
43280
43281 /**
43282  * Calls the free function if one is set
43283  */
43284 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
43285
43286 /**
43287  * Creates a copy of the Recipient
43288  */
43289 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
43290
43291 /**
43292  * Utility method to constructs a new Node-variant Recipient
43293  */
43294 enum LDKRecipient Recipient_node(void);
43295
43296 /**
43297  * Utility method to constructs a new PhantomNode-variant Recipient
43298  */
43299 enum LDKRecipient Recipient_phantom_node(void);
43300
43301 /**
43302  * Calls the free function if one is set
43303  */
43304 void EntropySource_free(struct LDKEntropySource this_ptr);
43305
43306 /**
43307  * Calls the free function if one is set
43308  */
43309 void NodeSigner_free(struct LDKNodeSigner this_ptr);
43310
43311 /**
43312  * Calls the free function if one is set
43313  */
43314 void SignerProvider_free(struct LDKSignerProvider this_ptr);
43315
43316 /**
43317  * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
43318  */
43319 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
43320
43321 /**
43322  * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
43323  * holder's anchor output in a commitment transaction, if one is present.
43324  */
43325 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
43326
43327 /**
43328  * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
43329  * holder's anchor output in a commitment transaction, if one is present.
43330  */
43331 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
43332
43333 /**
43334  * Holder secret key for blinded revocation pubkey.
43335  */
43336 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
43337
43338 /**
43339  * Holder secret key for blinded revocation pubkey.
43340  */
43341 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
43342
43343 /**
43344  * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
43345  */
43346 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
43347
43348 /**
43349  * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
43350  */
43351 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
43352
43353 /**
43354  * Holder secret key used in an HTLC transaction.
43355  */
43356 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
43357
43358 /**
43359  * Holder secret key used in an HTLC transaction.
43360  */
43361 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
43362
43363 /**
43364  * Holder HTLC secret key used in commitment transaction HTLC outputs.
43365  */
43366 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
43367
43368 /**
43369  * Holder HTLC secret key used in commitment transaction HTLC outputs.
43370  */
43371 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
43372
43373 /**
43374  * Commitment seed.
43375  */
43376 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
43377
43378 /**
43379  * Commitment seed.
43380  */
43381 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43382
43383 /**
43384  * Creates a copy of the InMemorySigner
43385  */
43386 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
43387
43388 /**
43389  * Creates a new [`InMemorySigner`].
43390  */
43391 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);
43392
43393 /**
43394  * Returns the counterparty's pubkeys.
43395  *
43396  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43397  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43398  *
43399  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43400  */
43401 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43402
43403 /**
43404  * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
43405  * transactions, i.e., the amount of time that we have to wait to recover our funds if we
43406  * broadcast a transaction.
43407  *
43408  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43409  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43410  */
43411 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43412
43413 /**
43414  * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
43415  * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
43416  * if they broadcast a transaction.
43417  *
43418  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43419  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43420  */
43421 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43422
43423 /**
43424  * Returns whether the holder is the initiator.
43425  *
43426  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43427  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43428  */
43429 MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43430
43431 /**
43432  * Funding outpoint
43433  *
43434  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43435  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43436  *
43437  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43438  */
43439 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43440
43441 /**
43442  * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
43443  * building transactions.
43444  *
43445  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43446  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43447  *
43448  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43449  */
43450 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43451
43452 /**
43453  * Returns the channel type features of the channel parameters. Should be helpful for
43454  * determining a channel's category, i. e. legacy/anchors/taproot/etc.
43455  *
43456  * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
43457  * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
43458  *
43459  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43460  */
43461 MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43462
43463 /**
43464  * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
43465  * by `descriptor`, returning the witness stack for the input.
43466  *
43467  * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
43468  * is not spending the outpoint described by [`descriptor.outpoint`],
43469  * or if an output descriptor `script_pubkey` does not match the one we can spend.
43470  *
43471  * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
43472  */
43473 MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor);
43474
43475 /**
43476  * Sign the single input of `spend_tx` at index `input_idx` which spends the output
43477  * described by `descriptor`, returning the witness stack for the input.
43478  *
43479  * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
43480  * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
43481  * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
43482  * `script_pubkey` does not match the one we can spend.
43483  *
43484  * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
43485  * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
43486  */
43487 MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor);
43488
43489 /**
43490  * Constructs a new EntropySource which calls the relevant methods on this_arg.
43491  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
43492  */
43493 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43494
43495 /**
43496  * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
43497  * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
43498  */
43499 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43500
43501 /**
43502  * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
43503  * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
43504  */
43505 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43506
43507 /**
43508  * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
43509  * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
43510  */
43511 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
43512
43513 /**
43514  * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
43515  */
43516 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
43517
43518 /**
43519  * Read a InMemorySigner from a byte array, created by InMemorySigner_write
43520  */
43521 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
43522
43523 /**
43524  * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
43525  */
43526 void KeysManager_free(struct LDKKeysManager this_obj);
43527
43528 /**
43529  * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
43530  * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
43531  * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
43532  * without a doubt, be unique to this instance. ie if you start multiple times with the same
43533  * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
43534  * is to simply use the current time (with very high precision).
43535  *
43536  * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
43537  * obviously, `starting_time` should be unique every time you reload the library - it is only
43538  * used to generate new ephemeral key data (which will be stored by the individual channel if
43539  * necessary).
43540  *
43541  * Note that the seed is required to recover certain on-chain funds independent of
43542  * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
43543  * for any channel, and some on-chain during-closing funds.
43544  *
43545  * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
43546  */
43547 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
43548
43549 /**
43550  * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
43551  */
43552 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
43553
43554 /**
43555  * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
43556  */
43557 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]);
43558
43559 /**
43560  * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
43561  * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
43562  * are no other inputs that need signing.
43563  *
43564  * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
43565  *
43566  * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
43567  * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
43568  */
43569 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);
43570
43571 /**
43572  * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
43573  * output to the given change destination (if sufficient change value remains). The
43574  * transaction will have a feerate, at least, of the given value.
43575  *
43576  * The `locktime` argument is used to set the transaction's locktime. If `None`, the
43577  * transaction will have a locktime of 0. It it recommended to set this to the current block
43578  * height to avoid fee sniping, unless you have some specific reason to use a different
43579  * locktime.
43580  *
43581  * Returns `Err(())` if the output value is greater than the input value minus required fee,
43582  * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
43583  * does not match the one we can spend.
43584  *
43585  * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
43586  *
43587  * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
43588  * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
43589  */
43590 MUST_USE_RES struct LDKCResult_TransactionNoneZ KeysManager_spend_spendable_outputs(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
43591
43592 /**
43593  * Constructs a new EntropySource which calls the relevant methods on this_arg.
43594  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
43595  */
43596 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
43597
43598 /**
43599  * Constructs a new NodeSigner which calls the relevant methods on this_arg.
43600  * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
43601  */
43602 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
43603
43604 /**
43605  * Constructs a new SignerProvider which calls the relevant methods on this_arg.
43606  * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
43607  */
43608 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
43609
43610 /**
43611  * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
43612  */
43613 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
43614
43615 /**
43616  * Constructs a new EntropySource which calls the relevant methods on this_arg.
43617  * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
43618  */
43619 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
43620
43621 /**
43622  * Constructs a new NodeSigner which calls the relevant methods on this_arg.
43623  * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
43624  */
43625 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
43626
43627 /**
43628  * Constructs a new SignerProvider which calls the relevant methods on this_arg.
43629  * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
43630  */
43631 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
43632
43633 /**
43634  * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
43635  * that is shared across all nodes that intend to participate in [phantom node payments]
43636  * together.
43637  *
43638  * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
43639  * `starting_time_nanos`.
43640  *
43641  * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
43642  * same across restarts, or else inbound payments may fail.
43643  *
43644  * [phantom node payments]: PhantomKeysManager
43645  */
43646 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]);
43647
43648 /**
43649  * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
43650  */
43651 MUST_USE_RES struct LDKCResult_TransactionNoneZ PhantomKeysManager_spend_spendable_outputs(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
43652
43653 /**
43654  * See [`KeysManager::derive_channel_keys`] for documentation on this method.
43655  */
43656 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]);
43657
43658 /**
43659  * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
43660  */
43661 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
43662
43663 /**
43664  * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
43665  * last-hop onion data, etc.
43666  */
43667 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
43668
43669 /**
43670  * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
43671  */
43672 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
43673
43674 /**
43675  * Calls the free function if one is set
43676  */
43677 void MessageRouter_free(struct LDKMessageRouter this_ptr);
43678
43679 /**
43680  * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
43681  */
43682 void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
43683
43684 /**
43685  * Constructs a new DefaultMessageRouter given each field
43686  */
43687 MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(void);
43688
43689 /**
43690  * Constructs a new MessageRouter which calls the relevant methods on this_arg.
43691  * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
43692  */
43693 struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
43694
43695 /**
43696  * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
43697  */
43698 void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
43699
43700 /**
43701  * Nodes on the path between the sender and the destination.
43702  *
43703  * Returns a copy of the field.
43704  */
43705 struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
43706
43707 /**
43708  * Nodes on the path between the sender and the destination.
43709  */
43710 void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
43711
43712 /**
43713  * The recipient of the message.
43714  */
43715 struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
43716
43717 /**
43718  * The recipient of the message.
43719  */
43720 void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
43721
43722 /**
43723  * Constructs a new OnionMessagePath given each field
43724  */
43725 MUST_USE_RES struct LDKOnionMessagePath OnionMessagePath_new(struct LDKCVec_PublicKeyZ intermediate_nodes_arg, struct LDKDestination destination_arg);
43726
43727 /**
43728  * Creates a copy of the OnionMessagePath
43729  */
43730 struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
43731
43732 /**
43733  * Frees any resources used by the Destination
43734  */
43735 void Destination_free(struct LDKDestination this_ptr);
43736
43737 /**
43738  * Creates a copy of the Destination
43739  */
43740 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
43741
43742 /**
43743  * Utility method to constructs a new Node-variant Destination
43744  */
43745 struct LDKDestination Destination_node(struct LDKPublicKey a);
43746
43747 /**
43748  * Utility method to constructs a new BlindedPath-variant Destination
43749  */
43750 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
43751
43752 /**
43753  * Frees any resources used by the SendError
43754  */
43755 void SendError_free(struct LDKSendError this_ptr);
43756
43757 /**
43758  * Creates a copy of the SendError
43759  */
43760 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
43761
43762 /**
43763  * Utility method to constructs a new Secp256k1-variant SendError
43764  */
43765 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
43766
43767 /**
43768  * Utility method to constructs a new TooBigPacket-variant SendError
43769  */
43770 struct LDKSendError SendError_too_big_packet(void);
43771
43772 /**
43773  * Utility method to constructs a new TooFewBlindedHops-variant SendError
43774  */
43775 struct LDKSendError SendError_too_few_blinded_hops(void);
43776
43777 /**
43778  * Utility method to constructs a new InvalidFirstHop-variant SendError
43779  */
43780 struct LDKSendError SendError_invalid_first_hop(void);
43781
43782 /**
43783  * Utility method to constructs a new InvalidMessage-variant SendError
43784  */
43785 struct LDKSendError SendError_invalid_message(void);
43786
43787 /**
43788  * Utility method to constructs a new BufferFull-variant SendError
43789  */
43790 struct LDKSendError SendError_buffer_full(void);
43791
43792 /**
43793  * Utility method to constructs a new GetNodeIdFailed-variant SendError
43794  */
43795 struct LDKSendError SendError_get_node_id_failed(void);
43796
43797 /**
43798  * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
43799  */
43800 struct LDKSendError SendError_blinded_path_advance_failed(void);
43801
43802 /**
43803  * Checks if two SendErrors contain equal inner contents.
43804  * This ignores pointers and is_owned flags and looks at the values in fields.
43805  */
43806 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
43807
43808 /**
43809  * Calls the free function if one is set
43810  */
43811 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
43812
43813 /**
43814  * Create an onion message with contents `message` to the destination of `path`.
43815  * Returns (introduction_node_id, onion_msg)
43816  *
43817  * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
43818  */
43819 struct LDKCResult_C2Tuple_PublicKeyOnionMessageZSendErrorZ create_onion_message(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, struct LDKOnionMessagePath path, struct LDKOnionMessageContents message, struct LDKBlindedPath reply_path);
43820
43821 /**
43822  * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
43823  * their respective handlers.
43824  */
43825 MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKCustomOnionMessageHandler custom_handler);
43826
43827 /**
43828  * Send an onion message with contents `message` to the destination of `path`.
43829  *
43830  * See [`OnionMessenger`] for example usage.
43831  *
43832  * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
43833  */
43834 MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessagePath path, struct LDKOnionMessageContents message, struct LDKBlindedPath reply_path);
43835
43836 /**
43837  * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
43838  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
43839  */
43840 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
43841
43842 /**
43843  * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
43844  * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
43845  */
43846 struct LDKOnionMessageProvider OnionMessenger_as_OnionMessageProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
43847
43848 /**
43849  * Calls the free function if one is set
43850  */
43851 void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
43852
43853 /**
43854  * Frees any resources used by the OffersMessage
43855  */
43856 void OffersMessage_free(struct LDKOffersMessage this_ptr);
43857
43858 /**
43859  * Creates a copy of the OffersMessage
43860  */
43861 struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
43862
43863 /**
43864  * Utility method to constructs a new InvoiceRequest-variant OffersMessage
43865  */
43866 struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
43867
43868 /**
43869  * Utility method to constructs a new Invoice-variant OffersMessage
43870  */
43871 struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
43872
43873 /**
43874  * Utility method to constructs a new InvoiceError-variant OffersMessage
43875  */
43876 struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
43877
43878 /**
43879  * Returns whether `tlv_type` corresponds to a TLV record for Offers.
43880  */
43881 MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
43882
43883 /**
43884  * The TLV record type for the message as used in an `onionmsg_tlv` TLV stream.
43885  */
43886 MUST_USE_RES uint64_t OffersMessage_tlv_type(const struct LDKOffersMessage *NONNULL_PTR this_arg);
43887
43888 /**
43889  * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
43890  */
43891 struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
43892
43893 /**
43894  * Read a OffersMessage from a byte array, created by OffersMessage_write
43895  */
43896 struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
43897
43898 /**
43899  * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
43900  */
43901 void Packet_free(struct LDKPacket this_obj);
43902
43903 /**
43904  * Bolt 04 version number
43905  */
43906 uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
43907
43908 /**
43909  * Bolt 04 version number
43910  */
43911 void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
43912
43913 /**
43914  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
43915  */
43916 struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
43917
43918 /**
43919  * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
43920  */
43921 void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
43922
43923 /**
43924  * Encrypted payload for the next hop
43925  *
43926  * Returns a copy of the field.
43927  */
43928 struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
43929
43930 /**
43931  * Encrypted payload for the next hop
43932  */
43933 void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
43934
43935 /**
43936  * HMAC to verify the integrity of hop_data
43937  */
43938 const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
43939
43940 /**
43941  * HMAC to verify the integrity of hop_data
43942  */
43943 void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
43944
43945 /**
43946  * Constructs a new Packet given each field
43947  */
43948 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);
43949
43950 /**
43951  * Creates a copy of the Packet
43952  */
43953 struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
43954
43955 /**
43956  * Checks if two Packets contain equal inner contents.
43957  * This ignores pointers and is_owned flags and looks at the values in fields.
43958  * Two objects with NULL inner values will be considered "equal" here.
43959  */
43960 bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
43961
43962 /**
43963  * Serialize the Packet object into a byte array which can be read by Packet_read
43964  */
43965 struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR obj);
43966
43967 /**
43968  * Frees any resources used by the OnionMessageContents
43969  */
43970 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
43971
43972 /**
43973  * Creates a copy of the OnionMessageContents
43974  */
43975 struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
43976
43977 /**
43978  * Utility method to constructs a new Offers-variant OnionMessageContents
43979  */
43980 struct LDKOnionMessageContents OnionMessageContents_offers(struct LDKOffersMessage a);
43981
43982 /**
43983  * Utility method to constructs a new Custom-variant OnionMessageContents
43984  */
43985 struct LDKOnionMessageContents OnionMessageContents_custom(struct LDKCustomOnionMessageContents a);
43986
43987 /**
43988  * Creates a copy of a CustomOnionMessageContents
43989  */
43990 struct LDKCustomOnionMessageContents CustomOnionMessageContents_clone(const struct LDKCustomOnionMessageContents *NONNULL_PTR orig);
43991
43992 /**
43993  * Calls the free function if one is set
43994  */
43995 void CustomOnionMessageContents_free(struct LDKCustomOnionMessageContents this_ptr);
43996
43997 /**
43998  * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
43999  */
44000 void BlindedPath_free(struct LDKBlindedPath this_obj);
44001
44002 /**
44003  * To send to a blinded path, the sender first finds a route to the unblinded
44004  * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
44005  * message or payment's next hop and forward it along.
44006  *
44007  * [`encrypted_payload`]: BlindedHop::encrypted_payload
44008  */
44009 struct LDKPublicKey BlindedPath_get_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
44010
44011 /**
44012  * To send to a blinded path, the sender first finds a route to the unblinded
44013  * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
44014  * message or payment's next hop and forward it along.
44015  *
44016  * [`encrypted_payload`]: BlindedHop::encrypted_payload
44017  */
44018 void BlindedPath_set_introduction_node_id(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44019
44020 /**
44021  * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
44022  * message or payment.
44023  *
44024  * [`encrypted_payload`]: BlindedHop::encrypted_payload
44025  */
44026 struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
44027
44028 /**
44029  * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
44030  * message or payment.
44031  *
44032  * [`encrypted_payload`]: BlindedHop::encrypted_payload
44033  */
44034 void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44035
44036 /**
44037  * The hops composing the blinded path.
44038  */
44039 struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
44040
44041 /**
44042  * The hops composing the blinded path.
44043  */
44044 void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
44045
44046 /**
44047  * Constructs a new BlindedPath given each field
44048  */
44049 MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKPublicKey introduction_node_id_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg);
44050
44051 /**
44052  * Creates a copy of the BlindedPath
44053  */
44054 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
44055
44056 /**
44057  * Generates a non-cryptographic 64-bit hash of the BlindedPath.
44058  */
44059 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
44060
44061 /**
44062  * Checks if two BlindedPaths contain equal inner contents.
44063  * This ignores pointers and is_owned flags and looks at the values in fields.
44064  * Two objects with NULL inner values will be considered "equal" here.
44065  */
44066 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
44067
44068 /**
44069  * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
44070  */
44071 void BlindedHop_free(struct LDKBlindedHop this_obj);
44072
44073 /**
44074  * The blinded node id of this hop in a [`BlindedPath`].
44075  */
44076 struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
44077
44078 /**
44079  * The blinded node id of this hop in a [`BlindedPath`].
44080  */
44081 void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44082
44083 /**
44084  * The encrypted payload intended for this hop in a [`BlindedPath`].
44085  *
44086  * Returns a copy of the field.
44087  */
44088 struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
44089
44090 /**
44091  * The encrypted payload intended for this hop in a [`BlindedPath`].
44092  */
44093 void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
44094
44095 /**
44096  * Constructs a new BlindedHop given each field
44097  */
44098 MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
44099
44100 /**
44101  * Creates a copy of the BlindedHop
44102  */
44103 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
44104
44105 /**
44106  * Generates a non-cryptographic 64-bit hash of the BlindedHop.
44107  */
44108 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
44109
44110 /**
44111  * Checks if two BlindedHops contain equal inner contents.
44112  * This ignores pointers and is_owned flags and looks at the values in fields.
44113  * Two objects with NULL inner values will be considered "equal" here.
44114  */
44115 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
44116
44117 /**
44118  * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
44119  * pubkey in `node_pks` will be the destination node.
44120  *
44121  * Errors if less than two hops are provided or if `node_pk`(s) are invalid.
44122  */
44123 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source);
44124
44125 /**
44126  * Create a one-hop blinded path for a payment.
44127  */
44128 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, const struct LDKEntropySource *NONNULL_PTR entropy_source);
44129
44130 /**
44131  * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
44132  */
44133 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
44134
44135 /**
44136  * Read a BlindedPath from a byte array, created by BlindedPath_write
44137  */
44138 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
44139
44140 /**
44141  * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
44142  */
44143 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
44144
44145 /**
44146  * Read a BlindedHop from a byte array, created by BlindedHop_write
44147  */
44148 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
44149
44150 /**
44151  * Frees any resources used by the ForwardNode, if is_owned is set and inner is non-NULL.
44152  */
44153 void ForwardNode_free(struct LDKForwardNode this_obj);
44154
44155 /**
44156  * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
44157  * used for [`BlindedPayInfo`] construction.
44158  */
44159 struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr);
44160
44161 /**
44162  * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
44163  * used for [`BlindedPayInfo`] construction.
44164  */
44165 void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
44166
44167 /**
44168  * This node's pubkey.
44169  */
44170 struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr);
44171
44172 /**
44173  * This node's pubkey.
44174  */
44175 void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
44176
44177 /**
44178  * The maximum value, in msat, that may be accepted by this node.
44179  */
44180 uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr);
44181
44182 /**
44183  * The maximum value, in msat, that may be accepted by this node.
44184  */
44185 void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val);
44186
44187 /**
44188  * Constructs a new ForwardNode given each field
44189  */
44190 MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
44191
44192 /**
44193  * Creates a copy of the ForwardNode
44194  */
44195 struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig);
44196
44197 /**
44198  * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
44199  */
44200 void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
44201
44202 /**
44203  * The short channel id this payment should be forwarded out over.
44204  */
44205 uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
44206
44207 /**
44208  * The short channel id this payment should be forwarded out over.
44209  */
44210 void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
44211
44212 /**
44213  * Payment parameters for relaying over [`Self::short_channel_id`].
44214  */
44215 struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
44216
44217 /**
44218  * Payment parameters for relaying over [`Self::short_channel_id`].
44219  */
44220 void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
44221
44222 /**
44223  * Payment constraints for relaying over [`Self::short_channel_id`].
44224  */
44225 struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
44226
44227 /**
44228  * Payment constraints for relaying over [`Self::short_channel_id`].
44229  */
44230 void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
44231
44232 /**
44233  * Supported and required features when relaying a payment onion containing this object's
44234  * corresponding [`BlindedHop::encrypted_payload`].
44235  *
44236  * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
44237  */
44238 struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
44239
44240 /**
44241  * Supported and required features when relaying a payment onion containing this object's
44242  * corresponding [`BlindedHop::encrypted_payload`].
44243  *
44244  * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
44245  */
44246 void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
44247
44248 /**
44249  * Constructs a new ForwardTlvs given each field
44250  */
44251 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);
44252
44253 /**
44254  * Creates a copy of the ForwardTlvs
44255  */
44256 struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
44257
44258 /**
44259  * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
44260  */
44261 void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
44262
44263 /**
44264  * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
44265  */
44266 const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
44267
44268 /**
44269  * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
44270  */
44271 void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44272
44273 /**
44274  * Constraints for the receiver of this payment.
44275  */
44276 struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
44277
44278 /**
44279  * Constraints for the receiver of this payment.
44280  */
44281 void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
44282
44283 /**
44284  * Constructs a new ReceiveTlvs given each field
44285  */
44286 MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg);
44287
44288 /**
44289  * Creates a copy of the ReceiveTlvs
44290  */
44291 struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
44292
44293 /**
44294  * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
44295  */
44296 void PaymentRelay_free(struct LDKPaymentRelay this_obj);
44297
44298 /**
44299  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
44300  */
44301 uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
44302
44303 /**
44304  * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
44305  */
44306 void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
44307
44308 /**
44309  * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
44310  * this [`BlindedHop`], (i.e., 10,000 is 1%).
44311  */
44312 uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
44313
44314 /**
44315  * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
44316  * this [`BlindedHop`], (i.e., 10,000 is 1%).
44317  */
44318 void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
44319
44320 /**
44321  * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
44322  */
44323 uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
44324
44325 /**
44326  * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
44327  */
44328 void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
44329
44330 /**
44331  * Constructs a new PaymentRelay given each field
44332  */
44333 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);
44334
44335 /**
44336  * Creates a copy of the PaymentRelay
44337  */
44338 struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
44339
44340 /**
44341  * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
44342  */
44343 void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
44344
44345 /**
44346  * The maximum total CLTV delta that is acceptable when relaying a payment over this
44347  * [`BlindedHop`].
44348  */
44349 uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
44350
44351 /**
44352  * The maximum total CLTV delta that is acceptable when relaying a payment over this
44353  * [`BlindedHop`].
44354  */
44355 void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
44356
44357 /**
44358  * The minimum value, in msat, that may be accepted by the node corresponding to this
44359  * [`BlindedHop`].
44360  */
44361 uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
44362
44363 /**
44364  * The minimum value, in msat, that may be accepted by the node corresponding to this
44365  * [`BlindedHop`].
44366  */
44367 void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
44368
44369 /**
44370  * Constructs a new PaymentConstraints given each field
44371  */
44372 MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
44373
44374 /**
44375  * Creates a copy of the PaymentConstraints
44376  */
44377 struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
44378
44379 /**
44380  * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
44381  */
44382 struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
44383
44384 /**
44385  * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
44386  */
44387 struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
44388
44389 /**
44390  * Read a ReceiveTlvs from a byte array, created by ReceiveTlvs_write
44391  */
44392 struct LDKCResult_ReceiveTlvsDecodeErrorZ ReceiveTlvs_read(struct LDKu8slice ser);
44393
44394 /**
44395  * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
44396  */
44397 struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
44398
44399 /**
44400  * Read a PaymentRelay from a byte array, created by PaymentRelay_write
44401  */
44402 struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
44403
44404 /**
44405  * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
44406  */
44407 struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
44408
44409 /**
44410  * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
44411  */
44412 struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
44413
44414 /**
44415  * Frees any resources used by the PaymentPurpose
44416  */
44417 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
44418
44419 /**
44420  * Creates a copy of the PaymentPurpose
44421  */
44422 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
44423
44424 /**
44425  * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
44426  */
44427 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
44428
44429 /**
44430  * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
44431  */
44432 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
44433
44434 /**
44435  * Checks if two PaymentPurposes contain equal inner contents.
44436  * This ignores pointers and is_owned flags and looks at the values in fields.
44437  */
44438 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
44439
44440 /**
44441  * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
44442  */
44443 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
44444
44445 /**
44446  * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
44447  */
44448 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
44449
44450 /**
44451  * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
44452  */
44453 void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
44454
44455 /**
44456  * The `channel_id` of the channel over which the HTLC was received.
44457  */
44458 const uint8_t (*ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr))[32];
44459
44460 /**
44461  * The `channel_id` of the channel over which the HTLC was received.
44462  */
44463 void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44464
44465 /**
44466  * The `user_channel_id` of the channel over which the HTLC was received. This is the value
44467  * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
44468  * [`ChannelManager::accept_inbound_channel`] for inbound channels if
44469  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
44470  * `user_channel_id` will be randomized for an inbound channel.
44471  *
44472  * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
44473  * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
44474  * was not actually claimed until after upgrading.)
44475  *
44476  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
44477  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
44478  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
44479  */
44480 struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
44481
44482 /**
44483  * The `user_channel_id` of the channel over which the HTLC was received. This is the value
44484  * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
44485  * [`ChannelManager::accept_inbound_channel`] for inbound channels if
44486  * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
44487  * `user_channel_id` will be randomized for an inbound channel.
44488  *
44489  * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
44490  * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
44491  * was not actually claimed until after upgrading.)
44492  *
44493  * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
44494  * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
44495  * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
44496  */
44497 void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
44498
44499 /**
44500  * The block height at which this HTLC expires.
44501  */
44502 uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
44503
44504 /**
44505  * The block height at which this HTLC expires.
44506  */
44507 void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
44508
44509 /**
44510  * The amount (in msats) of this part of an MPP.
44511  */
44512 uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
44513
44514 /**
44515  * The amount (in msats) of this part of an MPP.
44516  */
44517 void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
44518
44519 /**
44520  * Constructs a new ClaimedHTLC given each field
44521  */
44522 MUST_USE_RES struct LDKClaimedHTLC ClaimedHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKU128 user_channel_id_arg, uint32_t cltv_expiry_arg, uint64_t value_msat_arg);
44523
44524 /**
44525  * Creates a copy of the ClaimedHTLC
44526  */
44527 struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
44528
44529 /**
44530  * Checks if two ClaimedHTLCs contain equal inner contents.
44531  * This ignores pointers and is_owned flags and looks at the values in fields.
44532  * Two objects with NULL inner values will be considered "equal" here.
44533  */
44534 bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
44535
44536 /**
44537  * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
44538  */
44539 struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
44540
44541 /**
44542  * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
44543  */
44544 struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
44545
44546 /**
44547  * Frees any resources used by the PathFailure
44548  */
44549 void PathFailure_free(struct LDKPathFailure this_ptr);
44550
44551 /**
44552  * Creates a copy of the PathFailure
44553  */
44554 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
44555
44556 /**
44557  * Utility method to constructs a new InitialSend-variant PathFailure
44558  */
44559 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
44560
44561 /**
44562  * Utility method to constructs a new OnPath-variant PathFailure
44563  */
44564 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
44565
44566 /**
44567  * Checks if two PathFailures contain equal inner contents.
44568  * This ignores pointers and is_owned flags and looks at the values in fields.
44569  */
44570 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
44571
44572 /**
44573  * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
44574  */
44575 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
44576
44577 /**
44578  * Read a PathFailure from a byte array, created by PathFailure_write
44579  */
44580 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
44581
44582 /**
44583  * Frees any resources used by the ClosureReason
44584  */
44585 void ClosureReason_free(struct LDKClosureReason this_ptr);
44586
44587 /**
44588  * Creates a copy of the ClosureReason
44589  */
44590 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
44591
44592 /**
44593  * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
44594  */
44595 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
44596
44597 /**
44598  * Utility method to constructs a new HolderForceClosed-variant ClosureReason
44599  */
44600 struct LDKClosureReason ClosureReason_holder_force_closed(void);
44601
44602 /**
44603  * Utility method to constructs a new CooperativeClosure-variant ClosureReason
44604  */
44605 struct LDKClosureReason ClosureReason_cooperative_closure(void);
44606
44607 /**
44608  * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
44609  */
44610 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
44611
44612 /**
44613  * Utility method to constructs a new FundingTimedOut-variant ClosureReason
44614  */
44615 struct LDKClosureReason ClosureReason_funding_timed_out(void);
44616
44617 /**
44618  * Utility method to constructs a new ProcessingError-variant ClosureReason
44619  */
44620 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
44621
44622 /**
44623  * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
44624  */
44625 struct LDKClosureReason ClosureReason_disconnected_peer(void);
44626
44627 /**
44628  * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
44629  */
44630 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
44631
44632 /**
44633  * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
44634  */
44635 struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
44636
44637 /**
44638  * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
44639  */
44640 struct LDKClosureReason ClosureReason_funding_batch_closure(void);
44641
44642 /**
44643  * Checks if two ClosureReasons contain equal inner contents.
44644  * This ignores pointers and is_owned flags and looks at the values in fields.
44645  */
44646 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
44647
44648 /**
44649  * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
44650  */
44651 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
44652
44653 /**
44654  * Read a ClosureReason from a byte array, created by ClosureReason_write
44655  */
44656 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
44657
44658 /**
44659  * Frees any resources used by the HTLCDestination
44660  */
44661 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
44662
44663 /**
44664  * Creates a copy of the HTLCDestination
44665  */
44666 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
44667
44668 /**
44669  * Utility method to constructs a new NextHopChannel-variant HTLCDestination
44670  */
44671 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
44672
44673 /**
44674  * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
44675  */
44676 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
44677
44678 /**
44679  * Utility method to constructs a new InvalidForward-variant HTLCDestination
44680  */
44681 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
44682
44683 /**
44684  * Utility method to constructs a new FailedPayment-variant HTLCDestination
44685  */
44686 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
44687
44688 /**
44689  * Checks if two HTLCDestinations contain equal inner contents.
44690  * This ignores pointers and is_owned flags and looks at the values in fields.
44691  */
44692 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
44693
44694 /**
44695  * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
44696  */
44697 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
44698
44699 /**
44700  * Read a HTLCDestination from a byte array, created by HTLCDestination_write
44701  */
44702 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
44703
44704 /**
44705  * Creates a copy of the PaymentFailureReason
44706  */
44707 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
44708
44709 /**
44710  * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
44711  */
44712 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
44713
44714 /**
44715  * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
44716  */
44717 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
44718
44719 /**
44720  * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
44721  */
44722 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
44723
44724 /**
44725  * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
44726  */
44727 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
44728
44729 /**
44730  * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
44731  */
44732 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
44733
44734 /**
44735  * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
44736  */
44737 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
44738
44739 /**
44740  * Checks if two PaymentFailureReasons contain equal inner contents.
44741  * This ignores pointers and is_owned flags and looks at the values in fields.
44742  */
44743 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
44744
44745 /**
44746  * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
44747  */
44748 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
44749
44750 /**
44751  * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
44752  */
44753 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
44754
44755 /**
44756  * Frees any resources used by the Event
44757  */
44758 void Event_free(struct LDKEvent this_ptr);
44759
44760 /**
44761  * Creates a copy of the Event
44762  */
44763 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
44764
44765 /**
44766  * Utility method to constructs a new FundingGenerationReady-variant Event
44767  */
44768 struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id);
44769
44770 /**
44771  * Utility method to constructs a new PaymentClaimable-variant Event
44772  */
44773 struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields onion_fields, uint64_t amount_msat, uint64_t counterparty_skimmed_fee_msat, struct LDKPaymentPurpose purpose, struct LDKCOption_ThirtyTwoBytesZ via_channel_id, struct LDKCOption_U128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline);
44774
44775 /**
44776  * Utility method to constructs a new PaymentClaimed-variant Event
44777  */
44778 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);
44779
44780 /**
44781  * Utility method to constructs a new PaymentSent-variant Event
44782  */
44783 struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
44784
44785 /**
44786  * Utility method to constructs a new PaymentFailed-variant Event
44787  */
44788 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
44789
44790 /**
44791  * Utility method to constructs a new PaymentPathSuccessful-variant Event
44792  */
44793 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
44794
44795 /**
44796  * Utility method to constructs a new PaymentPathFailed-variant Event
44797  */
44798 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);
44799
44800 /**
44801  * Utility method to constructs a new ProbeSuccessful-variant Event
44802  */
44803 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
44804
44805 /**
44806  * Utility method to constructs a new ProbeFailed-variant Event
44807  */
44808 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
44809
44810 /**
44811  * Utility method to constructs a new PendingHTLCsForwardable-variant Event
44812  */
44813 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
44814
44815 /**
44816  * Utility method to constructs a new HTLCIntercepted-variant Event
44817  */
44818 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);
44819
44820 /**
44821  * Utility method to constructs a new SpendableOutputs-variant Event
44822  */
44823 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKCOption_ThirtyTwoBytesZ channel_id);
44824
44825 /**
44826  * Utility method to constructs a new PaymentForwarded-variant Event
44827  */
44828 struct LDKEvent Event_payment_forwarded(struct LDKCOption_ThirtyTwoBytesZ prev_channel_id, struct LDKCOption_ThirtyTwoBytesZ next_channel_id, struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat);
44829
44830 /**
44831  * Utility method to constructs a new ChannelPending-variant Event
44832  */
44833 struct LDKEvent Event_channel_pending(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo);
44834
44835 /**
44836  * Utility method to constructs a new ChannelReady-variant Event
44837  */
44838 struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
44839
44840 /**
44841  * Utility method to constructs a new ChannelClosed-variant Event
44842  */
44843 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u64Z channel_capacity_sats);
44844
44845 /**
44846  * Utility method to constructs a new DiscardFunding-variant Event
44847  */
44848 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
44849
44850 /**
44851  * Utility method to constructs a new OpenChannelRequest-variant Event
44852  */
44853 struct LDKEvent Event_open_channel_request(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type);
44854
44855 /**
44856  * Utility method to constructs a new HTLCHandlingFailed-variant Event
44857  */
44858 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
44859
44860 /**
44861  * Utility method to constructs a new BumpTransaction-variant Event
44862  */
44863 struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
44864
44865 /**
44866  * Checks if two Events contain equal inner contents.
44867  * This ignores pointers and is_owned flags and looks at the values in fields.
44868  */
44869 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
44870
44871 /**
44872  * Serialize the Event object into a byte array which can be read by Event_read
44873  */
44874 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
44875
44876 /**
44877  * Read a Event from a byte array, created by Event_write
44878  */
44879 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
44880
44881 /**
44882  * Frees any resources used by the MessageSendEvent
44883  */
44884 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
44885
44886 /**
44887  * Creates a copy of the MessageSendEvent
44888  */
44889 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
44890
44891 /**
44892  * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
44893  */
44894 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
44895
44896 /**
44897  * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
44898  */
44899 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
44900
44901 /**
44902  * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
44903  */
44904 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
44905
44906 /**
44907  * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
44908  */
44909 struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
44910
44911 /**
44912  * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
44913  */
44914 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
44915
44916 /**
44917  * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
44918  */
44919 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
44920
44921 /**
44922  * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
44923  */
44924 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
44925
44926 /**
44927  * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
44928  */
44929 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
44930
44931 /**
44932  * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
44933  */
44934 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
44935
44936 /**
44937  * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
44938  */
44939 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
44940
44941 /**
44942  * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
44943  */
44944 struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
44945
44946 /**
44947  * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
44948  */
44949 struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
44950
44951 /**
44952  * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
44953  */
44954 struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
44955
44956 /**
44957  * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
44958  */
44959 struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
44960
44961 /**
44962  * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
44963  */
44964 struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
44965
44966 /**
44967  * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
44968  */
44969 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
44970
44971 /**
44972  * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
44973  */
44974 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
44975
44976 /**
44977  * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
44978  */
44979 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
44980
44981 /**
44982  * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
44983  */
44984 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
44985
44986 /**
44987  * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
44988  */
44989 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
44990
44991 /**
44992  * Utility method to constructs a new SendShutdown-variant MessageSendEvent
44993  */
44994 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
44995
44996 /**
44997  * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
44998  */
44999 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
45000
45001 /**
45002  * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
45003  */
45004 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
45005
45006 /**
45007  * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
45008  */
45009 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
45010
45011 /**
45012  * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
45013  */
45014 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
45015
45016 /**
45017  * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
45018  */
45019 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
45020
45021 /**
45022  * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
45023  */
45024 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
45025
45026 /**
45027  * Utility method to constructs a new HandleError-variant MessageSendEvent
45028  */
45029 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
45030
45031 /**
45032  * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
45033  */
45034 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
45035
45036 /**
45037  * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
45038  */
45039 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
45040
45041 /**
45042  * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
45043  */
45044 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
45045
45046 /**
45047  * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
45048  */
45049 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
45050
45051 /**
45052  * Calls the free function if one is set
45053  */
45054 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
45055
45056 /**
45057  * Calls the free function if one is set
45058  */
45059 void OnionMessageProvider_free(struct LDKOnionMessageProvider this_ptr);
45060
45061 /**
45062  * Calls the free function if one is set
45063  */
45064 void EventsProvider_free(struct LDKEventsProvider this_ptr);
45065
45066 /**
45067  * Calls the free function if one is set
45068  */
45069 void EventHandler_free(struct LDKEventHandler this_ptr);
45070
45071 /**
45072  * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
45073  */
45074 void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
45075
45076 /**
45077  * The value in satoshis of the channel we're attempting to spend the anchor output of.
45078  */
45079 uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
45080
45081 /**
45082  * The value in satoshis of the channel we're attempting to spend the anchor output of.
45083  */
45084 void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
45085
45086 /**
45087  * The unique identifier to re-derive the signer for the associated channel.
45088  */
45089 const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
45090
45091 /**
45092  * The unique identifier to re-derive the signer for the associated channel.
45093  */
45094 void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
45095
45096 /**
45097  * The necessary channel parameters that need to be provided to the re-derived signer through
45098  * [`ChannelSigner::provide_channel_parameters`].
45099  *
45100  * [`ChannelSigner::provide_channel_parameters`]: crate::sign::ChannelSigner::provide_channel_parameters
45101  */
45102 struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
45103
45104 /**
45105  * The necessary channel parameters that need to be provided to the re-derived signer through
45106  * [`ChannelSigner::provide_channel_parameters`].
45107  *
45108  * [`ChannelSigner::provide_channel_parameters`]: crate::sign::ChannelSigner::provide_channel_parameters
45109  */
45110 void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
45111
45112 /**
45113  * Constructs a new ChannelDerivationParameters given each field
45114  */
45115 MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
45116
45117 /**
45118  * Creates a copy of the ChannelDerivationParameters
45119  */
45120 struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
45121
45122 /**
45123  * Checks if two ChannelDerivationParameterss contain equal inner contents.
45124  * This ignores pointers and is_owned flags and looks at the values in fields.
45125  * Two objects with NULL inner values will be considered "equal" here.
45126  */
45127 bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
45128
45129 /**
45130  * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
45131  */
45132 struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
45133
45134 /**
45135  * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
45136  */
45137 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
45138
45139 /**
45140  * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
45141  */
45142 void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
45143
45144 /**
45145  * The parameters required to derive the signer for the anchor input.
45146  */
45147 struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
45148
45149 /**
45150  * The parameters required to derive the signer for the anchor input.
45151  */
45152 void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
45153
45154 /**
45155  * The transaction input's outpoint corresponding to the commitment transaction's anchor
45156  * output.
45157  */
45158 struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
45159
45160 /**
45161  * The transaction input's outpoint corresponding to the commitment transaction's anchor
45162  * output.
45163  */
45164 void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
45165
45166 /**
45167  * Constructs a new AnchorDescriptor given each field
45168  */
45169 MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
45170
45171 /**
45172  * Creates a copy of the AnchorDescriptor
45173  */
45174 struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
45175
45176 /**
45177  * Checks if two AnchorDescriptors contain equal inner contents.
45178  * This ignores pointers and is_owned flags and looks at the values in fields.
45179  * Two objects with NULL inner values will be considered "equal" here.
45180  */
45181 bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
45182
45183 /**
45184  * Returns the UTXO to be spent by the anchor input, which can be obtained via
45185  * [`Self::unsigned_tx_input`].
45186  */
45187 MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
45188
45189 /**
45190  * Returns the unsigned transaction input spending the anchor output in the commitment
45191  * transaction.
45192  */
45193 MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
45194
45195 /**
45196  * Returns the witness script of the anchor output in the commitment transaction.
45197  */
45198 MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
45199
45200 /**
45201  * Returns the fully signed witness required to spend the anchor output in the commitment
45202  * transaction.
45203  */
45204 MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
45205
45206 /**
45207  * Derives the channel signer required to sign the anchor input.
45208  */
45209 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
45210
45211 /**
45212  * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
45213  */
45214 void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
45215
45216 /**
45217  * The parameters required to derive the signer for the HTLC input.
45218  */
45219 struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
45220
45221 /**
45222  * The parameters required to derive the signer for the HTLC input.
45223  */
45224 void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
45225
45226 /**
45227  * The number of the commitment transaction in which the HTLC output lives.
45228  */
45229 uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
45230
45231 /**
45232  * The number of the commitment transaction in which the HTLC output lives.
45233  */
45234 void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
45235
45236 /**
45237  * The key tweak corresponding to the number of the commitment transaction in which the HTLC
45238  * output lives. This tweak is applied to all the basepoints for both parties in the channel to
45239  * arrive at unique keys per commitment.
45240  *
45241  * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
45242  */
45243 struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
45244
45245 /**
45246  * The key tweak corresponding to the number of the commitment transaction in which the HTLC
45247  * output lives. This tweak is applied to all the basepoints for both parties in the channel to
45248  * arrive at unique keys per commitment.
45249  *
45250  * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
45251  */
45252 void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
45253
45254 /**
45255  * The details of the HTLC as it appears in the commitment transaction.
45256  */
45257 struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
45258
45259 /**
45260  * The details of the HTLC as it appears in the commitment transaction.
45261  */
45262 void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
45263
45264 /**
45265  * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
45266  * taken.
45267  */
45268 struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
45269
45270 /**
45271  * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
45272  * taken.
45273  */
45274 void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
45275
45276 /**
45277  * The counterparty's signature required to spend the HTLC output.
45278  */
45279 struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
45280
45281 /**
45282  * The counterparty's signature required to spend the HTLC output.
45283  */
45284 void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
45285
45286 /**
45287  * Creates a copy of the HTLCDescriptor
45288  */
45289 struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
45290
45291 /**
45292  * Checks if two HTLCDescriptors contain equal inner contents.
45293  * This ignores pointers and is_owned flags and looks at the values in fields.
45294  * Two objects with NULL inner values will be considered "equal" here.
45295  */
45296 bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
45297
45298 /**
45299  * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
45300  */
45301 struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
45302
45303 /**
45304  * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
45305  */
45306 struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
45307
45308 /**
45309  * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
45310  * being spent by the HTLC input in the HTLC transaction.
45311  */
45312 MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
45313
45314 /**
45315  * Returns the UTXO to be spent by the HTLC input, which can be obtained via
45316  * [`Self::unsigned_tx_input`].
45317  */
45318 MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
45319
45320 /**
45321  * Returns the unsigned transaction input spending the HTLC output in the commitment
45322  * transaction.
45323  */
45324 MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
45325
45326 /**
45327  * Returns the delayed output created as a result of spending the HTLC output in the commitment
45328  * transaction.
45329  */
45330 MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
45331
45332 /**
45333  * Returns the witness script of the HTLC output in the commitment transaction.
45334  */
45335 MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
45336
45337 /**
45338  * Returns the fully signed witness required to spend the HTLC output in the commitment
45339  * transaction.
45340  */
45341 MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
45342
45343 /**
45344  * Derives the channel signer required to sign the HTLC input.
45345  */
45346 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
45347
45348 /**
45349  * Frees any resources used by the BumpTransactionEvent
45350  */
45351 void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
45352
45353 /**
45354  * Creates a copy of the BumpTransactionEvent
45355  */
45356 struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
45357
45358 /**
45359  * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
45360  */
45361 struct LDKBumpTransactionEvent BumpTransactionEvent_channel_close(struct LDKThirtyTwoBytes claim_id, uint32_t package_target_feerate_sat_per_1000_weight, struct LDKTransaction commitment_tx, uint64_t commitment_tx_fee_satoshis, struct LDKAnchorDescriptor anchor_descriptor, struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs);
45362
45363 /**
45364  * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
45365  */
45366 struct LDKBumpTransactionEvent BumpTransactionEvent_htlcresolution(struct LDKThirtyTwoBytes claim_id, uint32_t target_feerate_sat_per_1000_weight, struct LDKCVec_HTLCDescriptorZ htlc_descriptors, uint32_t tx_lock_time);
45367
45368 /**
45369  * Checks if two BumpTransactionEvents contain equal inner contents.
45370  * This ignores pointers and is_owned flags and looks at the values in fields.
45371  */
45372 bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
45373
45374 /**
45375  * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
45376  */
45377 void Input_free(struct LDKInput this_obj);
45378
45379 /**
45380  * The unique identifier of the input.
45381  */
45382 struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
45383
45384 /**
45385  * The unique identifier of the input.
45386  */
45387 void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
45388
45389 /**
45390  * The UTXO being spent by the input.
45391  */
45392 struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
45393
45394 /**
45395  * The UTXO being spent by the input.
45396  */
45397 void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
45398
45399 /**
45400  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
45401  * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
45402  * script.
45403  */
45404 uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
45405
45406 /**
45407  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
45408  * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
45409  * script.
45410  */
45411 void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
45412
45413 /**
45414  * Constructs a new Input given each field
45415  */
45416 MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
45417
45418 /**
45419  * Creates a copy of the Input
45420  */
45421 struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
45422
45423 /**
45424  * Generates a non-cryptographic 64-bit hash of the Input.
45425  */
45426 uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
45427
45428 /**
45429  * Checks if two Inputs contain equal inner contents.
45430  * This ignores pointers and is_owned flags and looks at the values in fields.
45431  * Two objects with NULL inner values will be considered "equal" here.
45432  */
45433 bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
45434
45435 /**
45436  * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
45437  */
45438 void Utxo_free(struct LDKUtxo this_obj);
45439
45440 /**
45441  * The unique identifier of the output.
45442  */
45443 struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
45444
45445 /**
45446  * The unique identifier of the output.
45447  */
45448 void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
45449
45450 /**
45451  * The output to spend.
45452  */
45453 struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
45454
45455 /**
45456  * The output to spend.
45457  */
45458 void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
45459
45460 /**
45461  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
45462  * with their lengths included, required to satisfy the output's script. The weight consumed by
45463  * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
45464  */
45465 uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
45466
45467 /**
45468  * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
45469  * with their lengths included, required to satisfy the output's script. The weight consumed by
45470  * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
45471  */
45472 void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
45473
45474 /**
45475  * Constructs a new Utxo given each field
45476  */
45477 MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
45478
45479 /**
45480  * Creates a copy of the Utxo
45481  */
45482 struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
45483
45484 /**
45485  * Generates a non-cryptographic 64-bit hash of the Utxo.
45486  */
45487 uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
45488
45489 /**
45490  * Checks if two Utxos contain equal inner contents.
45491  * This ignores pointers and is_owned flags and looks at the values in fields.
45492  * Two objects with NULL inner values will be considered "equal" here.
45493  */
45494 bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
45495
45496 /**
45497  * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
45498  */
45499 MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
45500
45501 /**
45502  * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
45503  */
45504 void CoinSelection_free(struct LDKCoinSelection this_obj);
45505
45506 /**
45507  * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
45508  * requiring additional fees.
45509  */
45510 struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
45511
45512 /**
45513  * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
45514  * requiring additional fees.
45515  */
45516 void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
45517
45518 /**
45519  * An additional output tracking whether any change remained after coin selection. This output
45520  * should always have a value above dust for its given `script_pubkey`. It should not be
45521  * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
45522  * not met. This implies no other party should be able to spend it except us.
45523  */
45524 struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
45525
45526 /**
45527  * An additional output tracking whether any change remained after coin selection. This output
45528  * should always have a value above dust for its given `script_pubkey`. It should not be
45529  * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
45530  * not met. This implies no other party should be able to spend it except us.
45531  */
45532 void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
45533
45534 /**
45535  * Constructs a new CoinSelection given each field
45536  */
45537 MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
45538
45539 /**
45540  * Creates a copy of the CoinSelection
45541  */
45542 struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
45543
45544 /**
45545  * Calls the free function if one is set
45546  */
45547 void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
45548
45549 /**
45550  * Calls the free function if one is set
45551  */
45552 void WalletSource_free(struct LDKWalletSource this_ptr);
45553
45554 /**
45555  * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
45556  */
45557 void Wallet_free(struct LDKWallet this_obj);
45558
45559 /**
45560  * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
45561  * of [`CoinSelectionSource`].
45562  */
45563 MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
45564
45565 /**
45566  * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
45567  * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
45568  */
45569 struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
45570
45571 /**
45572  * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
45573  */
45574 void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
45575
45576 /**
45577  * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
45578  *
45579  * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
45580  */
45581 MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
45582
45583 /**
45584  * Handles all variants of [`BumpTransactionEvent`].
45585  */
45586 void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
45587
45588 /**
45589  * Frees any resources used by the FilesystemStore, if is_owned is set and inner is non-NULL.
45590  */
45591 void FilesystemStore_free(struct LDKFilesystemStore this_obj);
45592
45593 /**
45594  * Constructs a new [`FilesystemStore`].
45595  */
45596 MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir);
45597
45598 /**
45599  * Returns the data directory.
45600  */
45601 MUST_USE_RES struct LDKStr FilesystemStore_get_data_dir(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
45602
45603 /**
45604  * Constructs a new KVStore which calls the relevant methods on this_arg.
45605  * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
45606  */
45607 struct LDKKVStore FilesystemStore_as_KVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
45608
45609 /**
45610  * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
45611  */
45612 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
45613
45614 /**
45615  * Frees any resources used by the GossipSync
45616  */
45617 void GossipSync_free(struct LDKGossipSync this_ptr);
45618
45619 /**
45620  * Utility method to constructs a new P2P-variant GossipSync
45621  */
45622 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
45623
45624 /**
45625  * Utility method to constructs a new Rapid-variant GossipSync
45626  */
45627 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
45628
45629 /**
45630  * Utility method to constructs a new None-variant GossipSync
45631  */
45632 struct LDKGossipSync GossipSync_none(void);
45633
45634 /**
45635  * Start a background thread that takes care of responsibilities enumerated in the [top-level
45636  * documentation].
45637  *
45638  * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
45639  * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
45640  * either [`join`] or [`stop`].
45641  *
45642  * # Data Persistence
45643  *
45644  * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
45645  * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
45646  * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
45647  * provided implementation.
45648  *
45649  * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
45650  * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
45651  * See the `lightning-persister` crate for LDK's provided implementation.
45652  *
45653  * Typically, users should either implement [`Persister::persist_manager`] to never return an
45654  * error or call [`join`] and handle any error that may arise. For the latter case,
45655  * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
45656  *
45657  * # Event Handling
45658  *
45659  * `event_handler` is responsible for handling events that users should be notified of (e.g.,
45660  * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
45661  * functionality implemented by other handlers.
45662  * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
45663  *
45664  * # Rapid Gossip Sync
45665  *
45666  * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
45667  * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
45668  * until the [`RapidGossipSync`] instance completes its first sync.
45669  *
45670  * [top-level documentation]: BackgroundProcessor
45671  * [`join`]: Self::join
45672  * [`stop`]: Self::stop
45673  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
45674  * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
45675  * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
45676  * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
45677  * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
45678  * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
45679  */
45680 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);
45681
45682 /**
45683  * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
45684  * [`ChannelManager`].
45685  *
45686  * # Panics
45687  *
45688  * This function panics if the background thread has panicked such as while persisting or
45689  * handling events.
45690  *
45691  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
45692  */
45693 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
45694
45695 /**
45696  * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
45697  * [`ChannelManager`].
45698  *
45699  * # Panics
45700  *
45701  * This function panics if the background thread has panicked such as while persisting or
45702  * handling events.
45703  *
45704  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
45705  */
45706 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
45707
45708 /**
45709  * Frees any resources used by the Bolt11ParseError
45710  */
45711 void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr);
45712
45713 /**
45714  * Creates a copy of the Bolt11ParseError
45715  */
45716 struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig);
45717
45718 /**
45719  * Utility method to constructs a new Bech32Error-variant Bolt11ParseError
45720  */
45721 struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a);
45722
45723 /**
45724  * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError
45725  */
45726 struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a);
45727
45728 /**
45729  * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError
45730  */
45731 struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a);
45732
45733 /**
45734  * Utility method to constructs a new BadPrefix-variant Bolt11ParseError
45735  */
45736 struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void);
45737
45738 /**
45739  * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError
45740  */
45741 struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void);
45742
45743 /**
45744  * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError
45745  */
45746 struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void);
45747
45748 /**
45749  * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError
45750  */
45751 struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void);
45752
45753 /**
45754  * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError
45755  */
45756 struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void);
45757
45758 /**
45759  * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError
45760  */
45761 struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void);
45762
45763 /**
45764  * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError
45765  */
45766 struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a);
45767
45768 /**
45769  * Utility method to constructs a new PaddingError-variant Bolt11ParseError
45770  */
45771 struct LDKBolt11ParseError Bolt11ParseError_padding_error(void);
45772
45773 /**
45774  * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError
45775  */
45776 struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void);
45777
45778 /**
45779  * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError
45780  */
45781 struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void);
45782
45783 /**
45784  * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError
45785  */
45786 struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void);
45787
45788 /**
45789  * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError
45790  */
45791 struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void);
45792
45793 /**
45794  * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError
45795  */
45796 struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void);
45797
45798 /**
45799  * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError
45800  */
45801 struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a);
45802
45803 /**
45804  * Utility method to constructs a new Skip-variant Bolt11ParseError
45805  */
45806 struct LDKBolt11ParseError Bolt11ParseError_skip(void);
45807
45808 /**
45809  * Checks if two Bolt11ParseErrors contain equal inner contents.
45810  * This ignores pointers and is_owned flags and looks at the values in fields.
45811  */
45812 bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b);
45813
45814 /**
45815  * Frees any resources used by the ParseOrSemanticError
45816  */
45817 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
45818
45819 /**
45820  * Creates a copy of the ParseOrSemanticError
45821  */
45822 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
45823
45824 /**
45825  * Utility method to constructs a new ParseError-variant ParseOrSemanticError
45826  */
45827 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a);
45828
45829 /**
45830  * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
45831  */
45832 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a);
45833
45834 /**
45835  * Checks if two ParseOrSemanticErrors contain equal inner contents.
45836  * This ignores pointers and is_owned flags and looks at the values in fields.
45837  */
45838 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
45839
45840 /**
45841  * Frees any resources used by the Bolt11Invoice, if is_owned is set and inner is non-NULL.
45842  */
45843 void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj);
45844
45845 /**
45846  * Checks if two Bolt11Invoices contain equal inner contents.
45847  * This ignores pointers and is_owned flags and looks at the values in fields.
45848  * Two objects with NULL inner values will be considered "equal" here.
45849  */
45850 bool Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b);
45851
45852 /**
45853  * Creates a copy of the Bolt11Invoice
45854  */
45855 struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig);
45856
45857 /**
45858  * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice.
45859  */
45860 uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o);
45861
45862 /**
45863  * Frees any resources used by the SignedRawBolt11Invoice, if is_owned is set and inner is non-NULL.
45864  */
45865 void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj);
45866
45867 /**
45868  * Checks if two SignedRawBolt11Invoices contain equal inner contents.
45869  * This ignores pointers and is_owned flags and looks at the values in fields.
45870  * Two objects with NULL inner values will be considered "equal" here.
45871  */
45872 bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b);
45873
45874 /**
45875  * Creates a copy of the SignedRawBolt11Invoice
45876  */
45877 struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig);
45878
45879 /**
45880  * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice.
45881  */
45882 uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
45883
45884 /**
45885  * Frees any resources used by the RawBolt11Invoice, if is_owned is set and inner is non-NULL.
45886  */
45887 void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj);
45888
45889 /**
45890  * data part
45891  */
45892 struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr);
45893
45894 /**
45895  * data part
45896  */
45897 void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
45898
45899 /**
45900  * Checks if two RawBolt11Invoices contain equal inner contents.
45901  * This ignores pointers and is_owned flags and looks at the values in fields.
45902  * Two objects with NULL inner values will be considered "equal" here.
45903  */
45904 bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b);
45905
45906 /**
45907  * Creates a copy of the RawBolt11Invoice
45908  */
45909 struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig);
45910
45911 /**
45912  * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
45913  */
45914 uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o);
45915
45916 /**
45917  * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
45918  */
45919 void RawDataPart_free(struct LDKRawDataPart this_obj);
45920
45921 /**
45922  * generation time of the invoice
45923  */
45924 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
45925
45926 /**
45927  * generation time of the invoice
45928  */
45929 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
45930
45931 /**
45932  * Checks if two RawDataParts contain equal inner contents.
45933  * This ignores pointers and is_owned flags and looks at the values in fields.
45934  * Two objects with NULL inner values will be considered "equal" here.
45935  */
45936 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
45937
45938 /**
45939  * Creates a copy of the RawDataPart
45940  */
45941 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
45942
45943 /**
45944  * Generates a non-cryptographic 64-bit hash of the RawDataPart.
45945  */
45946 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
45947
45948 /**
45949  * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
45950  */
45951 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
45952
45953 /**
45954  * Checks if two PositiveTimestamps contain equal inner contents.
45955  * This ignores pointers and is_owned flags and looks at the values in fields.
45956  * Two objects with NULL inner values will be considered "equal" here.
45957  */
45958 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
45959
45960 /**
45961  * Creates a copy of the PositiveTimestamp
45962  */
45963 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
45964
45965 /**
45966  * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
45967  */
45968 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
45969
45970 /**
45971  * Creates a copy of the SiPrefix
45972  */
45973 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
45974
45975 /**
45976  * Utility method to constructs a new Milli-variant SiPrefix
45977  */
45978 enum LDKSiPrefix SiPrefix_milli(void);
45979
45980 /**
45981  * Utility method to constructs a new Micro-variant SiPrefix
45982  */
45983 enum LDKSiPrefix SiPrefix_micro(void);
45984
45985 /**
45986  * Utility method to constructs a new Nano-variant SiPrefix
45987  */
45988 enum LDKSiPrefix SiPrefix_nano(void);
45989
45990 /**
45991  * Utility method to constructs a new Pico-variant SiPrefix
45992  */
45993 enum LDKSiPrefix SiPrefix_pico(void);
45994
45995 /**
45996  * Checks if two SiPrefixs contain equal inner contents.
45997  * This ignores pointers and is_owned flags and looks at the values in fields.
45998  */
45999 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
46000
46001 /**
46002  * Generates a non-cryptographic 64-bit hash of the SiPrefix.
46003  */
46004 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
46005
46006 /**
46007  * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
46008  * This is effectively 10^12 * the prefix multiplier
46009  */
46010 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
46011
46012 /**
46013  * Creates a copy of the Currency
46014  */
46015 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
46016
46017 /**
46018  * Utility method to constructs a new Bitcoin-variant Currency
46019  */
46020 enum LDKCurrency Currency_bitcoin(void);
46021
46022 /**
46023  * Utility method to constructs a new BitcoinTestnet-variant Currency
46024  */
46025 enum LDKCurrency Currency_bitcoin_testnet(void);
46026
46027 /**
46028  * Utility method to constructs a new Regtest-variant Currency
46029  */
46030 enum LDKCurrency Currency_regtest(void);
46031
46032 /**
46033  * Utility method to constructs a new Simnet-variant Currency
46034  */
46035 enum LDKCurrency Currency_simnet(void);
46036
46037 /**
46038  * Utility method to constructs a new Signet-variant Currency
46039  */
46040 enum LDKCurrency Currency_signet(void);
46041
46042 /**
46043  * Generates a non-cryptographic 64-bit hash of the Currency.
46044  */
46045 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
46046
46047 /**
46048  * Checks if two Currencys contain equal inner contents.
46049  * This ignores pointers and is_owned flags and looks at the values in fields.
46050  */
46051 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
46052
46053 /**
46054  * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
46055  */
46056 void Sha256_free(struct LDKSha256 this_obj);
46057
46058 /**
46059  * Creates a copy of the Sha256
46060  */
46061 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
46062
46063 /**
46064  * Generates a non-cryptographic 64-bit hash of the Sha256.
46065  */
46066 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
46067
46068 /**
46069  * Checks if two Sha256s contain equal inner contents.
46070  * This ignores pointers and is_owned flags and looks at the values in fields.
46071  * Two objects with NULL inner values will be considered "equal" here.
46072  */
46073 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
46074
46075 /**
46076  * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
46077  * single sha256 hash.
46078  */
46079 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
46080
46081 /**
46082  * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
46083  */
46084 void Description_free(struct LDKDescription this_obj);
46085
46086 /**
46087  * Creates a copy of the Description
46088  */
46089 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
46090
46091 /**
46092  * Generates a non-cryptographic 64-bit hash of the Description.
46093  */
46094 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
46095
46096 /**
46097  * Checks if two Descriptions contain equal inner contents.
46098  * This ignores pointers and is_owned flags and looks at the values in fields.
46099  * Two objects with NULL inner values will be considered "equal" here.
46100  */
46101 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
46102
46103 /**
46104  * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
46105  */
46106 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
46107
46108 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
46109
46110 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
46111
46112 /**
46113  * Constructs a new PayeePubKey given each field
46114  */
46115 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
46116
46117 /**
46118  * Creates a copy of the PayeePubKey
46119  */
46120 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
46121
46122 /**
46123  * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
46124  */
46125 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
46126
46127 /**
46128  * Checks if two PayeePubKeys contain equal inner contents.
46129  * This ignores pointers and is_owned flags and looks at the values in fields.
46130  * Two objects with NULL inner values will be considered "equal" here.
46131  */
46132 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
46133
46134 /**
46135  * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
46136  */
46137 void ExpiryTime_free(struct LDKExpiryTime this_obj);
46138
46139 /**
46140  * Creates a copy of the ExpiryTime
46141  */
46142 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
46143
46144 /**
46145  * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
46146  */
46147 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
46148
46149 /**
46150  * Checks if two ExpiryTimes contain equal inner contents.
46151  * This ignores pointers and is_owned flags and looks at the values in fields.
46152  * Two objects with NULL inner values will be considered "equal" here.
46153  */
46154 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
46155
46156 /**
46157  * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
46158  */
46159 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
46160
46161 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
46162
46163 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
46164
46165 /**
46166  * Constructs a new MinFinalCltvExpiryDelta given each field
46167  */
46168 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
46169
46170 /**
46171  * Creates a copy of the MinFinalCltvExpiryDelta
46172  */
46173 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
46174
46175 /**
46176  * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
46177  */
46178 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
46179
46180 /**
46181  * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
46182  * This ignores pointers and is_owned flags and looks at the values in fields.
46183  * Two objects with NULL inner values will be considered "equal" here.
46184  */
46185 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
46186
46187 /**
46188  * Frees any resources used by the Fallback
46189  */
46190 void Fallback_free(struct LDKFallback this_ptr);
46191
46192 /**
46193  * Creates a copy of the Fallback
46194  */
46195 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
46196
46197 /**
46198  * Utility method to constructs a new SegWitProgram-variant Fallback
46199  */
46200 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
46201
46202 /**
46203  * Utility method to constructs a new PubKeyHash-variant Fallback
46204  */
46205 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
46206
46207 /**
46208  * Utility method to constructs a new ScriptHash-variant Fallback
46209  */
46210 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
46211
46212 /**
46213  * Generates a non-cryptographic 64-bit hash of the Fallback.
46214  */
46215 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
46216
46217 /**
46218  * Checks if two Fallbacks contain equal inner contents.
46219  * This ignores pointers and is_owned flags and looks at the values in fields.
46220  */
46221 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
46222
46223 /**
46224  * Frees any resources used by the Bolt11InvoiceSignature, if is_owned is set and inner is non-NULL.
46225  */
46226 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
46227
46228 /**
46229  * Creates a copy of the Bolt11InvoiceSignature
46230  */
46231 struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig);
46232
46233 /**
46234  * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
46235  */
46236 uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o);
46237
46238 /**
46239  * Checks if two Bolt11InvoiceSignatures contain equal inner contents.
46240  * This ignores pointers and is_owned flags and looks at the values in fields.
46241  * Two objects with NULL inner values will be considered "equal" here.
46242  */
46243 bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b);
46244
46245 /**
46246  * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
46247  */
46248 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
46249
46250 /**
46251  * Creates a copy of the PrivateRoute
46252  */
46253 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
46254
46255 /**
46256  * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
46257  */
46258 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
46259
46260 /**
46261  * Checks if two PrivateRoutes contain equal inner contents.
46262  * This ignores pointers and is_owned flags and looks at the values in fields.
46263  * Two objects with NULL inner values will be considered "equal" here.
46264  */
46265 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
46266
46267 /**
46268  * Disassembles the `SignedRawBolt11Invoice` into its three parts:
46269  *  1. raw invoice
46270  *  2. hash of the raw invoice
46271  *  3. signature
46272  */
46273 MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg);
46274
46275 /**
46276  * The [`RawBolt11Invoice`] which was signed.
46277  */
46278 MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46279
46280 /**
46281  * The hash of the [`RawBolt11Invoice`] that was signed.
46282  */
46283 MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32];
46284
46285 /**
46286  * Signature for the invoice.
46287  */
46288 MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46289
46290 /**
46291  * Recovers the public key used for signing the invoice from the recoverable signature.
46292  */
46293 MUST_USE_RES struct LDKCResult_PayeePubKeySecp256k1ErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46294
46295 /**
46296  * Checks if the signature is valid for the included payee public key or if none exists if it's
46297  * valid for the recovered signature (which should always be true?).
46298  */
46299 MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
46300
46301 /**
46302  * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
46303  */
46304 MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46305
46306 /**
46307  *
46308  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46309  */
46310 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46311
46312 /**
46313  *
46314  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46315  */
46316 MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46317
46318 /**
46319  *
46320  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46321  */
46322 MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46323
46324 /**
46325  *
46326  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46327  */
46328 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46329
46330 /**
46331  *
46332  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46333  */
46334 MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46335
46336 /**
46337  *
46338  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46339  */
46340 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46341
46342 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46343
46344 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46345
46346 /**
46347  *
46348  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46349  */
46350 MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46351
46352 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46353
46354 MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46355
46356 MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
46357
46358 /**
46359  * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
46360  *
46361  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
46362  */
46363 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
46364
46365 /**
46366  * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
46367  * the range `0..=MAX_TIMESTAMP`.
46368  *
46369  * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
46370  *
46371  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
46372  */
46373 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
46374
46375 /**
46376  * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
46377  * `0..=MAX_TIMESTAMP`.
46378  *
46379  * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
46380  *
46381  * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
46382  */
46383 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
46384
46385 /**
46386  * Returns the Unix timestamp representing the stored time
46387  */
46388 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
46389
46390 /**
46391  * Returns the duration of the stored time since the Unix epoch
46392  */
46393 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
46394
46395 /**
46396  * Returns the [`SystemTime`] representing the stored time
46397  */
46398 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
46399
46400 /**
46401  * The hash of the [`RawBolt11Invoice`] that was signed.
46402  */
46403 MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46404
46405 /**
46406  * Transform the `Bolt11Invoice` into its unchecked version.
46407  */
46408 MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg);
46409
46410 /**
46411  * Check that the invoice is signed correctly and that key recovery works
46412  */
46413 MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46414
46415 /**
46416  * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants.
46417  * ```
46418  * use lightning_invoice::*;
46419  *
46420  * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
46421  * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
46422  * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
46423  * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
46424  * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
46425  * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
46426  * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
46427  * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
46428  * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
46429  * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
46430  * j5r6drg6k6zcqj0fcwg\";
46431  *
46432  * let signed = invoice.parse::<SignedRawBolt11Invoice>().unwrap();
46433  *
46434  * assert!(Bolt11Invoice::from_signed(signed).is_ok());
46435  * ```
46436  */
46437 MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice);
46438
46439 /**
46440  * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time)
46441  */
46442 MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46443
46444 /**
46445  * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch
46446  */
46447 MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46448
46449 /**
46450  * Returns the hash to which we will receive the preimage on completion of the payment
46451  */
46452 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
46453
46454 /**
46455  * Get the payee's public key if one was included in the invoice
46456  *
46457  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46458  */
46459 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46460
46461 /**
46462  * Get the payment secret if one was included in the invoice
46463  */
46464 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
46465
46466 /**
46467  * Get the payment metadata blob if one was included in the invoice
46468  */
46469 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46470
46471 /**
46472  * Get the invoice features if they were included in the invoice
46473  *
46474  * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46475  */
46476 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46477
46478 /**
46479  * Recover the payee's public key (only to be used if none was included in the invoice)
46480  */
46481 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46482
46483 /**
46484  * Returns the Duration since the Unix epoch at which the invoice expires.
46485  * Returning None if overflow occurred.
46486  */
46487 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46488
46489 /**
46490  * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
46491  */
46492 MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46493
46494 /**
46495  * Returns whether the invoice has expired.
46496  */
46497 MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46498
46499 /**
46500  * Returns the Duration remaining until the invoice expires.
46501  */
46502 MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46503
46504 /**
46505  * Returns the Duration remaining until the invoice expires given the current time.
46506  * `time` is the timestamp as a duration since the Unix epoch.
46507  */
46508 MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time);
46509
46510 /**
46511  * Returns whether the expiry time would pass at the given point in time.
46512  * `at_time` is the timestamp as a duration since the Unix epoch.
46513  */
46514 MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time);
46515
46516 /**
46517  * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
46518  * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
46519  */
46520 MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46521
46522 /**
46523  * Returns a list of all fallback addresses as [`Address`]es
46524  */
46525 MUST_USE_RES struct LDKCVec_StrZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46526
46527 /**
46528  * Returns a list of all routes included in the invoice
46529  */
46530 MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46531
46532 /**
46533  * Returns a list of all routes included in the invoice as the underlying hints
46534  */
46535 MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46536
46537 /**
46538  * Returns the currency for which the invoice was issued
46539  */
46540 MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46541
46542 /**
46543  * Returns the amount if specified in the invoice as millisatoshis.
46544  */
46545 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
46546
46547 /**
46548  * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
46549  * returns [`CreationError::DescriptionTooLong`] otherwise
46550  *
46551  * Please note that single characters may use more than one byte due to UTF8 encoding.
46552  */
46553 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
46554
46555 /**
46556  * Returns the underlying description [`String`]
46557  */
46558 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
46559
46560 /**
46561  * Construct an `ExpiryTime` from seconds.
46562  */
46563 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
46564
46565 /**
46566  * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
46567  */
46568 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
46569
46570 /**
46571  * Returns the expiry time in seconds
46572  */
46573 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
46574
46575 /**
46576  * Returns a reference to the underlying [`Duration`] (=expiry time)
46577  */
46578 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
46579
46580 /**
46581  * Creates a new (partial) route from a list of hops
46582  */
46583 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
46584
46585 /**
46586  * Returns the underlying list of hops
46587  */
46588 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
46589
46590 /**
46591  * Creates a copy of the CreationError
46592  */
46593 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
46594
46595 /**
46596  * Utility method to constructs a new DescriptionTooLong-variant CreationError
46597  */
46598 enum LDKCreationError CreationError_description_too_long(void);
46599
46600 /**
46601  * Utility method to constructs a new RouteTooLong-variant CreationError
46602  */
46603 enum LDKCreationError CreationError_route_too_long(void);
46604
46605 /**
46606  * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
46607  */
46608 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
46609
46610 /**
46611  * Utility method to constructs a new InvalidAmount-variant CreationError
46612  */
46613 enum LDKCreationError CreationError_invalid_amount(void);
46614
46615 /**
46616  * Utility method to constructs a new MissingRouteHints-variant CreationError
46617  */
46618 enum LDKCreationError CreationError_missing_route_hints(void);
46619
46620 /**
46621  * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
46622  */
46623 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
46624
46625 /**
46626  * Checks if two CreationErrors contain equal inner contents.
46627  * This ignores pointers and is_owned flags and looks at the values in fields.
46628  */
46629 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
46630
46631 /**
46632  * Get the string representation of a CreationError object
46633  */
46634 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
46635
46636 /**
46637  * Creates a copy of the Bolt11SemanticError
46638  */
46639 enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig);
46640
46641 /**
46642  * Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
46643  */
46644 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void);
46645
46646 /**
46647  * Utility method to constructs a new MultiplePaymentHashes-variant Bolt11SemanticError
46648  */
46649 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void);
46650
46651 /**
46652  * Utility method to constructs a new NoDescription-variant Bolt11SemanticError
46653  */
46654 enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void);
46655
46656 /**
46657  * Utility method to constructs a new MultipleDescriptions-variant Bolt11SemanticError
46658  */
46659 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void);
46660
46661 /**
46662  * Utility method to constructs a new NoPaymentSecret-variant Bolt11SemanticError
46663  */
46664 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void);
46665
46666 /**
46667  * Utility method to constructs a new MultiplePaymentSecrets-variant Bolt11SemanticError
46668  */
46669 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void);
46670
46671 /**
46672  * Utility method to constructs a new InvalidFeatures-variant Bolt11SemanticError
46673  */
46674 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void);
46675
46676 /**
46677  * Utility method to constructs a new InvalidRecoveryId-variant Bolt11SemanticError
46678  */
46679 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void);
46680
46681 /**
46682  * Utility method to constructs a new InvalidSignature-variant Bolt11SemanticError
46683  */
46684 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void);
46685
46686 /**
46687  * Utility method to constructs a new ImpreciseAmount-variant Bolt11SemanticError
46688  */
46689 enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void);
46690
46691 /**
46692  * Checks if two Bolt11SemanticErrors contain equal inner contents.
46693  * This ignores pointers and is_owned flags and looks at the values in fields.
46694  */
46695 bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b);
46696
46697 /**
46698  * Get the string representation of a Bolt11SemanticError object
46699  */
46700 struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o);
46701
46702 /**
46703  * Frees any resources used by the SignOrCreationError
46704  */
46705 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
46706
46707 /**
46708  * Creates a copy of the SignOrCreationError
46709  */
46710 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
46711
46712 /**
46713  * Utility method to constructs a new SignError-variant SignOrCreationError
46714  */
46715 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
46716
46717 /**
46718  * Utility method to constructs a new CreationError-variant SignOrCreationError
46719  */
46720 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
46721
46722 /**
46723  * Checks if two SignOrCreationErrors contain equal inner contents.
46724  * This ignores pointers and is_owned flags and looks at the values in fields.
46725  */
46726 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
46727
46728 /**
46729  * Get the string representation of a SignOrCreationError object
46730  */
46731 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
46732
46733 /**
46734  * Pays the given [`Bolt11Invoice`], retrying if needed based on [`Retry`].
46735  *
46736  * [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
46737  * as the payment is still pending. If the payment succeeds, you must ensure that a second payment
46738  * with the same [`PaymentHash`] is never sent.
46739  *
46740  * If you wish to use a different payment idempotency token, see [`pay_invoice_with_id`].
46741  */
46742 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ pay_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
46743
46744 /**
46745  * Pays the given [`Bolt11Invoice`] with a custom idempotency key, retrying if needed based on
46746  * [`Retry`].
46747  *
46748  * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
46749  * payment completes or fails, no idempotency guarantees are made.
46750  *
46751  * You should ensure that the [`Bolt11Invoice::payment_hash`] is unique and the same
46752  * [`PaymentHash`] has never been paid before.
46753  *
46754  * See [`pay_invoice`] for a variant which uses the [`PaymentHash`] for the idempotency token.
46755  */
46756 struct LDKCResult_NonePaymentErrorZ pay_invoice_with_id(const struct LDKBolt11Invoice *NONNULL_PTR invoice, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
46757
46758 /**
46759  * Pays the given zero-value [`Bolt11Invoice`] using the given amount, retrying if needed based on
46760  * [`Retry`].
46761  *
46762  * [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
46763  * as the payment is still pending. If the payment succeeds, you must ensure that a second payment
46764  * with the same [`PaymentHash`] is never sent.
46765  *
46766  * If you wish to use a different payment idempotency token, see
46767  * [`pay_zero_value_invoice_with_id`].
46768  */
46769 struct LDKCResult_ThirtyTwoBytesPaymentErrorZ pay_zero_value_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
46770
46771 /**
46772  * Pays the given zero-value [`Bolt11Invoice`] using the given amount and custom idempotency key,
46773  * retrying if needed based on [`Retry`].
46774  *
46775  * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
46776  * payment completes or fails, no idempotency guarantees are made.
46777  *
46778  * You should ensure that the [`Bolt11Invoice::payment_hash`] is unique and the same
46779  * [`PaymentHash`] has never been paid before.
46780  *
46781  * See [`pay_zero_value_invoice`] for a variant which uses the [`PaymentHash`] for the
46782  * idempotency token.
46783  */
46784 struct LDKCResult_NonePaymentErrorZ pay_zero_value_invoice_with_id(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
46785
46786 /**
46787  * Sends payment probes over all paths of a route that would be used to pay the given invoice.
46788  *
46789  * See [`ChannelManager::send_preflight_probes`] for more information.
46790  */
46791 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ preflight_probe_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKCOption_u64Z liquidity_limit_multiplier);
46792
46793 /**
46794  * Sends payment probes over all paths of a route that would be used to pay the given zero-value
46795  * invoice using the given amount.
46796  *
46797  * See [`ChannelManager::send_preflight_probes`] for more information.
46798  */
46799 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbingErrorZ preflight_probe_zero_value_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat, const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKCOption_u64Z liquidity_limit_multiplier);
46800
46801 /**
46802  * Frees any resources used by the PaymentError
46803  */
46804 void PaymentError_free(struct LDKPaymentError this_ptr);
46805
46806 /**
46807  * Creates a copy of the PaymentError
46808  */
46809 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
46810
46811 /**
46812  * Utility method to constructs a new Invoice-variant PaymentError
46813  */
46814 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
46815
46816 /**
46817  * Utility method to constructs a new Sending-variant PaymentError
46818  */
46819 struct LDKPaymentError PaymentError_sending(enum LDKRetryableSendFailure a);
46820
46821 /**
46822  * Checks if two PaymentErrors contain equal inner contents.
46823  * This ignores pointers and is_owned flags and looks at the values in fields.
46824  */
46825 bool PaymentError_eq(const struct LDKPaymentError *NONNULL_PTR a, const struct LDKPaymentError *NONNULL_PTR b);
46826
46827 /**
46828  * Frees any resources used by the ProbingError
46829  */
46830 void ProbingError_free(struct LDKProbingError this_ptr);
46831
46832 /**
46833  * Creates a copy of the ProbingError
46834  */
46835 struct LDKProbingError ProbingError_clone(const struct LDKProbingError *NONNULL_PTR orig);
46836
46837 /**
46838  * Utility method to constructs a new Invoice-variant ProbingError
46839  */
46840 struct LDKProbingError ProbingError_invoice(struct LDKStr a);
46841
46842 /**
46843  * Utility method to constructs a new Sending-variant ProbingError
46844  */
46845 struct LDKProbingError ProbingError_sending(struct LDKProbeSendFailure a);
46846
46847 /**
46848  * Checks if two ProbingErrors contain equal inner contents.
46849  * This ignores pointers and is_owned flags and looks at the values in fields.
46850  */
46851 bool ProbingError_eq(const struct LDKProbingError *NONNULL_PTR a, const struct LDKProbingError *NONNULL_PTR b);
46852
46853 /**
46854  * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
46855  * See [`PhantomKeysManager`] for more information on phantom node payments.
46856  *
46857  * `phantom_route_hints` parameter:
46858  * * Contains channel info for all nodes participating in the phantom invoice
46859  * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
46860  *   participating node
46861  * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
46862  *   updated when a channel becomes disabled or closes
46863  * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
46864  *   may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
46865  *   down
46866  *
46867  * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
46868  * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
46869  * If `None` is provided for `payment_hash`, then one will be created.
46870  *
46871  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
46872  * in excess of the current time.
46873  *
46874  * `duration_since_epoch` is the current time since epoch in seconds.
46875  *
46876  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
46877  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
46878  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
46879  * confirmations during routing.
46880  *
46881  * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
46882  * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
46883  * requirement).
46884  *
46885  * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
46886  * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
46887  * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
46888  * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
46889  * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
46890  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
46891  *
46892  * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
46893  * available and the current time is supplied by the caller.
46894  */
46895 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);
46896
46897 /**
46898  * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
46899  * See [`PhantomKeysManager`] for more information on phantom node payments.
46900  *
46901  * `phantom_route_hints` parameter:
46902  * * Contains channel info for all nodes participating in the phantom invoice
46903  * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
46904  *   participating node
46905  * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
46906  *   updated when a channel becomes disabled or closes
46907  * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
46908  *   of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
46909  *   in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
46910  *   until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
46911  *   desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
46912  *
46913  * `description_hash` is a SHA-256 hash of the description text
46914  *
46915  * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
46916  * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
46917  * If `None` is provided for `payment_hash`, then one will be created.
46918  *
46919  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
46920  * in excess of the current time.
46921  *
46922  * `duration_since_epoch` is the current time since epoch in seconds.
46923  *
46924  * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
46925  * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
46926  * requirement).
46927  *
46928  * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
46929  * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
46930  * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
46931  * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
46932  * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
46933  *
46934  * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
46935  * available and the current time is supplied by the caller.
46936  */
46937 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);
46938
46939 /**
46940  * Utility to construct an invoice. Generally, unless you want to do something like a custom
46941  * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
46942  * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
46943  * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
46944  * that the payment secret is valid when the invoice is paid.
46945  *
46946  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
46947  * in excess of the current time.
46948  *
46949  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
46950  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
46951  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
46952  * confirmations during routing.
46953  *
46954  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
46955  */
46956 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);
46957
46958 /**
46959  * Utility to construct an invoice. Generally, unless you want to do something like a custom
46960  * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
46961  * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
46962  * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
46963  * that the payment secret is valid when the invoice is paid.
46964  * Use this variant if you want to pass the `description_hash` to the invoice.
46965  *
46966  * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
46967  * in excess of the current time.
46968  *
46969  * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
46970  * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
46971  * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
46972  * confirmations during routing.
46973  *
46974  * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
46975  */
46976 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);
46977
46978 /**
46979  * See [`create_invoice_from_channelmanager_with_description_hash`]
46980  * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
46981  * available and the current time is supplied by the caller.
46982  */
46983 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);
46984
46985 /**
46986  * See [`create_invoice_from_channelmanager`]
46987  * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
46988  * available and the current time is supplied by the caller.
46989  */
46990 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);
46991
46992 /**
46993  * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
46994  * This version allows for providing a custom [`PaymentHash`] for the invoice.
46995  * This may be useful if you're building an on-chain swap or involving another protocol where
46996  * the payment hash is also involved outside the scope of lightning.
46997  */
46998 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);
46999
47000 /**
47001  * Read a SiPrefix object from a string
47002  */
47003 struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s);
47004
47005 /**
47006  * Read a Bolt11Invoice object from a string
47007  */
47008 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s);
47009
47010 /**
47011  * Read a SignedRawBolt11Invoice object from a string
47012  */
47013 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s);
47014
47015 /**
47016  * Get the string representation of a Bolt11ParseError object
47017  */
47018 struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o);
47019
47020 /**
47021  * Get the string representation of a ParseOrSemanticError object
47022  */
47023 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
47024
47025 /**
47026  * Get the string representation of a Bolt11Invoice object
47027  */
47028 struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o);
47029
47030 /**
47031  * Get the string representation of a SignedRawBolt11Invoice object
47032  */
47033 struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
47034
47035 /**
47036  * Get the string representation of a Currency object
47037  */
47038 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
47039
47040 /**
47041  * Get the string representation of a SiPrefix object
47042  */
47043 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
47044
47045 /**
47046  * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
47047  */
47048 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
47049
47050 /**
47051  * Instantiate a new [`RapidGossipSync`] instance.
47052  */
47053 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
47054
47055 /**
47056  * Sync gossip data from a file.
47057  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
47058  *
47059  * `network_graph`: The network graph to apply the updates to
47060  *
47061  * `sync_path`: Path to the file where the gossip update data is located
47062  *
47063  */
47064 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
47065
47066 /**
47067  * Update network graph from binary data.
47068  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
47069  *
47070  * `update_data`: `&[u8]` binary stream that comprises the update data
47071  */
47072 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
47073
47074 /**
47075  * Update network graph from binary data.
47076  * Returns the last sync timestamp to be used the next time rapid sync data is queried.
47077  *
47078  * `update_data`: `&[u8]` binary stream that comprises the update data
47079  * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
47080  */
47081 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);
47082
47083 /**
47084  * Returns whether a rapid gossip sync has completed at least once.
47085  */
47086 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
47087
47088 /**
47089  * Frees any resources used by the GraphSyncError
47090  */
47091 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
47092
47093 /**
47094  * Creates a copy of the GraphSyncError
47095  */
47096 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
47097
47098 /**
47099  * Utility method to constructs a new DecodeError-variant GraphSyncError
47100  */
47101 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
47102
47103 /**
47104  * Utility method to constructs a new LightningError-variant GraphSyncError
47105  */
47106 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
47107
47108 #endif /* LDK_C_BINDINGS_H */
47109
47110 #include "ldk_ver.h"