1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.20.0 */
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
11 #include "ldk_rust_types.h"
14 * An error when accessing the chain via [`Access`].
16 typedef enum LDKAccessError {
18 * The requested chain is unknown.
20 LDKAccessError_UnknownChain,
22 * The requested transaction doesn't exist or hasn't confirmed.
24 LDKAccessError_UnknownTx,
26 * Must be last for serialization purposes
28 LDKAccessError_Sentinel,
32 * An enum which can either contain a or not
34 typedef enum LDKCOption_NoneZ {
36 * When we're in this state, this COption_NoneZ contains a
38 LDKCOption_NoneZ_Some,
40 * When we're in this state, this COption_NoneZ contains nothing
42 LDKCOption_NoneZ_None,
44 * Must be last for serialization purposes
46 LDKCOption_NoneZ_Sentinel,
50 * An error enum representing a failure to persist a channel monitor update.
52 typedef enum LDKChannelMonitorUpdateErr {
54 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
55 * our state failed, but is expected to succeed at some point in the future).
57 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
58 * submitting new commitment transactions to the counterparty. Once the update(s) that failed
59 * have been successfully applied, a [`MonitorEvent::UpdateCompleted`] event should be returned
60 * via [`Watch::release_pending_monitor_events`] which will then restore the channel to an
63 * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If
64 * you return a TemporaryFailure you must ensure that it is written to disk safely before
65 * writing out the latest ChannelManager state.
67 * Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur
68 * (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting
69 * to claim it on this channel) and those updates must be applied wherever they can be. At
70 * least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should
71 * be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to
72 * the channel which would invalidate previous ChannelMonitors are not made when a channel has
75 * Note that even if updates made after TemporaryFailure succeed you must still provide a
76 * [`MonitorEvent::UpdateCompleted`] to ensure you have the latest monitor and re-enable
77 * normal channel operation. Note that this is normally generated through a call to
78 * [`ChainMonitor::channel_monitor_updated`].
80 * Note that the update being processed here will not be replayed for you when you return a
81 * [`MonitorEvent::UpdateCompleted`] event via [`Watch::release_pending_monitor_events`], so
82 * you must store the update itself on your own local disk prior to returning a
83 * TemporaryFailure. You may, of course, employ a journaling approach, storing only the
84 * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at
87 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
88 * remote location (with local copies persisted immediately), it is anticipated that all
89 * updates will return TemporaryFailure until the remote copies could be updated.
91 * [`ChainMonitor::channel_monitor_updated`]: chainmonitor::ChainMonitor::channel_monitor_updated
93 LDKChannelMonitorUpdateErr_TemporaryFailure,
95 * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a
96 * different watchtower and cannot update with all watchtowers that were previously informed
99 * At reception of this error, ChannelManager will force-close the channel and return at
100 * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at
101 * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel
102 * update must be rejected.
104 * This failure may also signal a failure to update the local persisted copy of one of
105 * the channel monitor instance.
107 * Note that even when you fail a holder commitment transaction update, you must store the
108 * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor
109 * broadcasts it (e.g distributed channel-monitor deployment)
111 * In case of distributed watchtowers deployment, the new version must be written to disk, as
112 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
113 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
114 * lagging behind on block processing.
116 LDKChannelMonitorUpdateErr_PermanentFailure,
118 * Must be last for serialization purposes
120 LDKChannelMonitorUpdateErr_Sentinel,
121 } LDKChannelMonitorUpdateErr;
124 * An enum that represents the speed at which we want a transaction to confirm used for feerate
127 typedef enum LDKConfirmationTarget {
129 * We are happy with this transaction confirming slowly when feerate drops some.
131 LDKConfirmationTarget_Background,
133 * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
135 LDKConfirmationTarget_Normal,
137 * We'd like this transaction to confirm in the next few blocks.
139 LDKConfirmationTarget_HighPriority,
141 * Must be last for serialization purposes
143 LDKConfirmationTarget_Sentinel,
144 } LDKConfirmationTarget;
147 * Errors that may occur when constructing a new `RawInvoice` or `Invoice`
149 typedef enum LDKCreationError {
151 * The supplied description string was longer than 639 __bytes__ (see [`Description::new(…)`](./struct.Description.html#method.new))
153 LDKCreationError_DescriptionTooLong,
155 * The specified route has too many hops and can't be encoded
157 LDKCreationError_RouteTooLong,
159 * The unix timestamp of the supplied date is <0 or can't be represented as `SystemTime`
161 LDKCreationError_TimestampOutOfBounds,
163 * The supplied expiry time could cause an overflow if added to a `PositiveTimestamp`
165 LDKCreationError_ExpiryTimeOutOfBounds,
167 * The supplied millisatoshi amount was greater than the total bitcoin supply.
169 LDKCreationError_InvalidAmount,
171 * Must be last for serialization purposes
173 LDKCreationError_Sentinel,
177 * Enum representing the crypto currencies (or networks) supported by this library
179 typedef enum LDKCurrency {
187 LDKCurrency_BitcoinTestnet,
201 * Must be last for serialization purposes
203 LDKCurrency_Sentinel,
207 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
209 typedef enum LDKIOError {
211 LDKIOError_PermissionDenied,
212 LDKIOError_ConnectionRefused,
213 LDKIOError_ConnectionReset,
214 LDKIOError_ConnectionAborted,
215 LDKIOError_NotConnected,
216 LDKIOError_AddrInUse,
217 LDKIOError_AddrNotAvailable,
218 LDKIOError_BrokenPipe,
219 LDKIOError_AlreadyExists,
220 LDKIOError_WouldBlock,
221 LDKIOError_InvalidInput,
222 LDKIOError_InvalidData,
224 LDKIOError_WriteZero,
225 LDKIOError_Interrupted,
227 LDKIOError_UnexpectedEof,
229 * Must be last for serialization purposes
235 * An enum representing the available verbosity levels of the logger.
237 typedef enum LDKLevel {
239 * Designates extremely verbose information, including gossip-induced messages
243 * Designates very low priority, often extremely verbose, information
247 * Designates lower priority information
251 * Designates useful information
255 * Designates hazardous situations
259 * Designates very serious errors
263 * Must be last for serialization purposes
269 * An enum representing the possible Bitcoin or test networks which we can run on
271 typedef enum LDKNetwork {
273 * The main Bitcoin blockchain.
277 * The testnet3 blockchain.
281 * A local test blockchain.
285 * A blockchain on which blocks are signed instead of mined.
289 * Must be last for serialization purposes
295 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
297 typedef enum LDKSecp256k1Error {
299 * Signature failed verification
301 LDKSecp256k1Error_IncorrectSignature,
303 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
305 LDKSecp256k1Error_InvalidMessage,
309 LDKSecp256k1Error_InvalidPublicKey,
313 LDKSecp256k1Error_InvalidSignature,
317 LDKSecp256k1Error_InvalidSecretKey,
321 LDKSecp256k1Error_InvalidRecoveryId,
323 * Invalid tweak for add_assign or mul_assign
325 LDKSecp256k1Error_InvalidTweak,
327 * tweak_add_check failed on an xonly public key
329 LDKSecp256k1Error_TweakCheckFailed,
331 * Didn't pass enough memory to context creation with preallocated memory
333 LDKSecp256k1Error_NotEnoughMemory,
335 * Must be last for serialization purposes
337 LDKSecp256k1Error_Sentinel,
341 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
342 * requirements sections in BOLT #11
344 typedef enum LDKSemanticError {
346 * The invoice is missing the mandatory payment hash
348 LDKSemanticError_NoPaymentHash,
350 * The invoice has multiple payment hashes which isn't allowed
352 LDKSemanticError_MultiplePaymentHashes,
354 * No description or description hash are part of the invoice
356 LDKSemanticError_NoDescription,
358 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
360 LDKSemanticError_MultipleDescriptions,
362 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
365 LDKSemanticError_NoPaymentSecret,
367 * The invoice contains multiple payment secrets
369 LDKSemanticError_MultiplePaymentSecrets,
371 * The invoice's features are invalid
373 LDKSemanticError_InvalidFeatures,
375 * The recovery id doesn't fit the signature/pub key
377 LDKSemanticError_InvalidRecoveryId,
379 * The invoice's signature is invalid
381 LDKSemanticError_InvalidSignature,
383 * The invoice's amount was not a whole number of millisatoshis
385 LDKSemanticError_ImpreciseAmount,
387 * Must be last for serialization purposes
389 LDKSemanticError_Sentinel,
393 * SI prefixes for the human readable part
395 typedef enum LDKSiPrefix {
413 * Must be last for serialization purposes
415 LDKSiPrefix_Sentinel,
419 * A Rust str object, ie a reference to a UTF8-valid string.
420 * This is *not* null-terminated so cannot be used directly as a C string!
422 typedef struct LDKStr {
424 * A pointer to the string's bytes, in UTF8 encoding
426 const uint8_t *chars;
428 * The number of bytes (not characters!) pointed to by `chars`
432 * Whether the data pointed to by `chars` should be freed or not.
438 * A serialized transaction, in (pointer, length) form.
440 * This type optionally owns its own memory, and thus the semantics around access change based on
441 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
442 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
443 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
444 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
445 * you would be invalid.
447 * Note that, while it may change in the future, because transactions on the Rust side are stored
448 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
449 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
450 * `data_is_owned` either set or unset at your discretion.
452 typedef struct LDKTransaction {
454 * The serialized transaction data.
456 * This is non-const for your convenience, an object passed to Rust is never written to.
460 * The length of the serialized transaction
464 * Whether the data pointed to by `data` should be freed or not.
470 * A dynamically-allocated array of u8s of arbitrary size.
471 * This corresponds to std::vector in C++
473 typedef struct LDKCVec_u8Z {
475 * The elements in the array.
476 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
480 * The number of elements pointed to by `data`.
486 * A transaction output including a scriptPubKey and value.
487 * This type *does* own its own memory, so must be free'd appropriately.
489 typedef struct LDKTxOut {
491 * The script_pubkey in this output
493 struct LDKCVec_u8Z script_pubkey;
495 * The value, in satoshis, of this output
501 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
503 typedef struct LDKSecretKey {
505 * The bytes of the secret key
511 * The contents of CResult_SecretKeyErrorZ
513 typedef union LDKCResult_SecretKeyErrorZPtr {
515 * A pointer to the contents in the success state.
516 * Reading from this pointer when `result_ok` is not set is undefined.
518 struct LDKSecretKey *result;
520 * A pointer to the contents in the error state.
521 * Reading from this pointer when `result_ok` is set is undefined.
523 enum LDKSecp256k1Error *err;
524 } LDKCResult_SecretKeyErrorZPtr;
527 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
528 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
529 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
531 typedef struct LDKCResult_SecretKeyErrorZ {
533 * The contents of this CResult_SecretKeyErrorZ, accessible via either
534 * `err` or `result` depending on the state of `result_ok`.
536 union LDKCResult_SecretKeyErrorZPtr contents;
538 * Whether this CResult_SecretKeyErrorZ represents a success state.
541 } LDKCResult_SecretKeyErrorZ;
544 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
546 typedef struct LDKPublicKey {
548 * The bytes of the public key
550 uint8_t compressed_form[33];
554 * The contents of CResult_PublicKeyErrorZ
556 typedef union LDKCResult_PublicKeyErrorZPtr {
558 * A pointer to the contents in the success state.
559 * Reading from this pointer when `result_ok` is not set is undefined.
561 struct LDKPublicKey *result;
563 * A pointer to the contents in the error state.
564 * Reading from this pointer when `result_ok` is set is undefined.
566 enum LDKSecp256k1Error *err;
567 } LDKCResult_PublicKeyErrorZPtr;
570 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
571 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
572 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
574 typedef struct LDKCResult_PublicKeyErrorZ {
576 * The contents of this CResult_PublicKeyErrorZ, accessible via either
577 * `err` or `result` depending on the state of `result_ok`.
579 union LDKCResult_PublicKeyErrorZPtr contents;
581 * Whether this CResult_PublicKeyErrorZ represents a success state.
584 } LDKCResult_PublicKeyErrorZ;
589 * The set of public keys which are used in the creation of one commitment transaction.
590 * These are derived from the channel base keys and per-commitment data.
592 * A broadcaster key is provided from potential broadcaster of the computed transaction.
593 * A countersignatory key is coming from a protocol participant unable to broadcast the
596 * These keys are assumed to be good, either because the code derived them from
597 * channel basepoints via the new function, or they were obtained via
598 * CommitmentTransaction.trust().keys() because we trusted the source of the
599 * pre-calculated keys.
601 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
603 * A pointer to the opaque Rust object.
604 * Nearly everywhere, inner must be non-null, however in places where
605 * the Rust equivalent takes an Option, it may be set to null to indicate None.
607 LDKnativeTxCreationKeys *inner;
609 * Indicates that this is the only struct which contains the same pointer.
610 * Rust functions which take ownership of an object provided via an argument require
611 * this to be true and invalidate the object pointed to by inner.
619 * An error in decoding a message or struct.
621 typedef struct MUST_USE_STRUCT LDKDecodeError {
623 * A pointer to the opaque Rust object.
624 * Nearly everywhere, inner must be non-null, however in places where
625 * the Rust equivalent takes an Option, it may be set to null to indicate None.
627 LDKnativeDecodeError *inner;
629 * Indicates that this is the only struct which contains the same pointer.
630 * Rust functions which take ownership of an object provided via an argument require
631 * this to be true and invalidate the object pointed to by inner.
637 * The contents of CResult_TxCreationKeysDecodeErrorZ
639 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
641 * A pointer to the contents in the success state.
642 * Reading from this pointer when `result_ok` is not set is undefined.
644 struct LDKTxCreationKeys *result;
646 * A pointer to the contents in the error state.
647 * Reading from this pointer when `result_ok` is set is undefined.
649 struct LDKDecodeError *err;
650 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
653 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
654 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
655 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
657 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
659 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
660 * `err` or `result` depending on the state of `result_ok`.
662 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
664 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
667 } LDKCResult_TxCreationKeysDecodeErrorZ;
672 * One counterparty's public keys which do not change over the life of a channel.
674 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
676 * A pointer to the opaque Rust object.
677 * Nearly everywhere, inner must be non-null, however in places where
678 * the Rust equivalent takes an Option, it may be set to null to indicate None.
680 LDKnativeChannelPublicKeys *inner;
682 * Indicates that this is the only struct which contains the same pointer.
683 * Rust functions which take ownership of an object provided via an argument require
684 * this to be true and invalidate the object pointed to by inner.
687 } LDKChannelPublicKeys;
690 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
692 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
694 * A pointer to the contents in the success state.
695 * Reading from this pointer when `result_ok` is not set is undefined.
697 struct LDKChannelPublicKeys *result;
699 * A pointer to the contents in the error state.
700 * Reading from this pointer when `result_ok` is set is undefined.
702 struct LDKDecodeError *err;
703 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
706 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
707 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
708 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
710 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
712 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
713 * `err` or `result` depending on the state of `result_ok`.
715 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
717 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
720 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
723 * The contents of CResult_TxCreationKeysErrorZ
725 typedef union LDKCResult_TxCreationKeysErrorZPtr {
727 * A pointer to the contents in the success state.
728 * Reading from this pointer when `result_ok` is not set is undefined.
730 struct LDKTxCreationKeys *result;
732 * A pointer to the contents in the error state.
733 * Reading from this pointer when `result_ok` is set is undefined.
735 enum LDKSecp256k1Error *err;
736 } LDKCResult_TxCreationKeysErrorZPtr;
739 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
740 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
741 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
743 typedef struct LDKCResult_TxCreationKeysErrorZ {
745 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
746 * `err` or `result` depending on the state of `result_ok`.
748 union LDKCResult_TxCreationKeysErrorZPtr contents;
750 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
753 } LDKCResult_TxCreationKeysErrorZ;
756 * An enum which can either contain a u32 or not
758 typedef enum LDKCOption_u32Z_Tag {
760 * When we're in this state, this COption_u32Z contains a u32
762 LDKCOption_u32Z_Some,
764 * When we're in this state, this COption_u32Z contains nothing
766 LDKCOption_u32Z_None,
768 * Must be last for serialization purposes
770 LDKCOption_u32Z_Sentinel,
771 } LDKCOption_u32Z_Tag;
773 typedef struct LDKCOption_u32Z {
774 LDKCOption_u32Z_Tag tag;
785 * Information about an HTLC as it appears in a commitment transaction
787 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
789 * A pointer to the opaque Rust object.
790 * Nearly everywhere, inner must be non-null, however in places where
791 * the Rust equivalent takes an Option, it may be set to null to indicate None.
793 LDKnativeHTLCOutputInCommitment *inner;
795 * Indicates that this is the only struct which contains the same pointer.
796 * Rust functions which take ownership of an object provided via an argument require
797 * this to be true and invalidate the object pointed to by inner.
800 } LDKHTLCOutputInCommitment;
803 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
805 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
807 * A pointer to the contents in the success state.
808 * Reading from this pointer when `result_ok` is not set is undefined.
810 struct LDKHTLCOutputInCommitment *result;
812 * A pointer to the contents in the error state.
813 * Reading from this pointer when `result_ok` is set is undefined.
815 struct LDKDecodeError *err;
816 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
819 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
820 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
821 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
823 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
825 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
826 * `err` or `result` depending on the state of `result_ok`.
828 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
830 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
833 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
838 * Late-bound per-channel counterparty data used to build transactions.
840 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
842 * A pointer to the opaque Rust object.
843 * Nearly everywhere, inner must be non-null, however in places where
844 * the Rust equivalent takes an Option, it may be set to null to indicate None.
846 LDKnativeCounterpartyChannelTransactionParameters *inner;
848 * Indicates that this is the only struct which contains the same pointer.
849 * Rust functions which take ownership of an object provided via an argument require
850 * this to be true and invalidate the object pointed to by inner.
853 } LDKCounterpartyChannelTransactionParameters;
856 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
858 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
860 * A pointer to the contents in the success state.
861 * Reading from this pointer when `result_ok` is not set is undefined.
863 struct LDKCounterpartyChannelTransactionParameters *result;
865 * A pointer to the contents in the error state.
866 * Reading from this pointer when `result_ok` is set is undefined.
868 struct LDKDecodeError *err;
869 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
872 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
873 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
874 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
876 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
878 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
879 * `err` or `result` depending on the state of `result_ok`.
881 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
883 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
886 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
891 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
892 * The fields are organized by holder/counterparty.
894 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
895 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
897 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
899 * A pointer to the opaque Rust object.
900 * Nearly everywhere, inner must be non-null, however in places where
901 * the Rust equivalent takes an Option, it may be set to null to indicate None.
903 LDKnativeChannelTransactionParameters *inner;
905 * Indicates that this is the only struct which contains the same pointer.
906 * Rust functions which take ownership of an object provided via an argument require
907 * this to be true and invalidate the object pointed to by inner.
910 } LDKChannelTransactionParameters;
913 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
915 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
917 * A pointer to the contents in the success state.
918 * Reading from this pointer when `result_ok` is not set is undefined.
920 struct LDKChannelTransactionParameters *result;
922 * A pointer to the contents in the error state.
923 * Reading from this pointer when `result_ok` is set is undefined.
925 struct LDKDecodeError *err;
926 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
929 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
930 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
931 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
933 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
935 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
936 * `err` or `result` depending on the state of `result_ok`.
938 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
940 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
943 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
946 * Represents a secp256k1 signature serialized as two 32-byte numbers
948 typedef struct LDKSignature {
950 * The bytes of the signature in "compact" form
952 uint8_t compact_form[64];
956 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
957 * This corresponds to std::vector in C++
959 typedef struct LDKCVec_SignatureZ {
961 * The elements in the array.
962 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
964 struct LDKSignature *data;
966 * The number of elements pointed to by `data`.
969 } LDKCVec_SignatureZ;
974 * Information needed to build and sign a holder's commitment transaction.
976 * The transaction is only signed once we are ready to broadcast.
978 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
980 * A pointer to the opaque Rust object.
981 * Nearly everywhere, inner must be non-null, however in places where
982 * the Rust equivalent takes an Option, it may be set to null to indicate None.
984 LDKnativeHolderCommitmentTransaction *inner;
986 * Indicates that this is the only struct which contains the same pointer.
987 * Rust functions which take ownership of an object provided via an argument require
988 * this to be true and invalidate the object pointed to by inner.
991 } LDKHolderCommitmentTransaction;
994 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
996 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
998 * A pointer to the contents in the success state.
999 * Reading from this pointer when `result_ok` is not set is undefined.
1001 struct LDKHolderCommitmentTransaction *result;
1003 * A pointer to the contents in the error state.
1004 * Reading from this pointer when `result_ok` is set is undefined.
1006 struct LDKDecodeError *err;
1007 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
1010 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1011 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1012 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1014 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
1016 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
1017 * `err` or `result` depending on the state of `result_ok`.
1019 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
1021 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
1024 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
1029 * A pre-built Bitcoin commitment transaction and its txid.
1031 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
1033 * A pointer to the opaque Rust object.
1034 * Nearly everywhere, inner must be non-null, however in places where
1035 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1037 LDKnativeBuiltCommitmentTransaction *inner;
1039 * Indicates that this is the only struct which contains the same pointer.
1040 * Rust functions which take ownership of an object provided via an argument require
1041 * this to be true and invalidate the object pointed to by inner.
1044 } LDKBuiltCommitmentTransaction;
1047 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1049 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1051 * A pointer to the contents in the success state.
1052 * Reading from this pointer when `result_ok` is not set is undefined.
1054 struct LDKBuiltCommitmentTransaction *result;
1056 * A pointer to the contents in the error state.
1057 * Reading from this pointer when `result_ok` is set is undefined.
1059 struct LDKDecodeError *err;
1060 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1063 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1064 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1065 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1067 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1069 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1070 * `err` or `result` depending on the state of `result_ok`.
1072 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1074 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1077 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1082 * A wrapper on ClosingTransaction indicating that the built bitcoin
1083 * transaction is trusted.
1085 * See trust() and verify() functions on CommitmentTransaction.
1087 * This structure implements Deref.
1089 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
1091 * A pointer to the opaque Rust object.
1092 * Nearly everywhere, inner must be non-null, however in places where
1093 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1095 LDKnativeTrustedClosingTransaction *inner;
1097 * Indicates that this is the only struct which contains the same pointer.
1098 * Rust functions which take ownership of an object provided via an argument require
1099 * this to be true and invalidate the object pointed to by inner.
1102 } LDKTrustedClosingTransaction;
1105 * The contents of CResult_TrustedClosingTransactionNoneZ
1107 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
1109 * A pointer to the contents in the success state.
1110 * Reading from this pointer when `result_ok` is not set is undefined.
1112 struct LDKTrustedClosingTransaction *result;
1114 * Note that this value is always NULL, as there are no contents in the Err variant
1117 } LDKCResult_TrustedClosingTransactionNoneZPtr;
1120 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
1121 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
1122 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1124 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
1126 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
1127 * `err` or `result` depending on the state of `result_ok`.
1129 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
1131 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
1134 } LDKCResult_TrustedClosingTransactionNoneZ;
1139 * This class tracks the per-transaction information needed to build a commitment transaction and will
1140 * actually build it and sign. It is used for holder transactions that we sign only when needed
1141 * and for transactions we sign for the counterparty.
1143 * This class can be used inside a signer implementation to generate a signature given the relevant
1146 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1148 * A pointer to the opaque Rust object.
1149 * Nearly everywhere, inner must be non-null, however in places where
1150 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1152 LDKnativeCommitmentTransaction *inner;
1154 * Indicates that this is the only struct which contains the same pointer.
1155 * Rust functions which take ownership of an object provided via an argument require
1156 * this to be true and invalidate the object pointed to by inner.
1159 } LDKCommitmentTransaction;
1162 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1164 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1166 * A pointer to the contents in the success state.
1167 * Reading from this pointer when `result_ok` is not set is undefined.
1169 struct LDKCommitmentTransaction *result;
1171 * A pointer to the contents in the error state.
1172 * Reading from this pointer when `result_ok` is set is undefined.
1174 struct LDKDecodeError *err;
1175 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1178 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1179 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1180 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1182 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1184 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1185 * `err` or `result` depending on the state of `result_ok`.
1187 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1189 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1192 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1197 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1198 * transaction and the transaction creation keys) are trusted.
1200 * See trust() and verify() functions on CommitmentTransaction.
1202 * This structure implements Deref.
1204 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1206 * A pointer to the opaque Rust object.
1207 * Nearly everywhere, inner must be non-null, however in places where
1208 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1210 LDKnativeTrustedCommitmentTransaction *inner;
1212 * Indicates that this is the only struct which contains the same pointer.
1213 * Rust functions which take ownership of an object provided via an argument require
1214 * this to be true and invalidate the object pointed to by inner.
1217 } LDKTrustedCommitmentTransaction;
1220 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1222 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1224 * A pointer to the contents in the success state.
1225 * Reading from this pointer when `result_ok` is not set is undefined.
1227 struct LDKTrustedCommitmentTransaction *result;
1229 * Note that this value is always NULL, as there are no contents in the Err variant
1232 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1235 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1236 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1237 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1239 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1241 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1242 * `err` or `result` depending on the state of `result_ok`.
1244 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1246 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1249 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1252 * The contents of CResult_CVec_SignatureZNoneZ
1254 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1256 * A pointer to the contents in the success state.
1257 * Reading from this pointer when `result_ok` is not set is undefined.
1259 struct LDKCVec_SignatureZ *result;
1261 * Note that this value is always NULL, as there are no contents in the Err variant
1264 } LDKCResult_CVec_SignatureZNoneZPtr;
1267 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1268 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1269 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1271 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1273 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1274 * `err` or `result` depending on the state of `result_ok`.
1276 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1278 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1281 } LDKCResult_CVec_SignatureZNoneZ;
1286 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1288 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
1290 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1292 * A pointer to the opaque Rust object.
1293 * Nearly everywhere, inner must be non-null, however in places where
1294 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1296 LDKnativeShutdownScript *inner;
1298 * Indicates that this is the only struct which contains the same pointer.
1299 * Rust functions which take ownership of an object provided via an argument require
1300 * this to be true and invalidate the object pointed to by inner.
1303 } LDKShutdownScript;
1306 * The contents of CResult_ShutdownScriptDecodeErrorZ
1308 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
1310 * A pointer to the contents in the success state.
1311 * Reading from this pointer when `result_ok` is not set is undefined.
1313 struct LDKShutdownScript *result;
1315 * A pointer to the contents in the error state.
1316 * Reading from this pointer when `result_ok` is set is undefined.
1318 struct LDKDecodeError *err;
1319 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
1322 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
1323 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
1324 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1326 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
1328 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
1329 * `err` or `result` depending on the state of `result_ok`.
1331 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
1333 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
1336 } LDKCResult_ShutdownScriptDecodeErrorZ;
1341 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
1343 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
1345 * A pointer to the opaque Rust object.
1346 * Nearly everywhere, inner must be non-null, however in places where
1347 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1349 LDKnativeInvalidShutdownScript *inner;
1351 * Indicates that this is the only struct which contains the same pointer.
1352 * Rust functions which take ownership of an object provided via an argument require
1353 * this to be true and invalidate the object pointed to by inner.
1356 } LDKInvalidShutdownScript;
1359 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
1361 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
1363 * A pointer to the contents in the success state.
1364 * Reading from this pointer when `result_ok` is not set is undefined.
1366 struct LDKShutdownScript *result;
1368 * A pointer to the contents in the error state.
1369 * Reading from this pointer when `result_ok` is set is undefined.
1371 struct LDKInvalidShutdownScript *err;
1372 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
1375 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
1376 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
1377 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1379 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
1381 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
1382 * `err` or `result` depending on the state of `result_ok`.
1384 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
1386 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
1389 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
1392 * The contents of CResult_NoneErrorZ
1394 typedef union LDKCResult_NoneErrorZPtr {
1396 * Note that this value is always NULL, as there are no contents in the OK variant
1400 * A pointer to the contents in the error state.
1401 * Reading from this pointer when `result_ok` is set is undefined.
1403 enum LDKIOError *err;
1404 } LDKCResult_NoneErrorZPtr;
1407 * A CResult_NoneErrorZ represents the result of a fallible operation,
1408 * containing a () on success and a crate::c_types::IOError on failure.
1409 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1411 typedef struct LDKCResult_NoneErrorZ {
1413 * The contents of this CResult_NoneErrorZ, accessible via either
1414 * `err` or `result` depending on the state of `result_ok`.
1416 union LDKCResult_NoneErrorZPtr contents;
1418 * Whether this CResult_NoneErrorZ represents a success state.
1421 } LDKCResult_NoneErrorZ;
1428 typedef struct MUST_USE_STRUCT LDKRouteHop {
1430 * A pointer to the opaque Rust object.
1431 * Nearly everywhere, inner must be non-null, however in places where
1432 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1434 LDKnativeRouteHop *inner;
1436 * Indicates that this is the only struct which contains the same pointer.
1437 * Rust functions which take ownership of an object provided via an argument require
1438 * this to be true and invalidate the object pointed to by inner.
1444 * The contents of CResult_RouteHopDecodeErrorZ
1446 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
1448 * A pointer to the contents in the success state.
1449 * Reading from this pointer when `result_ok` is not set is undefined.
1451 struct LDKRouteHop *result;
1453 * A pointer to the contents in the error state.
1454 * Reading from this pointer when `result_ok` is set is undefined.
1456 struct LDKDecodeError *err;
1457 } LDKCResult_RouteHopDecodeErrorZPtr;
1460 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
1461 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1462 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1464 typedef struct LDKCResult_RouteHopDecodeErrorZ {
1466 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
1467 * `err` or `result` depending on the state of `result_ok`.
1469 union LDKCResult_RouteHopDecodeErrorZPtr contents;
1471 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
1474 } LDKCResult_RouteHopDecodeErrorZ;
1477 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
1478 * This corresponds to std::vector in C++
1480 typedef struct LDKCVec_RouteHopZ {
1482 * The elements in the array.
1483 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1485 struct LDKRouteHop *data;
1487 * The number of elements pointed to by `data`.
1490 } LDKCVec_RouteHopZ;
1493 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
1494 * This corresponds to std::vector in C++
1496 typedef struct LDKCVec_CVec_RouteHopZZ {
1498 * The elements in the array.
1499 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1501 struct LDKCVec_RouteHopZ *data;
1503 * The number of elements pointed to by `data`.
1506 } LDKCVec_CVec_RouteHopZZ;
1511 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
1512 * it can take multiple paths. Each path is composed of one or more hops through the network.
1514 typedef struct MUST_USE_STRUCT LDKRoute {
1516 * A pointer to the opaque Rust object.
1517 * Nearly everywhere, inner must be non-null, however in places where
1518 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1520 LDKnativeRoute *inner;
1522 * Indicates that this is the only struct which contains the same pointer.
1523 * Rust functions which take ownership of an object provided via an argument require
1524 * this to be true and invalidate the object pointed to by inner.
1530 * The contents of CResult_RouteDecodeErrorZ
1532 typedef union LDKCResult_RouteDecodeErrorZPtr {
1534 * A pointer to the contents in the success state.
1535 * Reading from this pointer when `result_ok` is not set is undefined.
1537 struct LDKRoute *result;
1539 * A pointer to the contents in the error state.
1540 * Reading from this pointer when `result_ok` is set is undefined.
1542 struct LDKDecodeError *err;
1543 } LDKCResult_RouteDecodeErrorZPtr;
1546 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
1547 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
1548 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1550 typedef struct LDKCResult_RouteDecodeErrorZ {
1552 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
1553 * `err` or `result` depending on the state of `result_ok`.
1555 union LDKCResult_RouteDecodeErrorZPtr contents;
1557 * Whether this CResult_RouteDecodeErrorZ represents a success state.
1560 } LDKCResult_RouteDecodeErrorZ;
1565 * Parameters needed to find a [`Route`] for paying a [`Payee`].
1567 * Passed to [`find_route`] and also provided in [`Event::PaymentPathFailed`] for retrying a failed
1570 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
1572 typedef struct MUST_USE_STRUCT LDKRouteParameters {
1574 * A pointer to the opaque Rust object.
1575 * Nearly everywhere, inner must be non-null, however in places where
1576 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1578 LDKnativeRouteParameters *inner;
1580 * Indicates that this is the only struct which contains the same pointer.
1581 * Rust functions which take ownership of an object provided via an argument require
1582 * this to be true and invalidate the object pointed to by inner.
1585 } LDKRouteParameters;
1588 * The contents of CResult_RouteParametersDecodeErrorZ
1590 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
1592 * A pointer to the contents in the success state.
1593 * Reading from this pointer when `result_ok` is not set is undefined.
1595 struct LDKRouteParameters *result;
1597 * A pointer to the contents in the error state.
1598 * Reading from this pointer when `result_ok` is set is undefined.
1600 struct LDKDecodeError *err;
1601 } LDKCResult_RouteParametersDecodeErrorZPtr;
1604 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
1605 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1606 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1608 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
1610 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
1611 * `err` or `result` depending on the state of `result_ok`.
1613 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
1615 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
1618 } LDKCResult_RouteParametersDecodeErrorZ;
1623 * A list of hops along a payment path terminating with a channel to the recipient.
1625 typedef struct MUST_USE_STRUCT LDKRouteHint {
1627 * A pointer to the opaque Rust object.
1628 * Nearly everywhere, inner must be non-null, however in places where
1629 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1631 LDKnativeRouteHint *inner;
1633 * Indicates that this is the only struct which contains the same pointer.
1634 * Rust functions which take ownership of an object provided via an argument require
1635 * this to be true and invalidate the object pointed to by inner.
1641 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
1642 * This corresponds to std::vector in C++
1644 typedef struct LDKCVec_RouteHintZ {
1646 * The elements in the array.
1647 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1649 struct LDKRouteHint *data;
1651 * The number of elements pointed to by `data`.
1654 } LDKCVec_RouteHintZ;
1657 * An enum which can either contain a u64 or not
1659 typedef enum LDKCOption_u64Z_Tag {
1661 * When we're in this state, this COption_u64Z contains a u64
1663 LDKCOption_u64Z_Some,
1665 * When we're in this state, this COption_u64Z contains nothing
1667 LDKCOption_u64Z_None,
1669 * Must be last for serialization purposes
1671 LDKCOption_u64Z_Sentinel,
1672 } LDKCOption_u64Z_Tag;
1674 typedef struct LDKCOption_u64Z {
1675 LDKCOption_u64Z_Tag tag;
1686 * The recipient of a payment.
1688 typedef struct MUST_USE_STRUCT LDKPayee {
1690 * A pointer to the opaque Rust object.
1691 * Nearly everywhere, inner must be non-null, however in places where
1692 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1694 LDKnativePayee *inner;
1696 * Indicates that this is the only struct which contains the same pointer.
1697 * Rust functions which take ownership of an object provided via an argument require
1698 * this to be true and invalidate the object pointed to by inner.
1704 * The contents of CResult_PayeeDecodeErrorZ
1706 typedef union LDKCResult_PayeeDecodeErrorZPtr {
1708 * A pointer to the contents in the success state.
1709 * Reading from this pointer when `result_ok` is not set is undefined.
1711 struct LDKPayee *result;
1713 * A pointer to the contents in the error state.
1714 * Reading from this pointer when `result_ok` is set is undefined.
1716 struct LDKDecodeError *err;
1717 } LDKCResult_PayeeDecodeErrorZPtr;
1720 * A CResult_PayeeDecodeErrorZ represents the result of a fallible operation,
1721 * containing a crate::lightning::routing::router::Payee on success and a crate::lightning::ln::msgs::DecodeError on failure.
1722 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1724 typedef struct LDKCResult_PayeeDecodeErrorZ {
1726 * The contents of this CResult_PayeeDecodeErrorZ, accessible via either
1727 * `err` or `result` depending on the state of `result_ok`.
1729 union LDKCResult_PayeeDecodeErrorZPtr contents;
1731 * Whether this CResult_PayeeDecodeErrorZ represents a success state.
1734 } LDKCResult_PayeeDecodeErrorZ;
1739 * A channel descriptor for a hop along a payment path.
1741 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
1743 * A pointer to the opaque Rust object.
1744 * Nearly everywhere, inner must be non-null, however in places where
1745 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1747 LDKnativeRouteHintHop *inner;
1749 * Indicates that this is the only struct which contains the same pointer.
1750 * Rust functions which take ownership of an object provided via an argument require
1751 * this to be true and invalidate the object pointed to by inner.
1757 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
1758 * This corresponds to std::vector in C++
1760 typedef struct LDKCVec_RouteHintHopZ {
1762 * The elements in the array.
1763 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1765 struct LDKRouteHintHop *data;
1767 * The number of elements pointed to by `data`.
1770 } LDKCVec_RouteHintHopZ;
1773 * The contents of CResult_RouteHintDecodeErrorZ
1775 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
1777 * A pointer to the contents in the success state.
1778 * Reading from this pointer when `result_ok` is not set is undefined.
1780 struct LDKRouteHint *result;
1782 * A pointer to the contents in the error state.
1783 * Reading from this pointer when `result_ok` is set is undefined.
1785 struct LDKDecodeError *err;
1786 } LDKCResult_RouteHintDecodeErrorZPtr;
1789 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
1790 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
1791 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1793 typedef struct LDKCResult_RouteHintDecodeErrorZ {
1795 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
1796 * `err` or `result` depending on the state of `result_ok`.
1798 union LDKCResult_RouteHintDecodeErrorZPtr contents;
1800 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
1803 } LDKCResult_RouteHintDecodeErrorZ;
1806 * The contents of CResult_RouteHintHopDecodeErrorZ
1808 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
1810 * A pointer to the contents in the success state.
1811 * Reading from this pointer when `result_ok` is not set is undefined.
1813 struct LDKRouteHintHop *result;
1815 * A pointer to the contents in the error state.
1816 * Reading from this pointer when `result_ok` is set is undefined.
1818 struct LDKDecodeError *err;
1819 } LDKCResult_RouteHintHopDecodeErrorZPtr;
1822 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
1823 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1824 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1826 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
1828 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
1829 * `err` or `result` depending on the state of `result_ok`.
1831 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
1833 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
1836 } LDKCResult_RouteHintHopDecodeErrorZ;
1841 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
1843 typedef struct MUST_USE_STRUCT LDKChannelDetails {
1845 * A pointer to the opaque Rust object.
1846 * Nearly everywhere, inner must be non-null, however in places where
1847 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1849 LDKnativeChannelDetails *inner;
1851 * Indicates that this is the only struct which contains the same pointer.
1852 * Rust functions which take ownership of an object provided via an argument require
1853 * this to be true and invalidate the object pointed to by inner.
1856 } LDKChannelDetails;
1859 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
1860 * This corresponds to std::vector in C++
1862 typedef struct LDKCVec_ChannelDetailsZ {
1864 * The elements in the array.
1865 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1867 struct LDKChannelDetails *data;
1869 * The number of elements pointed to by `data`.
1872 } LDKCVec_ChannelDetailsZ;
1877 * An Err type for failure to process messages.
1879 typedef struct MUST_USE_STRUCT LDKLightningError {
1881 * A pointer to the opaque Rust object.
1882 * Nearly everywhere, inner must be non-null, however in places where
1883 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1885 LDKnativeLightningError *inner;
1887 * Indicates that this is the only struct which contains the same pointer.
1888 * Rust functions which take ownership of an object provided via an argument require
1889 * this to be true and invalidate the object pointed to by inner.
1892 } LDKLightningError;
1895 * The contents of CResult_RouteLightningErrorZ
1897 typedef union LDKCResult_RouteLightningErrorZPtr {
1899 * A pointer to the contents in the success state.
1900 * Reading from this pointer when `result_ok` is not set is undefined.
1902 struct LDKRoute *result;
1904 * A pointer to the contents in the error state.
1905 * Reading from this pointer when `result_ok` is set is undefined.
1907 struct LDKLightningError *err;
1908 } LDKCResult_RouteLightningErrorZPtr;
1911 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
1912 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
1913 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1915 typedef struct LDKCResult_RouteLightningErrorZ {
1917 * The contents of this CResult_RouteLightningErrorZ, accessible via either
1918 * `err` or `result` depending on the state of `result_ok`.
1920 union LDKCResult_RouteLightningErrorZPtr contents;
1922 * Whether this CResult_RouteLightningErrorZ represents a success state.
1925 } LDKCResult_RouteLightningErrorZ;
1928 * The contents of CResult_TxOutAccessErrorZ
1930 typedef union LDKCResult_TxOutAccessErrorZPtr {
1932 * A pointer to the contents in the success state.
1933 * Reading from this pointer when `result_ok` is not set is undefined.
1935 struct LDKTxOut *result;
1937 * A pointer to the contents in the error state.
1938 * Reading from this pointer when `result_ok` is set is undefined.
1940 enum LDKAccessError *err;
1941 } LDKCResult_TxOutAccessErrorZPtr;
1944 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
1945 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
1946 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1948 typedef struct LDKCResult_TxOutAccessErrorZ {
1950 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
1951 * `err` or `result` depending on the state of `result_ok`.
1953 union LDKCResult_TxOutAccessErrorZPtr contents;
1955 * Whether this CResult_TxOutAccessErrorZ represents a success state.
1958 } LDKCResult_TxOutAccessErrorZ;
1961 * A tuple of 2 elements. See the individual fields for the types contained.
1963 typedef struct LDKC2Tuple_usizeTransactionZ {
1965 * The element at position 0
1969 * The element at position 1
1971 struct LDKTransaction b;
1972 } LDKC2Tuple_usizeTransactionZ;
1975 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
1976 * This corresponds to std::vector in C++
1978 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
1980 * The elements in the array.
1981 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1983 struct LDKC2Tuple_usizeTransactionZ *data;
1985 * The number of elements pointed to by `data`.
1988 } LDKCVec_C2Tuple_usizeTransactionZZ;
1991 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
1992 * look up the corresponding function in rust-lightning's docs.
1994 typedef struct LDKThirtyTwoBytes {
1996 * The thirty-two bytes
1999 } LDKThirtyTwoBytes;
2002 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
2003 * This corresponds to std::vector in C++
2005 typedef struct LDKCVec_TxidZ {
2007 * The elements in the array.
2008 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2010 struct LDKThirtyTwoBytes *data;
2012 * The number of elements pointed to by `data`.
2018 * The contents of CResult_NoneChannelMonitorUpdateErrZ
2020 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
2022 * Note that this value is always NULL, as there are no contents in the OK variant
2026 * A pointer to the contents in the error state.
2027 * Reading from this pointer when `result_ok` is set is undefined.
2029 enum LDKChannelMonitorUpdateErr *err;
2030 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
2033 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
2034 * containing a () on success and a crate::lightning::chain::ChannelMonitorUpdateErr on failure.
2035 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2037 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
2039 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
2040 * `err` or `result` depending on the state of `result_ok`.
2042 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
2044 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
2047 } LDKCResult_NoneChannelMonitorUpdateErrZ;
2052 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
2053 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
2054 * preimage claim backward will lead to loss of funds.
2056 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
2058 * A pointer to the opaque Rust object.
2059 * Nearly everywhere, inner must be non-null, however in places where
2060 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2062 LDKnativeHTLCUpdate *inner;
2064 * Indicates that this is the only struct which contains the same pointer.
2065 * Rust functions which take ownership of an object provided via an argument require
2066 * this to be true and invalidate the object pointed to by inner.
2074 * A reference to a transaction output.
2076 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2077 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2079 typedef struct MUST_USE_STRUCT LDKOutPoint {
2081 * A pointer to the opaque Rust object.
2082 * Nearly everywhere, inner must be non-null, however in places where
2083 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2085 LDKnativeOutPoint *inner;
2087 * Indicates that this is the only struct which contains the same pointer.
2088 * Rust functions which take ownership of an object provided via an argument require
2089 * this to be true and invalidate the object pointed to by inner.
2095 * An event to be processed by the ChannelManager.
2097 typedef enum LDKMonitorEvent_Tag {
2099 * A monitor event containing an HTLCUpdate.
2101 LDKMonitorEvent_HTLCEvent,
2103 * A monitor event that the Channel's commitment transaction was confirmed.
2105 LDKMonitorEvent_CommitmentTxConfirmed,
2107 * Indicates a [`ChannelMonitor`] update has completed. See
2108 * [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used.
2110 * [`ChannelMonitorUpdateErr::TemporaryFailure`]: super::ChannelMonitorUpdateErr::TemporaryFailure
2112 LDKMonitorEvent_UpdateCompleted,
2114 * Indicates a [`ChannelMonitor`] update has failed. See
2115 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used.
2117 * [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure
2119 LDKMonitorEvent_UpdateFailed,
2121 * Must be last for serialization purposes
2123 LDKMonitorEvent_Sentinel,
2124 } LDKMonitorEvent_Tag;
2126 typedef struct LDKMonitorEvent_LDKUpdateCompleted_Body {
2128 * The funding outpoint of the [`ChannelMonitor`] that was updated
2130 struct LDKOutPoint funding_txo;
2132 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
2133 * [`ChannelMonitor::get_latest_update_id`].
2135 * Note that this should only be set to a given update's ID if all previous updates for the
2136 * same [`ChannelMonitor`] have been applied and persisted.
2138 uint64_t monitor_update_id;
2139 } LDKMonitorEvent_LDKUpdateCompleted_Body;
2141 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
2142 LDKMonitorEvent_Tag tag;
2145 struct LDKHTLCUpdate htlc_event;
2148 struct LDKOutPoint commitment_tx_confirmed;
2150 LDKMonitorEvent_LDKUpdateCompleted_Body update_completed;
2152 struct LDKOutPoint update_failed;
2158 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
2159 * This corresponds to std::vector in C++
2161 typedef struct LDKCVec_MonitorEventZ {
2163 * The elements in the array.
2164 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2166 struct LDKMonitorEvent *data;
2168 * The number of elements pointed to by `data`.
2171 } LDKCVec_MonitorEventZ;
2174 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
2176 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
2178 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
2180 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
2182 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
2184 LDKCOption_C2Tuple_usizeTransactionZZ_None,
2186 * Must be last for serialization purposes
2188 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
2189 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
2191 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
2192 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
2195 struct LDKC2Tuple_usizeTransactionZ some;
2198 } LDKCOption_C2Tuple_usizeTransactionZZ;
2201 * The reason the channel was closed. See individual variants more details.
2203 typedef enum LDKClosureReason_Tag {
2205 * Closure generated from receiving a peer error message.
2207 * Our counterparty may have broadcasted their latest commitment state, and we have
2210 LDKClosureReason_CounterpartyForceClosed,
2212 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
2214 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
2216 LDKClosureReason_HolderForceClosed,
2218 * The channel was closed after negotiating a cooperative close and we've now broadcasted
2219 * the cooperative close transaction. Note the shutdown may have been initiated by us.
2221 LDKClosureReason_CooperativeClosure,
2223 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
2224 * commitment transaction came from our counterparty, but it may also have come from
2225 * a copy of our own `ChannelMonitor`.
2227 LDKClosureReason_CommitmentTxConfirmed,
2229 * The funding transaction failed to confirm in a timely manner on an inbound channel.
2231 LDKClosureReason_FundingTimedOut,
2233 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
2235 LDKClosureReason_ProcessingError,
2237 * The `PeerManager` informed us that we've disconnected from the peer. We close channels
2238 * if the `PeerManager` informed us that it is unlikely we'll be able to connect to the
2239 * peer again in the future or if the peer disconnected before we finished negotiating
2240 * the channel open. The first case may be caused by incompatible features which our
2241 * counterparty, or we, require.
2243 LDKClosureReason_DisconnectedPeer,
2245 * Closure generated from `ChannelManager::read` if the ChannelMonitor is newer than
2246 * the ChannelManager deserialized.
2248 LDKClosureReason_OutdatedChannelManager,
2250 * Must be last for serialization purposes
2252 LDKClosureReason_Sentinel,
2253 } LDKClosureReason_Tag;
2255 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
2257 * The error which the peer sent us.
2259 * The string should be sanitized before it is used (e.g emitted to logs
2260 * or printed to stdout). Otherwise, a well crafted error message may exploit
2261 * a security vulnerability in the terminal emulator or the logging subsystem.
2263 struct LDKStr peer_msg;
2264 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
2266 typedef struct LDKClosureReason_LDKProcessingError_Body {
2268 * A developer-readable error message which we generated.
2271 } LDKClosureReason_LDKProcessingError_Body;
2273 typedef struct MUST_USE_STRUCT LDKClosureReason {
2274 LDKClosureReason_Tag tag;
2276 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
2277 LDKClosureReason_LDKProcessingError_Body processing_error;
2282 * An enum which can either contain a crate::lightning::util::events::ClosureReason or not
2284 typedef enum LDKCOption_ClosureReasonZ_Tag {
2286 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::util::events::ClosureReason
2288 LDKCOption_ClosureReasonZ_Some,
2290 * When we're in this state, this COption_ClosureReasonZ contains nothing
2292 LDKCOption_ClosureReasonZ_None,
2294 * Must be last for serialization purposes
2296 LDKCOption_ClosureReasonZ_Sentinel,
2297 } LDKCOption_ClosureReasonZ_Tag;
2299 typedef struct LDKCOption_ClosureReasonZ {
2300 LDKCOption_ClosureReasonZ_Tag tag;
2303 struct LDKClosureReason some;
2306 } LDKCOption_ClosureReasonZ;
2309 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
2311 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
2313 * A pointer to the contents in the success state.
2314 * Reading from this pointer when `result_ok` is not set is undefined.
2316 struct LDKCOption_ClosureReasonZ *result;
2318 * A pointer to the contents in the error state.
2319 * Reading from this pointer when `result_ok` is set is undefined.
2321 struct LDKDecodeError *err;
2322 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
2325 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
2326 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2327 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2329 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
2331 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
2332 * `err` or `result` depending on the state of `result_ok`.
2334 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
2336 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
2339 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
2344 * A channel_update message to be sent or received from a peer
2346 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2348 * A pointer to the opaque Rust object.
2349 * Nearly everywhere, inner must be non-null, however in places where
2350 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2352 LDKnativeChannelUpdate *inner;
2354 * Indicates that this is the only struct which contains the same pointer.
2355 * Rust functions which take ownership of an object provided via an argument require
2356 * this to be true and invalidate the object pointed to by inner.
2362 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
2363 * return packet by a node along the route. See [BOLT #4] for details.
2365 * [BOLT #4]: https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md
2367 typedef enum LDKNetworkUpdate_Tag {
2369 * An error indicating a `channel_update` messages should be applied via
2370 * [`NetworkGraph::update_channel`].
2372 LDKNetworkUpdate_ChannelUpdateMessage,
2374 * An error indicating only that a channel has been closed, which should be applied via
2375 * [`NetworkGraph::close_channel_from_update`].
2377 LDKNetworkUpdate_ChannelClosed,
2379 * An error indicating only that a node has failed, which should be applied via
2380 * [`NetworkGraph::fail_node`].
2382 LDKNetworkUpdate_NodeFailure,
2384 * Must be last for serialization purposes
2386 LDKNetworkUpdate_Sentinel,
2387 } LDKNetworkUpdate_Tag;
2389 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
2391 * The update to apply via [`NetworkGraph::update_channel`].
2393 struct LDKChannelUpdate msg;
2394 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
2396 typedef struct LDKNetworkUpdate_LDKChannelClosed_Body {
2398 * The short channel id of the closed channel.
2400 uint64_t short_channel_id;
2402 * Whether the channel should be permanently removed or temporarily disabled until a new
2403 * `channel_update` message is received.
2406 } LDKNetworkUpdate_LDKChannelClosed_Body;
2408 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
2410 * The node id of the failed node.
2412 struct LDKPublicKey node_id;
2414 * Whether the node should be permanently removed from consideration or can be restored
2415 * when a new `channel_update` message is received.
2418 } LDKNetworkUpdate_LDKNodeFailure_Body;
2420 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
2421 LDKNetworkUpdate_Tag tag;
2423 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2424 LDKNetworkUpdate_LDKChannelClosed_Body channel_closed;
2425 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
2430 * An enum which can either contain a crate::lightning::routing::network_graph::NetworkUpdate or not
2432 typedef enum LDKCOption_NetworkUpdateZ_Tag {
2434 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::network_graph::NetworkUpdate
2436 LDKCOption_NetworkUpdateZ_Some,
2438 * When we're in this state, this COption_NetworkUpdateZ contains nothing
2440 LDKCOption_NetworkUpdateZ_None,
2442 * Must be last for serialization purposes
2444 LDKCOption_NetworkUpdateZ_Sentinel,
2445 } LDKCOption_NetworkUpdateZ_Tag;
2447 typedef struct LDKCOption_NetworkUpdateZ {
2448 LDKCOption_NetworkUpdateZ_Tag tag;
2451 struct LDKNetworkUpdate some;
2454 } LDKCOption_NetworkUpdateZ;
2459 * Information about a spendable output to a P2WSH script. See
2460 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
2462 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2464 * A pointer to the opaque Rust object.
2465 * Nearly everywhere, inner must be non-null, however in places where
2466 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2468 LDKnativeDelayedPaymentOutputDescriptor *inner;
2470 * Indicates that this is the only struct which contains the same pointer.
2471 * Rust functions which take ownership of an object provided via an argument require
2472 * this to be true and invalidate the object pointed to by inner.
2475 } LDKDelayedPaymentOutputDescriptor;
2480 * Information about a spendable output to our \"payment key\". See
2481 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
2483 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2485 * A pointer to the opaque Rust object.
2486 * Nearly everywhere, inner must be non-null, however in places where
2487 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2489 LDKnativeStaticPaymentOutputDescriptor *inner;
2491 * Indicates that this is the only struct which contains the same pointer.
2492 * Rust functions which take ownership of an object provided via an argument require
2493 * this to be true and invalidate the object pointed to by inner.
2496 } LDKStaticPaymentOutputDescriptor;
2499 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
2500 * claim at any point in the future) an event is generated which you must track and be able to
2501 * spend on-chain. The information needed to do this is provided in this enum, including the
2502 * outpoint describing which txid and output index is available, the full output which exists at
2503 * that txid/index, and any keys or other information required to sign.
2505 typedef enum LDKSpendableOutputDescriptor_Tag {
2507 * An output to a script which was provided via KeysInterface directly, either from
2508 * `get_destination_script()` or `get_shutdown_scriptpubkey()`, thus you should already know
2509 * how to spend it. No secret keys are provided as rust-lightning was never given any key.
2510 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2511 * on-chain using the payment preimage or after it has timed out.
2513 LDKSpendableOutputDescriptor_StaticOutput,
2515 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
2517 * The witness in the spending input should be:
2518 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2520 * Note that the nSequence field in the spending input must be set to to_self_delay
2521 * (which means the transaction is not broadcastable until at least to_self_delay
2522 * blocks after the outpoint confirms).
2524 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2525 * it is an output from an old state which we broadcast (which should never happen).
2527 * To derive the delayed_payment key which is used to sign for this input, you must pass the
2528 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
2529 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
2530 * chan_utils::derive_private_key. The public key can be generated without the secret key
2531 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
2534 * To derive the revocation_pubkey provided here (which is used in the witness
2535 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
2536 * call to Sign::ready_channel) and the provided per_commitment point
2537 * to chan_utils::derive_public_revocation_key.
2539 * The witness script which is hashed and included in the output script_pubkey may be
2540 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
2541 * (derived as above), and the to_self_delay contained here to
2542 * chan_utils::get_revokeable_redeemscript.
2544 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2546 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
2547 * corresponds to the public key in Sign::pubkeys().payment_point).
2548 * The witness in the spending input, is, thus, simply:
2549 * <BIP 143 signature> <payment key>
2551 * These are generally the result of our counterparty having broadcast the current state,
2552 * allowing us to claim the non-HTLC-encumbered outputs immediately.
2554 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2556 * Must be last for serialization purposes
2558 LDKSpendableOutputDescriptor_Sentinel,
2559 } LDKSpendableOutputDescriptor_Tag;
2561 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2563 * The outpoint which is spendable
2565 struct LDKOutPoint outpoint;
2567 * The output which is referenced by the given outpoint.
2569 struct LDKTxOut output;
2570 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2572 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2573 LDKSpendableOutputDescriptor_Tag tag;
2575 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2577 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2580 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2583 } LDKSpendableOutputDescriptor;
2586 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
2587 * This corresponds to std::vector in C++
2589 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2591 * The elements in the array.
2592 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2594 struct LDKSpendableOutputDescriptor *data;
2596 * The number of elements pointed to by `data`.
2599 } LDKCVec_SpendableOutputDescriptorZ;
2602 * Some information provided on receipt of payment depends on whether the payment received is a
2603 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
2605 typedef enum LDKPaymentPurpose_Tag {
2607 * Information for receiving a payment that we generated an invoice for.
2609 LDKPaymentPurpose_InvoicePayment,
2611 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
2612 * (the payee) providing a preimage.
2614 LDKPaymentPurpose_SpontaneousPayment,
2616 * Must be last for serialization purposes
2618 LDKPaymentPurpose_Sentinel,
2619 } LDKPaymentPurpose_Tag;
2621 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
2623 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2624 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2625 * [`ChannelManager::claim_funds`].
2627 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2628 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2630 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2632 struct LDKThirtyTwoBytes payment_preimage;
2634 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2635 * number of deanonymization attacks during the routing process.
2636 * It is provided here for your reference, however its accuracy is enforced directly by
2637 * [`ChannelManager`] using the values you previously provided to
2638 * [`ChannelManager::create_inbound_payment`] or
2639 * [`ChannelManager::create_inbound_payment_for_hash`].
2641 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2642 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2643 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2645 struct LDKThirtyTwoBytes payment_secret;
2646 } LDKPaymentPurpose_LDKInvoicePayment_Body;
2648 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
2649 LDKPaymentPurpose_Tag tag;
2651 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
2653 struct LDKThirtyTwoBytes spontaneous_payment;
2656 } LDKPaymentPurpose;
2659 * An Event which you should probably take some action in response to.
2661 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
2662 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
2663 * written as it makes no sense to respond to it after reconnecting to peers).
2665 typedef enum LDKEvent_Tag {
2667 * Used to indicate that the client should generate a funding transaction with the given
2668 * parameters and then call [`ChannelManager::funding_transaction_generated`].
2669 * Generated in [`ChannelManager`] message handling.
2670 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
2671 * counterparty can steal your funds!
2673 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2674 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2676 LDKEvent_FundingGenerationReady,
2678 * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
2679 * [`ChannelManager::claim_funds`] to get it....
2680 * Note that if the preimage is not known, you should call
2681 * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
2682 * network congestion.
2683 * If you fail to call either [`ChannelManager::claim_funds`] or
2684 * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
2685 * automatically failed.
2688 * LDK will not stop an inbound payment from being paid multiple times, so multiple
2689 * `PaymentReceived` events may be generated for the same payment.
2691 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2692 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
2694 LDKEvent_PaymentReceived,
2696 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
2697 * and we got back the payment preimage for it).
2699 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
2700 * event. In this situation, you SHOULD treat this payment as having succeeded.
2702 LDKEvent_PaymentSent,
2704 * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped
2705 * something. You may wish to retry with a different route.
2707 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
2708 * [`Event::PaymentFailed`] and [`all_paths_failed`].
2710 * [`all_paths_failed`]: Self::all_paths_failed
2712 LDKEvent_PaymentPathFailed,
2714 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
2715 * provide failure information for each MPP part in the payment.
2717 * This event is provided once there are no further pending HTLCs for the payment and the
2718 * payment is no longer retryable, either due to a several-block timeout or because
2719 * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment.
2721 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2723 LDKEvent_PaymentFailed,
2725 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
2726 * a time in the future.
2728 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
2730 LDKEvent_PendingHTLCsForwardable,
2732 * Used to indicate that an output which you should know how to spend was confirmed on chain
2733 * and is now spendable.
2734 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
2735 * counterparty spending them due to some kind of timeout. Thus, you need to store them
2736 * somewhere and spend them when you create on-chain transactions.
2738 LDKEvent_SpendableOutputs,
2740 * This event is generated when a payment has been successfully forwarded through us and a
2741 * forwarding fee earned.
2743 LDKEvent_PaymentForwarded,
2745 * Used to indicate that a channel with the given `channel_id` is in the process of closure.
2747 LDKEvent_ChannelClosed,
2749 * Used to indicate to the user that they can abandon the funding transaction and recycle the
2750 * inputs for another purpose.
2752 LDKEvent_DiscardFunding,
2754 * Indicates that a path for an outbound payment was successful.
2756 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
2757 * [`Event::PaymentSent`] for obtaining the payment preimage.
2759 LDKEvent_PaymentPathSuccessful,
2761 * Must be last for serialization purposes
2766 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
2768 * The random channel_id we picked which you'll need to pass into
2769 * ChannelManager::funding_transaction_generated.
2771 struct LDKThirtyTwoBytes temporary_channel_id;
2773 * The value, in satoshis, that the output should have.
2775 uint64_t channel_value_satoshis;
2777 * The script which should be used in the transaction output.
2779 struct LDKCVec_u8Z output_script;
2781 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
2782 * an inbound channel.
2784 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
2786 uint64_t user_channel_id;
2787 } LDKEvent_LDKFundingGenerationReady_Body;
2789 typedef struct LDKEvent_LDKPaymentReceived_Body {
2791 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
2792 * not stop you from registering duplicate payment hashes for inbound payments.
2794 struct LDKThirtyTwoBytes payment_hash;
2796 * The value, in thousandths of a satoshi, that this payment is for.
2800 * Information for claiming this received payment, based on whether the purpose of the
2801 * payment is to pay an invoice or to send a spontaneous payment.
2803 struct LDKPaymentPurpose purpose;
2804 } LDKEvent_LDKPaymentReceived_Body;
2806 typedef struct LDKEvent_LDKPaymentSent_Body {
2808 * The id returned by [`ChannelManager::send_payment`] and used with
2809 * [`ChannelManager::retry_payment`].
2811 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2812 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
2814 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2816 struct LDKThirtyTwoBytes payment_id;
2818 * The preimage to the hash given to ChannelManager::send_payment.
2819 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
2822 struct LDKThirtyTwoBytes payment_preimage;
2824 * The hash that was given to [`ChannelManager::send_payment`].
2826 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2828 struct LDKThirtyTwoBytes payment_hash;
2830 * The total fee which was spent at intermediate hops in this payment, across all paths.
2832 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
2833 * overpayment to the recipient node.
2835 * If the recipient or an intermediate node misbehaves and gives us free money, this may
2836 * overstate the amount paid, though this is unlikely.
2838 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
2840 struct LDKCOption_u64Z fee_paid_msat;
2841 } LDKEvent_LDKPaymentSent_Body;
2843 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
2845 * The id returned by [`ChannelManager::send_payment`] and used with
2846 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
2848 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2849 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
2850 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2852 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2854 struct LDKThirtyTwoBytes payment_id;
2856 * The hash that was given to [`ChannelManager::send_payment`].
2858 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2860 struct LDKThirtyTwoBytes payment_hash;
2862 * Indicates the payment was rejected for some reason by the recipient. This implies that
2863 * the payment has failed, not just the route in question. If this is not set, you may
2864 * retry the payment via a different route.
2866 bool rejected_by_dest;
2868 * Any failure information conveyed via the Onion return packet by a node along the failed
2871 * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
2872 * account the update. [`NetGraphMsgHandler`] is capable of doing this.
2874 * [`NetworkGraph`]: crate::routing::network_graph::NetworkGraph
2875 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
2877 struct LDKCOption_NetworkUpdateZ network_update;
2879 * For both single-path and multi-path payments, this is set if all paths of the payment have
2880 * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
2881 * larger MPP payment were still in flight when this event was generated.
2883 * Note that if you are retrying individual MPP parts, using this value to determine if a
2884 * payment has fully failed is race-y. Because multiple failures can happen prior to events
2885 * being processed, you may retry in response to a first failure, with a second failure
2886 * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
2887 * you will see `all_paths_failed` set even though the retry of the first failure still
2888 * has an associated in-flight HTLC. See (1) for an example of such a failure.
2890 * If you wish to retry individual MPP parts and learn when a payment has failed, you must
2891 * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
2893 * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
2895 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2897 bool all_paths_failed;
2899 * The payment path that failed.
2901 struct LDKCVec_RouteHopZ path;
2903 * The channel responsible for the failed payment path.
2905 * If this is `Some`, then the corresponding channel should be avoided when the payment is
2906 * retried. May be `None` for older [`Event`] serializations.
2908 struct LDKCOption_u64Z short_channel_id;
2910 * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
2912 * See [`find_route`] for details.
2914 * [`Route`]: crate::routing::router::Route
2915 * [`find_route`]: crate::routing::router::find_route
2917 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2919 struct LDKRouteParameters retry;
2920 } LDKEvent_LDKPaymentPathFailed_Body;
2922 typedef struct LDKEvent_LDKPaymentFailed_Body {
2924 * The id returned by [`ChannelManager::send_payment`] and used with
2925 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
2927 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2928 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
2929 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2931 struct LDKThirtyTwoBytes payment_id;
2933 * The hash that was given to [`ChannelManager::send_payment`].
2935 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
2937 struct LDKThirtyTwoBytes payment_hash;
2938 } LDKEvent_LDKPaymentFailed_Body;
2940 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
2942 * The minimum amount of time that should be waited prior to calling
2943 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
2944 * you should wait a random amount of time in roughly the range (now + time_forwardable,
2945 * now + 5*time_forwardable).
2947 uint64_t time_forwardable;
2948 } LDKEvent_LDKPendingHTLCsForwardable_Body;
2950 typedef struct LDKEvent_LDKSpendableOutputs_Body {
2952 * The outputs which you should store as spendable by you.
2954 struct LDKCVec_SpendableOutputDescriptorZ outputs;
2955 } LDKEvent_LDKSpendableOutputs_Body;
2957 typedef struct LDKEvent_LDKPaymentForwarded_Body {
2959 * The fee, in milli-satoshis, which was earned as a result of the payment.
2961 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
2962 * was pending, the amount the next hop claimed will have been rounded down to the nearest
2963 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
2964 * claimed the full value in millisatoshis from the source. In this case,
2965 * `claim_from_onchain_tx` will be set.
2967 * If the channel which sent us the payment has been force-closed, we will claim the funds
2968 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
2969 * fees which we will spend and will instead set this to `None`. It is possible duplicate
2970 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
2973 struct LDKCOption_u64Z fee_earned_msat;
2975 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
2978 bool claim_from_onchain_tx;
2979 } LDKEvent_LDKPaymentForwarded_Body;
2981 typedef struct LDKEvent_LDKChannelClosed_Body {
2983 * The channel_id of the channel which has been closed. Note that on-chain transactions
2984 * resolving the channel are likely still awaiting confirmation.
2986 struct LDKThirtyTwoBytes channel_id;
2988 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
2989 * an inbound channel. This will always be zero for objects serialized with LDK versions
2992 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
2994 uint64_t user_channel_id;
2996 * The reason the channel was closed.
2998 struct LDKClosureReason reason;
2999 } LDKEvent_LDKChannelClosed_Body;
3001 typedef struct LDKEvent_LDKDiscardFunding_Body {
3003 * The channel_id of the channel which has been closed.
3005 struct LDKThirtyTwoBytes channel_id;
3007 * The full transaction received from the user
3009 struct LDKTransaction transaction;
3010 } LDKEvent_LDKDiscardFunding_Body;
3012 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
3014 * The id returned by [`ChannelManager::send_payment`] and used with
3015 * [`ChannelManager::retry_payment`].
3017 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3018 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3020 struct LDKThirtyTwoBytes payment_id;
3022 * The hash that was given to [`ChannelManager::send_payment`].
3024 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3026 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3028 struct LDKThirtyTwoBytes payment_hash;
3030 * The payment path that was successful.
3032 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
3034 struct LDKCVec_RouteHopZ path;
3035 } LDKEvent_LDKPaymentPathSuccessful_Body;
3037 typedef struct MUST_USE_STRUCT LDKEvent {
3040 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
3041 LDKEvent_LDKPaymentReceived_Body payment_received;
3042 LDKEvent_LDKPaymentSent_Body payment_sent;
3043 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
3044 LDKEvent_LDKPaymentFailed_Body payment_failed;
3045 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
3046 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
3047 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
3048 LDKEvent_LDKChannelClosed_Body channel_closed;
3049 LDKEvent_LDKDiscardFunding_Body discard_funding;
3050 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
3055 * An enum which can either contain a crate::lightning::util::events::Event or not
3057 typedef enum LDKCOption_EventZ_Tag {
3059 * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event
3061 LDKCOption_EventZ_Some,
3063 * When we're in this state, this COption_EventZ contains nothing
3065 LDKCOption_EventZ_None,
3067 * Must be last for serialization purposes
3069 LDKCOption_EventZ_Sentinel,
3070 } LDKCOption_EventZ_Tag;
3072 typedef struct LDKCOption_EventZ {
3073 LDKCOption_EventZ_Tag tag;
3076 struct LDKEvent some;
3079 } LDKCOption_EventZ;
3082 * The contents of CResult_COption_EventZDecodeErrorZ
3084 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
3086 * A pointer to the contents in the success state.
3087 * Reading from this pointer when `result_ok` is not set is undefined.
3089 struct LDKCOption_EventZ *result;
3091 * A pointer to the contents in the error state.
3092 * Reading from this pointer when `result_ok` is set is undefined.
3094 struct LDKDecodeError *err;
3095 } LDKCResult_COption_EventZDecodeErrorZPtr;
3098 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
3099 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3100 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3102 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
3104 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
3105 * `err` or `result` depending on the state of `result_ok`.
3107 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
3109 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
3112 } LDKCResult_COption_EventZDecodeErrorZ;
3117 * An accept_channel message to be sent or received from a peer
3119 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3121 * A pointer to the opaque Rust object.
3122 * Nearly everywhere, inner must be non-null, however in places where
3123 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3125 LDKnativeAcceptChannel *inner;
3127 * Indicates that this is the only struct which contains the same pointer.
3128 * Rust functions which take ownership of an object provided via an argument require
3129 * this to be true and invalidate the object pointed to by inner.
3137 * An open_channel message to be sent or received from a peer
3139 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3141 * A pointer to the opaque Rust object.
3142 * Nearly everywhere, inner must be non-null, however in places where
3143 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3145 LDKnativeOpenChannel *inner;
3147 * Indicates that this is the only struct which contains the same pointer.
3148 * Rust functions which take ownership of an object provided via an argument require
3149 * this to be true and invalidate the object pointed to by inner.
3157 * A funding_created message to be sent or received from a peer
3159 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3161 * A pointer to the opaque Rust object.
3162 * Nearly everywhere, inner must be non-null, however in places where
3163 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3165 LDKnativeFundingCreated *inner;
3167 * Indicates that this is the only struct which contains the same pointer.
3168 * Rust functions which take ownership of an object provided via an argument require
3169 * this to be true and invalidate the object pointed to by inner.
3172 } LDKFundingCreated;
3177 * A funding_signed message to be sent or received from a peer
3179 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3181 * A pointer to the opaque Rust object.
3182 * Nearly everywhere, inner must be non-null, however in places where
3183 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3185 LDKnativeFundingSigned *inner;
3187 * Indicates that this is the only struct which contains the same pointer.
3188 * Rust functions which take ownership of an object provided via an argument require
3189 * this to be true and invalidate the object pointed to by inner.
3197 * A funding_locked message to be sent or received from a peer
3199 typedef struct MUST_USE_STRUCT LDKFundingLocked {
3201 * A pointer to the opaque Rust object.
3202 * Nearly everywhere, inner must be non-null, however in places where
3203 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3205 LDKnativeFundingLocked *inner;
3207 * Indicates that this is the only struct which contains the same pointer.
3208 * Rust functions which take ownership of an object provided via an argument require
3209 * this to be true and invalidate the object pointed to by inner.
3217 * An announcement_signatures message to be sent or received from a peer
3219 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3221 * A pointer to the opaque Rust object.
3222 * Nearly everywhere, inner must be non-null, however in places where
3223 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3225 LDKnativeAnnouncementSignatures *inner;
3227 * Indicates that this is the only struct which contains the same pointer.
3228 * Rust functions which take ownership of an object provided via an argument require
3229 * this to be true and invalidate the object pointed to by inner.
3232 } LDKAnnouncementSignatures;
3237 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3238 * transaction updates if they were pending.
3240 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3242 * A pointer to the opaque Rust object.
3243 * Nearly everywhere, inner must be non-null, however in places where
3244 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3246 LDKnativeCommitmentUpdate *inner;
3248 * Indicates that this is the only struct which contains the same pointer.
3249 * Rust functions which take ownership of an object provided via an argument require
3250 * this to be true and invalidate the object pointed to by inner.
3253 } LDKCommitmentUpdate;
3258 * A revoke_and_ack message to be sent or received from a peer
3260 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
3262 * A pointer to the opaque Rust object.
3263 * Nearly everywhere, inner must be non-null, however in places where
3264 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3266 LDKnativeRevokeAndACK *inner;
3268 * Indicates that this is the only struct which contains the same pointer.
3269 * Rust functions which take ownership of an object provided via an argument require
3270 * this to be true and invalidate the object pointed to by inner.
3278 * A closing_signed message to be sent or received from a peer
3280 typedef struct MUST_USE_STRUCT LDKClosingSigned {
3282 * A pointer to the opaque Rust object.
3283 * Nearly everywhere, inner must be non-null, however in places where
3284 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3286 LDKnativeClosingSigned *inner;
3288 * Indicates that this is the only struct which contains the same pointer.
3289 * Rust functions which take ownership of an object provided via an argument require
3290 * this to be true and invalidate the object pointed to by inner.
3298 * A shutdown message to be sent or received from a peer
3300 typedef struct MUST_USE_STRUCT LDKShutdown {
3302 * A pointer to the opaque Rust object.
3303 * Nearly everywhere, inner must be non-null, however in places where
3304 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3306 LDKnativeShutdown *inner;
3308 * Indicates that this is the only struct which contains the same pointer.
3309 * Rust functions which take ownership of an object provided via an argument require
3310 * this to be true and invalidate the object pointed to by inner.
3318 * A channel_reestablish message to be sent or received from a peer
3320 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
3322 * A pointer to the opaque Rust object.
3323 * Nearly everywhere, inner must be non-null, however in places where
3324 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3326 LDKnativeChannelReestablish *inner;
3328 * Indicates that this is the only struct which contains the same pointer.
3329 * Rust functions which take ownership of an object provided via an argument require
3330 * this to be true and invalidate the object pointed to by inner.
3333 } LDKChannelReestablish;
3338 * A channel_announcement message to be sent or received from a peer
3340 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
3342 * A pointer to the opaque Rust object.
3343 * Nearly everywhere, inner must be non-null, however in places where
3344 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3346 LDKnativeChannelAnnouncement *inner;
3348 * Indicates that this is the only struct which contains the same pointer.
3349 * Rust functions which take ownership of an object provided via an argument require
3350 * this to be true and invalidate the object pointed to by inner.
3353 } LDKChannelAnnouncement;
3358 * A node_announcement message to be sent or received from a peer
3360 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
3362 * A pointer to the opaque Rust object.
3363 * Nearly everywhere, inner must be non-null, however in places where
3364 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3366 LDKnativeNodeAnnouncement *inner;
3368 * Indicates that this is the only struct which contains the same pointer.
3369 * Rust functions which take ownership of an object provided via an argument require
3370 * this to be true and invalidate the object pointed to by inner.
3373 } LDKNodeAnnouncement;
3378 * An error message to be sent or received from a peer
3380 typedef struct MUST_USE_STRUCT LDKErrorMessage {
3382 * A pointer to the opaque Rust object.
3383 * Nearly everywhere, inner must be non-null, however in places where
3384 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3386 LDKnativeErrorMessage *inner;
3388 * Indicates that this is the only struct which contains the same pointer.
3389 * Rust functions which take ownership of an object provided via an argument require
3390 * this to be true and invalidate the object pointed to by inner.
3396 * Used to put an error message in a LightningError
3398 typedef enum LDKErrorAction_Tag {
3400 * The peer took some action which made us think they were useless. Disconnect them.
3402 LDKErrorAction_DisconnectPeer,
3404 * The peer did something harmless that we weren't able to process, just log and ignore
3406 LDKErrorAction_IgnoreError,
3408 * The peer did something harmless that we weren't able to meaningfully process.
3409 * If the error is logged, log it at the given level.
3411 LDKErrorAction_IgnoreAndLog,
3413 * The peer provided us with a gossip message which we'd already seen. In most cases this
3414 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
3415 * our own channel announcements.
3417 LDKErrorAction_IgnoreDuplicateGossip,
3419 * The peer did something incorrect. Tell them.
3421 LDKErrorAction_SendErrorMessage,
3423 * Must be last for serialization purposes
3425 LDKErrorAction_Sentinel,
3426 } LDKErrorAction_Tag;
3428 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
3430 * An error message which we should make an effort to send before we disconnect.
3432 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3434 struct LDKErrorMessage msg;
3435 } LDKErrorAction_LDKDisconnectPeer_Body;
3437 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
3439 * The message to send.
3441 struct LDKErrorMessage msg;
3442 } LDKErrorAction_LDKSendErrorMessage_Body;
3444 typedef struct MUST_USE_STRUCT LDKErrorAction {
3445 LDKErrorAction_Tag tag;
3447 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
3449 enum LDKLevel ignore_and_log;
3451 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
3458 * A query_channel_range message is used to query a peer for channel
3459 * UTXOs in a range of blocks. The recipient of a query makes a best
3460 * effort to reply to the query using one or more reply_channel_range
3463 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3465 * A pointer to the opaque Rust object.
3466 * Nearly everywhere, inner must be non-null, however in places where
3467 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3469 LDKnativeQueryChannelRange *inner;
3471 * Indicates that this is the only struct which contains the same pointer.
3472 * Rust functions which take ownership of an object provided via an argument require
3473 * this to be true and invalidate the object pointed to by inner.
3476 } LDKQueryChannelRange;
3481 * A query_short_channel_ids message is used to query a peer for
3482 * routing gossip messages related to one or more short_channel_ids.
3483 * The query recipient will reply with the latest, if available,
3484 * channel_announcement, channel_update and node_announcement messages
3485 * it maintains for the requested short_channel_ids followed by a
3486 * reply_short_channel_ids_end message. The short_channel_ids sent in
3487 * this query are encoded. We only support encoding_type=0 uncompressed
3488 * serialization and do not support encoding_type=1 zlib serialization.
3490 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
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.
3496 LDKnativeQueryShortChannelIds *inner;
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.
3503 } LDKQueryShortChannelIds;
3508 * A reply_channel_range message is a reply to a query_channel_range
3509 * message. Multiple reply_channel_range messages can be sent in reply
3510 * to a single query_channel_range message. The query recipient makes a
3511 * best effort to respond based on their local network view which may
3512 * not be a perfect view of the network. The short_channel_ids in the
3513 * reply are encoded. We only support encoding_type=0 uncompressed
3514 * serialization and do not support encoding_type=1 zlib serialization.
3516 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3518 * A pointer to the opaque Rust object.
3519 * Nearly everywhere, inner must be non-null, however in places where
3520 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3522 LDKnativeReplyChannelRange *inner;
3524 * Indicates that this is the only struct which contains the same pointer.
3525 * Rust functions which take ownership of an object provided via an argument require
3526 * this to be true and invalidate the object pointed to by inner.
3529 } LDKReplyChannelRange;
3532 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3533 * broadcast to most peers).
3534 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3536 typedef enum LDKMessageSendEvent_Tag {
3538 * Used to indicate that we've accepted a channel open and should send the accept_channel
3539 * message provided to the given peer.
3541 LDKMessageSendEvent_SendAcceptChannel,
3543 * Used to indicate that we've initiated a channel open and should send the open_channel
3544 * message provided to the given peer.
3546 LDKMessageSendEvent_SendOpenChannel,
3548 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3550 LDKMessageSendEvent_SendFundingCreated,
3552 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3554 LDKMessageSendEvent_SendFundingSigned,
3556 * Used to indicate that a funding_locked message should be sent to the peer with the given node_id.
3558 LDKMessageSendEvent_SendFundingLocked,
3560 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3562 LDKMessageSendEvent_SendAnnouncementSignatures,
3564 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3565 * message should be sent to the peer with the given node_id.
3567 LDKMessageSendEvent_UpdateHTLCs,
3569 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
3571 LDKMessageSendEvent_SendRevokeAndACK,
3573 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
3575 LDKMessageSendEvent_SendClosingSigned,
3577 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
3579 LDKMessageSendEvent_SendShutdown,
3581 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
3583 LDKMessageSendEvent_SendChannelReestablish,
3585 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
3586 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
3588 * Note that after doing so, you very likely (unless you did so very recently) want to call
3589 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
3590 * This ensures that any nodes which see our channel_announcement also have a relevant
3591 * node_announcement, including relevant feature flags which may be important for routing
3594 LDKMessageSendEvent_BroadcastChannelAnnouncement,
3596 * Used to indicate that a node_announcement should be broadcast to all peers.
3598 LDKMessageSendEvent_BroadcastNodeAnnouncement,
3600 * Used to indicate that a channel_update should be broadcast to all peers.
3602 LDKMessageSendEvent_BroadcastChannelUpdate,
3604 * Used to indicate that a channel_update should be sent to a single peer.
3605 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
3606 * private channel and we shouldn't be informing all of our peers of channel parameters.
3608 LDKMessageSendEvent_SendChannelUpdate,
3610 * Broadcast an error downstream to be handled
3612 LDKMessageSendEvent_HandleError,
3614 * Query a peer for channels with funding transaction UTXOs in a block range.
3616 LDKMessageSendEvent_SendChannelRangeQuery,
3618 * Request routing gossip messages from a peer for a list of channels identified by
3619 * their short_channel_ids.
3621 LDKMessageSendEvent_SendShortIdsQuery,
3623 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
3624 * emitted during processing of the query.
3626 LDKMessageSendEvent_SendReplyChannelRange,
3628 * Must be last for serialization purposes
3630 LDKMessageSendEvent_Sentinel,
3631 } LDKMessageSendEvent_Tag;
3633 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
3635 * The node_id of the node which should receive this message
3637 struct LDKPublicKey node_id;
3639 * The message which should be sent.
3641 struct LDKAcceptChannel msg;
3642 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
3644 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
3646 * The node_id of the node which should receive this message
3648 struct LDKPublicKey node_id;
3650 * The message which should be sent.
3652 struct LDKOpenChannel msg;
3653 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
3655 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
3657 * The node_id of the node which should receive this message
3659 struct LDKPublicKey node_id;
3661 * The message which should be sent.
3663 struct LDKFundingCreated msg;
3664 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
3666 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
3668 * The node_id of the node which should receive this message
3670 struct LDKPublicKey node_id;
3672 * The message which should be sent.
3674 struct LDKFundingSigned msg;
3675 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
3677 typedef struct LDKMessageSendEvent_LDKSendFundingLocked_Body {
3679 * The node_id of the node which should receive these message(s)
3681 struct LDKPublicKey node_id;
3683 * The funding_locked message which should be sent.
3685 struct LDKFundingLocked msg;
3686 } LDKMessageSendEvent_LDKSendFundingLocked_Body;
3688 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
3690 * The node_id of the node which should receive these message(s)
3692 struct LDKPublicKey node_id;
3694 * The announcement_signatures message which should be sent.
3696 struct LDKAnnouncementSignatures msg;
3697 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
3699 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
3701 * The node_id of the node which should receive these message(s)
3703 struct LDKPublicKey node_id;
3705 * The update messages which should be sent. ALL messages in the struct should be sent!
3707 struct LDKCommitmentUpdate updates;
3708 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
3710 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
3712 * The node_id of the node which should receive this message
3714 struct LDKPublicKey node_id;
3716 * The message which should be sent.
3718 struct LDKRevokeAndACK msg;
3719 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
3721 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
3723 * The node_id of the node which should receive this message
3725 struct LDKPublicKey node_id;
3727 * The message which should be sent.
3729 struct LDKClosingSigned msg;
3730 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
3732 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
3734 * The node_id of the node which should receive this message
3736 struct LDKPublicKey node_id;
3738 * The message which should be sent.
3740 struct LDKShutdown msg;
3741 } LDKMessageSendEvent_LDKSendShutdown_Body;
3743 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
3745 * The node_id of the node which should receive this message
3747 struct LDKPublicKey node_id;
3749 * The message which should be sent.
3751 struct LDKChannelReestablish msg;
3752 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
3754 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
3756 * The channel_announcement which should be sent.
3758 struct LDKChannelAnnouncement msg;
3760 * The followup channel_update which should be sent.
3762 struct LDKChannelUpdate update_msg;
3763 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
3765 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
3767 * The node_announcement which should be sent.
3769 struct LDKNodeAnnouncement msg;
3770 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
3772 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
3774 * The channel_update which should be sent.
3776 struct LDKChannelUpdate msg;
3777 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
3779 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
3781 * The node_id of the node which should receive this message
3783 struct LDKPublicKey node_id;
3785 * The channel_update which should be sent.
3787 struct LDKChannelUpdate msg;
3788 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
3790 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
3792 * The node_id of the node which should receive this message
3794 struct LDKPublicKey node_id;
3796 * The action which should be taken.
3798 struct LDKErrorAction action;
3799 } LDKMessageSendEvent_LDKHandleError_Body;
3801 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
3803 * The node_id of this message recipient
3805 struct LDKPublicKey node_id;
3807 * The query_channel_range which should be sent.
3809 struct LDKQueryChannelRange msg;
3810 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
3812 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
3814 * The node_id of this message recipient
3816 struct LDKPublicKey node_id;
3818 * The query_short_channel_ids which should be sent.
3820 struct LDKQueryShortChannelIds msg;
3821 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
3823 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
3825 * The node_id of this message recipient
3827 struct LDKPublicKey node_id;
3829 * The reply_channel_range which should be sent.
3831 struct LDKReplyChannelRange msg;
3832 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
3834 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
3835 LDKMessageSendEvent_Tag tag;
3837 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
3838 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
3839 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
3840 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
3841 LDKMessageSendEvent_LDKSendFundingLocked_Body send_funding_locked;
3842 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
3843 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
3844 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
3845 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
3846 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
3847 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
3848 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
3849 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
3850 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
3851 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
3852 LDKMessageSendEvent_LDKHandleError_Body handle_error;
3853 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
3854 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
3855 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
3857 } LDKMessageSendEvent;
3860 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
3861 * This corresponds to std::vector in C++
3863 typedef struct LDKCVec_MessageSendEventZ {
3865 * The elements in the array.
3866 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3868 struct LDKMessageSendEvent *data;
3870 * The number of elements pointed to by `data`.
3873 } LDKCVec_MessageSendEventZ;
3878 * Parameters for configuring [`Scorer`].
3880 typedef struct MUST_USE_STRUCT LDKScoringParameters {
3882 * A pointer to the opaque Rust object.
3883 * Nearly everywhere, inner must be non-null, however in places where
3884 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3886 LDKnativeScoringParameters *inner;
3888 * Indicates that this is the only struct which contains the same pointer.
3889 * Rust functions which take ownership of an object provided via an argument require
3890 * this to be true and invalidate the object pointed to by inner.
3893 } LDKScoringParameters;
3896 * The contents of CResult_ScoringParametersDecodeErrorZ
3898 typedef union LDKCResult_ScoringParametersDecodeErrorZPtr {
3900 * A pointer to the contents in the success state.
3901 * Reading from this pointer when `result_ok` is not set is undefined.
3903 struct LDKScoringParameters *result;
3905 * A pointer to the contents in the error state.
3906 * Reading from this pointer when `result_ok` is set is undefined.
3908 struct LDKDecodeError *err;
3909 } LDKCResult_ScoringParametersDecodeErrorZPtr;
3912 * A CResult_ScoringParametersDecodeErrorZ represents the result of a fallible operation,
3913 * containing a crate::lightning::routing::scoring::ScoringParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
3914 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3916 typedef struct LDKCResult_ScoringParametersDecodeErrorZ {
3918 * The contents of this CResult_ScoringParametersDecodeErrorZ, accessible via either
3919 * `err` or `result` depending on the state of `result_ok`.
3921 union LDKCResult_ScoringParametersDecodeErrorZPtr contents;
3923 * Whether this CResult_ScoringParametersDecodeErrorZ represents a success state.
3926 } LDKCResult_ScoringParametersDecodeErrorZ;
3931 * [`Score`] implementation that provides reasonable default behavior.
3933 * Used to apply a fixed penalty to each channel, thus avoiding long paths when shorter paths with
3934 * slightly higher fees are available. Will further penalize channels that fail to relay payments.
3936 * See [module-level documentation] for usage.
3938 * [module-level documentation]: crate::routing::scoring
3940 typedef struct MUST_USE_STRUCT LDKScorer {
3942 * A pointer to the opaque Rust object.
3943 * Nearly everywhere, inner must be non-null, however in places where
3944 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3946 LDKnativeScorer *inner;
3948 * Indicates that this is the only struct which contains the same pointer.
3949 * Rust functions which take ownership of an object provided via an argument require
3950 * this to be true and invalidate the object pointed to by inner.
3956 * The contents of CResult_ScorerDecodeErrorZ
3958 typedef union LDKCResult_ScorerDecodeErrorZPtr {
3960 * A pointer to the contents in the success state.
3961 * Reading from this pointer when `result_ok` is not set is undefined.
3963 struct LDKScorer *result;
3965 * A pointer to the contents in the error state.
3966 * Reading from this pointer when `result_ok` is set is undefined.
3968 struct LDKDecodeError *err;
3969 } LDKCResult_ScorerDecodeErrorZPtr;
3972 * A CResult_ScorerDecodeErrorZ represents the result of a fallible operation,
3973 * containing a crate::lightning::routing::scoring::Scorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
3974 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3976 typedef struct LDKCResult_ScorerDecodeErrorZ {
3978 * The contents of this CResult_ScorerDecodeErrorZ, accessible via either
3979 * `err` or `result` depending on the state of `result_ok`.
3981 union LDKCResult_ScorerDecodeErrorZPtr contents;
3983 * Whether this CResult_ScorerDecodeErrorZ represents a success state.
3986 } LDKCResult_ScorerDecodeErrorZ;
3991 * Features used within an `init` message.
3993 typedef struct MUST_USE_STRUCT LDKInitFeatures {
3995 * A pointer to the opaque Rust object.
3996 * Nearly everywhere, inner must be non-null, however in places where
3997 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3999 LDKnativeInitFeatures *inner;
4001 * Indicates that this is the only struct which contains the same pointer.
4002 * Rust functions which take ownership of an object provided via an argument require
4003 * this to be true and invalidate the object pointed to by inner.
4009 * The contents of CResult_InitFeaturesDecodeErrorZ
4011 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4013 * A pointer to the contents in the success state.
4014 * Reading from this pointer when `result_ok` is not set is undefined.
4016 struct LDKInitFeatures *result;
4018 * A pointer to the contents in the error state.
4019 * Reading from this pointer when `result_ok` is set is undefined.
4021 struct LDKDecodeError *err;
4022 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4025 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4026 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4027 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4029 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4031 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4032 * `err` or `result` depending on the state of `result_ok`.
4034 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4036 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4039 } LDKCResult_InitFeaturesDecodeErrorZ;
4044 * Features used within a `channel_announcement` message.
4046 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4048 * A pointer to the opaque Rust object.
4049 * Nearly everywhere, inner must be non-null, however in places where
4050 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4052 LDKnativeChannelFeatures *inner;
4054 * Indicates that this is the only struct which contains the same pointer.
4055 * Rust functions which take ownership of an object provided via an argument require
4056 * this to be true and invalidate the object pointed to by inner.
4059 } LDKChannelFeatures;
4062 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4064 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4066 * A pointer to the contents in the success state.
4067 * Reading from this pointer when `result_ok` is not set is undefined.
4069 struct LDKChannelFeatures *result;
4071 * A pointer to the contents in the error state.
4072 * Reading from this pointer when `result_ok` is set is undefined.
4074 struct LDKDecodeError *err;
4075 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4078 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4079 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4080 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4082 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4084 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4085 * `err` or `result` depending on the state of `result_ok`.
4087 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4089 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4092 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4097 * Features used within a `node_announcement` message.
4099 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4101 * A pointer to the opaque Rust object.
4102 * Nearly everywhere, inner must be non-null, however in places where
4103 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4105 LDKnativeNodeFeatures *inner;
4107 * Indicates that this is the only struct which contains the same pointer.
4108 * Rust functions which take ownership of an object provided via an argument require
4109 * this to be true and invalidate the object pointed to by inner.
4115 * The contents of CResult_NodeFeaturesDecodeErrorZ
4117 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4119 * A pointer to the contents in the success state.
4120 * Reading from this pointer when `result_ok` is not set is undefined.
4122 struct LDKNodeFeatures *result;
4124 * A pointer to the contents in the error state.
4125 * Reading from this pointer when `result_ok` is set is undefined.
4127 struct LDKDecodeError *err;
4128 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4131 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4132 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4133 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4135 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4137 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4138 * `err` or `result` depending on the state of `result_ok`.
4140 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4142 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4145 } LDKCResult_NodeFeaturesDecodeErrorZ;
4150 * Features used within an invoice.
4152 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
4154 * A pointer to the opaque Rust object.
4155 * Nearly everywhere, inner must be non-null, however in places where
4156 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4158 LDKnativeInvoiceFeatures *inner;
4160 * Indicates that this is the only struct which contains the same pointer.
4161 * Rust functions which take ownership of an object provided via an argument require
4162 * this to be true and invalidate the object pointed to by inner.
4165 } LDKInvoiceFeatures;
4168 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
4170 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
4172 * A pointer to the contents in the success state.
4173 * Reading from this pointer when `result_ok` is not set is undefined.
4175 struct LDKInvoiceFeatures *result;
4177 * A pointer to the contents in the error state.
4178 * Reading from this pointer when `result_ok` is set is undefined.
4180 struct LDKDecodeError *err;
4181 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
4184 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4185 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4186 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4188 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
4190 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
4191 * `err` or `result` depending on the state of `result_ok`.
4193 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
4195 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
4198 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
4203 * Features used within the channel_type field in an OpenChannel message.
4205 * A channel is always of some known \"type\", describing the transaction formats used and the exact
4206 * semantics of our interaction with our peer.
4208 * Note that because a channel is a specific type which is proposed by the opener and accepted by
4209 * the counterparty, only required features are allowed here.
4211 * This is serialized differently from other feature types - it is not prefixed by a length, and
4212 * thus must only appear inside a TLV where its length is known in advance.
4214 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
4216 * A pointer to the opaque Rust object.
4217 * Nearly everywhere, inner must be non-null, however in places where
4218 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4220 LDKnativeChannelTypeFeatures *inner;
4222 * Indicates that this is the only struct which contains the same pointer.
4223 * Rust functions which take ownership of an object provided via an argument require
4224 * this to be true and invalidate the object pointed to by inner.
4227 } LDKChannelTypeFeatures;
4230 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
4232 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
4234 * A pointer to the contents in the success state.
4235 * Reading from this pointer when `result_ok` is not set is undefined.
4237 struct LDKChannelTypeFeatures *result;
4239 * A pointer to the contents in the error state.
4240 * Reading from this pointer when `result_ok` is set is undefined.
4242 struct LDKDecodeError *err;
4243 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
4246 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
4247 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4248 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4250 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
4252 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
4253 * `err` or `result` depending on the state of `result_ok`.
4255 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
4257 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
4260 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
4263 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
4265 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
4267 * A pointer to the contents in the success state.
4268 * Reading from this pointer when `result_ok` is not set is undefined.
4270 struct LDKDelayedPaymentOutputDescriptor *result;
4272 * A pointer to the contents in the error state.
4273 * Reading from this pointer when `result_ok` is set is undefined.
4275 struct LDKDecodeError *err;
4276 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
4279 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
4280 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
4281 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4283 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
4285 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
4286 * `err` or `result` depending on the state of `result_ok`.
4288 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
4290 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
4293 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
4296 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
4298 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
4300 * A pointer to the contents in the success state.
4301 * Reading from this pointer when `result_ok` is not set is undefined.
4303 struct LDKStaticPaymentOutputDescriptor *result;
4305 * A pointer to the contents in the error state.
4306 * Reading from this pointer when `result_ok` is set is undefined.
4308 struct LDKDecodeError *err;
4309 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
4312 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
4313 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
4314 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4316 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
4318 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
4319 * `err` or `result` depending on the state of `result_ok`.
4321 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
4323 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
4326 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
4329 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
4331 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
4333 * A pointer to the contents in the success state.
4334 * Reading from this pointer when `result_ok` is not set is undefined.
4336 struct LDKSpendableOutputDescriptor *result;
4338 * A pointer to the contents in the error state.
4339 * Reading from this pointer when `result_ok` is set is undefined.
4341 struct LDKDecodeError *err;
4342 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
4345 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
4346 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
4347 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4349 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
4351 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
4352 * `err` or `result` depending on the state of `result_ok`.
4354 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
4356 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
4359 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
4362 * The contents of CResult_NoneNoneZ
4364 typedef union LDKCResult_NoneNoneZPtr {
4366 * Note that this value is always NULL, as there are no contents in the OK variant
4370 * Note that this value is always NULL, as there are no contents in the Err variant
4373 } LDKCResult_NoneNoneZPtr;
4376 * A CResult_NoneNoneZ represents the result of a fallible operation,
4377 * containing a () on success and a () on failure.
4378 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4380 typedef struct LDKCResult_NoneNoneZ {
4382 * The contents of this CResult_NoneNoneZ, accessible via either
4383 * `err` or `result` depending on the state of `result_ok`.
4385 union LDKCResult_NoneNoneZPtr contents;
4387 * Whether this CResult_NoneNoneZ represents a success state.
4390 } LDKCResult_NoneNoneZ;
4393 * A tuple of 2 elements. See the individual fields for the types contained.
4395 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
4397 * The element at position 0
4399 struct LDKSignature a;
4401 * The element at position 1
4403 struct LDKCVec_SignatureZ b;
4404 } LDKC2Tuple_SignatureCVec_SignatureZZ;
4407 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
4409 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
4411 * A pointer to the contents in the success state.
4412 * Reading from this pointer when `result_ok` is not set is undefined.
4414 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
4416 * Note that this value is always NULL, as there are no contents in the Err variant
4419 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
4422 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
4423 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
4424 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4426 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
4428 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
4429 * `err` or `result` depending on the state of `result_ok`.
4431 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
4433 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
4436 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
4439 * The contents of CResult_SignatureNoneZ
4441 typedef union LDKCResult_SignatureNoneZPtr {
4443 * A pointer to the contents in the success state.
4444 * Reading from this pointer when `result_ok` is not set is undefined.
4446 struct LDKSignature *result;
4448 * Note that this value is always NULL, as there are no contents in the Err variant
4451 } LDKCResult_SignatureNoneZPtr;
4454 * A CResult_SignatureNoneZ represents the result of a fallible operation,
4455 * containing a crate::c_types::Signature on success and a () on failure.
4456 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4458 typedef struct LDKCResult_SignatureNoneZ {
4460 * The contents of this CResult_SignatureNoneZ, accessible via either
4461 * `err` or `result` depending on the state of `result_ok`.
4463 union LDKCResult_SignatureNoneZPtr contents;
4465 * Whether this CResult_SignatureNoneZ represents a success state.
4468 } LDKCResult_SignatureNoneZ;
4473 * This class tracks the per-transaction information needed to build a closing transaction and will
4474 * actually build it and sign.
4476 * This class can be used inside a signer implementation to generate a signature given the relevant
4479 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
4481 * A pointer to the opaque Rust object.
4482 * Nearly everywhere, inner must be non-null, however in places where
4483 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4485 LDKnativeClosingTransaction *inner;
4487 * Indicates that this is the only struct which contains the same pointer.
4488 * Rust functions which take ownership of an object provided via an argument require
4489 * this to be true and invalidate the object pointed to by inner.
4492 } LDKClosingTransaction;
4497 * The unsigned part of a channel_announcement
4499 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
4501 * A pointer to the opaque Rust object.
4502 * Nearly everywhere, inner must be non-null, however in places where
4503 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4505 LDKnativeUnsignedChannelAnnouncement *inner;
4507 * Indicates that this is the only struct which contains the same pointer.
4508 * Rust functions which take ownership of an object provided via an argument require
4509 * this to be true and invalidate the object pointed to by inner.
4512 } LDKUnsignedChannelAnnouncement;
4515 * A trait to sign lightning channel transactions as described in BOLT 3.
4517 * Signing services could be implemented on a hardware wallet. In this case,
4518 * the current Sign would be a front-end on top of a communication
4519 * channel connected to your secure device and lightning key material wouldn't
4520 * reside on a hot server. Nevertheless, a this deployment would still need
4521 * to trust the ChannelManager to avoid loss of funds as this latest component
4522 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
4524 * A more secure iteration would be to use hashlock (or payment points) to pair
4525 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
4526 * at the price of more state and computation on the hardware wallet side. In the future,
4527 * we are looking forward to design such interface.
4529 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
4530 * to act, as liveness and breach reply correctness are always going to be hard requirements
4531 * of LN security model, orthogonal of key management issues.
4533 typedef struct LDKBaseSign {
4535 * An opaque pointer which is passed to your function implementations as an argument.
4536 * This has no meaning in the LDK, and can be NULL or any other value.
4540 * Gets the per-commitment point for a specific commitment number
4542 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
4544 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
4546 * Gets the commitment secret for a specific commitment number as part of the revocation process
4548 * An external signer implementation should error here if the commitment was already signed
4549 * and should refuse to sign it in the future.
4551 * May be called more than once for the same index.
4553 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
4555 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
4557 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
4559 * This is required in order for the signer to make sure that releasing a commitment
4560 * secret won't leave us without a broadcastable holder transaction.
4561 * Policy checks should be implemented in this function, including checking the amount
4562 * sent to us and checking the HTLCs.
4564 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx);
4566 * Gets the holder's channel public keys and basepoints
4568 struct LDKChannelPublicKeys pubkeys;
4570 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
4571 * Note that this takes a pointer to this object, not the this_ptr like other methods do
4572 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
4574 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
4576 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
4577 * some SpendableOutputDescriptor types. This should be sufficient to identify this
4578 * Sign object uniquely and lookup or re-derive its keys.
4580 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
4582 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
4584 * Note that if signing fails or is rejected, the channel will be force-closed.
4586 * Policy checks should be implemented in this function, including checking the amount
4587 * sent to us and checking the HTLCs.
4589 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
4591 * Validate the counterparty's revocation.
4593 * This is required in order for the signer to make sure that the state has moved
4594 * forward and it is safe to sign the next counterparty commitment.
4596 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
4598 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
4599 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
4600 * latest commitment_tx when we initiate a force-close.
4601 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
4602 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
4604 * This may be called multiple times for the same transaction.
4606 * An external signer implementation should check that the commitment has not been revoked.
4608 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
4610 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
4612 * Create a signature for the given input in a transaction spending an HTLC transaction output
4613 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
4615 * A justice transaction may claim multiple outputs at the same time if timelocks are
4616 * similar, but only a signature for the input at index `input` should be signed for here.
4617 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
4618 * to an upcoming timelock expiration.
4620 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
4622 * per_commitment_key is revocation secret which was provided by our counterparty when they
4623 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
4624 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
4627 struct LDKCResult_SignatureNoneZ (*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]);
4629 * Create a signature for the given input in a transaction spending a commitment transaction
4630 * HTLC output when our counterparty broadcasts an old state.
4632 * A justice transaction may claim multiple outputs at the same time if timelocks are
4633 * similar, but only a signature for the input at index `input` should be signed for here.
4634 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
4635 * to an upcoming timelock expiration.
4637 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
4639 * per_commitment_key is revocation secret which was provided by our counterparty when they
4640 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
4641 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
4644 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
4645 * (which is committed to in the BIP 143 signatures).
4647 struct LDKCResult_SignatureNoneZ (*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);
4649 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
4650 * transaction, either offered or received.
4652 * Such a transaction may claim multiples offered outputs at same time if we know the
4653 * preimage for each when we create it, but only the input at index `input` should be
4654 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
4655 * needed with regards to an upcoming timelock expiration.
4657 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
4660 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
4662 * Per_commitment_point is the dynamic point corresponding to the channel state
4663 * detected onchain. It has been generated by our counterparty and is used to derive
4664 * channel state keys, which are then included in the witness script and committed to in the
4665 * BIP 143 signature.
4667 struct LDKCResult_SignatureNoneZ (*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);
4669 * Create a signature for a (proposed) closing transaction.
4671 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
4672 * chosen to forgo their output as dust.
4674 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
4676 * Signs a channel announcement message with our funding key, proving it comes from one
4677 * of the channel participants.
4679 * Note that if this fails or is rejected, the channel will not be publicly announced and
4680 * our counterparty may (though likely will not) close the channel on us for violating the
4683 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
4685 * Set the counterparty static channel data, including basepoints,
4686 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
4687 * This is done as soon as the funding outpoint is known. Since these are static channel data,
4688 * they MUST NOT be allowed to change to different values once set.
4690 * channel_parameters.is_populated() MUST be true.
4692 * We bind holder_selected_contest_delay late here for API convenience.
4694 * Will be called before any signatures are applied.
4696 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
4698 * Frees any resources associated with this object given its this_arg pointer.
4699 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4701 void (*free)(void *this_arg);
4705 * A cloneable signer.
4707 * Although we require signers to be cloneable, it may be useful for developers to be able to use
4708 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
4709 * which implies Sized, into this derived trait.
4711 typedef struct LDKSign {
4713 * An opaque pointer which is passed to your function implementations as an argument.
4714 * This has no meaning in the LDK, and can be NULL or any other value.
4718 * Implementation of BaseSign for this object.
4720 struct LDKBaseSign BaseSign;
4722 * Serialize the object into a byte array
4724 struct LDKCVec_u8Z (*write)(const void *this_arg);
4726 * Called, if set, after this Sign has been cloned into a duplicate object.
4727 * The new Sign is provided, and should be mutated as needed to perform a
4728 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
4730 void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
4732 * Frees any resources associated with this object given its this_arg pointer.
4733 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4735 void (*free)(void *this_arg);
4739 * The contents of CResult_SignDecodeErrorZ
4741 typedef union LDKCResult_SignDecodeErrorZPtr {
4743 * A pointer to the contents in the success state.
4744 * Reading from this pointer when `result_ok` is not set is undefined.
4746 struct LDKSign *result;
4748 * A pointer to the contents in the error state.
4749 * Reading from this pointer when `result_ok` is set is undefined.
4751 struct LDKDecodeError *err;
4752 } LDKCResult_SignDecodeErrorZPtr;
4755 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
4756 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
4757 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4759 typedef struct LDKCResult_SignDecodeErrorZ {
4761 * The contents of this CResult_SignDecodeErrorZ, accessible via either
4762 * `err` or `result` depending on the state of `result_ok`.
4764 union LDKCResult_SignDecodeErrorZPtr contents;
4766 * Whether this CResult_SignDecodeErrorZ represents a success state.
4769 } LDKCResult_SignDecodeErrorZ;
4772 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
4773 * allows recovering the exact public key which created the signature given the message.
4775 typedef struct LDKRecoverableSignature {
4777 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
4780 uint8_t serialized_form[68];
4781 } LDKRecoverableSignature;
4784 * The contents of CResult_RecoverableSignatureNoneZ
4786 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
4788 * A pointer to the contents in the success state.
4789 * Reading from this pointer when `result_ok` is not set is undefined.
4791 struct LDKRecoverableSignature *result;
4793 * Note that this value is always NULL, as there are no contents in the Err variant
4796 } LDKCResult_RecoverableSignatureNoneZPtr;
4799 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
4800 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
4801 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4803 typedef struct LDKCResult_RecoverableSignatureNoneZ {
4805 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
4806 * `err` or `result` depending on the state of `result_ok`.
4808 union LDKCResult_RecoverableSignatureNoneZPtr contents;
4810 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
4813 } LDKCResult_RecoverableSignatureNoneZ;
4816 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
4817 * This corresponds to std::vector in C++
4819 typedef struct LDKCVec_CVec_u8ZZ {
4821 * The elements in the array.
4822 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4824 struct LDKCVec_u8Z *data;
4826 * The number of elements pointed to by `data`.
4829 } LDKCVec_CVec_u8ZZ;
4832 * The contents of CResult_CVec_CVec_u8ZZNoneZ
4834 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
4836 * A pointer to the contents in the success state.
4837 * Reading from this pointer when `result_ok` is not set is undefined.
4839 struct LDKCVec_CVec_u8ZZ *result;
4841 * Note that this value is always NULL, as there are no contents in the Err variant
4844 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
4847 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
4848 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
4849 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4851 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
4853 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
4854 * `err` or `result` depending on the state of `result_ok`.
4856 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
4858 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
4861 } LDKCResult_CVec_CVec_u8ZZNoneZ;
4866 * A simple implementation of Sign that just keeps the private keys in memory.
4868 * This implementation performs no policy checks and is insufficient by itself as
4869 * a secure external signer.
4871 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
4873 * A pointer to the opaque Rust object.
4874 * Nearly everywhere, inner must be non-null, however in places where
4875 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4877 LDKnativeInMemorySigner *inner;
4879 * Indicates that this is the only struct which contains the same pointer.
4880 * Rust functions which take ownership of an object provided via an argument require
4881 * this to be true and invalidate the object pointed to by inner.
4884 } LDKInMemorySigner;
4887 * The contents of CResult_InMemorySignerDecodeErrorZ
4889 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
4891 * A pointer to the contents in the success state.
4892 * Reading from this pointer when `result_ok` is not set is undefined.
4894 struct LDKInMemorySigner *result;
4896 * A pointer to the contents in the error state.
4897 * Reading from this pointer when `result_ok` is set is undefined.
4899 struct LDKDecodeError *err;
4900 } LDKCResult_InMemorySignerDecodeErrorZPtr;
4903 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
4904 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
4905 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4907 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
4909 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
4910 * `err` or `result` depending on the state of `result_ok`.
4912 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
4914 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
4917 } LDKCResult_InMemorySignerDecodeErrorZ;
4920 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
4921 * This corresponds to std::vector in C++
4923 typedef struct LDKCVec_TxOutZ {
4925 * The elements in the array.
4926 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4928 struct LDKTxOut *data;
4930 * The number of elements pointed to by `data`.
4936 * The contents of CResult_TransactionNoneZ
4938 typedef union LDKCResult_TransactionNoneZPtr {
4940 * A pointer to the contents in the success state.
4941 * Reading from this pointer when `result_ok` is not set is undefined.
4943 struct LDKTransaction *result;
4945 * Note that this value is always NULL, as there are no contents in the Err variant
4948 } LDKCResult_TransactionNoneZPtr;
4951 * A CResult_TransactionNoneZ represents the result of a fallible operation,
4952 * containing a crate::c_types::Transaction on success and a () on failure.
4953 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4955 typedef struct LDKCResult_TransactionNoneZ {
4957 * The contents of this CResult_TransactionNoneZ, accessible via either
4958 * `err` or `result` depending on the state of `result_ok`.
4960 union LDKCResult_TransactionNoneZPtr contents;
4962 * Whether this CResult_TransactionNoneZ represents a success state.
4965 } LDKCResult_TransactionNoneZ;
4970 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
4971 * on-chain transactions to ensure no loss of funds occurs.
4973 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
4974 * information and are actively monitoring the chain.
4976 * Pending Events or updated HTLCs which have not yet been read out by
4977 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
4978 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
4979 * gotten are fully handled before re-serializing the new state.
4981 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
4982 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
4983 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
4984 * returned block hash and the the current chain and then reconnecting blocks to get to the
4985 * best chain) upon deserializing the object!
4987 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
4989 * A pointer to the opaque Rust object.
4990 * Nearly everywhere, inner must be non-null, however in places where
4991 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4993 LDKnativeChannelMonitor *inner;
4995 * Indicates that this is the only struct which contains the same pointer.
4996 * Rust functions which take ownership of an object provided via an argument require
4997 * this to be true and invalidate the object pointed to by inner.
5000 } LDKChannelMonitor;
5003 * A tuple of 2 elements. See the individual fields for the types contained.
5005 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
5007 * The element at position 0
5009 struct LDKThirtyTwoBytes a;
5011 * The element at position 1
5013 struct LDKChannelMonitor b;
5014 } LDKC2Tuple_BlockHashChannelMonitorZ;
5017 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
5018 * This corresponds to std::vector in C++
5020 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
5022 * The elements in the array.
5023 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5025 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
5027 * The number of elements pointed to by `data`.
5030 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
5033 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
5035 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
5037 * A pointer to the contents in the success state.
5038 * Reading from this pointer when `result_ok` is not set is undefined.
5040 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
5042 * A pointer to the contents in the error state.
5043 * Reading from this pointer when `result_ok` is set is undefined.
5045 enum LDKIOError *err;
5046 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
5049 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
5050 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
5051 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5053 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
5055 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
5056 * `err` or `result` depending on the state of `result_ok`.
5058 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
5060 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
5063 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
5066 * An enum which can either contain a u16 or not
5068 typedef enum LDKCOption_u16Z_Tag {
5070 * When we're in this state, this COption_u16Z contains a u16
5072 LDKCOption_u16Z_Some,
5074 * When we're in this state, this COption_u16Z contains nothing
5076 LDKCOption_u16Z_None,
5078 * Must be last for serialization purposes
5080 LDKCOption_u16Z_Sentinel,
5081 } LDKCOption_u16Z_Tag;
5083 typedef struct LDKCOption_u16Z {
5084 LDKCOption_u16Z_Tag tag;
5093 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
5096 typedef enum LDKAPIError_Tag {
5098 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
5099 * are documented, but generally indicates some precondition of a function was violated.
5101 LDKAPIError_APIMisuseError,
5103 * Due to a high feerate, we were unable to complete the request.
5104 * For example, this may be returned if the feerate implies we cannot open a channel at the
5105 * requested value, but opening a larger channel would succeed.
5107 LDKAPIError_FeeRateTooHigh,
5109 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
5110 * too-many-hops, etc).
5112 LDKAPIError_RouteError,
5114 * We were unable to complete the request as the Channel required to do so is unable to
5115 * complete the request (or was not found). This can take many forms, including disconnected
5116 * peer, channel at capacity, channel shutting down, etc.
5118 LDKAPIError_ChannelUnavailable,
5120 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
5121 * attempted action to fail.
5123 LDKAPIError_MonitorUpdateFailed,
5125 * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
5126 * with the channel counterparty as negotiated in [`InitFeatures`].
5128 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
5129 * a channel or cooperatively close one with this peer (and will have to force-close instead).
5131 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
5132 * [`InitFeatures`]: crate::ln::features::InitFeatures
5134 LDKAPIError_IncompatibleShutdownScript,
5136 * Must be last for serialization purposes
5138 LDKAPIError_Sentinel,
5141 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
5143 * A human-readable error message
5146 } LDKAPIError_LDKAPIMisuseError_Body;
5148 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
5150 * A human-readable error message
5154 * The feerate which was too high.
5157 } LDKAPIError_LDKFeeRateTooHigh_Body;
5159 typedef struct LDKAPIError_LDKRouteError_Body {
5161 * A human-readable error message
5164 } LDKAPIError_LDKRouteError_Body;
5166 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
5168 * A human-readable error message
5171 } LDKAPIError_LDKChannelUnavailable_Body;
5173 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
5175 * The incompatible shutdown script.
5177 struct LDKShutdownScript script;
5178 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
5180 typedef struct MUST_USE_STRUCT LDKAPIError {
5181 LDKAPIError_Tag tag;
5183 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
5184 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
5185 LDKAPIError_LDKRouteError_Body route_error;
5186 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
5187 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
5192 * The contents of CResult_NoneAPIErrorZ
5194 typedef union LDKCResult_NoneAPIErrorZPtr {
5196 * Note that this value is always NULL, as there are no contents in the OK variant
5200 * A pointer to the contents in the error state.
5201 * Reading from this pointer when `result_ok` is set is undefined.
5203 struct LDKAPIError *err;
5204 } LDKCResult_NoneAPIErrorZPtr;
5207 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
5208 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
5209 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5211 typedef struct LDKCResult_NoneAPIErrorZ {
5213 * The contents of this CResult_NoneAPIErrorZ, accessible via either
5214 * `err` or `result` depending on the state of `result_ok`.
5216 union LDKCResult_NoneAPIErrorZPtr contents;
5218 * Whether this CResult_NoneAPIErrorZ represents a success state.
5221 } LDKCResult_NoneAPIErrorZ;
5224 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
5225 * This corresponds to std::vector in C++
5227 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
5229 * The elements in the array.
5230 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5232 struct LDKCResult_NoneAPIErrorZ *data;
5234 * The number of elements pointed to by `data`.
5237 } LDKCVec_CResult_NoneAPIErrorZZ;
5240 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
5241 * This corresponds to std::vector in C++
5243 typedef struct LDKCVec_APIErrorZ {
5245 * The elements in the array.
5246 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5248 struct LDKAPIError *data;
5250 * The number of elements pointed to by `data`.
5253 } LDKCVec_APIErrorZ;
5256 * The contents of CResult__u832APIErrorZ
5258 typedef union LDKCResult__u832APIErrorZPtr {
5260 * A pointer to the contents in the success state.
5261 * Reading from this pointer when `result_ok` is not set is undefined.
5263 struct LDKThirtyTwoBytes *result;
5265 * A pointer to the contents in the error state.
5266 * Reading from this pointer when `result_ok` is set is undefined.
5268 struct LDKAPIError *err;
5269 } LDKCResult__u832APIErrorZPtr;
5272 * A CResult__u832APIErrorZ represents the result of a fallible operation,
5273 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
5274 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5276 typedef struct LDKCResult__u832APIErrorZ {
5278 * The contents of this CResult__u832APIErrorZ, accessible via either
5279 * `err` or `result` depending on the state of `result_ok`.
5281 union LDKCResult__u832APIErrorZPtr contents;
5283 * Whether this CResult__u832APIErrorZ represents a success state.
5286 } LDKCResult__u832APIErrorZ;
5289 * If a payment fails to send, it can be in one of several states. This enum is returned as the
5290 * Err() type describing which state the payment is in, see the description of individual enum
5293 typedef enum LDKPaymentSendFailure_Tag {
5295 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
5296 * send the payment at all. No channel state has been changed or messages sent to peers, and
5297 * once you've changed the parameter at error, you can freely retry the payment in full.
5299 LDKPaymentSendFailure_ParameterError,
5301 * A parameter in a single path which was passed to send_payment was invalid, preventing us
5302 * from attempting to send the payment at all. No channel state has been changed or messages
5303 * sent to peers, and once you've changed the parameter at error, you can freely retry the
5306 * The results here are ordered the same as the paths in the route object which was passed to
5309 LDKPaymentSendFailure_PathParameterError,
5311 * All paths which were attempted failed to send, with no channel state change taking place.
5312 * You can freely retry the payment in full (though you probably want to do so over different
5313 * paths than the ones selected).
5315 LDKPaymentSendFailure_AllFailedRetrySafe,
5317 * Some paths which were attempted failed to send, though possibly not all. At least some
5318 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
5319 * in over-/re-payment.
5321 * The results here are ordered the same as the paths in the route object which was passed to
5322 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
5323 * retried (though there is currently no API with which to do so).
5325 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
5326 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
5327 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
5328 * with the latest update_id.
5330 LDKPaymentSendFailure_PartialFailure,
5332 * Must be last for serialization purposes
5334 LDKPaymentSendFailure_Sentinel,
5335 } LDKPaymentSendFailure_Tag;
5337 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
5339 * The errors themselves, in the same order as the route hops.
5341 struct LDKCVec_CResult_NoneAPIErrorZZ results;
5343 * If some paths failed without irrevocably committing to the new HTLC(s), this will
5344 * contain a [`RouteParameters`] object which can be used to calculate a new route that
5345 * will pay all remaining unpaid balance.
5347 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5349 struct LDKRouteParameters failed_paths_retry;
5351 * The payment id for the payment, which is now at least partially pending.
5353 struct LDKThirtyTwoBytes payment_id;
5354 } LDKPaymentSendFailure_LDKPartialFailure_Body;
5356 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
5357 LDKPaymentSendFailure_Tag tag;
5360 struct LDKAPIError parameter_error;
5363 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
5366 struct LDKCVec_APIErrorZ all_failed_retry_safe;
5368 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
5370 } LDKPaymentSendFailure;
5373 * The contents of CResult_PaymentIdPaymentSendFailureZ
5375 typedef union LDKCResult_PaymentIdPaymentSendFailureZPtr {
5377 * A pointer to the contents in the success state.
5378 * Reading from this pointer when `result_ok` is not set is undefined.
5380 struct LDKThirtyTwoBytes *result;
5382 * A pointer to the contents in the error state.
5383 * Reading from this pointer when `result_ok` is set is undefined.
5385 struct LDKPaymentSendFailure *err;
5386 } LDKCResult_PaymentIdPaymentSendFailureZPtr;
5389 * A CResult_PaymentIdPaymentSendFailureZ represents the result of a fallible operation,
5390 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
5391 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5393 typedef struct LDKCResult_PaymentIdPaymentSendFailureZ {
5395 * The contents of this CResult_PaymentIdPaymentSendFailureZ, accessible via either
5396 * `err` or `result` depending on the state of `result_ok`.
5398 union LDKCResult_PaymentIdPaymentSendFailureZPtr contents;
5400 * Whether this CResult_PaymentIdPaymentSendFailureZ represents a success state.
5403 } LDKCResult_PaymentIdPaymentSendFailureZ;
5406 * The contents of CResult_NonePaymentSendFailureZ
5408 typedef union LDKCResult_NonePaymentSendFailureZPtr {
5410 * Note that this value is always NULL, as there are no contents in the OK variant
5414 * A pointer to the contents in the error state.
5415 * Reading from this pointer when `result_ok` is set is undefined.
5417 struct LDKPaymentSendFailure *err;
5418 } LDKCResult_NonePaymentSendFailureZPtr;
5421 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
5422 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
5423 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5425 typedef struct LDKCResult_NonePaymentSendFailureZ {
5427 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
5428 * `err` or `result` depending on the state of `result_ok`.
5430 union LDKCResult_NonePaymentSendFailureZPtr contents;
5432 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
5435 } LDKCResult_NonePaymentSendFailureZ;
5438 * A tuple of 2 elements. See the individual fields for the types contained.
5440 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
5442 * The element at position 0
5444 struct LDKThirtyTwoBytes a;
5446 * The element at position 1
5448 struct LDKThirtyTwoBytes b;
5449 } LDKC2Tuple_PaymentHashPaymentIdZ;
5452 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
5454 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
5456 * A pointer to the contents in the success state.
5457 * Reading from this pointer when `result_ok` is not set is undefined.
5459 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
5461 * A pointer to the contents in the error state.
5462 * Reading from this pointer when `result_ok` is set is undefined.
5464 struct LDKPaymentSendFailure *err;
5465 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
5468 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
5469 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
5470 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5472 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
5474 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
5475 * `err` or `result` depending on the state of `result_ok`.
5477 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
5479 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
5482 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
5485 * A 4-byte byte array.
5487 typedef struct LDKFourBytes {
5495 * A 16-byte byte array.
5497 typedef struct LDKSixteenBytes {
5505 * A 12-byte byte array.
5507 typedef struct LDKTwelveBytes {
5515 * An address which can be used to connect to a remote peer
5517 typedef enum LDKNetAddress_Tag {
5519 * An IPv4 address/port on which the peer is listening.
5523 * An IPv6 address/port on which the peer is listening.
5527 * An old-style Tor onion address/port on which the peer is listening.
5529 * This field is deprecated and the Tor network generally no longer supports V2 Onion
5530 * addresses. Thus, the details are not parsed here.
5532 LDKNetAddress_OnionV2,
5534 * A new-style Tor onion address/port on which the peer is listening.
5535 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
5536 * wrap as base32 and append \".onion\".
5538 LDKNetAddress_OnionV3,
5540 * Must be last for serialization purposes
5542 LDKNetAddress_Sentinel,
5543 } LDKNetAddress_Tag;
5545 typedef struct LDKNetAddress_LDKIPv4_Body {
5547 * The 4-byte IPv4 address
5549 struct LDKFourBytes addr;
5551 * The port on which the node is listening
5554 } LDKNetAddress_LDKIPv4_Body;
5556 typedef struct LDKNetAddress_LDKIPv6_Body {
5558 * The 16-byte IPv6 address
5560 struct LDKSixteenBytes addr;
5562 * The port on which the node is listening
5565 } LDKNetAddress_LDKIPv6_Body;
5567 typedef struct LDKNetAddress_LDKOnionV3_Body {
5569 * The ed25519 long-term public key of the peer
5571 struct LDKThirtyTwoBytes ed25519_pubkey;
5573 * The checksum of the pubkey and version, as included in the onion address
5577 * The version byte, as defined by the Tor Onion v3 spec.
5581 * The port on which the node is listening
5584 } LDKNetAddress_LDKOnionV3_Body;
5586 typedef struct MUST_USE_STRUCT LDKNetAddress {
5587 LDKNetAddress_Tag tag;
5589 LDKNetAddress_LDKIPv4_Body i_pv4;
5590 LDKNetAddress_LDKIPv6_Body i_pv6;
5592 struct LDKTwelveBytes onion_v2;
5594 LDKNetAddress_LDKOnionV3_Body onion_v3;
5599 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
5600 * This corresponds to std::vector in C++
5602 typedef struct LDKCVec_NetAddressZ {
5604 * The elements in the array.
5605 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5607 struct LDKNetAddress *data;
5609 * The number of elements pointed to by `data`.
5612 } LDKCVec_NetAddressZ;
5615 * A tuple of 2 elements. See the individual fields for the types contained.
5617 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
5619 * The element at position 0
5621 struct LDKThirtyTwoBytes a;
5623 * The element at position 1
5625 struct LDKThirtyTwoBytes b;
5626 } LDKC2Tuple_PaymentHashPaymentSecretZ;
5629 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
5631 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
5633 * A pointer to the contents in the success state.
5634 * Reading from this pointer when `result_ok` is not set is undefined.
5636 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
5638 * Note that this value is always NULL, as there are no contents in the Err variant
5641 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
5644 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
5645 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
5646 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5648 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
5650 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
5651 * `err` or `result` depending on the state of `result_ok`.
5653 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
5655 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
5658 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
5661 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
5663 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
5665 * A pointer to the contents in the success state.
5666 * Reading from this pointer when `result_ok` is not set is undefined.
5668 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
5670 * A pointer to the contents in the error state.
5671 * Reading from this pointer when `result_ok` is set is undefined.
5673 struct LDKAPIError *err;
5674 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
5677 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
5678 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
5679 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5681 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
5683 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
5684 * `err` or `result` depending on the state of `result_ok`.
5686 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
5688 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
5691 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
5694 * The contents of CResult_PaymentSecretNoneZ
5696 typedef union LDKCResult_PaymentSecretNoneZPtr {
5698 * A pointer to the contents in the success state.
5699 * Reading from this pointer when `result_ok` is not set is undefined.
5701 struct LDKThirtyTwoBytes *result;
5703 * Note that this value is always NULL, as there are no contents in the Err variant
5706 } LDKCResult_PaymentSecretNoneZPtr;
5709 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
5710 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
5711 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5713 typedef struct LDKCResult_PaymentSecretNoneZ {
5715 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
5716 * `err` or `result` depending on the state of `result_ok`.
5718 union LDKCResult_PaymentSecretNoneZPtr contents;
5720 * Whether this CResult_PaymentSecretNoneZ represents a success state.
5723 } LDKCResult_PaymentSecretNoneZ;
5726 * The contents of CResult_PaymentSecretAPIErrorZ
5728 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
5730 * A pointer to the contents in the success state.
5731 * Reading from this pointer when `result_ok` is not set is undefined.
5733 struct LDKThirtyTwoBytes *result;
5735 * A pointer to the contents in the error state.
5736 * Reading from this pointer when `result_ok` is set is undefined.
5738 struct LDKAPIError *err;
5739 } LDKCResult_PaymentSecretAPIErrorZPtr;
5742 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
5743 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
5744 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5746 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
5748 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
5749 * `err` or `result` depending on the state of `result_ok`.
5751 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
5753 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
5756 } LDKCResult_PaymentSecretAPIErrorZ;
5759 * The contents of CResult_PaymentPreimageAPIErrorZ
5761 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
5763 * A pointer to the contents in the success state.
5764 * Reading from this pointer when `result_ok` is not set is undefined.
5766 struct LDKThirtyTwoBytes *result;
5768 * A pointer to the contents in the error state.
5769 * Reading from this pointer when `result_ok` is set is undefined.
5771 struct LDKAPIError *err;
5772 } LDKCResult_PaymentPreimageAPIErrorZPtr;
5775 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
5776 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
5777 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5779 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
5781 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
5782 * `err` or `result` depending on the state of `result_ok`.
5784 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
5786 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
5789 } LDKCResult_PaymentPreimageAPIErrorZ;
5792 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
5793 * This corresponds to std::vector in C++
5795 typedef struct LDKCVec_ChannelMonitorZ {
5797 * The elements in the array.
5798 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5800 struct LDKChannelMonitor *data;
5802 * The number of elements pointed to by `data`.
5805 } LDKCVec_ChannelMonitorZ;
5810 * An update generated by the underlying Channel itself which contains some new information the
5811 * ChannelMonitor should be made aware of.
5813 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
5815 * A pointer to the opaque Rust object.
5816 * Nearly everywhere, inner must be non-null, however in places where
5817 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5819 LDKnativeChannelMonitorUpdate *inner;
5821 * Indicates that this is the only struct which contains the same pointer.
5822 * Rust functions which take ownership of an object provided via an argument require
5823 * this to be true and invalidate the object pointed to by inner.
5826 } LDKChannelMonitorUpdate;
5829 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
5830 * blocks are connected and disconnected.
5832 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
5833 * responsible for maintaining a set of monitors such that they can be updated accordingly as
5834 * channel state changes and HTLCs are resolved. See method documentation for specific
5837 * Implementations **must** ensure that updates are successfully applied and persisted upon method
5838 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
5839 * without taking any further action such as persisting the current state.
5841 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
5842 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
5843 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
5844 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
5845 * multiple instances.
5847 * [`PermanentFailure`]: ChannelMonitorUpdateErr::PermanentFailure
5849 typedef struct LDKWatch {
5851 * An opaque pointer which is passed to your function implementations as an argument.
5852 * This has no meaning in the LDK, and can be NULL or any other value.
5856 * Watches a channel identified by `funding_txo` using `monitor`.
5858 * Implementations are responsible for watching the chain for the funding transaction along
5859 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
5860 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
5862 * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
5863 * the given `funding_txo` has previously been registered via `watch_channel`.
5865 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
5866 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
5867 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
5869 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
5871 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
5873 * Implementations must call [`update_monitor`] with the given update. See
5874 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
5876 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
5878 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
5880 * Returns any monitor events since the last call. Subsequent calls must only return new
5883 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
5884 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
5887 * For details on asynchronous [`ChannelMonitor`] updating and returning
5888 * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
5890 struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
5892 * Frees any resources associated with this object given its this_arg pointer.
5893 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5895 void (*free)(void *this_arg);
5899 * An interface to send a transaction to the Bitcoin network.
5901 typedef struct LDKBroadcasterInterface {
5903 * An opaque pointer which is passed to your function implementations as an argument.
5904 * This has no meaning in the LDK, and can be NULL or any other value.
5908 * Sends a transaction out to (hopefully) be mined.
5910 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
5912 * Frees any resources associated with this object given its this_arg pointer.
5913 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5915 void (*free)(void *this_arg);
5916 } LDKBroadcasterInterface;
5919 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
5920 * own the memory pointed to by data.
5922 typedef struct LDKu8slice {
5924 * A pointer to the byte buffer
5926 const uint8_t *data;
5928 * The number of bytes pointed to by `data`.
5934 * A trait to describe an object which can get user secrets and key material.
5936 typedef struct LDKKeysInterface {
5938 * An opaque pointer which is passed to your function implementations as an argument.
5939 * This has no meaning in the LDK, and can be NULL or any other value.
5943 * Get node secret key (aka node_id or network_key).
5945 * This method must return the same value each time it is called.
5947 struct LDKSecretKey (*get_node_secret)(const void *this_arg);
5949 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
5951 * This method should return a different value each time it is called, to avoid linking
5952 * on-chain funds across channels as controlled to the same user.
5954 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
5956 * Get a script pubkey which we will send funds to when closing a channel.
5958 * This method should return a different value each time it is called, to avoid linking
5959 * on-chain funds across channels as controlled to the same user.
5961 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
5963 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
5964 * restarted with some stale data!
5966 * This method must return a different value each time it is called.
5968 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
5970 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
5971 * onion packets and for temporary channel IDs. There is no requirement that these be
5972 * persisted anywhere, though they must be unique across restarts.
5974 * This method must return a different value each time it is called.
5976 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
5978 * Reads a `Signer` for this `KeysInterface` from the given input stream.
5979 * This is only called during deserialization of other objects which contain
5980 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
5981 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
5982 * contain no versioning scheme. You may wish to include your own version prefix and ensure
5983 * you've read all of the provided bytes to ensure no corruption occurred.
5985 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
5987 * Sign an invoice's preimage (note that this is the preimage of the invoice, not the HTLC's
5988 * preimage). By parameterizing by the preimage instead of the hash, we allow implementors of
5989 * this trait to parse the invoice and make sure they're signing what they expect, rather than
5990 * blindly signing the hash.
5992 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKCVec_u8Z invoice_preimage);
5994 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
5996 * This method must return the same value each time it is called.
5998 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
6000 * Frees any resources associated with this object given its this_arg pointer.
6001 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6003 void (*free)(void *this_arg);
6007 * A trait which should be implemented to provide feerate information on a number of time
6010 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
6011 * called from inside the library in response to chain events, P2P events, or timer events).
6013 typedef struct LDKFeeEstimator {
6015 * An opaque pointer which is passed to your function implementations as an argument.
6016 * This has no meaning in the LDK, and can be NULL or any other value.
6020 * Gets estimated satoshis of fee required per 1000 Weight-Units.
6022 * Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later
6023 * round-downs don't put us below 1 satoshi-per-byte).
6025 * This method can be implemented with the following unit conversions:
6026 * * max(satoshis-per-byte * 250, 253)
6027 * * max(satoshis-per-kbyte / 4, 253)
6029 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
6031 * Frees any resources associated with this object given its this_arg pointer.
6032 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6034 void (*free)(void *this_arg);
6040 * A Record, unit of logging output with Metadata to enable filtering
6041 * Module_path, file, line to inform on log's source
6043 typedef struct MUST_USE_STRUCT LDKRecord {
6045 * A pointer to the opaque Rust object.
6046 * Nearly everywhere, inner must be non-null, however in places where
6047 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6049 LDKnativeRecord *inner;
6051 * Indicates that this is the only struct which contains the same pointer.
6052 * Rust functions which take ownership of an object provided via an argument require
6053 * this to be true and invalidate the object pointed to by inner.
6059 * A trait encapsulating the operations required of a logger
6061 typedef struct LDKLogger {
6063 * An opaque pointer which is passed to your function implementations as an argument.
6064 * This has no meaning in the LDK, and can be NULL or any other value.
6070 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
6072 * Frees any resources associated with this object given its this_arg pointer.
6073 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6075 void (*free)(void *this_arg);
6081 * Manager which keeps track of a number of channels and sends messages to the appropriate
6082 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
6084 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
6085 * to individual Channels.
6087 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
6088 * all peers during write/read (though does not modify this instance, only the instance being
6089 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
6090 * called funding_transaction_generated for outbound channels).
6092 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
6093 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
6094 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
6095 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
6096 * the serialization process). If the deserialized version is out-of-date compared to the
6097 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
6098 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
6100 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
6101 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
6102 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
6103 * block_connected() to step towards your best block) upon deserialization before using the
6106 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
6107 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
6108 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
6109 * offline for a full minute. In order to track this, you must call
6110 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
6112 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
6113 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
6114 * essentially you should default to using a SimpleRefChannelManager, and use a
6115 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
6116 * you're using lightning-net-tokio.
6118 typedef struct MUST_USE_STRUCT LDKChannelManager {
6120 * A pointer to the opaque Rust object.
6121 * Nearly everywhere, inner must be non-null, however in places where
6122 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6124 LDKnativeChannelManager *inner;
6126 * Indicates that this is the only struct which contains the same pointer.
6127 * Rust functions which take ownership of an object provided via an argument require
6128 * this to be true and invalidate the object pointed to by inner.
6131 } LDKChannelManager;
6134 * A tuple of 2 elements. See the individual fields for the types contained.
6136 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
6138 * The element at position 0
6140 struct LDKThirtyTwoBytes a;
6142 * The element at position 1
6144 struct LDKChannelManager b;
6145 } LDKC2Tuple_BlockHashChannelManagerZ;
6148 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
6150 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
6152 * A pointer to the contents in the success state.
6153 * Reading from this pointer when `result_ok` is not set is undefined.
6155 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
6157 * A pointer to the contents in the error state.
6158 * Reading from this pointer when `result_ok` is set is undefined.
6160 struct LDKDecodeError *err;
6161 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
6164 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
6165 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6166 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6168 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
6170 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
6171 * `err` or `result` depending on the state of `result_ok`.
6173 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
6175 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
6178 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
6183 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
6184 * with our counterparty.
6186 typedef struct MUST_USE_STRUCT LDKChannelConfig {
6188 * A pointer to the opaque Rust object.
6189 * Nearly everywhere, inner must be non-null, however in places where
6190 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6192 LDKnativeChannelConfig *inner;
6194 * Indicates that this is the only struct which contains the same pointer.
6195 * Rust functions which take ownership of an object provided via an argument require
6196 * this to be true and invalidate the object pointed to by inner.
6202 * The contents of CResult_ChannelConfigDecodeErrorZ
6204 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
6206 * A pointer to the contents in the success state.
6207 * Reading from this pointer when `result_ok` is not set is undefined.
6209 struct LDKChannelConfig *result;
6211 * A pointer to the contents in the error state.
6212 * Reading from this pointer when `result_ok` is set is undefined.
6214 struct LDKDecodeError *err;
6215 } LDKCResult_ChannelConfigDecodeErrorZPtr;
6218 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
6219 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
6220 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6222 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
6224 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
6225 * `err` or `result` depending on the state of `result_ok`.
6227 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
6229 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
6232 } LDKCResult_ChannelConfigDecodeErrorZ;
6235 * The contents of CResult_OutPointDecodeErrorZ
6237 typedef union LDKCResult_OutPointDecodeErrorZPtr {
6239 * A pointer to the contents in the success state.
6240 * Reading from this pointer when `result_ok` is not set is undefined.
6242 struct LDKOutPoint *result;
6244 * A pointer to the contents in the error state.
6245 * Reading from this pointer when `result_ok` is set is undefined.
6247 struct LDKDecodeError *err;
6248 } LDKCResult_OutPointDecodeErrorZPtr;
6251 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
6252 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
6253 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6255 typedef struct LDKCResult_OutPointDecodeErrorZ {
6257 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
6258 * `err` or `result` depending on the state of `result_ok`.
6260 union LDKCResult_OutPointDecodeErrorZPtr contents;
6262 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
6265 } LDKCResult_OutPointDecodeErrorZ;
6268 * Defines a type identifier for sending messages over the wire.
6270 * Messages implementing this trait specify a type and must be [`Writeable`].
6272 typedef struct LDKType {
6274 * An opaque pointer which is passed to your function implementations as an argument.
6275 * This has no meaning in the LDK, and can be NULL or any other value.
6279 * Returns the type identifying the message payload.
6281 uint16_t (*type_id)(const void *this_arg);
6283 * Return a human-readable "debug" string describing this object
6285 struct LDKStr (*debug_str)(const void *this_arg);
6287 * Serialize the object into a byte array
6289 struct LDKCVec_u8Z (*write)(const void *this_arg);
6291 * Frees any resources associated with this object given its this_arg pointer.
6292 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6294 void (*free)(void *this_arg);
6298 * An enum which can either contain a crate::lightning::ln::wire::Type or not
6300 typedef enum LDKCOption_TypeZ_Tag {
6302 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
6304 LDKCOption_TypeZ_Some,
6306 * When we're in this state, this COption_TypeZ contains nothing
6308 LDKCOption_TypeZ_None,
6310 * Must be last for serialization purposes
6312 LDKCOption_TypeZ_Sentinel,
6313 } LDKCOption_TypeZ_Tag;
6315 typedef struct LDKCOption_TypeZ {
6316 LDKCOption_TypeZ_Tag tag;
6319 struct LDKType some;
6325 * The contents of CResult_COption_TypeZDecodeErrorZ
6327 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
6329 * A pointer to the contents in the success state.
6330 * Reading from this pointer when `result_ok` is not set is undefined.
6332 struct LDKCOption_TypeZ *result;
6334 * A pointer to the contents in the error state.
6335 * Reading from this pointer when `result_ok` is set is undefined.
6337 struct LDKDecodeError *err;
6338 } LDKCResult_COption_TypeZDecodeErrorZPtr;
6341 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
6342 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6343 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6345 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
6347 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
6348 * `err` or `result` depending on the state of `result_ok`.
6350 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
6352 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
6355 } LDKCResult_COption_TypeZDecodeErrorZ;
6358 * An error that may occur when making a payment.
6360 typedef enum LDKPaymentError_Tag {
6362 * An error resulting from the provided [`Invoice`] or payment hash.
6364 LDKPaymentError_Invoice,
6366 * An error occurring when finding a route.
6368 LDKPaymentError_Routing,
6370 * An error occurring when sending a payment.
6372 LDKPaymentError_Sending,
6374 * Must be last for serialization purposes
6376 LDKPaymentError_Sentinel,
6377 } LDKPaymentError_Tag;
6379 typedef struct MUST_USE_STRUCT LDKPaymentError {
6380 LDKPaymentError_Tag tag;
6383 struct LDKStr invoice;
6386 struct LDKLightningError routing;
6389 struct LDKPaymentSendFailure sending;
6395 * The contents of CResult_PaymentIdPaymentErrorZ
6397 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
6399 * A pointer to the contents in the success state.
6400 * Reading from this pointer when `result_ok` is not set is undefined.
6402 struct LDKThirtyTwoBytes *result;
6404 * A pointer to the contents in the error state.
6405 * Reading from this pointer when `result_ok` is set is undefined.
6407 struct LDKPaymentError *err;
6408 } LDKCResult_PaymentIdPaymentErrorZPtr;
6411 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
6412 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
6413 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6415 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
6417 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
6418 * `err` or `result` depending on the state of `result_ok`.
6420 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
6422 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
6425 } LDKCResult_PaymentIdPaymentErrorZ;
6428 * The contents of CResult_SiPrefixNoneZ
6430 typedef union LDKCResult_SiPrefixNoneZPtr {
6432 * A pointer to the contents in the success state.
6433 * Reading from this pointer when `result_ok` is not set is undefined.
6435 enum LDKSiPrefix *result;
6437 * Note that this value is always NULL, as there are no contents in the Err variant
6440 } LDKCResult_SiPrefixNoneZPtr;
6443 * A CResult_SiPrefixNoneZ represents the result of a fallible operation,
6444 * containing a crate::lightning_invoice::SiPrefix on success and a () on failure.
6445 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6447 typedef struct LDKCResult_SiPrefixNoneZ {
6449 * The contents of this CResult_SiPrefixNoneZ, accessible via either
6450 * `err` or `result` depending on the state of `result_ok`.
6452 union LDKCResult_SiPrefixNoneZPtr contents;
6454 * Whether this CResult_SiPrefixNoneZ represents a success state.
6457 } LDKCResult_SiPrefixNoneZ;
6462 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
6464 * There are three ways to construct an `Invoice`:
6465 * 1. using `InvoiceBuilder`
6466 * 2. using `Invoice::from_signed(SignedRawInvoice)`
6467 * 3. using `str::parse::<Invoice>(&str)`
6469 typedef struct MUST_USE_STRUCT LDKInvoice {
6471 * A pointer to the opaque Rust object.
6472 * Nearly everywhere, inner must be non-null, however in places where
6473 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6475 LDKnativeInvoice *inner;
6477 * Indicates that this is the only struct which contains the same pointer.
6478 * Rust functions which take ownership of an object provided via an argument require
6479 * this to be true and invalidate the object pointed to by inner.
6485 * The contents of CResult_InvoiceNoneZ
6487 typedef union LDKCResult_InvoiceNoneZPtr {
6489 * A pointer to the contents in the success state.
6490 * Reading from this pointer when `result_ok` is not set is undefined.
6492 struct LDKInvoice *result;
6494 * Note that this value is always NULL, as there are no contents in the Err variant
6497 } LDKCResult_InvoiceNoneZPtr;
6500 * A CResult_InvoiceNoneZ represents the result of a fallible operation,
6501 * containing a crate::lightning_invoice::Invoice on success and a () on failure.
6502 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6504 typedef struct LDKCResult_InvoiceNoneZ {
6506 * The contents of this CResult_InvoiceNoneZ, accessible via either
6507 * `err` or `result` depending on the state of `result_ok`.
6509 union LDKCResult_InvoiceNoneZPtr contents;
6511 * Whether this CResult_InvoiceNoneZ represents a success state.
6514 } LDKCResult_InvoiceNoneZ;
6519 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
6523 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
6525 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
6527 * A pointer to the opaque Rust object.
6528 * Nearly everywhere, inner must be non-null, however in places where
6529 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6531 LDKnativeSignedRawInvoice *inner;
6533 * Indicates that this is the only struct which contains the same pointer.
6534 * Rust functions which take ownership of an object provided via an argument require
6535 * this to be true and invalidate the object pointed to by inner.
6538 } LDKSignedRawInvoice;
6541 * The contents of CResult_SignedRawInvoiceNoneZ
6543 typedef union LDKCResult_SignedRawInvoiceNoneZPtr {
6545 * A pointer to the contents in the success state.
6546 * Reading from this pointer when `result_ok` is not set is undefined.
6548 struct LDKSignedRawInvoice *result;
6550 * Note that this value is always NULL, as there are no contents in the Err variant
6553 } LDKCResult_SignedRawInvoiceNoneZPtr;
6556 * A CResult_SignedRawInvoiceNoneZ represents the result of a fallible operation,
6557 * containing a crate::lightning_invoice::SignedRawInvoice on success and a () on failure.
6558 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6560 typedef struct LDKCResult_SignedRawInvoiceNoneZ {
6562 * The contents of this CResult_SignedRawInvoiceNoneZ, accessible via either
6563 * `err` or `result` depending on the state of `result_ok`.
6565 union LDKCResult_SignedRawInvoiceNoneZPtr contents;
6567 * Whether this CResult_SignedRawInvoiceNoneZ represents a success state.
6570 } LDKCResult_SignedRawInvoiceNoneZ;
6575 * Represents an syntactically correct Invoice for a payment on the lightning network,
6576 * but without the signature information.
6577 * De- and encoding should not lead to information loss but may lead to different hashes.
6579 * For methods without docs see the corresponding methods in `Invoice`.
6581 typedef struct MUST_USE_STRUCT LDKRawInvoice {
6583 * A pointer to the opaque Rust object.
6584 * Nearly everywhere, inner must be non-null, however in places where
6585 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6587 LDKnativeRawInvoice *inner;
6589 * Indicates that this is the only struct which contains the same pointer.
6590 * Rust functions which take ownership of an object provided via an argument require
6591 * this to be true and invalidate the object pointed to by inner.
6599 * Recoverable signature
6601 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
6603 * A pointer to the opaque Rust object.
6604 * Nearly everywhere, inner must be non-null, however in places where
6605 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6607 LDKnativeInvoiceSignature *inner;
6609 * Indicates that this is the only struct which contains the same pointer.
6610 * Rust functions which take ownership of an object provided via an argument require
6611 * this to be true and invalidate the object pointed to by inner.
6614 } LDKInvoiceSignature;
6617 * A tuple of 3 elements. See the individual fields for the types contained.
6619 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
6621 * The element at position 0
6623 struct LDKRawInvoice a;
6625 * The element at position 1
6627 struct LDKThirtyTwoBytes b;
6629 * The element at position 2
6631 struct LDKInvoiceSignature c;
6632 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
6639 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
6641 * A pointer to the opaque Rust object.
6642 * Nearly everywhere, inner must be non-null, however in places where
6643 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6645 LDKnativePayeePubKey *inner;
6647 * Indicates that this is the only struct which contains the same pointer.
6648 * Rust functions which take ownership of an object provided via an argument require
6649 * this to be true and invalidate the object pointed to by inner.
6655 * The contents of CResult_PayeePubKeyErrorZ
6657 typedef union LDKCResult_PayeePubKeyErrorZPtr {
6659 * A pointer to the contents in the success state.
6660 * Reading from this pointer when `result_ok` is not set is undefined.
6662 struct LDKPayeePubKey *result;
6664 * A pointer to the contents in the error state.
6665 * Reading from this pointer when `result_ok` is set is undefined.
6667 enum LDKSecp256k1Error *err;
6668 } LDKCResult_PayeePubKeyErrorZPtr;
6671 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
6672 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
6673 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6675 typedef struct LDKCResult_PayeePubKeyErrorZ {
6677 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
6678 * `err` or `result` depending on the state of `result_ok`.
6680 union LDKCResult_PayeePubKeyErrorZPtr contents;
6682 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
6685 } LDKCResult_PayeePubKeyErrorZ;
6690 * Private routing information
6693 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
6696 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
6698 * A pointer to the opaque Rust object.
6699 * Nearly everywhere, inner must be non-null, however in places where
6700 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6702 LDKnativePrivateRoute *inner;
6704 * Indicates that this is the only struct which contains the same pointer.
6705 * Rust functions which take ownership of an object provided via an argument require
6706 * this to be true and invalidate the object pointed to by inner.
6712 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
6713 * This corresponds to std::vector in C++
6715 typedef struct LDKCVec_PrivateRouteZ {
6717 * The elements in the array.
6718 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6720 struct LDKPrivateRoute *data;
6722 * The number of elements pointed to by `data`.
6725 } LDKCVec_PrivateRouteZ;
6730 * A timestamp that refers to a date after 1 January 1970 which means its representation as UNIX
6731 * timestamp is positive.
6734 * The UNIX timestamp representing the stored time has to be positive and small enough so that
6735 * a `EpiryTime` can be added to it without an overflow.
6737 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
6739 * A pointer to the opaque Rust object.
6740 * Nearly everywhere, inner must be non-null, however in places where
6741 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6743 LDKnativePositiveTimestamp *inner;
6745 * Indicates that this is the only struct which contains the same pointer.
6746 * Rust functions which take ownership of an object provided via an argument require
6747 * this to be true and invalidate the object pointed to by inner.
6750 } LDKPositiveTimestamp;
6753 * The contents of CResult_PositiveTimestampCreationErrorZ
6755 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
6757 * A pointer to the contents in the success state.
6758 * Reading from this pointer when `result_ok` is not set is undefined.
6760 struct LDKPositiveTimestamp *result;
6762 * A pointer to the contents in the error state.
6763 * Reading from this pointer when `result_ok` is set is undefined.
6765 enum LDKCreationError *err;
6766 } LDKCResult_PositiveTimestampCreationErrorZPtr;
6769 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
6770 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
6771 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6773 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
6775 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
6776 * `err` or `result` depending on the state of `result_ok`.
6778 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
6780 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
6783 } LDKCResult_PositiveTimestampCreationErrorZ;
6786 * The contents of CResult_NoneSemanticErrorZ
6788 typedef union LDKCResult_NoneSemanticErrorZPtr {
6790 * Note that this value is always NULL, as there are no contents in the OK variant
6794 * A pointer to the contents in the error state.
6795 * Reading from this pointer when `result_ok` is set is undefined.
6797 enum LDKSemanticError *err;
6798 } LDKCResult_NoneSemanticErrorZPtr;
6801 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
6802 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
6803 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6805 typedef struct LDKCResult_NoneSemanticErrorZ {
6807 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
6808 * `err` or `result` depending on the state of `result_ok`.
6810 union LDKCResult_NoneSemanticErrorZPtr contents;
6812 * Whether this CResult_NoneSemanticErrorZ represents a success state.
6815 } LDKCResult_NoneSemanticErrorZ;
6818 * The contents of CResult_InvoiceSemanticErrorZ
6820 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
6822 * A pointer to the contents in the success state.
6823 * Reading from this pointer when `result_ok` is not set is undefined.
6825 struct LDKInvoice *result;
6827 * A pointer to the contents in the error state.
6828 * Reading from this pointer when `result_ok` is set is undefined.
6830 enum LDKSemanticError *err;
6831 } LDKCResult_InvoiceSemanticErrorZPtr;
6834 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
6835 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
6836 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6838 typedef struct LDKCResult_InvoiceSemanticErrorZ {
6840 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
6841 * `err` or `result` depending on the state of `result_ok`.
6843 union LDKCResult_InvoiceSemanticErrorZPtr contents;
6845 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
6848 } LDKCResult_InvoiceSemanticErrorZ;
6853 * Description string
6856 * The description can be at most 639 __bytes__ long
6858 typedef struct MUST_USE_STRUCT LDKDescription {
6860 * A pointer to the opaque Rust object.
6861 * Nearly everywhere, inner must be non-null, however in places where
6862 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6864 LDKnativeDescription *inner;
6866 * Indicates that this is the only struct which contains the same pointer.
6867 * Rust functions which take ownership of an object provided via an argument require
6868 * this to be true and invalidate the object pointed to by inner.
6874 * The contents of CResult_DescriptionCreationErrorZ
6876 typedef union LDKCResult_DescriptionCreationErrorZPtr {
6878 * A pointer to the contents in the success state.
6879 * Reading from this pointer when `result_ok` is not set is undefined.
6881 struct LDKDescription *result;
6883 * A pointer to the contents in the error state.
6884 * Reading from this pointer when `result_ok` is set is undefined.
6886 enum LDKCreationError *err;
6887 } LDKCResult_DescriptionCreationErrorZPtr;
6890 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
6891 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
6892 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6894 typedef struct LDKCResult_DescriptionCreationErrorZ {
6896 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
6897 * `err` or `result` depending on the state of `result_ok`.
6899 union LDKCResult_DescriptionCreationErrorZPtr contents;
6901 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
6904 } LDKCResult_DescriptionCreationErrorZ;
6909 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
6913 * The number of seconds this expiry time represents has to be in the range
6914 * `0...(SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME)` to avoid overflows when adding it to a
6917 typedef struct MUST_USE_STRUCT LDKExpiryTime {
6919 * A pointer to the opaque Rust object.
6920 * Nearly everywhere, inner must be non-null, however in places where
6921 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6923 LDKnativeExpiryTime *inner;
6925 * Indicates that this is the only struct which contains the same pointer.
6926 * Rust functions which take ownership of an object provided via an argument require
6927 * this to be true and invalidate the object pointed to by inner.
6933 * The contents of CResult_ExpiryTimeCreationErrorZ
6935 typedef union LDKCResult_ExpiryTimeCreationErrorZPtr {
6937 * A pointer to the contents in the success state.
6938 * Reading from this pointer when `result_ok` is not set is undefined.
6940 struct LDKExpiryTime *result;
6942 * A pointer to the contents in the error state.
6943 * Reading from this pointer when `result_ok` is set is undefined.
6945 enum LDKCreationError *err;
6946 } LDKCResult_ExpiryTimeCreationErrorZPtr;
6949 * A CResult_ExpiryTimeCreationErrorZ represents the result of a fallible operation,
6950 * containing a crate::lightning_invoice::ExpiryTime on success and a crate::lightning_invoice::CreationError on failure.
6951 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6953 typedef struct LDKCResult_ExpiryTimeCreationErrorZ {
6955 * The contents of this CResult_ExpiryTimeCreationErrorZ, accessible via either
6956 * `err` or `result` depending on the state of `result_ok`.
6958 union LDKCResult_ExpiryTimeCreationErrorZPtr contents;
6960 * Whether this CResult_ExpiryTimeCreationErrorZ represents a success state.
6963 } LDKCResult_ExpiryTimeCreationErrorZ;
6966 * The contents of CResult_PrivateRouteCreationErrorZ
6968 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
6970 * A pointer to the contents in the success state.
6971 * Reading from this pointer when `result_ok` is not set is undefined.
6973 struct LDKPrivateRoute *result;
6975 * A pointer to the contents in the error state.
6976 * Reading from this pointer when `result_ok` is set is undefined.
6978 enum LDKCreationError *err;
6979 } LDKCResult_PrivateRouteCreationErrorZPtr;
6982 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
6983 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
6984 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6986 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
6988 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
6989 * `err` or `result` depending on the state of `result_ok`.
6991 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
6993 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
6996 } LDKCResult_PrivateRouteCreationErrorZ;
6999 * The contents of CResult_StringErrorZ
7001 typedef union LDKCResult_StringErrorZPtr {
7003 * A pointer to the contents in the success state.
7004 * Reading from this pointer when `result_ok` is not set is undefined.
7006 struct LDKStr *result;
7008 * A pointer to the contents in the error state.
7009 * Reading from this pointer when `result_ok` is set is undefined.
7011 enum LDKSecp256k1Error *err;
7012 } LDKCResult_StringErrorZPtr;
7015 * A CResult_StringErrorZ represents the result of a fallible operation,
7016 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
7017 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7019 typedef struct LDKCResult_StringErrorZ {
7021 * The contents of this CResult_StringErrorZ, accessible via either
7022 * `err` or `result` depending on the state of `result_ok`.
7024 union LDKCResult_StringErrorZPtr contents;
7026 * Whether this CResult_StringErrorZ represents a success state.
7029 } LDKCResult_StringErrorZ;
7032 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
7034 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
7036 * A pointer to the contents in the success state.
7037 * Reading from this pointer when `result_ok` is not set is undefined.
7039 struct LDKChannelMonitorUpdate *result;
7041 * A pointer to the contents in the error state.
7042 * Reading from this pointer when `result_ok` is set is undefined.
7044 struct LDKDecodeError *err;
7045 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
7048 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
7049 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7050 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7052 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
7054 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
7055 * `err` or `result` depending on the state of `result_ok`.
7057 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
7059 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
7062 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
7065 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
7067 typedef enum LDKCOption_MonitorEventZ_Tag {
7069 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
7071 LDKCOption_MonitorEventZ_Some,
7073 * When we're in this state, this COption_MonitorEventZ contains nothing
7075 LDKCOption_MonitorEventZ_None,
7077 * Must be last for serialization purposes
7079 LDKCOption_MonitorEventZ_Sentinel,
7080 } LDKCOption_MonitorEventZ_Tag;
7082 typedef struct LDKCOption_MonitorEventZ {
7083 LDKCOption_MonitorEventZ_Tag tag;
7086 struct LDKMonitorEvent some;
7089 } LDKCOption_MonitorEventZ;
7092 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
7094 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
7096 * A pointer to the contents in the success state.
7097 * Reading from this pointer when `result_ok` is not set is undefined.
7099 struct LDKCOption_MonitorEventZ *result;
7101 * A pointer to the contents in the error state.
7102 * Reading from this pointer when `result_ok` is set is undefined.
7104 struct LDKDecodeError *err;
7105 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
7108 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
7109 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7110 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7112 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
7114 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
7115 * `err` or `result` depending on the state of `result_ok`.
7117 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
7119 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
7122 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
7125 * The contents of CResult_HTLCUpdateDecodeErrorZ
7127 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
7129 * A pointer to the contents in the success state.
7130 * Reading from this pointer when `result_ok` is not set is undefined.
7132 struct LDKHTLCUpdate *result;
7134 * A pointer to the contents in the error state.
7135 * Reading from this pointer when `result_ok` is set is undefined.
7137 struct LDKDecodeError *err;
7138 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
7141 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
7142 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
7143 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7145 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
7147 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
7148 * `err` or `result` depending on the state of `result_ok`.
7150 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
7152 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
7155 } LDKCResult_HTLCUpdateDecodeErrorZ;
7158 * A tuple of 2 elements. See the individual fields for the types contained.
7160 typedef struct LDKC2Tuple_OutPointScriptZ {
7162 * The element at position 0
7164 struct LDKOutPoint a;
7166 * The element at position 1
7168 struct LDKCVec_u8Z b;
7169 } LDKC2Tuple_OutPointScriptZ;
7172 * A tuple of 2 elements. See the individual fields for the types contained.
7174 typedef struct LDKC2Tuple_u32ScriptZ {
7176 * The element at position 0
7180 * The element at position 1
7182 struct LDKCVec_u8Z b;
7183 } LDKC2Tuple_u32ScriptZ;
7186 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
7187 * This corresponds to std::vector in C++
7189 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
7191 * The elements in the array.
7192 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7194 struct LDKC2Tuple_u32ScriptZ *data;
7196 * The number of elements pointed to by `data`.
7199 } LDKCVec_C2Tuple_u32ScriptZZ;
7202 * A tuple of 2 elements. See the individual fields for the types contained.
7204 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
7206 * The element at position 0
7208 struct LDKThirtyTwoBytes a;
7210 * The element at position 1
7212 struct LDKCVec_C2Tuple_u32ScriptZZ b;
7213 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
7216 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
7217 * This corresponds to std::vector in C++
7219 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
7221 * The elements in the array.
7222 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7224 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
7226 * The number of elements pointed to by `data`.
7229 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
7232 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
7233 * This corresponds to std::vector in C++
7235 typedef struct LDKCVec_EventZ {
7237 * The elements in the array.
7238 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7240 struct LDKEvent *data;
7242 * The number of elements pointed to by `data`.
7248 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
7249 * This corresponds to std::vector in C++
7251 typedef struct LDKCVec_TransactionZ {
7253 * The elements in the array.
7254 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7256 struct LDKTransaction *data;
7258 * The number of elements pointed to by `data`.
7261 } LDKCVec_TransactionZ;
7264 * A tuple of 2 elements. See the individual fields for the types contained.
7266 typedef struct LDKC2Tuple_u32TxOutZ {
7268 * The element at position 0
7272 * The element at position 1
7275 } LDKC2Tuple_u32TxOutZ;
7278 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
7279 * This corresponds to std::vector in C++
7281 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
7283 * The elements in the array.
7284 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7286 struct LDKC2Tuple_u32TxOutZ *data;
7288 * The number of elements pointed to by `data`.
7291 } LDKCVec_C2Tuple_u32TxOutZZ;
7294 * A tuple of 2 elements. See the individual fields for the types contained.
7296 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
7298 * The element at position 0
7300 struct LDKThirtyTwoBytes a;
7302 * The element at position 1
7304 struct LDKCVec_C2Tuple_u32TxOutZZ b;
7305 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
7308 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
7309 * This corresponds to std::vector in C++
7311 typedef struct LDKCVec_TransactionOutputsZ {
7313 * The elements in the array.
7314 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7316 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
7318 * The number of elements pointed to by `data`.
7321 } LDKCVec_TransactionOutputsZ;
7324 * Details about the balance(s) available for spending once the channel appears on chain.
7326 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
7329 typedef enum LDKBalance_Tag {
7331 * The channel is not yet closed (or the commitment or closing transaction has not yet
7332 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
7335 LDKBalance_ClaimableOnChannelClose,
7337 * The channel has been closed, and the given balance is ours but awaiting confirmations until
7338 * we consider it spendable.
7340 LDKBalance_ClaimableAwaitingConfirmations,
7342 * The channel has been closed, and the given balance should be ours but awaiting spending
7343 * transaction confirmation. If the spending transaction does not confirm in time, it is
7344 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
7346 * Once the spending transaction confirms, before it has reached enough confirmations to be
7347 * considered safe from chain reorganizations, the balance will instead be provided via
7348 * [`Balance::ClaimableAwaitingConfirmations`].
7350 LDKBalance_ContentiousClaimable,
7352 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
7353 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
7354 * likely to be claimed by our counterparty before we do.
7356 LDKBalance_MaybeClaimableHTLCAwaitingTimeout,
7358 * Must be last for serialization purposes
7360 LDKBalance_Sentinel,
7363 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
7365 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
7366 * required to do so.
7368 uint64_t claimable_amount_satoshis;
7369 } LDKBalance_LDKClaimableOnChannelClose_Body;
7371 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
7373 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
7374 * were spent in broadcasting the transaction.
7376 uint64_t claimable_amount_satoshis;
7378 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
7381 uint32_t confirmation_height;
7382 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
7384 typedef struct LDKBalance_LDKContentiousClaimable_Body {
7386 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
7387 * required to do so.
7389 uint64_t claimable_amount_satoshis;
7391 * The height at which the counterparty may be able to claim the balance if we have not
7394 uint32_t timeout_height;
7395 } LDKBalance_LDKContentiousClaimable_Body;
7397 typedef struct LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body {
7399 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
7400 * required to do so.
7402 uint64_t claimable_amount_satoshis;
7404 * The height at which we will be able to claim the balance if our counterparty has not
7407 uint32_t claimable_height;
7408 } LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body;
7410 typedef struct MUST_USE_STRUCT LDKBalance {
7413 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
7414 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
7415 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
7416 LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body maybe_claimable_htlc_awaiting_timeout;
7421 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
7422 * This corresponds to std::vector in C++
7424 typedef struct LDKCVec_BalanceZ {
7426 * The elements in the array.
7427 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7429 struct LDKBalance *data;
7431 * The number of elements pointed to by `data`.
7437 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
7439 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
7441 * A pointer to the contents in the success state.
7442 * Reading from this pointer when `result_ok` is not set is undefined.
7444 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
7446 * A pointer to the contents in the error state.
7447 * Reading from this pointer when `result_ok` is set is undefined.
7449 struct LDKDecodeError *err;
7450 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
7453 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
7454 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7455 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7457 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
7459 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
7460 * `err` or `result` depending on the state of `result_ok`.
7462 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
7464 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
7467 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
7470 * The contents of CResult_NoneLightningErrorZ
7472 typedef union LDKCResult_NoneLightningErrorZPtr {
7474 * Note that this value is always NULL, as there are no contents in the OK variant
7478 * A pointer to the contents in the error state.
7479 * Reading from this pointer when `result_ok` is set is undefined.
7481 struct LDKLightningError *err;
7482 } LDKCResult_NoneLightningErrorZPtr;
7485 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
7486 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
7487 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7489 typedef struct LDKCResult_NoneLightningErrorZ {
7491 * The contents of this CResult_NoneLightningErrorZ, accessible via either
7492 * `err` or `result` depending on the state of `result_ok`.
7494 union LDKCResult_NoneLightningErrorZPtr contents;
7496 * Whether this CResult_NoneLightningErrorZ represents a success state.
7499 } LDKCResult_NoneLightningErrorZ;
7502 * A tuple of 2 elements. See the individual fields for the types contained.
7504 typedef struct LDKC2Tuple_PublicKeyTypeZ {
7506 * The element at position 0
7508 struct LDKPublicKey a;
7510 * The element at position 1
7513 } LDKC2Tuple_PublicKeyTypeZ;
7516 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
7517 * This corresponds to std::vector in C++
7519 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
7521 * The elements in the array.
7522 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7524 struct LDKC2Tuple_PublicKeyTypeZ *data;
7526 * The number of elements pointed to by `data`.
7529 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
7532 * The contents of CResult_boolLightningErrorZ
7534 typedef union LDKCResult_boolLightningErrorZPtr {
7536 * A pointer to the contents in the success state.
7537 * Reading from this pointer when `result_ok` is not set is undefined.
7541 * A pointer to the contents in the error state.
7542 * Reading from this pointer when `result_ok` is set is undefined.
7544 struct LDKLightningError *err;
7545 } LDKCResult_boolLightningErrorZPtr;
7548 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
7549 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
7550 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7552 typedef struct LDKCResult_boolLightningErrorZ {
7554 * The contents of this CResult_boolLightningErrorZ, accessible via either
7555 * `err` or `result` depending on the state of `result_ok`.
7557 union LDKCResult_boolLightningErrorZPtr contents;
7559 * Whether this CResult_boolLightningErrorZ represents a success state.
7562 } LDKCResult_boolLightningErrorZ;
7565 * A tuple of 3 elements. See the individual fields for the types contained.
7567 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
7569 * The element at position 0
7571 struct LDKChannelAnnouncement a;
7573 * The element at position 1
7575 struct LDKChannelUpdate b;
7577 * The element at position 2
7579 struct LDKChannelUpdate c;
7580 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
7583 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
7584 * This corresponds to std::vector in C++
7586 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
7588 * The elements in the array.
7589 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7591 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
7593 * The number of elements pointed to by `data`.
7596 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
7599 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
7600 * This corresponds to std::vector in C++
7602 typedef struct LDKCVec_NodeAnnouncementZ {
7604 * The elements in the array.
7605 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7607 struct LDKNodeAnnouncement *data;
7609 * The number of elements pointed to by `data`.
7612 } LDKCVec_NodeAnnouncementZ;
7615 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
7616 * This corresponds to std::vector in C++
7618 typedef struct LDKCVec_PublicKeyZ {
7620 * The elements in the array.
7621 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7623 struct LDKPublicKey *data;
7625 * The number of elements pointed to by `data`.
7628 } LDKCVec_PublicKeyZ;
7633 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
7634 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
7637 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
7639 * A pointer to the opaque Rust object.
7640 * Nearly everywhere, inner must be non-null, however in places where
7641 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7643 LDKnativePeerHandleError *inner;
7645 * Indicates that this is the only struct which contains the same pointer.
7646 * Rust functions which take ownership of an object provided via an argument require
7647 * this to be true and invalidate the object pointed to by inner.
7650 } LDKPeerHandleError;
7653 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
7655 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
7657 * A pointer to the contents in the success state.
7658 * Reading from this pointer when `result_ok` is not set is undefined.
7660 struct LDKCVec_u8Z *result;
7662 * A pointer to the contents in the error state.
7663 * Reading from this pointer when `result_ok` is set is undefined.
7665 struct LDKPeerHandleError *err;
7666 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
7669 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
7670 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
7671 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7673 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
7675 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
7676 * `err` or `result` depending on the state of `result_ok`.
7678 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
7680 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
7683 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
7686 * The contents of CResult_NonePeerHandleErrorZ
7688 typedef union LDKCResult_NonePeerHandleErrorZPtr {
7690 * Note that this value is always NULL, as there are no contents in the OK variant
7694 * A pointer to the contents in the error state.
7695 * Reading from this pointer when `result_ok` is set is undefined.
7697 struct LDKPeerHandleError *err;
7698 } LDKCResult_NonePeerHandleErrorZPtr;
7701 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
7702 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
7703 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7705 typedef struct LDKCResult_NonePeerHandleErrorZ {
7707 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
7708 * `err` or `result` depending on the state of `result_ok`.
7710 union LDKCResult_NonePeerHandleErrorZPtr contents;
7712 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
7715 } LDKCResult_NonePeerHandleErrorZ;
7718 * The contents of CResult_boolPeerHandleErrorZ
7720 typedef union LDKCResult_boolPeerHandleErrorZPtr {
7722 * A pointer to the contents in the success state.
7723 * Reading from this pointer when `result_ok` is not set is undefined.
7727 * A pointer to the contents in the error state.
7728 * Reading from this pointer when `result_ok` is set is undefined.
7730 struct LDKPeerHandleError *err;
7731 } LDKCResult_boolPeerHandleErrorZPtr;
7734 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
7735 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
7736 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7738 typedef struct LDKCResult_boolPeerHandleErrorZ {
7740 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
7741 * `err` or `result` depending on the state of `result_ok`.
7743 union LDKCResult_boolPeerHandleErrorZPtr contents;
7745 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
7748 } LDKCResult_boolPeerHandleErrorZ;
7753 * Represents the compressed public key of a node
7755 typedef struct MUST_USE_STRUCT LDKNodeId {
7757 * A pointer to the opaque Rust object.
7758 * Nearly everywhere, inner must be non-null, however in places where
7759 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7761 LDKnativeNodeId *inner;
7763 * Indicates that this is the only struct which contains the same pointer.
7764 * Rust functions which take ownership of an object provided via an argument require
7765 * this to be true and invalidate the object pointed to by inner.
7771 * The contents of CResult_NodeIdDecodeErrorZ
7773 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
7775 * A pointer to the contents in the success state.
7776 * Reading from this pointer when `result_ok` is not set is undefined.
7778 struct LDKNodeId *result;
7780 * A pointer to the contents in the error state.
7781 * Reading from this pointer when `result_ok` is set is undefined.
7783 struct LDKDecodeError *err;
7784 } LDKCResult_NodeIdDecodeErrorZPtr;
7787 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
7788 * containing a crate::lightning::routing::network_graph::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
7789 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7791 typedef struct LDKCResult_NodeIdDecodeErrorZ {
7793 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
7794 * `err` or `result` depending on the state of `result_ok`.
7796 union LDKCResult_NodeIdDecodeErrorZPtr contents;
7798 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
7801 } LDKCResult_NodeIdDecodeErrorZ;
7804 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
7806 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
7808 * A pointer to the contents in the success state.
7809 * Reading from this pointer when `result_ok` is not set is undefined.
7811 struct LDKCOption_NetworkUpdateZ *result;
7813 * A pointer to the contents in the error state.
7814 * Reading from this pointer when `result_ok` is set is undefined.
7816 struct LDKDecodeError *err;
7817 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
7820 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
7821 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7822 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7824 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
7826 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
7827 * `err` or `result` depending on the state of `result_ok`.
7829 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
7831 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
7834 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
7837 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
7840 typedef struct LDKAccess {
7842 * An opaque pointer which is passed to your function implementations as an argument.
7843 * This has no meaning in the LDK, and can be NULL or any other value.
7847 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
7848 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
7851 * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
7853 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
7855 * Frees any resources associated with this object given its this_arg pointer.
7856 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7858 void (*free)(void *this_arg);
7862 * An enum which can either contain a crate::lightning::chain::Access or not
7864 typedef enum LDKCOption_AccessZ_Tag {
7866 * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access
7868 LDKCOption_AccessZ_Some,
7870 * When we're in this state, this COption_AccessZ contains nothing
7872 LDKCOption_AccessZ_None,
7874 * Must be last for serialization purposes
7876 LDKCOption_AccessZ_Sentinel,
7877 } LDKCOption_AccessZ_Tag;
7879 typedef struct LDKCOption_AccessZ {
7880 LDKCOption_AccessZ_Tag tag;
7883 struct LDKAccess some;
7886 } LDKCOption_AccessZ;
7891 * Details about one direction of a channel. Received
7892 * within a channel update.
7894 typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
7896 * A pointer to the opaque Rust object.
7897 * Nearly everywhere, inner must be non-null, however in places where
7898 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7900 LDKnativeDirectionalChannelInfo *inner;
7902 * Indicates that this is the only struct which contains the same pointer.
7903 * Rust functions which take ownership of an object provided via an argument require
7904 * this to be true and invalidate the object pointed to by inner.
7907 } LDKDirectionalChannelInfo;
7910 * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
7912 typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
7914 * A pointer to the contents in the success state.
7915 * Reading from this pointer when `result_ok` is not set is undefined.
7917 struct LDKDirectionalChannelInfo *result;
7919 * A pointer to the contents in the error state.
7920 * Reading from this pointer when `result_ok` is set is undefined.
7922 struct LDKDecodeError *err;
7923 } LDKCResult_DirectionalChannelInfoDecodeErrorZPtr;
7926 * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
7927 * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7928 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7930 typedef struct LDKCResult_DirectionalChannelInfoDecodeErrorZ {
7932 * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
7933 * `err` or `result` depending on the state of `result_ok`.
7935 union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
7937 * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
7940 } LDKCResult_DirectionalChannelInfoDecodeErrorZ;
7945 * Details about a channel (both directions).
7946 * Received within a channel announcement.
7948 typedef struct MUST_USE_STRUCT LDKChannelInfo {
7950 * A pointer to the opaque Rust object.
7951 * Nearly everywhere, inner must be non-null, however in places where
7952 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7954 LDKnativeChannelInfo *inner;
7956 * Indicates that this is the only struct which contains the same pointer.
7957 * Rust functions which take ownership of an object provided via an argument require
7958 * this to be true and invalidate the object pointed to by inner.
7964 * The contents of CResult_ChannelInfoDecodeErrorZ
7966 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
7968 * A pointer to the contents in the success state.
7969 * Reading from this pointer when `result_ok` is not set is undefined.
7971 struct LDKChannelInfo *result;
7973 * A pointer to the contents in the error state.
7974 * Reading from this pointer when `result_ok` is set is undefined.
7976 struct LDKDecodeError *err;
7977 } LDKCResult_ChannelInfoDecodeErrorZPtr;
7980 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
7981 * containing a crate::lightning::routing::network_graph::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7982 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7984 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
7986 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
7987 * `err` or `result` depending on the state of `result_ok`.
7989 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
7991 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
7994 } LDKCResult_ChannelInfoDecodeErrorZ;
7999 * Fees for routing via a given channel or a node
8001 typedef struct MUST_USE_STRUCT LDKRoutingFees {
8003 * A pointer to the opaque Rust object.
8004 * Nearly everywhere, inner must be non-null, however in places where
8005 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8007 LDKnativeRoutingFees *inner;
8009 * Indicates that this is the only struct which contains the same pointer.
8010 * Rust functions which take ownership of an object provided via an argument require
8011 * this to be true and invalidate the object pointed to by inner.
8017 * The contents of CResult_RoutingFeesDecodeErrorZ
8019 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
8021 * A pointer to the contents in the success state.
8022 * Reading from this pointer when `result_ok` is not set is undefined.
8024 struct LDKRoutingFees *result;
8026 * A pointer to the contents in the error state.
8027 * Reading from this pointer when `result_ok` is set is undefined.
8029 struct LDKDecodeError *err;
8030 } LDKCResult_RoutingFeesDecodeErrorZPtr;
8033 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
8034 * containing a crate::lightning::routing::network_graph::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
8035 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8037 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
8039 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
8040 * `err` or `result` depending on the state of `result_ok`.
8042 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
8044 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
8047 } LDKCResult_RoutingFeesDecodeErrorZ;
8052 * Information received in the latest node_announcement from this node.
8054 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
8056 * A pointer to the opaque Rust object.
8057 * Nearly everywhere, inner must be non-null, however in places where
8058 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8060 LDKnativeNodeAnnouncementInfo *inner;
8062 * Indicates that this is the only struct which contains the same pointer.
8063 * Rust functions which take ownership of an object provided via an argument require
8064 * this to be true and invalidate the object pointed to by inner.
8067 } LDKNodeAnnouncementInfo;
8070 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
8072 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
8074 * A pointer to the contents in the success state.
8075 * Reading from this pointer when `result_ok` is not set is undefined.
8077 struct LDKNodeAnnouncementInfo *result;
8079 * A pointer to the contents in the error state.
8080 * Reading from this pointer when `result_ok` is set is undefined.
8082 struct LDKDecodeError *err;
8083 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
8086 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
8087 * containing a crate::lightning::routing::network_graph::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8088 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8090 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
8092 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
8093 * `err` or `result` depending on the state of `result_ok`.
8095 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
8097 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
8100 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
8103 * A dynamically-allocated array of u64s of arbitrary size.
8104 * This corresponds to std::vector in C++
8106 typedef struct LDKCVec_u64Z {
8108 * The elements in the array.
8109 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8113 * The number of elements pointed to by `data`.
8121 * Details about a node in the network, known from the network announcement.
8123 typedef struct MUST_USE_STRUCT LDKNodeInfo {
8125 * A pointer to the opaque Rust object.
8126 * Nearly everywhere, inner must be non-null, however in places where
8127 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8129 LDKnativeNodeInfo *inner;
8131 * Indicates that this is the only struct which contains the same pointer.
8132 * Rust functions which take ownership of an object provided via an argument require
8133 * this to be true and invalidate the object pointed to by inner.
8139 * The contents of CResult_NodeInfoDecodeErrorZ
8141 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
8143 * A pointer to the contents in the success state.
8144 * Reading from this pointer when `result_ok` is not set is undefined.
8146 struct LDKNodeInfo *result;
8148 * A pointer to the contents in the error state.
8149 * Reading from this pointer when `result_ok` is set is undefined.
8151 struct LDKDecodeError *err;
8152 } LDKCResult_NodeInfoDecodeErrorZPtr;
8155 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
8156 * containing a crate::lightning::routing::network_graph::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8157 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8159 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
8161 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
8162 * `err` or `result` depending on the state of `result_ok`.
8164 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
8166 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
8169 } LDKCResult_NodeInfoDecodeErrorZ;
8174 * Represents the network as nodes and channels between them
8176 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
8178 * A pointer to the opaque Rust object.
8179 * Nearly everywhere, inner must be non-null, however in places where
8180 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8182 LDKnativeNetworkGraph *inner;
8184 * Indicates that this is the only struct which contains the same pointer.
8185 * Rust functions which take ownership of an object provided via an argument require
8186 * this to be true and invalidate the object pointed to by inner.
8192 * The contents of CResult_NetworkGraphDecodeErrorZ
8194 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
8196 * A pointer to the contents in the success state.
8197 * Reading from this pointer when `result_ok` is not set is undefined.
8199 struct LDKNetworkGraph *result;
8201 * A pointer to the contents in the error state.
8202 * Reading from this pointer when `result_ok` is set is undefined.
8204 struct LDKDecodeError *err;
8205 } LDKCResult_NetworkGraphDecodeErrorZPtr;
8208 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
8209 * containing a crate::lightning::routing::network_graph::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
8210 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8212 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
8214 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
8215 * `err` or `result` depending on the state of `result_ok`.
8217 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
8219 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
8222 } LDKCResult_NetworkGraphDecodeErrorZ;
8225 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
8227 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
8229 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
8231 LDKCOption_CVec_NetAddressZZ_Some,
8233 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
8235 LDKCOption_CVec_NetAddressZZ_None,
8237 * Must be last for serialization purposes
8239 LDKCOption_CVec_NetAddressZZ_Sentinel,
8240 } LDKCOption_CVec_NetAddressZZ_Tag;
8242 typedef struct LDKCOption_CVec_NetAddressZZ {
8243 LDKCOption_CVec_NetAddressZZ_Tag tag;
8246 struct LDKCVec_NetAddressZ some;
8249 } LDKCOption_CVec_NetAddressZZ;
8252 * The contents of CResult_NetAddressDecodeErrorZ
8254 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
8256 * A pointer to the contents in the success state.
8257 * Reading from this pointer when `result_ok` is not set is undefined.
8259 struct LDKNetAddress *result;
8261 * A pointer to the contents in the error state.
8262 * Reading from this pointer when `result_ok` is set is undefined.
8264 struct LDKDecodeError *err;
8265 } LDKCResult_NetAddressDecodeErrorZPtr;
8268 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
8269 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
8270 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8272 typedef struct LDKCResult_NetAddressDecodeErrorZ {
8274 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
8275 * `err` or `result` depending on the state of `result_ok`.
8277 union LDKCResult_NetAddressDecodeErrorZPtr contents;
8279 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
8282 } LDKCResult_NetAddressDecodeErrorZ;
8287 * An update_add_htlc message to be sent or received from a peer
8289 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
8291 * A pointer to the opaque Rust object.
8292 * Nearly everywhere, inner must be non-null, however in places where
8293 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8295 LDKnativeUpdateAddHTLC *inner;
8297 * Indicates that this is the only struct which contains the same pointer.
8298 * Rust functions which take ownership of an object provided via an argument require
8299 * this to be true and invalidate the object pointed to by inner.
8305 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
8306 * This corresponds to std::vector in C++
8308 typedef struct LDKCVec_UpdateAddHTLCZ {
8310 * The elements in the array.
8311 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8313 struct LDKUpdateAddHTLC *data;
8315 * The number of elements pointed to by `data`.
8318 } LDKCVec_UpdateAddHTLCZ;
8323 * An update_fulfill_htlc message to be sent or received from a peer
8325 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
8327 * A pointer to the opaque Rust object.
8328 * Nearly everywhere, inner must be non-null, however in places where
8329 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8331 LDKnativeUpdateFulfillHTLC *inner;
8333 * Indicates that this is the only struct which contains the same pointer.
8334 * Rust functions which take ownership of an object provided via an argument require
8335 * this to be true and invalidate the object pointed to by inner.
8338 } LDKUpdateFulfillHTLC;
8341 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
8342 * This corresponds to std::vector in C++
8344 typedef struct LDKCVec_UpdateFulfillHTLCZ {
8346 * The elements in the array.
8347 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8349 struct LDKUpdateFulfillHTLC *data;
8351 * The number of elements pointed to by `data`.
8354 } LDKCVec_UpdateFulfillHTLCZ;
8359 * An update_fail_htlc message to be sent or received from a peer
8361 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
8363 * A pointer to the opaque Rust object.
8364 * Nearly everywhere, inner must be non-null, however in places where
8365 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8367 LDKnativeUpdateFailHTLC *inner;
8369 * Indicates that this is the only struct which contains the same pointer.
8370 * Rust functions which take ownership of an object provided via an argument require
8371 * this to be true and invalidate the object pointed to by inner.
8374 } LDKUpdateFailHTLC;
8377 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
8378 * This corresponds to std::vector in C++
8380 typedef struct LDKCVec_UpdateFailHTLCZ {
8382 * The elements in the array.
8383 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8385 struct LDKUpdateFailHTLC *data;
8387 * The number of elements pointed to by `data`.
8390 } LDKCVec_UpdateFailHTLCZ;
8395 * An update_fail_malformed_htlc message to be sent or received from a peer
8397 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
8399 * A pointer to the opaque Rust object.
8400 * Nearly everywhere, inner must be non-null, however in places where
8401 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8403 LDKnativeUpdateFailMalformedHTLC *inner;
8405 * Indicates that this is the only struct which contains the same pointer.
8406 * Rust functions which take ownership of an object provided via an argument require
8407 * this to be true and invalidate the object pointed to by inner.
8410 } LDKUpdateFailMalformedHTLC;
8413 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
8414 * This corresponds to std::vector in C++
8416 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
8418 * The elements in the array.
8419 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8421 struct LDKUpdateFailMalformedHTLC *data;
8423 * The number of elements pointed to by `data`.
8426 } LDKCVec_UpdateFailMalformedHTLCZ;
8429 * The contents of CResult_AcceptChannelDecodeErrorZ
8431 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
8433 * A pointer to the contents in the success state.
8434 * Reading from this pointer when `result_ok` is not set is undefined.
8436 struct LDKAcceptChannel *result;
8438 * A pointer to the contents in the error state.
8439 * Reading from this pointer when `result_ok` is set is undefined.
8441 struct LDKDecodeError *err;
8442 } LDKCResult_AcceptChannelDecodeErrorZPtr;
8445 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
8446 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
8447 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8449 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
8451 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
8452 * `err` or `result` depending on the state of `result_ok`.
8454 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
8456 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
8459 } LDKCResult_AcceptChannelDecodeErrorZ;
8462 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
8464 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
8466 * A pointer to the contents in the success state.
8467 * Reading from this pointer when `result_ok` is not set is undefined.
8469 struct LDKAnnouncementSignatures *result;
8471 * A pointer to the contents in the error state.
8472 * Reading from this pointer when `result_ok` is set is undefined.
8474 struct LDKDecodeError *err;
8475 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
8478 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
8479 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
8480 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8482 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
8484 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
8485 * `err` or `result` depending on the state of `result_ok`.
8487 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
8489 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
8492 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
8495 * The contents of CResult_ChannelReestablishDecodeErrorZ
8497 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
8499 * A pointer to the contents in the success state.
8500 * Reading from this pointer when `result_ok` is not set is undefined.
8502 struct LDKChannelReestablish *result;
8504 * A pointer to the contents in the error state.
8505 * Reading from this pointer when `result_ok` is set is undefined.
8507 struct LDKDecodeError *err;
8508 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
8511 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
8512 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
8513 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8515 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
8517 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
8518 * `err` or `result` depending on the state of `result_ok`.
8520 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
8522 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
8525 } LDKCResult_ChannelReestablishDecodeErrorZ;
8528 * The contents of CResult_ClosingSignedDecodeErrorZ
8530 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
8532 * A pointer to the contents in the success state.
8533 * Reading from this pointer when `result_ok` is not set is undefined.
8535 struct LDKClosingSigned *result;
8537 * A pointer to the contents in the error state.
8538 * Reading from this pointer when `result_ok` is set is undefined.
8540 struct LDKDecodeError *err;
8541 } LDKCResult_ClosingSignedDecodeErrorZPtr;
8544 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
8545 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
8546 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8548 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
8550 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
8551 * `err` or `result` depending on the state of `result_ok`.
8553 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
8555 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
8558 } LDKCResult_ClosingSignedDecodeErrorZ;
8563 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
8564 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
8567 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
8569 * A pointer to the opaque Rust object.
8570 * Nearly everywhere, inner must be non-null, however in places where
8571 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8573 LDKnativeClosingSignedFeeRange *inner;
8575 * Indicates that this is the only struct which contains the same pointer.
8576 * Rust functions which take ownership of an object provided via an argument require
8577 * this to be true and invalidate the object pointed to by inner.
8580 } LDKClosingSignedFeeRange;
8583 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
8585 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
8587 * A pointer to the contents in the success state.
8588 * Reading from this pointer when `result_ok` is not set is undefined.
8590 struct LDKClosingSignedFeeRange *result;
8592 * A pointer to the contents in the error state.
8593 * Reading from this pointer when `result_ok` is set is undefined.
8595 struct LDKDecodeError *err;
8596 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
8599 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
8600 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
8601 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8603 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
8605 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
8606 * `err` or `result` depending on the state of `result_ok`.
8608 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
8610 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
8613 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
8618 * A commitment_signed message to be sent or received from a peer
8620 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
8622 * A pointer to the opaque Rust object.
8623 * Nearly everywhere, inner must be non-null, however in places where
8624 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8626 LDKnativeCommitmentSigned *inner;
8628 * Indicates that this is the only struct which contains the same pointer.
8629 * Rust functions which take ownership of an object provided via an argument require
8630 * this to be true and invalidate the object pointed to by inner.
8633 } LDKCommitmentSigned;
8636 * The contents of CResult_CommitmentSignedDecodeErrorZ
8638 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
8640 * A pointer to the contents in the success state.
8641 * Reading from this pointer when `result_ok` is not set is undefined.
8643 struct LDKCommitmentSigned *result;
8645 * A pointer to the contents in the error state.
8646 * Reading from this pointer when `result_ok` is set is undefined.
8648 struct LDKDecodeError *err;
8649 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
8652 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
8653 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
8654 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8656 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
8658 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
8659 * `err` or `result` depending on the state of `result_ok`.
8661 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
8663 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
8666 } LDKCResult_CommitmentSignedDecodeErrorZ;
8669 * The contents of CResult_FundingCreatedDecodeErrorZ
8671 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
8673 * A pointer to the contents in the success state.
8674 * Reading from this pointer when `result_ok` is not set is undefined.
8676 struct LDKFundingCreated *result;
8678 * A pointer to the contents in the error state.
8679 * Reading from this pointer when `result_ok` is set is undefined.
8681 struct LDKDecodeError *err;
8682 } LDKCResult_FundingCreatedDecodeErrorZPtr;
8685 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
8686 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
8687 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8689 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
8691 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
8692 * `err` or `result` depending on the state of `result_ok`.
8694 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
8696 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
8699 } LDKCResult_FundingCreatedDecodeErrorZ;
8702 * The contents of CResult_FundingSignedDecodeErrorZ
8704 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
8706 * A pointer to the contents in the success state.
8707 * Reading from this pointer when `result_ok` is not set is undefined.
8709 struct LDKFundingSigned *result;
8711 * A pointer to the contents in the error state.
8712 * Reading from this pointer when `result_ok` is set is undefined.
8714 struct LDKDecodeError *err;
8715 } LDKCResult_FundingSignedDecodeErrorZPtr;
8718 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
8719 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
8720 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8722 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
8724 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
8725 * `err` or `result` depending on the state of `result_ok`.
8727 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
8729 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
8732 } LDKCResult_FundingSignedDecodeErrorZ;
8735 * The contents of CResult_FundingLockedDecodeErrorZ
8737 typedef union LDKCResult_FundingLockedDecodeErrorZPtr {
8739 * A pointer to the contents in the success state.
8740 * Reading from this pointer when `result_ok` is not set is undefined.
8742 struct LDKFundingLocked *result;
8744 * A pointer to the contents in the error state.
8745 * Reading from this pointer when `result_ok` is set is undefined.
8747 struct LDKDecodeError *err;
8748 } LDKCResult_FundingLockedDecodeErrorZPtr;
8751 * A CResult_FundingLockedDecodeErrorZ represents the result of a fallible operation,
8752 * containing a crate::lightning::ln::msgs::FundingLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
8753 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8755 typedef struct LDKCResult_FundingLockedDecodeErrorZ {
8757 * The contents of this CResult_FundingLockedDecodeErrorZ, accessible via either
8758 * `err` or `result` depending on the state of `result_ok`.
8760 union LDKCResult_FundingLockedDecodeErrorZPtr contents;
8762 * Whether this CResult_FundingLockedDecodeErrorZ represents a success state.
8765 } LDKCResult_FundingLockedDecodeErrorZ;
8770 * An init message to be sent or received from a peer
8772 typedef struct MUST_USE_STRUCT LDKInit {
8774 * A pointer to the opaque Rust object.
8775 * Nearly everywhere, inner must be non-null, however in places where
8776 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8778 LDKnativeInit *inner;
8780 * Indicates that this is the only struct which contains the same pointer.
8781 * Rust functions which take ownership of an object provided via an argument require
8782 * this to be true and invalidate the object pointed to by inner.
8788 * The contents of CResult_InitDecodeErrorZ
8790 typedef union LDKCResult_InitDecodeErrorZPtr {
8792 * A pointer to the contents in the success state.
8793 * Reading from this pointer when `result_ok` is not set is undefined.
8795 struct LDKInit *result;
8797 * A pointer to the contents in the error state.
8798 * Reading from this pointer when `result_ok` is set is undefined.
8800 struct LDKDecodeError *err;
8801 } LDKCResult_InitDecodeErrorZPtr;
8804 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
8805 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
8806 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8808 typedef struct LDKCResult_InitDecodeErrorZ {
8810 * The contents of this CResult_InitDecodeErrorZ, accessible via either
8811 * `err` or `result` depending on the state of `result_ok`.
8813 union LDKCResult_InitDecodeErrorZPtr contents;
8815 * Whether this CResult_InitDecodeErrorZ represents a success state.
8818 } LDKCResult_InitDecodeErrorZ;
8821 * The contents of CResult_OpenChannelDecodeErrorZ
8823 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
8825 * A pointer to the contents in the success state.
8826 * Reading from this pointer when `result_ok` is not set is undefined.
8828 struct LDKOpenChannel *result;
8830 * A pointer to the contents in the error state.
8831 * Reading from this pointer when `result_ok` is set is undefined.
8833 struct LDKDecodeError *err;
8834 } LDKCResult_OpenChannelDecodeErrorZPtr;
8837 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
8838 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
8839 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8841 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
8843 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
8844 * `err` or `result` depending on the state of `result_ok`.
8846 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
8848 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
8851 } LDKCResult_OpenChannelDecodeErrorZ;
8854 * The contents of CResult_RevokeAndACKDecodeErrorZ
8856 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
8858 * A pointer to the contents in the success state.
8859 * Reading from this pointer when `result_ok` is not set is undefined.
8861 struct LDKRevokeAndACK *result;
8863 * A pointer to the contents in the error state.
8864 * Reading from this pointer when `result_ok` is set is undefined.
8866 struct LDKDecodeError *err;
8867 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
8870 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
8871 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
8872 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8874 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
8876 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
8877 * `err` or `result` depending on the state of `result_ok`.
8879 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
8881 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
8884 } LDKCResult_RevokeAndACKDecodeErrorZ;
8887 * The contents of CResult_ShutdownDecodeErrorZ
8889 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
8891 * A pointer to the contents in the success state.
8892 * Reading from this pointer when `result_ok` is not set is undefined.
8894 struct LDKShutdown *result;
8896 * A pointer to the contents in the error state.
8897 * Reading from this pointer when `result_ok` is set is undefined.
8899 struct LDKDecodeError *err;
8900 } LDKCResult_ShutdownDecodeErrorZPtr;
8903 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
8904 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
8905 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8907 typedef struct LDKCResult_ShutdownDecodeErrorZ {
8909 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
8910 * `err` or `result` depending on the state of `result_ok`.
8912 union LDKCResult_ShutdownDecodeErrorZPtr contents;
8914 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
8917 } LDKCResult_ShutdownDecodeErrorZ;
8920 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
8922 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
8924 * A pointer to the contents in the success state.
8925 * Reading from this pointer when `result_ok` is not set is undefined.
8927 struct LDKUpdateFailHTLC *result;
8929 * A pointer to the contents in the error state.
8930 * Reading from this pointer when `result_ok` is set is undefined.
8932 struct LDKDecodeError *err;
8933 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
8936 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
8937 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
8938 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8940 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
8942 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
8943 * `err` or `result` depending on the state of `result_ok`.
8945 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
8947 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
8950 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
8953 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
8955 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
8957 * A pointer to the contents in the success state.
8958 * Reading from this pointer when `result_ok` is not set is undefined.
8960 struct LDKUpdateFailMalformedHTLC *result;
8962 * A pointer to the contents in the error state.
8963 * Reading from this pointer when `result_ok` is set is undefined.
8965 struct LDKDecodeError *err;
8966 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
8969 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
8970 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
8971 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8973 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
8975 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
8976 * `err` or `result` depending on the state of `result_ok`.
8978 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
8980 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
8983 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
8988 * An update_fee message to be sent or received from a peer
8990 typedef struct MUST_USE_STRUCT LDKUpdateFee {
8992 * A pointer to the opaque Rust object.
8993 * Nearly everywhere, inner must be non-null, however in places where
8994 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8996 LDKnativeUpdateFee *inner;
8998 * Indicates that this is the only struct which contains the same pointer.
8999 * Rust functions which take ownership of an object provided via an argument require
9000 * this to be true and invalidate the object pointed to by inner.
9006 * The contents of CResult_UpdateFeeDecodeErrorZ
9008 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
9010 * A pointer to the contents in the success state.
9011 * Reading from this pointer when `result_ok` is not set is undefined.
9013 struct LDKUpdateFee *result;
9015 * A pointer to the contents in the error state.
9016 * Reading from this pointer when `result_ok` is set is undefined.
9018 struct LDKDecodeError *err;
9019 } LDKCResult_UpdateFeeDecodeErrorZPtr;
9022 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
9023 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
9024 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9026 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
9028 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
9029 * `err` or `result` depending on the state of `result_ok`.
9031 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
9033 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
9036 } LDKCResult_UpdateFeeDecodeErrorZ;
9039 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
9041 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
9043 * A pointer to the contents in the success state.
9044 * Reading from this pointer when `result_ok` is not set is undefined.
9046 struct LDKUpdateFulfillHTLC *result;
9048 * A pointer to the contents in the error state.
9049 * Reading from this pointer when `result_ok` is set is undefined.
9051 struct LDKDecodeError *err;
9052 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
9055 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
9056 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9057 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9059 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
9061 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
9062 * `err` or `result` depending on the state of `result_ok`.
9064 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
9066 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
9069 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
9072 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
9074 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
9076 * A pointer to the contents in the success state.
9077 * Reading from this pointer when `result_ok` is not set is undefined.
9079 struct LDKUpdateAddHTLC *result;
9081 * A pointer to the contents in the error state.
9082 * Reading from this pointer when `result_ok` is set is undefined.
9084 struct LDKDecodeError *err;
9085 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
9088 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
9089 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
9090 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9092 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
9094 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
9095 * `err` or `result` depending on the state of `result_ok`.
9097 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
9099 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
9102 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
9107 * A ping message to be sent or received from a peer
9109 typedef struct MUST_USE_STRUCT LDKPing {
9111 * A pointer to the opaque Rust object.
9112 * Nearly everywhere, inner must be non-null, however in places where
9113 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9115 LDKnativePing *inner;
9117 * Indicates that this is the only struct which contains the same pointer.
9118 * Rust functions which take ownership of an object provided via an argument require
9119 * this to be true and invalidate the object pointed to by inner.
9125 * The contents of CResult_PingDecodeErrorZ
9127 typedef union LDKCResult_PingDecodeErrorZPtr {
9129 * A pointer to the contents in the success state.
9130 * Reading from this pointer when `result_ok` is not set is undefined.
9132 struct LDKPing *result;
9134 * A pointer to the contents in the error state.
9135 * Reading from this pointer when `result_ok` is set is undefined.
9137 struct LDKDecodeError *err;
9138 } LDKCResult_PingDecodeErrorZPtr;
9141 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
9142 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
9143 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9145 typedef struct LDKCResult_PingDecodeErrorZ {
9147 * The contents of this CResult_PingDecodeErrorZ, accessible via either
9148 * `err` or `result` depending on the state of `result_ok`.
9150 union LDKCResult_PingDecodeErrorZPtr contents;
9152 * Whether this CResult_PingDecodeErrorZ represents a success state.
9155 } LDKCResult_PingDecodeErrorZ;
9160 * A pong message to be sent or received from a peer
9162 typedef struct MUST_USE_STRUCT LDKPong {
9164 * A pointer to the opaque Rust object.
9165 * Nearly everywhere, inner must be non-null, however in places where
9166 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9168 LDKnativePong *inner;
9170 * Indicates that this is the only struct which contains the same pointer.
9171 * Rust functions which take ownership of an object provided via an argument require
9172 * this to be true and invalidate the object pointed to by inner.
9178 * The contents of CResult_PongDecodeErrorZ
9180 typedef union LDKCResult_PongDecodeErrorZPtr {
9182 * A pointer to the contents in the success state.
9183 * Reading from this pointer when `result_ok` is not set is undefined.
9185 struct LDKPong *result;
9187 * A pointer to the contents in the error state.
9188 * Reading from this pointer when `result_ok` is set is undefined.
9190 struct LDKDecodeError *err;
9191 } LDKCResult_PongDecodeErrorZPtr;
9194 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
9195 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
9196 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9198 typedef struct LDKCResult_PongDecodeErrorZ {
9200 * The contents of this CResult_PongDecodeErrorZ, accessible via either
9201 * `err` or `result` depending on the state of `result_ok`.
9203 union LDKCResult_PongDecodeErrorZPtr contents;
9205 * Whether this CResult_PongDecodeErrorZ represents a success state.
9208 } LDKCResult_PongDecodeErrorZ;
9211 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
9213 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
9215 * A pointer to the contents in the success state.
9216 * Reading from this pointer when `result_ok` is not set is undefined.
9218 struct LDKUnsignedChannelAnnouncement *result;
9220 * A pointer to the contents in the error state.
9221 * Reading from this pointer when `result_ok` is set is undefined.
9223 struct LDKDecodeError *err;
9224 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
9227 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
9228 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
9229 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9231 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
9233 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
9234 * `err` or `result` depending on the state of `result_ok`.
9236 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
9238 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
9241 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
9244 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
9246 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
9248 * A pointer to the contents in the success state.
9249 * Reading from this pointer when `result_ok` is not set is undefined.
9251 struct LDKChannelAnnouncement *result;
9253 * A pointer to the contents in the error state.
9254 * Reading from this pointer when `result_ok` is set is undefined.
9256 struct LDKDecodeError *err;
9257 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
9260 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
9261 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
9262 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9264 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
9266 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
9267 * `err` or `result` depending on the state of `result_ok`.
9269 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
9271 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
9274 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
9279 * The unsigned part of a channel_update
9281 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
9283 * A pointer to the opaque Rust object.
9284 * Nearly everywhere, inner must be non-null, however in places where
9285 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9287 LDKnativeUnsignedChannelUpdate *inner;
9289 * Indicates that this is the only struct which contains the same pointer.
9290 * Rust functions which take ownership of an object provided via an argument require
9291 * this to be true and invalidate the object pointed to by inner.
9294 } LDKUnsignedChannelUpdate;
9297 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
9299 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
9301 * A pointer to the contents in the success state.
9302 * Reading from this pointer when `result_ok` is not set is undefined.
9304 struct LDKUnsignedChannelUpdate *result;
9306 * A pointer to the contents in the error state.
9307 * Reading from this pointer when `result_ok` is set is undefined.
9309 struct LDKDecodeError *err;
9310 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
9313 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
9314 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9315 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9317 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
9319 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
9320 * `err` or `result` depending on the state of `result_ok`.
9322 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
9324 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
9327 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
9330 * The contents of CResult_ChannelUpdateDecodeErrorZ
9332 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
9334 * A pointer to the contents in the success state.
9335 * Reading from this pointer when `result_ok` is not set is undefined.
9337 struct LDKChannelUpdate *result;
9339 * A pointer to the contents in the error state.
9340 * Reading from this pointer when `result_ok` is set is undefined.
9342 struct LDKDecodeError *err;
9343 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
9346 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
9347 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9348 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9350 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
9352 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
9353 * `err` or `result` depending on the state of `result_ok`.
9355 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
9357 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
9360 } LDKCResult_ChannelUpdateDecodeErrorZ;
9363 * The contents of CResult_ErrorMessageDecodeErrorZ
9365 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
9367 * A pointer to the contents in the success state.
9368 * Reading from this pointer when `result_ok` is not set is undefined.
9370 struct LDKErrorMessage *result;
9372 * A pointer to the contents in the error state.
9373 * Reading from this pointer when `result_ok` is set is undefined.
9375 struct LDKDecodeError *err;
9376 } LDKCResult_ErrorMessageDecodeErrorZPtr;
9379 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
9380 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
9381 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9383 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
9385 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
9386 * `err` or `result` depending on the state of `result_ok`.
9388 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
9390 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
9393 } LDKCResult_ErrorMessageDecodeErrorZ;
9398 * The unsigned part of a node_announcement
9400 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
9402 * A pointer to the opaque Rust object.
9403 * Nearly everywhere, inner must be non-null, however in places where
9404 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9406 LDKnativeUnsignedNodeAnnouncement *inner;
9408 * Indicates that this is the only struct which contains the same pointer.
9409 * Rust functions which take ownership of an object provided via an argument require
9410 * this to be true and invalidate the object pointed to by inner.
9413 } LDKUnsignedNodeAnnouncement;
9416 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
9418 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
9420 * A pointer to the contents in the success state.
9421 * Reading from this pointer when `result_ok` is not set is undefined.
9423 struct LDKUnsignedNodeAnnouncement *result;
9425 * A pointer to the contents in the error state.
9426 * Reading from this pointer when `result_ok` is set is undefined.
9428 struct LDKDecodeError *err;
9429 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
9432 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
9433 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
9434 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9436 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
9438 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
9439 * `err` or `result` depending on the state of `result_ok`.
9441 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
9443 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
9446 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
9449 * The contents of CResult_NodeAnnouncementDecodeErrorZ
9451 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
9453 * A pointer to the contents in the success state.
9454 * Reading from this pointer when `result_ok` is not set is undefined.
9456 struct LDKNodeAnnouncement *result;
9458 * A pointer to the contents in the error state.
9459 * Reading from this pointer when `result_ok` is set is undefined.
9461 struct LDKDecodeError *err;
9462 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
9465 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
9466 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
9467 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9469 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
9471 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
9472 * `err` or `result` depending on the state of `result_ok`.
9474 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
9476 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
9479 } LDKCResult_NodeAnnouncementDecodeErrorZ;
9482 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
9484 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
9486 * A pointer to the contents in the success state.
9487 * Reading from this pointer when `result_ok` is not set is undefined.
9489 struct LDKQueryShortChannelIds *result;
9491 * A pointer to the contents in the error state.
9492 * Reading from this pointer when `result_ok` is set is undefined.
9494 struct LDKDecodeError *err;
9495 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
9498 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
9499 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
9500 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9502 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
9504 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
9505 * `err` or `result` depending on the state of `result_ok`.
9507 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
9509 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
9512 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
9517 * A reply_short_channel_ids_end message is sent as a reply to a
9518 * query_short_channel_ids message. The query recipient makes a best
9519 * effort to respond based on their local network view which may not be
9520 * a perfect view of the network.
9522 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
9524 * A pointer to the opaque Rust object.
9525 * Nearly everywhere, inner must be non-null, however in places where
9526 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9528 LDKnativeReplyShortChannelIdsEnd *inner;
9530 * Indicates that this is the only struct which contains the same pointer.
9531 * Rust functions which take ownership of an object provided via an argument require
9532 * this to be true and invalidate the object pointed to by inner.
9535 } LDKReplyShortChannelIdsEnd;
9538 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
9540 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
9542 * A pointer to the contents in the success state.
9543 * Reading from this pointer when `result_ok` is not set is undefined.
9545 struct LDKReplyShortChannelIdsEnd *result;
9547 * A pointer to the contents in the error state.
9548 * Reading from this pointer when `result_ok` is set is undefined.
9550 struct LDKDecodeError *err;
9551 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
9554 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
9555 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
9556 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9558 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
9560 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
9561 * `err` or `result` depending on the state of `result_ok`.
9563 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
9565 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
9568 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
9571 * The contents of CResult_QueryChannelRangeDecodeErrorZ
9573 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
9575 * A pointer to the contents in the success state.
9576 * Reading from this pointer when `result_ok` is not set is undefined.
9578 struct LDKQueryChannelRange *result;
9580 * A pointer to the contents in the error state.
9581 * Reading from this pointer when `result_ok` is set is undefined.
9583 struct LDKDecodeError *err;
9584 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
9587 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
9588 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
9589 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9591 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
9593 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
9594 * `err` or `result` depending on the state of `result_ok`.
9596 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
9598 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
9601 } LDKCResult_QueryChannelRangeDecodeErrorZ;
9604 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
9606 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
9608 * A pointer to the contents in the success state.
9609 * Reading from this pointer when `result_ok` is not set is undefined.
9611 struct LDKReplyChannelRange *result;
9613 * A pointer to the contents in the error state.
9614 * Reading from this pointer when `result_ok` is set is undefined.
9616 struct LDKDecodeError *err;
9617 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
9620 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
9621 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
9622 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9624 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
9626 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
9627 * `err` or `result` depending on the state of `result_ok`.
9629 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
9631 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
9634 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
9639 * A gossip_timestamp_filter message is used by a node to request
9640 * gossip relay for messages in the requested time range when the
9641 * gossip_queries feature has been negotiated.
9643 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
9645 * A pointer to the opaque Rust object.
9646 * Nearly everywhere, inner must be non-null, however in places where
9647 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9649 LDKnativeGossipTimestampFilter *inner;
9651 * Indicates that this is the only struct which contains the same pointer.
9652 * Rust functions which take ownership of an object provided via an argument require
9653 * this to be true and invalidate the object pointed to by inner.
9656 } LDKGossipTimestampFilter;
9659 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
9661 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
9663 * A pointer to the contents in the success state.
9664 * Reading from this pointer when `result_ok` is not set is undefined.
9666 struct LDKGossipTimestampFilter *result;
9668 * A pointer to the contents in the error state.
9669 * Reading from this pointer when `result_ok` is set is undefined.
9671 struct LDKDecodeError *err;
9672 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
9675 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
9676 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
9677 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9679 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
9681 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
9682 * `err` or `result` depending on the state of `result_ok`.
9684 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
9686 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
9689 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
9692 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
9695 typedef enum LDKSignOrCreationError_Tag {
9697 * An error occurred during signing
9699 LDKSignOrCreationError_SignError,
9701 * An error occurred while building the transaction
9703 LDKSignOrCreationError_CreationError,
9705 * Must be last for serialization purposes
9707 LDKSignOrCreationError_Sentinel,
9708 } LDKSignOrCreationError_Tag;
9710 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
9711 LDKSignOrCreationError_Tag tag;
9714 enum LDKCreationError creation_error;
9717 } LDKSignOrCreationError;
9720 * The contents of CResult_InvoiceSignOrCreationErrorZ
9722 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
9724 * A pointer to the contents in the success state.
9725 * Reading from this pointer when `result_ok` is not set is undefined.
9727 struct LDKInvoice *result;
9729 * A pointer to the contents in the error state.
9730 * Reading from this pointer when `result_ok` is set is undefined.
9732 struct LDKSignOrCreationError *err;
9733 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
9736 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
9737 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
9738 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9740 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
9742 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
9743 * `err` or `result` depending on the state of `result_ok`.
9745 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
9747 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
9750 } LDKCResult_InvoiceSignOrCreationErrorZ;
9755 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
9757 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
9758 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
9759 * the return value of [`Filter::register_output`].
9761 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
9762 * may have been spent there. See [`Filter::register_output`] for details.
9764 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
9765 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
9767 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
9769 * A pointer to the opaque Rust object.
9770 * Nearly everywhere, inner must be non-null, however in places where
9771 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9773 LDKnativeWatchedOutput *inner;
9775 * Indicates that this is the only struct which contains the same pointer.
9776 * Rust functions which take ownership of an object provided via an argument require
9777 * this to be true and invalidate the object pointed to by inner.
9783 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
9786 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
9787 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
9788 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
9789 * receiving full blocks from a chain source, any further filtering is unnecessary.
9791 * After an output has been registered, subsequent block retrievals from the chain source must not
9792 * exclude any transactions matching the new criteria nor any in-block descendants of such
9795 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
9796 * should not block on I/O. Implementations should instead queue the newly monitored data to be
9797 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
9798 * invocation that has called the `Filter` must return [`TemporaryFailure`].
9800 * [`TemporaryFailure`]: ChannelMonitorUpdateErr::TemporaryFailure
9801 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
9802 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
9804 typedef struct LDKFilter {
9806 * An opaque pointer which is passed to your function implementations as an argument.
9807 * This has no meaning in the LDK, and can be NULL or any other value.
9811 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
9812 * a spending condition.
9814 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
9816 * Registers interest in spends of a transaction output.
9818 * Optionally, when `output.block_hash` is set, should return any transaction spending the
9819 * output that is found in the corresponding block along with its index.
9821 * This return value is useful for Electrum clients in order to supply in-block descendant
9822 * transactions which otherwise were not included. This is not necessary for other clients if
9823 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
9826 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
9828 * Frees any resources associated with this object given its this_arg pointer.
9829 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9831 void (*free)(void *this_arg);
9835 * An enum which can either contain a crate::lightning::chain::Filter or not
9837 typedef enum LDKCOption_FilterZ_Tag {
9839 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
9841 LDKCOption_FilterZ_Some,
9843 * When we're in this state, this COption_FilterZ contains nothing
9845 LDKCOption_FilterZ_None,
9847 * Must be last for serialization purposes
9849 LDKCOption_FilterZ_Sentinel,
9850 } LDKCOption_FilterZ_Tag;
9852 typedef struct LDKCOption_FilterZ {
9853 LDKCOption_FilterZ_Tag tag;
9856 struct LDKFilter some;
9859 } LDKCOption_FilterZ;
9864 * A read-only reference to a current ChannelMonitor.
9866 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
9869 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
9871 * A pointer to the opaque Rust object.
9872 * Nearly everywhere, inner must be non-null, however in places where
9873 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9875 LDKnativeLockedChannelMonitor *inner;
9877 * Indicates that this is the only struct which contains the same pointer.
9878 * Rust functions which take ownership of an object provided via an argument require
9879 * this to be true and invalidate the object pointed to by inner.
9882 } LDKLockedChannelMonitor;
9885 * The contents of CResult_LockedChannelMonitorNoneZ
9887 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
9889 * A pointer to the contents in the success state.
9890 * Reading from this pointer when `result_ok` is not set is undefined.
9892 struct LDKLockedChannelMonitor *result;
9894 * Note that this value is always NULL, as there are no contents in the Err variant
9897 } LDKCResult_LockedChannelMonitorNoneZPtr;
9900 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
9901 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
9902 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9904 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
9906 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
9907 * `err` or `result` depending on the state of `result_ok`.
9909 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
9911 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
9914 } LDKCResult_LockedChannelMonitorNoneZ;
9917 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
9918 * This corresponds to std::vector in C++
9920 typedef struct LDKCVec_OutPointZ {
9922 * The elements in the array.
9923 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9925 struct LDKOutPoint *data;
9927 * The number of elements pointed to by `data`.
9930 } LDKCVec_OutPointZ;
9933 * A trait indicating an object may generate message send events
9935 typedef struct LDKMessageSendEventsProvider {
9937 * An opaque pointer which is passed to your function implementations as an argument.
9938 * This has no meaning in the LDK, and can be NULL or any other value.
9942 * Gets the list of pending events which were generated by previous actions, clearing the list
9945 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
9947 * Frees any resources associated with this object given its this_arg pointer.
9948 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9950 void (*free)(void *this_arg);
9951 } LDKMessageSendEventsProvider;
9954 * A trait implemented for objects handling events from [`EventsProvider`].
9956 typedef struct LDKEventHandler {
9958 * An opaque pointer which is passed to your function implementations as an argument.
9959 * This has no meaning in the LDK, and can be NULL or any other value.
9963 * Handles the given [`Event`].
9965 * See [`EventsProvider`] for details that must be considered when implementing this method.
9967 void (*handle_event)(const void *this_arg, const struct LDKEvent *NONNULL_PTR event);
9969 * Frees any resources associated with this object given its this_arg pointer.
9970 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9972 void (*free)(void *this_arg);
9976 * A trait indicating an object may generate events.
9978 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
9982 * See [`process_pending_events`] for requirements around event processing.
9984 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
9985 * event since the last invocation. The handler must either act upon the event immediately
9986 * or preserve it for later handling.
9988 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
9989 * consult the provider's documentation on the implication of processing events and how a handler
9990 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
9991 * [`ChainMonitor::process_pending_events`]).
9993 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
9996 * [`process_pending_events`]: Self::process_pending_events
9997 * [`handle_event`]: EventHandler::handle_event
9998 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
9999 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
10001 typedef struct LDKEventsProvider {
10003 * An opaque pointer which is passed to your function implementations as an argument.
10004 * This has no meaning in the LDK, and can be NULL or any other value.
10008 * Processes any events generated since the last call using the given event handler.
10010 * Subsequent calls must only process new events. However, handlers must be capable of handling
10011 * duplicate events across process restarts. This may occur if the provider was recovered from
10012 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
10014 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
10016 * Frees any resources associated with this object given its this_arg pointer.
10017 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10019 void (*free)(void *this_arg);
10020 } LDKEventsProvider;
10025 * Configuration we set when applicable.
10027 * Default::default() provides sane defaults.
10029 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
10031 * A pointer to the opaque Rust object.
10032 * Nearly everywhere, inner must be non-null, however in places where
10033 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10035 LDKnativeChannelHandshakeConfig *inner;
10037 * Indicates that this is the only struct which contains the same pointer.
10038 * Rust functions which take ownership of an object provided via an argument require
10039 * this to be true and invalidate the object pointed to by inner.
10042 } LDKChannelHandshakeConfig;
10047 * Optional channel limits which are applied during channel creation.
10049 * These limits are only applied to our counterparty's limits, not our own.
10051 * Use 0/<type>::max_value() as appropriate to skip checking.
10053 * Provides sane defaults for most configurations.
10055 * Most additional limits are disabled except those with which specify a default in individual
10056 * field documentation. Note that this may result in barely-usable channels, but since they
10057 * are applied mostly only to incoming channels that's not much of a problem.
10059 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
10061 * A pointer to the opaque Rust object.
10062 * Nearly everywhere, inner must be non-null, however in places where
10063 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10065 LDKnativeChannelHandshakeLimits *inner;
10067 * Indicates that this is the only struct which contains the same pointer.
10068 * Rust functions which take ownership of an object provided via an argument require
10069 * this to be true and invalidate the object pointed to by inner.
10072 } LDKChannelHandshakeLimits;
10077 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
10079 * Default::default() provides sane defaults for most configurations
10080 * (but currently with 0 relay fees!)
10082 typedef struct MUST_USE_STRUCT LDKUserConfig {
10084 * A pointer to the opaque Rust object.
10085 * Nearly everywhere, inner must be non-null, however in places where
10086 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10088 LDKnativeUserConfig *inner;
10090 * Indicates that this is the only struct which contains the same pointer.
10091 * Rust functions which take ownership of an object provided via an argument require
10092 * this to be true and invalidate the object pointed to by inner.
10100 * The best known block as identified by its hash and height.
10102 typedef struct MUST_USE_STRUCT LDKBestBlock {
10104 * A pointer to the opaque Rust object.
10105 * Nearly everywhere, inner must be non-null, however in places where
10106 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10108 LDKnativeBestBlock *inner;
10110 * Indicates that this is the only struct which contains the same pointer.
10111 * Rust functions which take ownership of an object provided via an argument require
10112 * this to be true and invalidate the object pointed to by inner.
10118 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
10121 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
10122 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
10123 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
10126 typedef struct LDKListen {
10128 * An opaque pointer which is passed to your function implementations as an argument.
10129 * This has no meaning in the LDK, and can be NULL or any other value.
10133 * Notifies the listener that a block was added at the given height.
10135 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
10137 * Notifies the listener that a block was removed at the given height.
10139 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
10141 * Frees any resources associated with this object given its this_arg pointer.
10142 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10144 void (*free)(void *this_arg);
10148 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
10149 * unconfirmed during a chain reorganization.
10151 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
10152 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
10153 * related to registered transactions and outputs. Upon notification, it would pass along the
10154 * matching transactions using this interface.
10158 * The intended use is as follows:
10159 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
10160 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
10161 * that has been reorganized out of the chain.
10162 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
10166 * Clients must call these methods in chain order. Specifically:
10167 * - Transactions confirmed in a block must be given before transactions confirmed in a later
10169 * - Dependent transactions within the same block must be given in topological order, possibly in
10171 * - Unconfirmed transactions must be given after the original confirmations and before any
10174 * See individual method documentation for further details.
10176 * [`transactions_confirmed`]: Self::transactions_confirmed
10177 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
10178 * [`best_block_updated`]: Self::best_block_updated
10179 * [`get_relevant_txids`]: Self::get_relevant_txids
10181 typedef struct LDKConfirm {
10183 * An opaque pointer which is passed to your function implementations as an argument.
10184 * This has no meaning in the LDK, and can be NULL or any other value.
10188 * Processes transactions confirmed in a block with a given header and height.
10190 * Should be called for any transactions registered by [`Filter::register_tx`] or any
10191 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
10192 * appearing in the same block do not need to be included in the same call; instead, multiple
10193 * calls with additional transactions may be made so long as they are made in [chain order].
10195 * May be called before or after [`best_block_updated`] for the corresponding block. However,
10196 * in the event of a chain reorganization, it must not be called with a `header` that is no
10197 * longer in the chain as of the last call to [`best_block_updated`].
10199 * [chain order]: Confirm#Order
10200 * [`best_block_updated`]: Self::best_block_updated
10202 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
10204 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
10206 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
10207 * reorganized out of the best chain. Once called, the given transaction should not be returned
10208 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
10210 * [`get_relevant_txids`]: Self::get_relevant_txids
10211 * [`transactions_confirmed`]: Self::transactions_confirmed
10213 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
10215 * Processes an update to the best header connected at the given height.
10217 * Should be called when a new header is available but may be skipped for intermediary blocks
10218 * if they become available at the same time.
10220 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
10222 * Returns transactions that should be monitored for reorganization out of the chain.
10224 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
10225 * confirmations to be safe from a chain reorganization. Should not include any transactions
10226 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
10228 * May be called to determine the subset of transactions that must still be monitored for
10229 * reorganization. Will be idempotent between calls but may change as a result of calls to the
10230 * other interface methods. Thus, this is useful to determine which transactions may need to be
10231 * given to [`transaction_unconfirmed`].
10233 * [`transactions_confirmed`]: Self::transactions_confirmed
10234 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
10236 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
10238 * Frees any resources associated with this object given its this_arg pointer.
10239 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10241 void (*free)(void *this_arg);
10247 * An opaque identifier describing a specific [`Persist`] method call.
10249 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
10251 * A pointer to the opaque Rust object.
10252 * Nearly everywhere, inner must be non-null, however in places where
10253 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10255 LDKnativeMonitorUpdateId *inner;
10257 * Indicates that this is the only struct which contains the same pointer.
10258 * Rust functions which take ownership of an object provided via an argument require
10259 * this to be true and invalidate the object pointed to by inner.
10262 } LDKMonitorUpdateId;
10265 * `Persist` defines behavior for persisting channel monitors: this could mean
10266 * writing once to disk, and/or uploading to one or more backup services.
10268 * Each method can return three possible values:
10269 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
10270 * implementation should return `Ok(())`, indicating normal channel operation should continue.
10271 * * If persistence happens asynchronously, implementations should first ensure the
10272 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
10273 * `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the
10274 * background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be
10275 * called with the corresponding [`MonitorUpdateId`].
10277 * Note that unlike the direct [`chain::Watch`] interface,
10278 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
10280 * * If persistence fails for some reason, implementations should return
10281 * `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be
10282 * closed without broadcasting the latest state. See
10283 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
10285 typedef struct LDKPersist {
10287 * An opaque pointer which is passed to your function implementations as an argument.
10288 * This has no meaning in the LDK, and can be NULL or any other value.
10292 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
10293 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
10295 * The data can be stored any way you want, but the identifier provided by LDK is the
10296 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
10297 * and the stored channel data). Note that you **must** persist every new monitor to disk.
10299 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
10300 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
10302 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
10303 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
10305 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
10306 * [`Writeable::write`]: crate::util::ser::Writeable::write
10308 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
10310 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
10313 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
10314 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
10317 * During blockchain synchronization operations, this may be called with no
10318 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
10319 * Note that after the full [`ChannelMonitor`] is persisted any previous
10320 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
10321 * applied to the persisted [`ChannelMonitor`] as they were already applied.
10323 * If an implementer chooses to persist the updates only, they need to make
10324 * sure that all the updates are applied to the `ChannelMonitors` *before*
10325 * the set of channel monitors is given to the `ChannelManager`
10326 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
10327 * applying a monitor update to a monitor. If full `ChannelMonitors` are
10328 * persisted, then there is no need to persist individual updates.
10330 * Note that there could be a performance tradeoff between persisting complete
10331 * channel monitors on every update vs. persisting only updates and applying
10332 * them in batches. The size of each monitor grows `O(number of state updates)`
10333 * whereas updates are small and `O(1)`.
10335 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
10336 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
10338 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
10339 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
10340 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
10342 * [`Writeable::write`]: crate::util::ser::Writeable::write
10344 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
10346 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
10348 * Frees any resources associated with this object given its this_arg pointer.
10349 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10351 void (*free)(void *this_arg);
10357 * An implementation of [`chain::Watch`] for monitoring channels.
10359 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
10360 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
10361 * or used independently to monitor channels remotely. See the [module-level documentation] for
10364 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
10365 * [module-level documentation]: crate::chain::chainmonitor
10367 typedef struct MUST_USE_STRUCT LDKChainMonitor {
10369 * A pointer to the opaque Rust object.
10370 * Nearly everywhere, inner must be non-null, however in places where
10371 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10373 LDKnativeChainMonitor *inner;
10375 * Indicates that this is the only struct which contains the same pointer.
10376 * Rust functions which take ownership of an object provided via an argument require
10377 * this to be true and invalidate the object pointed to by inner.
10385 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
10386 * and derives keys from that.
10388 * Your node_id is seed/0'
10389 * ChannelMonitor closes may use seed/1'
10390 * Cooperative closes may use seed/2'
10391 * The two close keys may be needed to claim on-chain funds!
10393 typedef struct MUST_USE_STRUCT LDKKeysManager {
10395 * A pointer to the opaque Rust object.
10396 * Nearly everywhere, inner must be non-null, however in places where
10397 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10399 LDKnativeKeysManager *inner;
10401 * Indicates that this is the only struct which contains the same pointer.
10402 * Rust functions which take ownership of an object provided via an argument require
10403 * this to be true and invalidate the object pointed to by inner.
10411 * Chain-related parameters used to construct a new `ChannelManager`.
10413 * Typically, the block-specific parameters are derived from the best block hash for the network,
10414 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
10415 * are not needed when deserializing a previously constructed `ChannelManager`.
10417 typedef struct MUST_USE_STRUCT LDKChainParameters {
10419 * A pointer to the opaque Rust object.
10420 * Nearly everywhere, inner must be non-null, however in places where
10421 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10423 LDKnativeChainParameters *inner;
10425 * Indicates that this is the only struct which contains the same pointer.
10426 * Rust functions which take ownership of an object provided via an argument require
10427 * this to be true and invalidate the object pointed to by inner.
10430 } LDKChainParameters;
10435 * Information needed for constructing an invoice route hint for this channel.
10437 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
10439 * A pointer to the opaque Rust object.
10440 * Nearly everywhere, inner must be non-null, however in places where
10441 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10443 LDKnativeCounterpartyForwardingInfo *inner;
10445 * Indicates that this is the only struct which contains the same pointer.
10446 * Rust functions which take ownership of an object provided via an argument require
10447 * this to be true and invalidate the object pointed to by inner.
10450 } LDKCounterpartyForwardingInfo;
10455 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
10456 * to better separate parameters.
10458 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
10460 * A pointer to the opaque Rust object.
10461 * Nearly everywhere, inner must be non-null, however in places where
10462 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10464 LDKnativeChannelCounterparty *inner;
10466 * Indicates that this is the only struct which contains the same pointer.
10467 * Rust functions which take ownership of an object provided via an argument require
10468 * this to be true and invalidate the object pointed to by inner.
10471 } LDKChannelCounterparty;
10474 * A 3-byte byte array.
10476 typedef struct LDKThreeBytes {
10484 * A trait to describe an object which can receive channel messages.
10486 * Messages MAY be called in parallel when they originate from different their_node_ids, however
10487 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
10489 typedef struct LDKChannelMessageHandler {
10491 * An opaque pointer which is passed to your function implementations as an argument.
10492 * This has no meaning in the LDK, and can be NULL or any other value.
10496 * Handle an incoming open_channel message from the given peer.
10498 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
10500 * Handle an incoming accept_channel message from the given peer.
10502 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
10504 * Handle an incoming funding_created message from the given peer.
10506 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
10508 * Handle an incoming funding_signed message from the given peer.
10510 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
10512 * Handle an incoming funding_locked message from the given peer.
10514 void (*handle_funding_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg);
10516 * Handle an incoming shutdown message from the given peer.
10518 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg);
10520 * Handle an incoming closing_signed message from the given peer.
10522 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
10524 * Handle an incoming update_add_htlc message from the given peer.
10526 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
10528 * Handle an incoming update_fulfill_htlc message from the given peer.
10530 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
10532 * Handle an incoming update_fail_htlc message from the given peer.
10534 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
10536 * Handle an incoming update_fail_malformed_htlc message from the given peer.
10538 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
10540 * Handle an incoming commitment_signed message from the given peer.
10542 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
10544 * Handle an incoming revoke_and_ack message from the given peer.
10546 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
10548 * Handle an incoming update_fee message from the given peer.
10550 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
10552 * Handle an incoming announcement_signatures message from the given peer.
10554 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
10556 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
10557 * is believed to be possible in the future (eg they're sending us messages we don't
10558 * understand or indicate they require unknown feature bits), no_connection_possible is set
10559 * and any outstanding channels should be failed.
10561 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
10563 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
10565 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
10567 * Handle an incoming channel_reestablish message from the given peer.
10569 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
10571 * Handle an incoming channel update from the given peer.
10573 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
10575 * Handle an incoming error message from the given peer.
10577 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
10579 * Implementation of MessageSendEventsProvider for this object.
10581 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
10583 * Frees any resources associated with this object given its this_arg pointer.
10584 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10586 void (*free)(void *this_arg);
10587 } LDKChannelMessageHandler;
10592 * Arguments for the creation of a ChannelManager that are not deserialized.
10594 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
10596 * 1) Deserialize all stored [`ChannelMonitor`]s.
10597 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
10598 * `<(BlockHash, ChannelManager)>::read(reader, args)`
10599 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
10600 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
10601 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
10602 * same way you would handle a [`chain::Filter`] call using
10603 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
10604 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
10605 * 5) Disconnect/connect blocks on the [`ChannelManager`].
10606 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
10607 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
10608 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
10610 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
10611 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
10613 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
10614 * call any other methods on the newly-deserialized [`ChannelManager`].
10616 * Note that because some channels may be closed during deserialization, it is critical that you
10617 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
10618 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
10619 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
10620 * not force-close the same channels but consider them live), you may end up revoking a state for
10621 * which you've already broadcasted the transaction.
10623 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
10625 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
10627 * A pointer to the opaque Rust object.
10628 * Nearly everywhere, inner must be non-null, however in places where
10629 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10631 LDKnativeChannelManagerReadArgs *inner;
10633 * Indicates that this is the only struct which contains the same pointer.
10634 * Rust functions which take ownership of an object provided via an argument require
10635 * this to be true and invalidate the object pointed to by inner.
10638 } LDKChannelManagerReadArgs;
10643 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
10644 * This is used to convince the recipient that the channel is at a certain commitment
10645 * number even if they lost that data due to a local failure. Of course, the peer may lie
10646 * and even later commitments may have been revoked.
10648 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
10650 * A pointer to the opaque Rust object.
10651 * Nearly everywhere, inner must be non-null, however in places where
10652 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10654 LDKnativeDataLossProtect *inner;
10656 * Indicates that this is the only struct which contains the same pointer.
10657 * Rust functions which take ownership of an object provided via an argument require
10658 * this to be true and invalidate the object pointed to by inner.
10661 } LDKDataLossProtect;
10664 * A trait to describe an object which can receive routing messages.
10666 * # Implementor DoS Warnings
10668 * For `gossip_queries` messages there are potential DoS vectors when handling
10669 * inbound queries. Implementors using an on-disk network graph should be aware of
10670 * repeated disk I/O for queries accessing different parts of the network graph.
10672 typedef struct LDKRoutingMessageHandler {
10674 * An opaque pointer which is passed to your function implementations as an argument.
10675 * This has no meaning in the LDK, and can be NULL or any other value.
10679 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
10680 * false or returning an Err otherwise.
10682 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
10684 * Handle a channel_announcement message, returning true if it should be forwarded on, false
10685 * or returning an Err otherwise.
10687 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
10689 * Handle an incoming channel_update message, returning true if it should be forwarded on,
10690 * false or returning an Err otherwise.
10692 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
10694 * Gets a subset of the channel announcements and updates required to dump our routing table
10695 * to a remote node, starting at the short_channel_id indicated by starting_point and
10696 * including the batch_amount entries immediately higher in numerical value than starting_point.
10698 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
10700 * Gets a subset of the node announcements required to dump our routing table to a remote node,
10701 * starting at the node *after* the provided publickey and including batch_amount entries
10702 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
10703 * If None is provided for starting_point, we start at the first node.
10705 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
10707 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
10709 * Called when a connection is established with a peer. This can be used to
10710 * perform routing table synchronization using a strategy defined by the
10713 void (*sync_routing_table)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
10715 * Handles the reply of a query we initiated to learn about channels
10716 * for a given range of blocks. We can expect to receive one or more
10717 * replies to a single query.
10719 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
10721 * Handles the reply of a query we initiated asking for routing gossip
10722 * messages for a list of channels. We should receive this message when
10723 * a node has completed its best effort to send us the pertaining routing
10726 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
10728 * Handles when a peer asks us to send a list of short_channel_ids
10729 * for the requested range of blocks.
10731 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
10733 * Handles when a peer asks us to send routing gossip messages for a
10734 * list of short_channel_ids.
10736 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
10738 * Implementation of MessageSendEventsProvider for this object.
10740 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
10742 * Frees any resources associated with this object given its this_arg pointer.
10743 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10745 void (*free)(void *this_arg);
10746 } LDKRoutingMessageHandler;
10749 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
10752 typedef struct LDKCustomMessageReader {
10754 * An opaque pointer which is passed to your function implementations as an argument.
10755 * This has no meaning in the LDK, and can be NULL or any other value.
10759 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
10760 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
10761 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
10762 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
10764 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
10766 * Frees any resources associated with this object given its this_arg pointer.
10767 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10769 void (*free)(void *this_arg);
10770 } LDKCustomMessageReader;
10773 * Handler for BOLT1-compliant messages.
10775 typedef struct LDKCustomMessageHandler {
10777 * An opaque pointer which is passed to your function implementations as an argument.
10778 * This has no meaning in the LDK, and can be NULL or any other value.
10782 * Called with the message type that was received and the buffer to be read.
10783 * Can return a `MessageHandlingError` if the message could not be handled.
10785 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
10787 * Gets the list of pending messages which were generated by the custom message
10788 * handler, clearing the list in the process. The first tuple element must
10789 * correspond to the intended recipients node ids. If no connection to one of the
10790 * specified node does not exist, the message is simply not sent to it.
10792 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
10794 * Implementation of CustomMessageReader for this object.
10796 struct LDKCustomMessageReader CustomMessageReader;
10798 * Frees any resources associated with this object given its this_arg pointer.
10799 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10801 void (*free)(void *this_arg);
10802 } LDKCustomMessageHandler;
10807 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
10808 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
10810 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
10812 * A pointer to the opaque Rust object.
10813 * Nearly everywhere, inner must be non-null, however in places where
10814 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10816 LDKnativeIgnoringMessageHandler *inner;
10818 * Indicates that this is the only struct which contains the same pointer.
10819 * Rust functions which take ownership of an object provided via an argument require
10820 * this to be true and invalidate the object pointed to by inner.
10823 } LDKIgnoringMessageHandler;
10828 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
10829 * You can provide one of these as the route_handler in a MessageHandler.
10831 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
10833 * A pointer to the opaque Rust object.
10834 * Nearly everywhere, inner must be non-null, however in places where
10835 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10837 LDKnativeErroringMessageHandler *inner;
10839 * Indicates that this is the only struct which contains the same pointer.
10840 * Rust functions which take ownership of an object provided via an argument require
10841 * this to be true and invalidate the object pointed to by inner.
10844 } LDKErroringMessageHandler;
10849 * Provides references to trait impls which handle different types of messages.
10851 typedef struct MUST_USE_STRUCT LDKMessageHandler {
10853 * A pointer to the opaque Rust object.
10854 * Nearly everywhere, inner must be non-null, however in places where
10855 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10857 LDKnativeMessageHandler *inner;
10859 * Indicates that this is the only struct which contains the same pointer.
10860 * Rust functions which take ownership of an object provided via an argument require
10861 * this to be true and invalidate the object pointed to by inner.
10864 } LDKMessageHandler;
10867 * Provides an object which can be used to send data to and which uniquely identifies a connection
10868 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
10869 * implement Hash to meet the PeerManager API.
10871 * For efficiency, Clone should be relatively cheap for this type.
10873 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
10874 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
10875 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
10876 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
10877 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
10878 * to simply use another value which is guaranteed to be globally unique instead.
10880 typedef struct LDKSocketDescriptor {
10882 * An opaque pointer which is passed to your function implementations as an argument.
10883 * This has no meaning in the LDK, and can be NULL or any other value.
10887 * Attempts to send some data from the given slice to the peer.
10889 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
10890 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
10891 * called and further write attempts may occur until that time.
10893 * If the returned size is smaller than `data.len()`, a
10894 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
10895 * written. Additionally, until a `send_data` event completes fully, no further
10896 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
10897 * prevent denial-of-service issues, you should not read or buffer any data from the socket
10900 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
10901 * (indicating that read events should be paused to prevent DoS in the send buffer),
10902 * `resume_read` may be set indicating that read events on this descriptor should resume. A
10903 * `resume_read` of false carries no meaning, and should not cause any action.
10905 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
10907 * Disconnect the socket pointed to by this SocketDescriptor.
10909 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
10910 * call (doing so is a noop).
10912 void (*disconnect_socket)(void *this_arg);
10914 * Checks if two objects are equal given this object's this_arg pointer and another object.
10916 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
10918 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
10919 * This is used, for example, for inclusion of this object in a hash map.
10921 uint64_t (*hash)(const void *this_arg);
10923 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
10924 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
10925 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
10927 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
10929 * Frees any resources associated with this object given its this_arg pointer.
10930 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10932 void (*free)(void *this_arg);
10933 } LDKSocketDescriptor;
10938 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
10939 * socket events into messages which it passes on to its [`MessageHandler`].
10941 * Locks are taken internally, so you must never assume that reentrancy from a
10942 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
10944 * Calls to [`read_event`] will decode relevant messages and pass them to the
10945 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
10946 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
10947 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
10948 * calls only after previous ones have returned.
10950 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
10951 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
10952 * essentially you should default to using a SimpleRefPeerManager, and use a
10953 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
10954 * you're using lightning-net-tokio.
10956 * [`read_event`]: PeerManager::read_event
10958 typedef struct MUST_USE_STRUCT LDKPeerManager {
10960 * A pointer to the opaque Rust object.
10961 * Nearly everywhere, inner must be non-null, however in places where
10962 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10964 LDKnativePeerManager *inner;
10966 * Indicates that this is the only struct which contains the same pointer.
10967 * Rust functions which take ownership of an object provided via an argument require
10968 * this to be true and invalidate the object pointed to by inner.
10976 * Static channel fields used to build transactions given per-commitment fields, organized by
10977 * broadcaster/countersignatory.
10979 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
10980 * as_holder_broadcastable and as_counterparty_broadcastable functions.
10982 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
10984 * A pointer to the opaque Rust object.
10985 * Nearly everywhere, inner must be non-null, however in places where
10986 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10988 LDKnativeDirectedChannelTransactionParameters *inner;
10990 * Indicates that this is the only struct which contains the same pointer.
10991 * Rust functions which take ownership of an object provided via an argument require
10992 * this to be true and invalidate the object pointed to by inner.
10995 } LDKDirectedChannelTransactionParameters;
11000 * A read-only view of [`NetworkGraph`].
11002 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
11004 * A pointer to the opaque Rust object.
11005 * Nearly everywhere, inner must be non-null, however in places where
11006 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11008 LDKnativeReadOnlyNetworkGraph *inner;
11010 * Indicates that this is the only struct which contains the same pointer.
11011 * Rust functions which take ownership of an object provided via an argument require
11012 * this to be true and invalidate the object pointed to by inner.
11015 } LDKReadOnlyNetworkGraph;
11020 * Receives and validates network updates from peers,
11021 * stores authentic and relevant data as a network graph.
11022 * This network graph is then used for routing payments.
11023 * Provides interface to help with initial routing sync by
11024 * serving historical announcements.
11026 * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
11027 * [`NetworkGraph`].
11029 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
11031 * A pointer to the opaque Rust object.
11032 * Nearly everywhere, inner must be non-null, however in places where
11033 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11035 LDKnativeNetGraphMsgHandler *inner;
11037 * Indicates that this is the only struct which contains the same pointer.
11038 * Rust functions which take ownership of an object provided via an argument require
11039 * this to be true and invalidate the object pointed to by inner.
11042 } LDKNetGraphMsgHandler;
11045 * An interface used to score payment channels for path finding.
11047 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
11049 typedef struct LDKScore {
11051 * An opaque pointer which is passed to your function implementations as an argument.
11052 * This has no meaning in the LDK, and can be NULL or any other value.
11056 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
11057 * given channel in the direction from `source` to `target`.
11059 * The channel's capacity (less any other MPP parts which are also being considered for use in
11060 * the same payment) is given by `channel_capacity_msat`. It may be guessed from various
11061 * sources or assumed from no data at all.
11063 * For hints provided in the invoice, we assume the channel has sufficient capacity to accept
11064 * the invoice's full amount, and provide a `channel_capacity_msat` of `None`. In all other
11065 * cases it is set to `Some`, even if we're guessing at the channel value.
11067 * Your code should be overflow-safe through a `channel_capacity_msat` of 21 million BTC.
11069 uint64_t (*channel_penalty_msat)(const void *this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, struct LDKCOption_u64Z channel_capacity_msat, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target);
11071 * Handles updating channel penalties after failing to route through a channel.
11073 void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
11075 * Handles updating channel penalties after successfully routing along a path.
11077 void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
11079 * Serialize the object into a byte array
11081 struct LDKCVec_u8Z (*write)(const void *this_arg);
11083 * Frees any resources associated with this object given its this_arg pointer.
11084 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11086 void (*free)(void *this_arg);
11090 * A scorer that is accessed under a lock.
11092 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
11093 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
11094 * implementations. Internal locking would be detrimental to route finding performance and could
11095 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
11097 * [`find_route`]: crate::routing::router::find_route
11099 typedef struct LDKLockableScore {
11101 * An opaque pointer which is passed to your function implementations as an argument.
11102 * This has no meaning in the LDK, and can be NULL or any other value.
11106 * Returns the locked scorer.
11108 struct LDKScore (*lock)(const void *this_arg);
11110 * Frees any resources associated with this object given its this_arg pointer.
11111 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11113 void (*free)(void *this_arg);
11114 } LDKLockableScore;
11119 * A concrete implementation of [`LockableScore`] which supports multi-threading.
11121 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
11123 * A pointer to the opaque Rust object.
11124 * Nearly everywhere, inner must be non-null, however in places where
11125 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11127 LDKnativeMultiThreadedLockableScore *inner;
11129 * Indicates that this is the only struct which contains the same pointer.
11130 * Rust functions which take ownership of an object provided via an argument require
11131 * this to be true and invalidate the object pointed to by inner.
11134 } LDKMultiThreadedLockableScore;
11139 * FilesystemPersister persists channel data on disk, where each channel's
11140 * data is stored in a file named after its funding outpoint.
11142 * Warning: this module does the best it can with calls to persist data, but it
11143 * can only guarantee that the data is passed to the drive. It is up to the
11144 * drive manufacturers to do the actual persistence properly, which they often
11145 * don't (especially on consumer-grade hardware). Therefore, it is up to the
11146 * user to validate their entire storage stack, to ensure the writes are
11148 * Corollary: especially when dealing with larger amounts of money, it is best
11149 * practice to have multiple channel data backups and not rely only on one
11150 * FilesystemPersister.
11152 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
11154 * A pointer to the opaque Rust object.
11155 * Nearly everywhere, inner must be non-null, however in places where
11156 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11158 LDKnativeFilesystemPersister *inner;
11160 * Indicates that this is the only struct which contains the same pointer.
11161 * Rust functions which take ownership of an object provided via an argument require
11162 * this to be true and invalidate the object pointed to by inner.
11165 } LDKFilesystemPersister;
11170 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
11171 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
11172 * responsibilities are:
11173 * * Processing [`Event`]s with a user-provided [`EventHandler`].
11174 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
11175 * writing it to disk/backups by invoking the callback given to it at startup.
11176 * [`ChannelManager`] persistence should be done in the background.
11177 * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
11178 * at the appropriate intervals.
11179 * * Calling [`NetworkGraph::remove_stale_channels`] (if a [`NetGraphMsgHandler`] is provided to
11180 * [`BackgroundProcessor::start`]).
11182 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
11183 * upon as doing so may result in high latency.
11187 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
11188 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
11189 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
11190 * unilateral chain closure fees are at risk.
11192 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
11193 * [`Event`]: lightning::util::events::Event
11194 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
11196 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
11198 * A pointer to the opaque Rust object.
11199 * Nearly everywhere, inner must be non-null, however in places where
11200 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11202 LDKnativeBackgroundProcessor *inner;
11204 * Indicates that this is the only struct which contains the same pointer.
11205 * Rust functions which take ownership of an object provided via an argument require
11206 * this to be true and invalidate the object pointed to by inner.
11209 } LDKBackgroundProcessor;
11212 * Trait which handles persisting a [`ChannelManager`] to disk.
11214 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
11216 typedef struct LDKChannelManagerPersister {
11218 * An opaque pointer which is passed to your function implementations as an argument.
11219 * This has no meaning in the LDK, and can be NULL or any other value.
11223 * Persist the given [`ChannelManager`] to disk, returning an error if persistence failed
11224 * (which will cause the [`BackgroundProcessor`] which called this method to exit.
11226 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
11228 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
11230 * Frees any resources associated with this object given its this_arg pointer.
11231 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11233 void (*free)(void *this_arg);
11234 } LDKChannelManagerPersister;
11239 * Data of the `RawInvoice` that is encoded in the data part
11241 typedef struct MUST_USE_STRUCT LDKRawDataPart {
11243 * A pointer to the opaque Rust object.
11244 * Nearly everywhere, inner must be non-null, however in places where
11245 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11247 LDKnativeRawDataPart *inner;
11249 * Indicates that this is the only struct which contains the same pointer.
11250 * Rust functions which take ownership of an object provided via an argument require
11251 * this to be true and invalidate the object pointed to by inner.
11261 typedef struct MUST_USE_STRUCT LDKSha256 {
11263 * A pointer to the opaque Rust object.
11264 * Nearly everywhere, inner must be non-null, however in places where
11265 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11267 LDKnativeSha256 *inner;
11269 * Indicates that this is the only struct which contains the same pointer.
11270 * Rust functions which take ownership of an object provided via an argument require
11271 * this to be true and invalidate the object pointed to by inner.
11279 * `min_final_cltv_expiry` to use for the last HTLC in the route
11281 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
11283 * A pointer to the opaque Rust object.
11284 * Nearly everywhere, inner must be non-null, however in places where
11285 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11287 LDKnativeMinFinalCltvExpiry *inner;
11289 * Indicates that this is the only struct which contains the same pointer.
11290 * Rust functions which take ownership of an object provided via an argument require
11291 * this to be true and invalidate the object pointed to by inner.
11294 } LDKMinFinalCltvExpiry;
11297 * Integer in the range `0..32`
11299 typedef struct LDKu5 {
11304 * A 20-byte byte array.
11306 typedef struct LDKTwentyBytes {
11314 * Fallback address in case no LN payment is possible
11316 typedef enum LDKFallback_Tag {
11317 LDKFallback_SegWitProgram,
11318 LDKFallback_PubKeyHash,
11319 LDKFallback_ScriptHash,
11321 * Must be last for serialization purposes
11323 LDKFallback_Sentinel,
11326 typedef struct LDKFallback_LDKSegWitProgram_Body {
11327 struct LDKu5 version;
11328 struct LDKCVec_u8Z program;
11329 } LDKFallback_LDKSegWitProgram_Body;
11331 typedef struct MUST_USE_STRUCT LDKFallback {
11332 LDKFallback_Tag tag;
11334 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
11336 struct LDKTwentyBytes pub_key_hash;
11339 struct LDKTwentyBytes script_hash;
11345 * A trait defining behavior of an [`Invoice`] payer.
11347 typedef struct LDKPayer {
11349 * An opaque pointer which is passed to your function implementations as an argument.
11350 * This has no meaning in the LDK, and can be NULL or any other value.
11354 * Returns the payer's node id.
11356 struct LDKPublicKey (*node_id)(const void *this_arg);
11358 * Returns the payer's channels.
11360 struct LDKCVec_ChannelDetailsZ (*first_hops)(const void *this_arg);
11362 * Sends a payment over the Lightning Network using the given [`Route`].
11364 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
11366 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
11368 * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
11370 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_spontaneous_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
11372 * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
11374 struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
11376 * Signals that no further retries for the given payment will occur.
11378 void (*abandon_payment)(const void *this_arg, struct LDKThirtyTwoBytes payment_id);
11380 * Frees any resources associated with this object given its this_arg pointer.
11381 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11383 void (*free)(void *this_arg);
11387 * A trait defining behavior for routing an [`Invoice`] payment.
11389 typedef struct LDKRouter {
11391 * An opaque pointer which is passed to your function implementations as an argument.
11392 * This has no meaning in the LDK, and can be NULL or any other value.
11396 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
11398 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
11400 struct LDKCResult_RouteLightningErrorZ (*find_route)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, const uint8_t (*payment_hash)[32], struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer);
11402 * Frees any resources associated with this object given its this_arg pointer.
11403 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11405 void (*free)(void *this_arg);
11411 * A utility for paying [`Invoice`]s and sending spontaneous payments.
11413 * See [module-level documentation] for details.
11415 * [module-level documentation]: crate::payment
11417 typedef struct MUST_USE_STRUCT LDKInvoicePayer {
11419 * A pointer to the opaque Rust object.
11420 * Nearly everywhere, inner must be non-null, however in places where
11421 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11423 LDKnativeInvoicePayer *inner;
11425 * Indicates that this is the only struct which contains the same pointer.
11426 * Rust functions which take ownership of an object provided via an argument require
11427 * this to be true and invalidate the object pointed to by inner.
11435 * Number of attempts to retry payment path failures for an [`Invoice`].
11437 * Note that this is the number of *path* failures, not full payment retries. For multi-path
11438 * payments, if this is less than the total number of paths, we will never even retry all of the
11441 typedef struct MUST_USE_STRUCT LDKRetryAttempts {
11443 * A pointer to the opaque Rust object.
11444 * Nearly everywhere, inner must be non-null, however in places where
11445 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11447 LDKnativeRetryAttempts *inner;
11449 * Indicates that this is the only struct which contains the same pointer.
11450 * Rust functions which take ownership of an object provided via an argument require
11451 * this to be true and invalidate the object pointed to by inner.
11454 } LDKRetryAttempts;
11459 * A [`Router`] implemented using [`find_route`].
11461 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
11463 * A pointer to the opaque Rust object.
11464 * Nearly everywhere, inner must be non-null, however in places where
11465 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11467 LDKnativeDefaultRouter *inner;
11469 * Indicates that this is the only struct which contains the same pointer.
11470 * Rust functions which take ownership of an object provided via an argument require
11471 * this to be true and invalidate the object pointed to by inner.
11474 } LDKDefaultRouter;
11476 extern const uintptr_t MAX_BUF_SIZE;
11478 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
11480 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
11482 extern const uint32_t ANTI_REORG_DELAY;
11484 extern const uint16_t BREAKDOWN_TIMEOUT;
11486 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
11488 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
11490 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
11492 extern const uint64_t DEFAULT_EXPIRY_TIME;
11494 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
11496 extern const uint8_t TAG_PAYMENT_HASH;
11498 extern const uint8_t TAG_DESCRIPTION;
11500 extern const uint8_t TAG_PAYEE_PUB_KEY;
11502 extern const uint8_t TAG_DESCRIPTION_HASH;
11504 extern const uint8_t TAG_EXPIRY_TIME;
11506 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
11508 extern const uint8_t TAG_FALLBACK;
11510 extern const uint8_t TAG_PRIVATE_ROUTE;
11512 extern const uint8_t TAG_PAYMENT_SECRET;
11514 extern const uint8_t TAG_FEATURES;
11516 struct LDKStr _ldk_get_compiled_version(void);
11518 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
11521 * Frees the data buffer, if data_is_owned is set and datalen > 0.
11523 void Transaction_free(struct LDKTransaction _res);
11526 * Convenience function for constructing a new TxOut
11528 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
11531 * Frees the data pointed to by script_pubkey.
11533 void TxOut_free(struct LDKTxOut _res);
11536 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
11538 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
11541 * Frees the data buffer, if chars_is_owned is set and len > 0.
11543 void Str_free(struct LDKStr _res);
11545 #if defined(LDK_DEBUG_BUILD)
11547 * This function exists for memory safety testing purposes. It should never be used in production
11550 const void *__unmangle_inner_ptr(const void *ptr);
11554 * Creates a new CResult_SecretKeyErrorZ in the success state.
11556 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
11559 * Creates a new CResult_SecretKeyErrorZ in the error state.
11561 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
11564 * Checks if the given object is currently in the success state
11566 bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o);
11569 * Frees any resources used by the CResult_SecretKeyErrorZ.
11571 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
11574 * Creates a new CResult_PublicKeyErrorZ in the success state.
11576 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
11579 * Creates a new CResult_PublicKeyErrorZ in the error state.
11581 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
11584 * Checks if the given object is currently in the success state
11586 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
11589 * Frees any resources used by the CResult_PublicKeyErrorZ.
11591 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
11594 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
11595 * but with all dynamically-allocated buffers duplicated in new buffers.
11597 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
11600 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
11602 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
11605 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
11607 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
11610 * Checks if the given object is currently in the success state
11612 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
11615 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
11617 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
11620 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
11621 * but with all dynamically-allocated buffers duplicated in new buffers.
11623 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
11626 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
11628 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
11631 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
11633 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
11636 * Checks if the given object is currently in the success state
11638 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
11641 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
11643 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
11646 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
11647 * but with all dynamically-allocated buffers duplicated in new buffers.
11649 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
11652 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
11654 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
11657 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
11659 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
11662 * Checks if the given object is currently in the success state
11664 bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o);
11667 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
11669 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
11672 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
11673 * but with all dynamically-allocated buffers duplicated in new buffers.
11675 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
11678 * Constructs a new COption_u32Z containing a u32
11680 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
11683 * Constructs a new COption_u32Z containing nothing
11685 struct LDKCOption_u32Z COption_u32Z_none(void);
11688 * Frees any resources associated with the u32, if we are in the Some state
11690 void COption_u32Z_free(struct LDKCOption_u32Z _res);
11693 * Creates a new COption_u32Z which has the same data as `orig`
11694 * but with all dynamically-allocated buffers duplicated in new buffers.
11696 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
11699 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
11701 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
11704 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
11706 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
11709 * Checks if the given object is currently in the success state
11711 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
11714 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
11716 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
11719 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
11720 * but with all dynamically-allocated buffers duplicated in new buffers.
11722 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
11725 * Constructs a new COption_NoneZ containing a
11727 enum LDKCOption_NoneZ COption_NoneZ_some(void);
11730 * Constructs a new COption_NoneZ containing nothing
11732 enum LDKCOption_NoneZ COption_NoneZ_none(void);
11735 * Frees any resources associated with the , if we are in the Some state
11737 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
11740 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
11742 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
11745 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
11747 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
11750 * Checks if the given object is currently in the success state
11752 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
11755 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
11757 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
11760 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
11761 * but with all dynamically-allocated buffers duplicated in new buffers.
11763 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
11766 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
11768 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
11771 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
11773 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
11776 * Checks if the given object is currently in the success state
11778 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
11781 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
11783 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
11786 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
11787 * but with all dynamically-allocated buffers duplicated in new buffers.
11789 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
11792 * Frees the buffer pointed to by `data` if `datalen` is non-0.
11794 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
11797 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
11799 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
11802 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
11804 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
11807 * Checks if the given object is currently in the success state
11809 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
11812 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
11814 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
11817 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
11818 * but with all dynamically-allocated buffers duplicated in new buffers.
11820 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
11823 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
11825 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
11828 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
11830 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
11833 * Checks if the given object is currently in the success state
11835 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
11838 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
11840 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
11843 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
11844 * but with all dynamically-allocated buffers duplicated in new buffers.
11846 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
11849 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
11851 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
11854 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
11856 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
11859 * Checks if the given object is currently in the success state
11861 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
11864 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
11866 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
11869 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
11871 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
11874 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
11876 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
11879 * Checks if the given object is currently in the success state
11881 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
11884 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
11886 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
11889 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
11890 * but with all dynamically-allocated buffers duplicated in new buffers.
11892 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
11895 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
11897 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
11900 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
11902 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
11905 * Checks if the given object is currently in the success state
11907 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
11910 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
11912 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
11915 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
11917 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
11920 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
11922 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
11925 * Checks if the given object is currently in the success state
11927 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
11930 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
11932 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
11935 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
11936 * but with all dynamically-allocated buffers duplicated in new buffers.
11938 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
11941 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
11943 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
11946 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
11948 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
11951 * Checks if the given object is currently in the success state
11953 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
11956 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
11958 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
11961 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
11962 * but with all dynamically-allocated buffers duplicated in new buffers.
11964 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
11967 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
11969 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
11972 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
11974 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
11977 * Checks if the given object is currently in the success state
11979 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
11982 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
11984 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
11987 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
11988 * but with all dynamically-allocated buffers duplicated in new buffers.
11990 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
11993 * Creates a new CResult_NoneErrorZ in the success state.
11995 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
11998 * Creates a new CResult_NoneErrorZ in the error state.
12000 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
12003 * Checks if the given object is currently in the success state
12005 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
12008 * Frees any resources used by the CResult_NoneErrorZ.
12010 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
12013 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
12014 * but with all dynamically-allocated buffers duplicated in new buffers.
12016 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
12019 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
12021 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
12024 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
12026 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
12029 * Checks if the given object is currently in the success state
12031 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
12034 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
12036 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
12039 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
12040 * but with all dynamically-allocated buffers duplicated in new buffers.
12042 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
12045 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12047 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
12050 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12052 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
12055 * Creates a new CResult_RouteDecodeErrorZ in the success state.
12057 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
12060 * Creates a new CResult_RouteDecodeErrorZ in the error state.
12062 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
12065 * Checks if the given object is currently in the success state
12067 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
12070 * Frees any resources used by the CResult_RouteDecodeErrorZ.
12072 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
12075 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
12076 * but with all dynamically-allocated buffers duplicated in new buffers.
12078 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
12081 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
12083 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
12086 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
12088 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
12091 * Checks if the given object is currently in the success state
12093 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
12096 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
12098 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
12101 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
12102 * but with all dynamically-allocated buffers duplicated in new buffers.
12104 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
12107 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12109 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
12112 * Constructs a new COption_u64Z containing a u64
12114 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
12117 * Constructs a new COption_u64Z containing nothing
12119 struct LDKCOption_u64Z COption_u64Z_none(void);
12122 * Frees any resources associated with the u64, if we are in the Some state
12124 void COption_u64Z_free(struct LDKCOption_u64Z _res);
12127 * Creates a new COption_u64Z which has the same data as `orig`
12128 * but with all dynamically-allocated buffers duplicated in new buffers.
12130 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
12133 * Creates a new CResult_PayeeDecodeErrorZ in the success state.
12135 struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_ok(struct LDKPayee o);
12138 * Creates a new CResult_PayeeDecodeErrorZ in the error state.
12140 struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_err(struct LDKDecodeError e);
12143 * Checks if the given object is currently in the success state
12145 bool CResult_PayeeDecodeErrorZ_is_ok(const struct LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR o);
12148 * Frees any resources used by the CResult_PayeeDecodeErrorZ.
12150 void CResult_PayeeDecodeErrorZ_free(struct LDKCResult_PayeeDecodeErrorZ _res);
12153 * Creates a new CResult_PayeeDecodeErrorZ which has the same data as `orig`
12154 * but with all dynamically-allocated buffers duplicated in new buffers.
12156 struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_clone(const struct LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR orig);
12159 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12161 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
12164 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
12166 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
12169 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
12171 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
12174 * Checks if the given object is currently in the success state
12176 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
12179 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
12181 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
12184 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
12185 * but with all dynamically-allocated buffers duplicated in new buffers.
12187 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
12190 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
12192 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
12195 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
12197 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
12200 * Checks if the given object is currently in the success state
12202 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
12205 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
12207 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
12210 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
12211 * but with all dynamically-allocated buffers duplicated in new buffers.
12213 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
12216 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12218 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
12221 * Creates a new CResult_RouteLightningErrorZ in the success state.
12223 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
12226 * Creates a new CResult_RouteLightningErrorZ in the error state.
12228 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
12231 * Checks if the given object is currently in the success state
12233 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
12236 * Frees any resources used by the CResult_RouteLightningErrorZ.
12238 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
12241 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
12242 * but with all dynamically-allocated buffers duplicated in new buffers.
12244 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
12247 * Creates a new CResult_TxOutAccessErrorZ in the success state.
12249 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
12252 * Creates a new CResult_TxOutAccessErrorZ in the error state.
12254 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
12257 * Checks if the given object is currently in the success state
12259 bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o);
12262 * Frees any resources used by the CResult_TxOutAccessErrorZ.
12264 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
12267 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
12268 * but with all dynamically-allocated buffers duplicated in new buffers.
12270 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
12273 * Creates a new tuple which has the same data as `orig`
12274 * but with all dynamically-allocated buffers duplicated in new buffers.
12276 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
12279 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
12281 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
12284 * Frees any resources used by the C2Tuple_usizeTransactionZ.
12286 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
12289 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12291 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
12294 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12296 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
12299 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
12301 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
12304 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
12306 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
12309 * Checks if the given object is currently in the success state
12311 bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o);
12314 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
12316 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
12319 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
12320 * but with all dynamically-allocated buffers duplicated in new buffers.
12322 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
12325 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12327 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
12330 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
12332 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
12335 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
12337 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
12340 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
12342 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
12345 * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig`
12346 * but with all dynamically-allocated buffers duplicated in new buffers.
12348 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
12351 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason
12353 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
12356 * Constructs a new COption_ClosureReasonZ containing nothing
12358 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
12361 * Frees any resources associated with the crate::lightning::util::events::ClosureReason, if we are in the Some state
12363 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
12366 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
12367 * but with all dynamically-allocated buffers duplicated in new buffers.
12369 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
12372 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
12374 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
12377 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
12379 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
12382 * Checks if the given object is currently in the success state
12384 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
12387 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
12389 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
12392 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
12393 * but with all dynamically-allocated buffers duplicated in new buffers.
12395 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
12398 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::network_graph::NetworkUpdate
12400 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
12403 * Constructs a new COption_NetworkUpdateZ containing nothing
12405 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
12408 * Frees any resources associated with the crate::lightning::routing::network_graph::NetworkUpdate, if we are in the Some state
12410 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
12413 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
12414 * but with all dynamically-allocated buffers duplicated in new buffers.
12416 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
12419 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12421 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
12424 * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
12426 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
12429 * Constructs a new COption_EventZ containing nothing
12431 struct LDKCOption_EventZ COption_EventZ_none(void);
12434 * Frees any resources associated with the crate::lightning::util::events::Event, if we are in the Some state
12436 void COption_EventZ_free(struct LDKCOption_EventZ _res);
12439 * Creates a new COption_EventZ which has the same data as `orig`
12440 * but with all dynamically-allocated buffers duplicated in new buffers.
12442 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
12445 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
12447 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
12450 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
12452 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
12455 * Checks if the given object is currently in the success state
12457 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
12460 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
12462 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
12465 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
12466 * but with all dynamically-allocated buffers duplicated in new buffers.
12468 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
12471 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12473 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
12476 * Creates a new CResult_ScoringParametersDecodeErrorZ in the success state.
12478 struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o);
12481 * Creates a new CResult_ScoringParametersDecodeErrorZ in the error state.
12483 struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e);
12486 * Checks if the given object is currently in the success state
12488 bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o);
12491 * Frees any resources used by the CResult_ScoringParametersDecodeErrorZ.
12493 void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res);
12496 * Creates a new CResult_ScorerDecodeErrorZ in the success state.
12498 struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_ok(struct LDKScorer o);
12501 * Creates a new CResult_ScorerDecodeErrorZ in the error state.
12503 struct LDKCResult_ScorerDecodeErrorZ CResult_ScorerDecodeErrorZ_err(struct LDKDecodeError e);
12506 * Checks if the given object is currently in the success state
12508 bool CResult_ScorerDecodeErrorZ_is_ok(const struct LDKCResult_ScorerDecodeErrorZ *NONNULL_PTR o);
12511 * Frees any resources used by the CResult_ScorerDecodeErrorZ.
12513 void CResult_ScorerDecodeErrorZ_free(struct LDKCResult_ScorerDecodeErrorZ _res);
12516 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
12518 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
12521 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
12523 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
12526 * Checks if the given object is currently in the success state
12528 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
12531 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
12533 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
12536 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
12538 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
12541 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
12543 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
12546 * Checks if the given object is currently in the success state
12548 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
12551 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
12553 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
12556 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
12558 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
12561 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
12563 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
12566 * Checks if the given object is currently in the success state
12568 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
12571 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
12573 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
12576 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
12578 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
12581 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
12583 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
12586 * Checks if the given object is currently in the success state
12588 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
12591 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
12593 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
12596 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
12598 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
12601 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
12603 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
12606 * Checks if the given object is currently in the success state
12608 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
12611 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
12613 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
12616 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
12618 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
12621 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
12623 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
12626 * Checks if the given object is currently in the success state
12628 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
12631 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
12633 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
12636 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
12637 * but with all dynamically-allocated buffers duplicated in new buffers.
12639 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
12642 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
12644 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
12647 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
12649 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
12652 * Checks if the given object is currently in the success state
12654 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
12657 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
12659 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
12662 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
12663 * but with all dynamically-allocated buffers duplicated in new buffers.
12665 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
12668 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
12670 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
12673 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
12675 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
12678 * Checks if the given object is currently in the success state
12680 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
12683 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
12685 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
12688 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
12689 * but with all dynamically-allocated buffers duplicated in new buffers.
12691 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
12694 * Creates a new CResult_NoneNoneZ in the success state.
12696 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
12699 * Creates a new CResult_NoneNoneZ in the error state.
12701 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
12704 * Checks if the given object is currently in the success state
12706 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
12709 * Frees any resources used by the CResult_NoneNoneZ.
12711 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
12714 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
12715 * but with all dynamically-allocated buffers duplicated in new buffers.
12717 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
12720 * Creates a new tuple which has the same data as `orig`
12721 * but with all dynamically-allocated buffers duplicated in new buffers.
12723 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
12726 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
12728 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
12731 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
12733 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
12736 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
12738 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
12741 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
12743 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
12746 * Checks if the given object is currently in the success state
12748 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
12751 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
12753 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
12756 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
12757 * but with all dynamically-allocated buffers duplicated in new buffers.
12759 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
12762 * Creates a new CResult_SignatureNoneZ in the success state.
12764 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
12767 * Creates a new CResult_SignatureNoneZ in the error state.
12769 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
12772 * Checks if the given object is currently in the success state
12774 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
12777 * Frees any resources used by the CResult_SignatureNoneZ.
12779 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
12782 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
12783 * but with all dynamically-allocated buffers duplicated in new buffers.
12785 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
12788 * Creates a new CResult_SignDecodeErrorZ in the success state.
12790 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
12793 * Creates a new CResult_SignDecodeErrorZ in the error state.
12795 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
12798 * Checks if the given object is currently in the success state
12800 bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o);
12803 * Frees any resources used by the CResult_SignDecodeErrorZ.
12805 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
12808 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
12809 * but with all dynamically-allocated buffers duplicated in new buffers.
12811 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
12814 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12816 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
12819 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
12821 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
12824 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
12826 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
12829 * Checks if the given object is currently in the success state
12831 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
12834 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
12836 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
12839 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
12840 * but with all dynamically-allocated buffers duplicated in new buffers.
12842 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
12845 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12847 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
12850 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
12852 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
12855 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
12857 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
12860 * Checks if the given object is currently in the success state
12862 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
12865 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
12867 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
12870 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
12871 * but with all dynamically-allocated buffers duplicated in new buffers.
12873 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
12876 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
12878 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
12881 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
12883 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
12886 * Checks if the given object is currently in the success state
12888 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
12891 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
12893 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
12896 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
12897 * but with all dynamically-allocated buffers duplicated in new buffers.
12899 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
12902 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12904 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
12907 * Creates a new CResult_TransactionNoneZ in the success state.
12909 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
12912 * Creates a new CResult_TransactionNoneZ in the error state.
12914 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
12917 * Checks if the given object is currently in the success state
12919 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
12922 * Frees any resources used by the CResult_TransactionNoneZ.
12924 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
12927 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
12928 * but with all dynamically-allocated buffers duplicated in new buffers.
12930 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
12933 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
12935 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
12938 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
12940 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
12943 * Frees the buffer pointed to by `data` if `datalen` is non-0.
12945 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
12948 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
12950 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
12953 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
12955 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
12958 * Checks if the given object is currently in the success state
12960 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
12963 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
12965 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
12968 * Constructs a new COption_u16Z containing a u16
12970 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
12973 * Constructs a new COption_u16Z containing nothing
12975 struct LDKCOption_u16Z COption_u16Z_none(void);
12978 * Frees any resources associated with the u16, if we are in the Some state
12980 void COption_u16Z_free(struct LDKCOption_u16Z _res);
12983 * Creates a new COption_u16Z which has the same data as `orig`
12984 * but with all dynamically-allocated buffers duplicated in new buffers.
12986 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
12989 * Creates a new CResult_NoneAPIErrorZ in the success state.
12991 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
12994 * Creates a new CResult_NoneAPIErrorZ in the error state.
12996 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
12999 * Checks if the given object is currently in the success state
13001 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
13004 * Frees any resources used by the CResult_NoneAPIErrorZ.
13006 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
13009 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
13010 * but with all dynamically-allocated buffers duplicated in new buffers.
13012 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
13015 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13017 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
13020 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13022 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
13025 * Creates a new CResult__u832APIErrorZ in the success state.
13027 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
13030 * Creates a new CResult__u832APIErrorZ in the error state.
13032 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
13035 * Checks if the given object is currently in the success state
13037 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
13040 * Frees any resources used by the CResult__u832APIErrorZ.
13042 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
13045 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
13046 * but with all dynamically-allocated buffers duplicated in new buffers.
13048 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
13051 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
13053 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
13056 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state.
13058 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
13061 * Checks if the given object is currently in the success state
13063 bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o);
13066 * Frees any resources used by the CResult_PaymentIdPaymentSendFailureZ.
13068 void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res);
13071 * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig`
13072 * but with all dynamically-allocated buffers duplicated in new buffers.
13074 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig);
13077 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
13079 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
13082 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
13084 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
13087 * Checks if the given object is currently in the success state
13089 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
13092 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
13094 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
13097 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
13098 * but with all dynamically-allocated buffers duplicated in new buffers.
13100 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
13103 * Creates a new tuple which has the same data as `orig`
13104 * but with all dynamically-allocated buffers duplicated in new buffers.
13106 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
13109 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
13111 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
13114 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
13116 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
13119 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
13121 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
13124 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
13126 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
13129 * Checks if the given object is currently in the success state
13131 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
13134 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
13136 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
13139 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
13140 * but with all dynamically-allocated buffers duplicated in new buffers.
13142 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
13145 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13147 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
13150 * Creates a new tuple which has the same data as `orig`
13151 * but with all dynamically-allocated buffers duplicated in new buffers.
13153 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
13156 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
13158 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
13161 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
13163 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
13166 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
13168 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
13171 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
13173 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
13176 * Checks if the given object is currently in the success state
13178 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
13181 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
13183 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
13186 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
13187 * but with all dynamically-allocated buffers duplicated in new buffers.
13189 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
13192 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
13194 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
13197 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
13199 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
13202 * Checks if the given object is currently in the success state
13204 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
13207 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
13209 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
13212 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
13213 * but with all dynamically-allocated buffers duplicated in new buffers.
13215 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
13218 * Creates a new CResult_PaymentSecretNoneZ in the success state.
13220 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
13223 * Creates a new CResult_PaymentSecretNoneZ in the error state.
13225 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
13228 * Checks if the given object is currently in the success state
13230 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
13233 * Frees any resources used by the CResult_PaymentSecretNoneZ.
13235 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
13238 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
13239 * but with all dynamically-allocated buffers duplicated in new buffers.
13241 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
13244 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
13246 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
13249 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
13251 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
13254 * Checks if the given object is currently in the success state
13256 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
13259 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
13261 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
13264 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
13265 * but with all dynamically-allocated buffers duplicated in new buffers.
13267 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
13270 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
13272 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
13275 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
13277 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
13280 * Checks if the given object is currently in the success state
13282 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
13285 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
13287 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
13290 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
13291 * but with all dynamically-allocated buffers duplicated in new buffers.
13293 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
13296 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13298 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
13301 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
13303 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
13306 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
13308 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
13311 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
13313 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
13316 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
13318 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
13321 * Checks if the given object is currently in the success state
13323 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
13326 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
13328 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
13331 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
13333 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
13336 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
13338 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
13341 * Checks if the given object is currently in the success state
13343 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
13346 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
13348 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
13351 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
13352 * but with all dynamically-allocated buffers duplicated in new buffers.
13354 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
13357 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
13359 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
13362 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
13364 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
13367 * Checks if the given object is currently in the success state
13369 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
13372 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
13374 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
13377 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
13378 * but with all dynamically-allocated buffers duplicated in new buffers.
13380 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
13383 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
13385 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
13388 * Constructs a new COption_TypeZ containing nothing
13390 struct LDKCOption_TypeZ COption_TypeZ_none(void);
13393 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
13395 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
13398 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
13400 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
13403 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
13405 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
13408 * Checks if the given object is currently in the success state
13410 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
13413 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
13415 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
13418 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
13420 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
13423 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
13425 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
13428 * Checks if the given object is currently in the success state
13430 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
13433 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
13435 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
13438 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
13439 * but with all dynamically-allocated buffers duplicated in new buffers.
13441 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
13444 * Creates a new CResult_SiPrefixNoneZ in the success state.
13446 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_ok(enum LDKSiPrefix o);
13449 * Creates a new CResult_SiPrefixNoneZ in the error state.
13451 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_err(void);
13454 * Checks if the given object is currently in the success state
13456 bool CResult_SiPrefixNoneZ_is_ok(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR o);
13459 * Frees any resources used by the CResult_SiPrefixNoneZ.
13461 void CResult_SiPrefixNoneZ_free(struct LDKCResult_SiPrefixNoneZ _res);
13464 * Creates a new CResult_SiPrefixNoneZ which has the same data as `orig`
13465 * but with all dynamically-allocated buffers duplicated in new buffers.
13467 struct LDKCResult_SiPrefixNoneZ CResult_SiPrefixNoneZ_clone(const struct LDKCResult_SiPrefixNoneZ *NONNULL_PTR orig);
13470 * Creates a new CResult_InvoiceNoneZ in the success state.
13472 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_ok(struct LDKInvoice o);
13475 * Creates a new CResult_InvoiceNoneZ in the error state.
13477 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_err(void);
13480 * Checks if the given object is currently in the success state
13482 bool CResult_InvoiceNoneZ_is_ok(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR o);
13485 * Frees any resources used by the CResult_InvoiceNoneZ.
13487 void CResult_InvoiceNoneZ_free(struct LDKCResult_InvoiceNoneZ _res);
13490 * Creates a new CResult_InvoiceNoneZ which has the same data as `orig`
13491 * but with all dynamically-allocated buffers duplicated in new buffers.
13493 struct LDKCResult_InvoiceNoneZ CResult_InvoiceNoneZ_clone(const struct LDKCResult_InvoiceNoneZ *NONNULL_PTR orig);
13496 * Creates a new CResult_SignedRawInvoiceNoneZ in the success state.
13498 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_ok(struct LDKSignedRawInvoice o);
13501 * Creates a new CResult_SignedRawInvoiceNoneZ in the error state.
13503 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_err(void);
13506 * Checks if the given object is currently in the success state
13508 bool CResult_SignedRawInvoiceNoneZ_is_ok(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR o);
13511 * Frees any resources used by the CResult_SignedRawInvoiceNoneZ.
13513 void CResult_SignedRawInvoiceNoneZ_free(struct LDKCResult_SignedRawInvoiceNoneZ _res);
13516 * Creates a new CResult_SignedRawInvoiceNoneZ which has the same data as `orig`
13517 * but with all dynamically-allocated buffers duplicated in new buffers.
13519 struct LDKCResult_SignedRawInvoiceNoneZ CResult_SignedRawInvoiceNoneZ_clone(const struct LDKCResult_SignedRawInvoiceNoneZ *NONNULL_PTR orig);
13522 * Creates a new tuple which has the same data as `orig`
13523 * but with all dynamically-allocated buffers duplicated in new buffers.
13525 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
13528 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
13530 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
13533 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
13535 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
13538 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
13540 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
13543 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
13545 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
13548 * Checks if the given object is currently in the success state
13550 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
13553 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
13555 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
13558 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
13559 * but with all dynamically-allocated buffers duplicated in new buffers.
13561 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
13564 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13566 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
13569 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
13571 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
13574 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
13576 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
13579 * Checks if the given object is currently in the success state
13581 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
13584 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
13586 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
13589 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
13590 * but with all dynamically-allocated buffers duplicated in new buffers.
13592 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
13595 * Creates a new CResult_NoneSemanticErrorZ in the success state.
13597 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
13600 * Creates a new CResult_NoneSemanticErrorZ in the error state.
13602 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
13605 * Checks if the given object is currently in the success state
13607 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
13610 * Frees any resources used by the CResult_NoneSemanticErrorZ.
13612 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
13615 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
13616 * but with all dynamically-allocated buffers duplicated in new buffers.
13618 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
13621 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
13623 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
13626 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
13628 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
13631 * Checks if the given object is currently in the success state
13633 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
13636 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
13638 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
13641 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
13642 * but with all dynamically-allocated buffers duplicated in new buffers.
13644 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
13647 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
13649 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
13652 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
13654 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
13657 * Checks if the given object is currently in the success state
13659 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
13662 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
13664 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
13667 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
13668 * but with all dynamically-allocated buffers duplicated in new buffers.
13670 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
13673 * Creates a new CResult_ExpiryTimeCreationErrorZ in the success state.
13675 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_ok(struct LDKExpiryTime o);
13678 * Creates a new CResult_ExpiryTimeCreationErrorZ in the error state.
13680 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_err(enum LDKCreationError e);
13683 * Checks if the given object is currently in the success state
13685 bool CResult_ExpiryTimeCreationErrorZ_is_ok(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR o);
13688 * Frees any resources used by the CResult_ExpiryTimeCreationErrorZ.
13690 void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationErrorZ _res);
13693 * Creates a new CResult_ExpiryTimeCreationErrorZ which has the same data as `orig`
13694 * but with all dynamically-allocated buffers duplicated in new buffers.
13696 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig);
13699 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
13701 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
13704 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
13706 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
13709 * Checks if the given object is currently in the success state
13711 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
13714 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
13716 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
13719 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
13720 * but with all dynamically-allocated buffers duplicated in new buffers.
13722 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
13725 * Creates a new CResult_StringErrorZ in the success state.
13727 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
13730 * Creates a new CResult_StringErrorZ in the error state.
13732 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
13735 * Checks if the given object is currently in the success state
13737 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
13740 * Frees any resources used by the CResult_StringErrorZ.
13742 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
13745 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
13747 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
13750 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
13752 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
13755 * Checks if the given object is currently in the success state
13757 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
13760 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
13762 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
13765 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
13766 * but with all dynamically-allocated buffers duplicated in new buffers.
13768 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
13771 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
13773 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
13776 * Constructs a new COption_MonitorEventZ containing nothing
13778 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
13781 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
13783 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
13786 * Creates a new COption_MonitorEventZ which has the same data as `orig`
13787 * but with all dynamically-allocated buffers duplicated in new buffers.
13789 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
13792 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
13794 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
13797 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
13799 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
13802 * Checks if the given object is currently in the success state
13804 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
13807 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
13809 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
13812 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
13813 * but with all dynamically-allocated buffers duplicated in new buffers.
13815 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
13818 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
13820 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
13823 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
13825 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
13828 * Checks if the given object is currently in the success state
13830 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
13833 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
13835 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
13838 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
13839 * but with all dynamically-allocated buffers duplicated in new buffers.
13841 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
13844 * Creates a new tuple which has the same data as `orig`
13845 * but with all dynamically-allocated buffers duplicated in new buffers.
13847 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
13850 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
13852 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
13855 * Frees any resources used by the C2Tuple_OutPointScriptZ.
13857 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
13860 * Creates a new tuple which has the same data as `orig`
13861 * but with all dynamically-allocated buffers duplicated in new buffers.
13863 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
13866 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
13868 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
13871 * Frees any resources used by the C2Tuple_u32ScriptZ.
13873 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
13876 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13878 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
13881 * Creates a new tuple which has the same data as `orig`
13882 * but with all dynamically-allocated buffers duplicated in new buffers.
13884 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
13887 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
13889 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
13892 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
13894 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
13897 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13899 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
13902 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13904 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
13907 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13909 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
13912 * Creates a new tuple which has the same data as `orig`
13913 * but with all dynamically-allocated buffers duplicated in new buffers.
13915 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
13918 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
13920 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
13923 * Frees any resources used by the C2Tuple_u32TxOutZ.
13925 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
13928 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13930 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
13933 * Creates a new tuple which has the same data as `orig`
13934 * but with all dynamically-allocated buffers duplicated in new buffers.
13936 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
13939 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
13941 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
13944 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
13946 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
13949 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13951 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
13954 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13956 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
13959 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
13961 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
13964 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
13966 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
13969 * Checks if the given object is currently in the success state
13971 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
13974 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
13976 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
13979 * Creates a new CResult_NoneLightningErrorZ in the success state.
13981 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
13984 * Creates a new CResult_NoneLightningErrorZ in the error state.
13986 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
13989 * Checks if the given object is currently in the success state
13991 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
13994 * Frees any resources used by the CResult_NoneLightningErrorZ.
13996 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
13999 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
14000 * but with all dynamically-allocated buffers duplicated in new buffers.
14002 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
14005 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
14007 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
14010 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
14012 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
14015 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14017 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
14020 * Creates a new CResult_boolLightningErrorZ in the success state.
14022 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
14025 * Creates a new CResult_boolLightningErrorZ in the error state.
14027 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
14030 * Checks if the given object is currently in the success state
14032 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
14035 * Frees any resources used by the CResult_boolLightningErrorZ.
14037 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
14040 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
14041 * but with all dynamically-allocated buffers duplicated in new buffers.
14043 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
14046 * Creates a new tuple which has the same data as `orig`
14047 * but with all dynamically-allocated buffers duplicated in new buffers.
14049 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
14052 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
14054 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
14057 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
14059 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
14062 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14064 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
14067 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14069 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
14072 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14074 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
14077 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
14079 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
14082 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
14084 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
14087 * Checks if the given object is currently in the success state
14089 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
14092 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
14094 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
14097 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
14098 * but with all dynamically-allocated buffers duplicated in new buffers.
14100 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
14103 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
14105 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
14108 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
14110 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
14113 * Checks if the given object is currently in the success state
14115 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
14118 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
14120 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
14123 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
14124 * but with all dynamically-allocated buffers duplicated in new buffers.
14126 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
14129 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
14131 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
14134 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
14136 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
14139 * Checks if the given object is currently in the success state
14141 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
14144 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
14146 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
14149 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
14150 * but with all dynamically-allocated buffers duplicated in new buffers.
14152 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
14155 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
14157 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
14160 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
14162 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
14165 * Checks if the given object is currently in the success state
14167 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
14170 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
14172 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
14175 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
14176 * but with all dynamically-allocated buffers duplicated in new buffers.
14178 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
14181 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
14183 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
14186 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
14188 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
14191 * Checks if the given object is currently in the success state
14193 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
14196 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
14198 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
14201 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
14202 * but with all dynamically-allocated buffers duplicated in new buffers.
14204 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
14207 * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
14209 struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
14212 * Constructs a new COption_AccessZ containing nothing
14214 struct LDKCOption_AccessZ COption_AccessZ_none(void);
14217 * Frees any resources associated with the crate::lightning::chain::Access, if we are in the Some state
14219 void COption_AccessZ_free(struct LDKCOption_AccessZ _res);
14222 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
14224 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
14227 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
14229 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
14232 * Checks if the given object is currently in the success state
14234 bool CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR o);
14237 * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
14239 void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
14242 * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
14243 * but with all dynamically-allocated buffers duplicated in new buffers.
14245 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
14248 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
14250 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
14253 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
14255 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
14258 * Checks if the given object is currently in the success state
14260 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
14263 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
14265 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
14268 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
14269 * but with all dynamically-allocated buffers duplicated in new buffers.
14271 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
14274 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
14276 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
14279 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
14281 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
14284 * Checks if the given object is currently in the success state
14286 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
14289 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
14291 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
14294 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
14295 * but with all dynamically-allocated buffers duplicated in new buffers.
14297 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
14300 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
14302 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
14305 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
14307 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
14310 * Checks if the given object is currently in the success state
14312 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
14315 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
14317 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
14320 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
14321 * but with all dynamically-allocated buffers duplicated in new buffers.
14323 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
14326 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14328 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
14331 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
14333 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
14336 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
14338 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
14341 * Checks if the given object is currently in the success state
14343 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
14346 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
14348 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
14351 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
14352 * but with all dynamically-allocated buffers duplicated in new buffers.
14354 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
14357 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
14359 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
14362 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
14364 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
14367 * Checks if the given object is currently in the success state
14369 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
14372 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
14374 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
14377 * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig`
14378 * but with all dynamically-allocated buffers duplicated in new buffers.
14380 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
14383 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
14385 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
14388 * Constructs a new COption_CVec_NetAddressZZ containing nothing
14390 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
14393 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
14395 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
14398 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
14399 * but with all dynamically-allocated buffers duplicated in new buffers.
14401 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
14404 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
14406 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
14409 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
14411 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
14414 * Checks if the given object is currently in the success state
14416 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
14419 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
14421 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
14424 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
14425 * but with all dynamically-allocated buffers duplicated in new buffers.
14427 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
14430 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14432 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
14435 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14437 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
14440 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14442 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
14445 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14447 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
14450 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
14452 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
14455 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
14457 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
14460 * Checks if the given object is currently in the success state
14462 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
14465 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
14467 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
14470 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
14471 * but with all dynamically-allocated buffers duplicated in new buffers.
14473 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
14476 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
14478 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
14481 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
14483 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
14486 * Checks if the given object is currently in the success state
14488 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
14491 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
14493 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
14496 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
14497 * but with all dynamically-allocated buffers duplicated in new buffers.
14499 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
14502 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
14504 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
14507 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
14509 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
14512 * Checks if the given object is currently in the success state
14514 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
14517 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
14519 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
14522 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
14523 * but with all dynamically-allocated buffers duplicated in new buffers.
14525 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
14528 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
14530 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
14533 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
14535 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
14538 * Checks if the given object is currently in the success state
14540 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
14543 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
14545 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
14548 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
14549 * but with all dynamically-allocated buffers duplicated in new buffers.
14551 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
14554 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
14556 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
14559 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
14561 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
14564 * Checks if the given object is currently in the success state
14566 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
14569 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
14571 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
14574 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
14575 * but with all dynamically-allocated buffers duplicated in new buffers.
14577 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
14580 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
14582 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
14585 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
14587 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
14590 * Checks if the given object is currently in the success state
14592 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
14595 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
14597 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
14600 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
14601 * but with all dynamically-allocated buffers duplicated in new buffers.
14603 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
14606 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
14608 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
14611 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
14613 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
14616 * Checks if the given object is currently in the success state
14618 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
14621 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
14623 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
14626 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
14627 * but with all dynamically-allocated buffers duplicated in new buffers.
14629 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
14632 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
14634 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
14637 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
14639 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
14642 * Checks if the given object is currently in the success state
14644 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
14647 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
14649 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
14652 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
14653 * but with all dynamically-allocated buffers duplicated in new buffers.
14655 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
14658 * Creates a new CResult_FundingLockedDecodeErrorZ in the success state.
14660 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o);
14663 * Creates a new CResult_FundingLockedDecodeErrorZ in the error state.
14665 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e);
14668 * Checks if the given object is currently in the success state
14670 bool CResult_FundingLockedDecodeErrorZ_is_ok(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR o);
14673 * Frees any resources used by the CResult_FundingLockedDecodeErrorZ.
14675 void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res);
14678 * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig`
14679 * but with all dynamically-allocated buffers duplicated in new buffers.
14681 struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig);
14684 * Creates a new CResult_InitDecodeErrorZ in the success state.
14686 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
14689 * Creates a new CResult_InitDecodeErrorZ in the error state.
14691 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
14694 * Checks if the given object is currently in the success state
14696 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
14699 * Frees any resources used by the CResult_InitDecodeErrorZ.
14701 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
14704 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
14705 * but with all dynamically-allocated buffers duplicated in new buffers.
14707 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
14710 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
14712 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
14715 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
14717 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
14720 * Checks if the given object is currently in the success state
14722 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
14725 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
14727 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
14730 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
14731 * but with all dynamically-allocated buffers duplicated in new buffers.
14733 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
14736 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
14738 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
14741 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
14743 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
14746 * Checks if the given object is currently in the success state
14748 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
14751 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
14753 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
14756 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
14757 * but with all dynamically-allocated buffers duplicated in new buffers.
14759 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
14762 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
14764 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
14767 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
14769 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
14772 * Checks if the given object is currently in the success state
14774 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
14777 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
14779 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
14782 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
14783 * but with all dynamically-allocated buffers duplicated in new buffers.
14785 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
14788 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
14790 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
14793 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
14795 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
14798 * Checks if the given object is currently in the success state
14800 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
14803 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
14805 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
14808 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
14809 * but with all dynamically-allocated buffers duplicated in new buffers.
14811 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
14814 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
14816 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
14819 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
14821 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
14824 * Checks if the given object is currently in the success state
14826 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
14829 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
14831 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
14834 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
14835 * but with all dynamically-allocated buffers duplicated in new buffers.
14837 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
14840 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
14842 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
14845 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
14847 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
14850 * Checks if the given object is currently in the success state
14852 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
14855 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
14857 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
14860 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
14861 * but with all dynamically-allocated buffers duplicated in new buffers.
14863 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
14866 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
14868 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
14871 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
14873 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
14876 * Checks if the given object is currently in the success state
14878 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
14881 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
14883 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
14886 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
14887 * but with all dynamically-allocated buffers duplicated in new buffers.
14889 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
14892 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
14894 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
14897 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
14899 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
14902 * Checks if the given object is currently in the success state
14904 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
14907 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
14909 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
14912 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
14913 * but with all dynamically-allocated buffers duplicated in new buffers.
14915 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
14918 * Creates a new CResult_PingDecodeErrorZ in the success state.
14920 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
14923 * Creates a new CResult_PingDecodeErrorZ in the error state.
14925 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
14928 * Checks if the given object is currently in the success state
14930 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
14933 * Frees any resources used by the CResult_PingDecodeErrorZ.
14935 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
14938 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
14939 * but with all dynamically-allocated buffers duplicated in new buffers.
14941 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
14944 * Creates a new CResult_PongDecodeErrorZ in the success state.
14946 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
14949 * Creates a new CResult_PongDecodeErrorZ in the error state.
14951 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
14954 * Checks if the given object is currently in the success state
14956 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
14959 * Frees any resources used by the CResult_PongDecodeErrorZ.
14961 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
14964 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
14965 * but with all dynamically-allocated buffers duplicated in new buffers.
14967 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
14970 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
14972 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
14975 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
14977 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
14980 * Checks if the given object is currently in the success state
14982 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
14985 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
14987 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
14990 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
14991 * but with all dynamically-allocated buffers duplicated in new buffers.
14993 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
14996 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
14998 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
15001 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
15003 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
15006 * Checks if the given object is currently in the success state
15008 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
15011 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
15013 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
15016 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
15017 * but with all dynamically-allocated buffers duplicated in new buffers.
15019 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
15022 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
15024 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
15027 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
15029 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
15032 * Checks if the given object is currently in the success state
15034 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
15037 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
15039 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
15042 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
15043 * but with all dynamically-allocated buffers duplicated in new buffers.
15045 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
15048 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
15050 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
15053 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
15055 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
15058 * Checks if the given object is currently in the success state
15060 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
15063 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
15065 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
15068 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
15069 * but with all dynamically-allocated buffers duplicated in new buffers.
15071 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
15074 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
15076 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
15079 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
15081 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
15084 * Checks if the given object is currently in the success state
15086 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
15089 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
15091 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
15094 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
15095 * but with all dynamically-allocated buffers duplicated in new buffers.
15097 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
15100 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
15102 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
15105 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
15107 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
15110 * Checks if the given object is currently in the success state
15112 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
15115 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
15117 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
15120 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
15121 * but with all dynamically-allocated buffers duplicated in new buffers.
15123 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
15126 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
15128 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
15131 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
15133 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
15136 * Checks if the given object is currently in the success state
15138 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
15141 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
15143 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
15146 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
15147 * but with all dynamically-allocated buffers duplicated in new buffers.
15149 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
15152 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
15154 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
15157 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
15159 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
15162 * Checks if the given object is currently in the success state
15164 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
15167 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
15169 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
15172 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
15173 * but with all dynamically-allocated buffers duplicated in new buffers.
15175 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
15178 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
15180 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
15183 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
15185 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
15188 * Checks if the given object is currently in the success state
15190 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
15193 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
15195 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
15198 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
15199 * but with all dynamically-allocated buffers duplicated in new buffers.
15201 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
15204 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
15206 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
15209 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
15211 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
15214 * Checks if the given object is currently in the success state
15216 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
15219 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
15221 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
15224 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
15225 * but with all dynamically-allocated buffers duplicated in new buffers.
15227 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
15230 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
15232 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
15235 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
15237 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
15240 * Checks if the given object is currently in the success state
15242 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
15245 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
15247 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
15250 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
15251 * but with all dynamically-allocated buffers duplicated in new buffers.
15253 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
15256 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
15258 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
15261 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
15263 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
15266 * Checks if the given object is currently in the success state
15268 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
15271 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
15273 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
15276 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
15277 * but with all dynamically-allocated buffers duplicated in new buffers.
15279 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
15282 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
15284 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
15287 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
15289 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
15292 * Checks if the given object is currently in the success state
15294 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
15297 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
15299 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
15302 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
15303 * but with all dynamically-allocated buffers duplicated in new buffers.
15305 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
15308 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
15310 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
15313 * Constructs a new COption_FilterZ containing nothing
15315 struct LDKCOption_FilterZ COption_FilterZ_none(void);
15318 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
15320 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
15323 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
15325 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
15328 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
15330 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
15333 * Checks if the given object is currently in the success state
15335 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
15338 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
15340 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
15343 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15345 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
15348 * Frees any resources used by the PaymentPurpose
15350 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
15353 * Creates a copy of the PaymentPurpose
15355 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
15358 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
15360 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
15363 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
15365 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
15368 * Frees any resources used by the ClosureReason
15370 void ClosureReason_free(struct LDKClosureReason this_ptr);
15373 * Creates a copy of the ClosureReason
15375 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
15378 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
15380 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
15383 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
15385 struct LDKClosureReason ClosureReason_holder_force_closed(void);
15388 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
15390 struct LDKClosureReason ClosureReason_cooperative_closure(void);
15393 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
15395 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
15398 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
15400 struct LDKClosureReason ClosureReason_funding_timed_out(void);
15403 * Utility method to constructs a new ProcessingError-variant ClosureReason
15405 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
15408 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
15410 struct LDKClosureReason ClosureReason_disconnected_peer(void);
15413 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
15415 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
15418 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
15420 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
15423 * Read a ClosureReason from a byte array, created by ClosureReason_write
15425 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
15428 * Frees any resources used by the Event
15430 void Event_free(struct LDKEvent this_ptr);
15433 * Creates a copy of the Event
15435 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
15438 * Utility method to constructs a new FundingGenerationReady-variant Event
15440 struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id);
15443 * Utility method to constructs a new PaymentReceived-variant Event
15445 struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amt, struct LDKPaymentPurpose purpose);
15448 * Utility method to constructs a new PaymentSent-variant Event
15450 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
15453 * Utility method to constructs a new PaymentPathFailed-variant Event
15455 struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry);
15458 * Utility method to constructs a new PaymentFailed-variant Event
15460 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
15463 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
15465 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
15468 * Utility method to constructs a new SpendableOutputs-variant Event
15470 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
15473 * Utility method to constructs a new PaymentForwarded-variant Event
15475 struct LDKEvent Event_payment_forwarded(struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx);
15478 * Utility method to constructs a new ChannelClosed-variant Event
15480 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason);
15483 * Utility method to constructs a new DiscardFunding-variant Event
15485 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
15488 * Utility method to constructs a new PaymentPathSuccessful-variant Event
15490 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
15493 * Serialize the Event object into a byte array which can be read by Event_read
15495 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
15498 * Read a Event from a byte array, created by Event_write
15500 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
15503 * Frees any resources used by the MessageSendEvent
15505 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
15508 * Creates a copy of the MessageSendEvent
15510 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
15513 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
15515 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
15518 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
15520 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
15523 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
15525 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
15528 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
15530 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
15533 * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent
15535 struct LDKMessageSendEvent MessageSendEvent_send_funding_locked(struct LDKPublicKey node_id, struct LDKFundingLocked msg);
15538 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
15540 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
15543 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
15545 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
15548 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
15550 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
15553 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
15555 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
15558 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
15560 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
15563 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
15565 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
15568 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
15570 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
15573 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
15575 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
15578 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
15580 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
15583 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
15585 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
15588 * Utility method to constructs a new HandleError-variant MessageSendEvent
15590 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
15593 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
15595 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
15598 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
15600 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
15603 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
15605 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
15608 * Calls the free function if one is set
15610 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
15613 * Calls the free function if one is set
15615 void EventsProvider_free(struct LDKEventsProvider this_ptr);
15618 * Calls the free function if one is set
15620 void EventHandler_free(struct LDKEventHandler this_ptr);
15623 * Frees any resources used by the APIError
15625 void APIError_free(struct LDKAPIError this_ptr);
15628 * Creates a copy of the APIError
15630 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
15633 * Utility method to constructs a new APIMisuseError-variant APIError
15635 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
15638 * Utility method to constructs a new FeeRateTooHigh-variant APIError
15640 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
15643 * Utility method to constructs a new RouteError-variant APIError
15645 struct LDKAPIError APIError_route_error(struct LDKStr err);
15648 * Utility method to constructs a new ChannelUnavailable-variant APIError
15650 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
15653 * Utility method to constructs a new MonitorUpdateFailed-variant APIError
15655 struct LDKAPIError APIError_monitor_update_failed(void);
15658 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
15660 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
15663 * Creates a digital signature of a message given a SecretKey, like the node's secret.
15664 * 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.
15665 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
15667 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
15670 * Recovers the PublicKey of the signer of the message given the message and the signature.
15672 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
15675 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
15676 * and the PublicKey.
15678 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
15681 * Creates a copy of the Level
15683 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
15686 * Utility method to constructs a new Gossip-variant Level
15688 enum LDKLevel Level_gossip(void);
15691 * Utility method to constructs a new Trace-variant Level
15693 enum LDKLevel Level_trace(void);
15696 * Utility method to constructs a new Debug-variant Level
15698 enum LDKLevel Level_debug(void);
15701 * Utility method to constructs a new Info-variant Level
15703 enum LDKLevel Level_info(void);
15706 * Utility method to constructs a new Warn-variant Level
15708 enum LDKLevel Level_warn(void);
15711 * Utility method to constructs a new Error-variant Level
15713 enum LDKLevel Level_error(void);
15716 * Checks if two Levels contain equal inner contents.
15717 * This ignores pointers and is_owned flags and looks at the values in fields.
15719 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
15722 * Checks if two Levels contain equal inner contents.
15724 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
15727 * Returns the most verbose logging level.
15729 MUST_USE_RES enum LDKLevel Level_max(void);
15732 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
15734 void Record_free(struct LDKRecord this_obj);
15737 * The verbosity level of the message.
15739 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
15742 * The verbosity level of the message.
15744 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
15747 * The message body.
15749 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
15752 * The message body.
15754 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
15757 * The module path of the message.
15759 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
15762 * The module path of the message.
15764 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
15767 * The source file containing the message.
15769 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
15772 * The source file containing the message.
15774 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
15777 * The line containing the message.
15779 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
15782 * The line containing the message.
15784 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
15787 * Creates a copy of the Record
15789 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
15792 * Calls the free function if one is set
15794 void Logger_free(struct LDKLogger this_ptr);
15797 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
15799 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
15802 * Confirmations we will wait for before considering the channel locked in.
15803 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
15804 * equivalent limit applied to outbound channels).
15806 * Default value: 6.
15808 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
15811 * Confirmations we will wait for before considering the channel locked in.
15812 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
15813 * equivalent limit applied to outbound channels).
15815 * Default value: 6.
15817 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
15820 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
15821 * the number of blocks we have to punish our counterparty if they broadcast a revoked
15824 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
15825 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
15826 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
15827 * possibly with time in between to RBF the spending transaction).
15829 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
15830 * case of an honest unilateral channel close, which implicitly decrease the economic value of
15833 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
15834 * can tweak config to ask for more security, not less.
15836 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
15839 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
15840 * the number of blocks we have to punish our counterparty if they broadcast a revoked
15843 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
15844 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
15845 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
15846 * possibly with time in between to RBF the spending transaction).
15848 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
15849 * case of an honest unilateral channel close, which implicitly decrease the economic value of
15852 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
15853 * can tweak config to ask for more security, not less.
15855 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
15858 * Set to the smallest value HTLC we will accept to process.
15860 * This value is sent to our counterparty on channel-open and we close the channel any time
15861 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
15863 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
15866 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
15869 * Set to the smallest value HTLC we will accept to process.
15871 * This value is sent to our counterparty on channel-open and we close the channel any time
15872 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
15874 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
15877 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
15880 * Constructs a new ChannelHandshakeConfig given each field
15882 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);
15885 * Creates a copy of the ChannelHandshakeConfig
15887 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
15890 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
15892 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
15895 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
15897 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
15900 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
15901 * only applies to inbound channels.
15903 * Default value: 0.
15905 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
15908 * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
15909 * only applies to inbound channels.
15911 * Default value: 0.
15913 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
15916 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
15917 * you to limit the maximum minimum-size they can require.
15919 * Default value: u64::max_value.
15921 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
15924 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
15925 * you to limit the maximum minimum-size they can require.
15927 * Default value: u64::max_value.
15929 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
15932 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
15933 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
15935 * Default value: 0.
15937 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
15940 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
15941 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
15943 * Default value: 0.
15945 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
15948 * The remote node will require we keep a certain amount in direct payment to ourselves at all
15949 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
15950 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
15952 * Default value: u64::max_value.
15954 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
15957 * The remote node will require we keep a certain amount in direct payment to ourselves at all
15958 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
15959 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
15961 * Default value: u64::max_value.
15963 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
15966 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
15967 * time. This allows you to set a minimum such value.
15969 * Default value: 0.
15971 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
15974 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
15975 * time. This allows you to set a minimum such value.
15977 * Default value: 0.
15979 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
15982 * Before a channel is usable the funding transaction will need to be confirmed by at least a
15983 * certain number of blocks, specified by the node which is not the funder (as the funder can
15984 * assume they aren't going to double-spend themselves).
15985 * This config allows you to set a limit on the maximum amount of time to wait.
15987 * Default value: 144, or roughly one day and only applies to outbound channels.
15989 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
15992 * Before a channel is usable the funding transaction will need to be confirmed by at least a
15993 * certain number of blocks, specified by the node which is not the funder (as the funder can
15994 * assume they aren't going to double-spend themselves).
15995 * This config allows you to set a limit on the maximum amount of time to wait.
15997 * Default value: 144, or roughly one day and only applies to outbound channels.
15999 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
16002 * Set to force an incoming channel to match our announced channel preference in
16003 * [`ChannelConfig::announced_channel`].
16005 * For a node which is not online reliably, this should be set to true and
16006 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
16007 * channels will ever be opened.
16009 * Default value: true.
16011 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
16014 * Set to force an incoming channel to match our announced channel preference in
16015 * [`ChannelConfig::announced_channel`].
16017 * For a node which is not online reliably, this should be set to true and
16018 * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
16019 * channels will ever be opened.
16021 * Default value: true.
16023 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
16026 * Set to the amount of time we're willing to wait to claim money back to us.
16028 * Not checking this value would be a security issue, as our peer would be able to set it to
16029 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
16031 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
16032 * reduce the loss of having useless locked funds (if your peer accepts)
16034 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
16037 * Set to the amount of time we're willing to wait to claim money back to us.
16039 * Not checking this value would be a security issue, as our peer would be able to set it to
16040 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
16042 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
16043 * reduce the loss of having useless locked funds (if your peer accepts)
16045 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
16048 * Constructs a new ChannelHandshakeLimits given each field
16050 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_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 force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg);
16053 * Creates a copy of the ChannelHandshakeLimits
16055 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
16058 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
16060 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
16063 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
16065 void ChannelConfig_free(struct LDKChannelConfig this_obj);
16068 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
16069 * over the channel.
16070 * This may be allowed to change at runtime in a later update, however doing so must result in
16071 * update messages sent to notify all nodes of our updated relay fee.
16073 * Default value: 0.
16075 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
16078 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
16079 * over the channel.
16080 * This may be allowed to change at runtime in a later update, however doing so must result in
16081 * update messages sent to notify all nodes of our updated relay fee.
16083 * Default value: 0.
16085 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
16088 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
16089 * excess of [`forwarding_fee_proportional_millionths`].
16090 * This may be allowed to change at runtime in a later update, however doing so must result in
16091 * update messages sent to notify all nodes of our updated relay fee.
16093 * The default value of a single satoshi roughly matches the market rate on many routing nodes
16094 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
16097 * Default value: 1000.
16099 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
16101 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
16104 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
16105 * excess of [`forwarding_fee_proportional_millionths`].
16106 * This may be allowed to change at runtime in a later update, however doing so must result in
16107 * update messages sent to notify all nodes of our updated relay fee.
16109 * The default value of a single satoshi roughly matches the market rate on many routing nodes
16110 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
16113 * Default value: 1000.
16115 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
16117 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
16120 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
16121 * the channel this config applies to.
16123 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
16124 * HTLC balance when a channel appears on-chain whereas
16125 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
16126 * (non-HTLC-encumbered) balance.
16128 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
16129 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
16130 * commitment transaction at least once per this many blocks (minus some margin to allow us
16131 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
16132 * the spending transaction).
16134 * Default value: 72 (12 hours at an average of 6 blocks/hour).
16135 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
16136 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
16138 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
16140 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
16143 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
16144 * the channel this config applies to.
16146 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
16147 * HTLC balance when a channel appears on-chain whereas
16148 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
16149 * (non-HTLC-encumbered) balance.
16151 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
16152 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
16153 * commitment transaction at least once per this many blocks (minus some margin to allow us
16154 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
16155 * the spending transaction).
16157 * Default value: 72 (12 hours at an average of 6 blocks/hour).
16158 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
16159 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
16161 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
16163 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
16166 * Set to announce the channel publicly and notify all nodes that they can route via this
16169 * This should only be set to true for nodes which expect to be online reliably.
16171 * As the node which funds a channel picks this value this will only apply for new outbound
16172 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
16174 * This cannot be changed after the initial channel handshake.
16176 * Default value: false.
16178 bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
16181 * Set to announce the channel publicly and notify all nodes that they can route via this
16184 * This should only be set to true for nodes which expect to be online reliably.
16186 * As the node which funds a channel picks this value this will only apply for new outbound
16187 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
16189 * This cannot be changed after the initial channel handshake.
16191 * Default value: false.
16193 void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
16196 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
16197 * supports it, they will then enforce the mutual-close output to us matches what we provided
16198 * at intialization, preventing us from closing to an alternate pubkey.
16200 * This is set to true by default to provide a slight increase in security, though ultimately
16201 * any attacker who is able to take control of a channel can just as easily send the funds via
16202 * lightning payments, so we never require that our counterparties support this option.
16204 * This cannot be changed after a channel has been initialized.
16206 * Default value: true.
16208 bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
16211 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
16212 * supports it, they will then enforce the mutual-close output to us matches what we provided
16213 * at intialization, preventing us from closing to an alternate pubkey.
16215 * This is set to true by default to provide a slight increase in security, though ultimately
16216 * any attacker who is able to take control of a channel can just as easily send the funds via
16217 * lightning payments, so we never require that our counterparties support this option.
16219 * This cannot be changed after a channel has been initialized.
16221 * Default value: true.
16223 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
16226 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
16227 * small to claim on-chain.
16229 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
16230 * not be claimable on-chain, instead being turned into additional miner fees if either
16231 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
16232 * to such payments may be sustantial if there are many dust HTLCs present when the
16233 * channel is force-closed.
16235 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
16236 * exposure across all three types per-channel. Setting this too low may prevent the
16237 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
16238 * important to prevent stealing of dust HTLCs by miners.
16240 * Default value: 5_000_000 msat.
16242 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
16245 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
16246 * small to claim on-chain.
16248 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
16249 * not be claimable on-chain, instead being turned into additional miner fees if either
16250 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
16251 * to such payments may be sustantial if there are many dust HTLCs present when the
16252 * channel is force-closed.
16254 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
16255 * exposure across all three types per-channel. Setting this too low may prevent the
16256 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
16257 * important to prevent stealing of dust HTLCs by miners.
16259 * Default value: 5_000_000 msat.
16261 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
16264 * The additional fee we're willing to pay to avoid waiting for the counterparty's
16265 * `to_self_delay` to reclaim funds.
16267 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
16268 * closing transaction which both sides find acceptable, ultimately paid by the channel
16269 * funder/initiator.
16271 * When we are the funder, because we have to pay the channel closing fee, we bound the
16272 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
16273 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
16274 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
16275 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
16278 * When we are not the funder, we require the closing transaction fee pay at least our
16279 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
16280 * Thus, this value is ignored when we are not the funder.
16282 * Default value: 1000 satoshis.
16284 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
16285 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
16287 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
16290 * The additional fee we're willing to pay to avoid waiting for the counterparty's
16291 * `to_self_delay` to reclaim funds.
16293 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
16294 * closing transaction which both sides find acceptable, ultimately paid by the channel
16295 * funder/initiator.
16297 * When we are the funder, because we have to pay the channel closing fee, we bound the
16298 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
16299 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
16300 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
16301 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
16304 * When we are not the funder, we require the closing transaction fee pay at least our
16305 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
16306 * Thus, this value is ignored when we are not the funder.
16308 * Default value: 1000 satoshis.
16310 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
16311 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
16313 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
16316 * Constructs a new ChannelConfig given each field
16318 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, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg);
16321 * Creates a copy of the ChannelConfig
16323 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
16326 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
16328 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
16331 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
16333 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
16336 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
16338 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
16341 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
16343 void UserConfig_free(struct LDKUserConfig this_obj);
16346 * Channel config that we propose to our counterparty.
16348 struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
16351 * Channel config that we propose to our counterparty.
16353 void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
16356 * Limits applied to our counterparty's proposed channel config settings.
16358 struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
16361 * Limits applied to our counterparty's proposed channel config settings.
16363 void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
16366 * Channel config which affects behavior during channel lifetime.
16368 struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr);
16371 * Channel config which affects behavior during channel lifetime.
16373 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
16376 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
16377 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
16378 * node which is not online reliably.
16380 * For nodes which are not online reliably, you should set all channels to *not* be announced
16381 * (using [`ChannelConfig::announced_channel`] and
16382 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
16383 * ensure you are not exposed to any forwarding risk.
16385 * Note that because you cannot change a channel's announced state after creation, there is no
16386 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
16387 * from a publicly-announced forwarding node to a private non-forwarding node you must close
16388 * all your channels and open new ones. For privacy, you should also change your node_id
16389 * (swapping all private and public key material for new ones) at that time.
16391 * Default value: false.
16393 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
16396 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
16397 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
16398 * node which is not online reliably.
16400 * For nodes which are not online reliably, you should set all channels to *not* be announced
16401 * (using [`ChannelConfig::announced_channel`] and
16402 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
16403 * ensure you are not exposed to any forwarding risk.
16405 * Note that because you cannot change a channel's announced state after creation, there is no
16406 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
16407 * from a publicly-announced forwarding node to a private non-forwarding node you must close
16408 * all your channels and open new ones. For privacy, you should also change your node_id
16409 * (swapping all private and public key material for new ones) at that time.
16411 * Default value: false.
16413 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
16416 * If this is set to false, we do not accept inbound requests to open a new channel.
16417 * Default value: true.
16419 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
16422 * If this is set to false, we do not accept inbound requests to open a new channel.
16423 * Default value: true.
16425 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
16428 * Constructs a new UserConfig given each field
16430 MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg);
16433 * Creates a copy of the UserConfig
16435 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
16438 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
16440 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
16443 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
16445 void BestBlock_free(struct LDKBestBlock this_obj);
16448 * Creates a copy of the BestBlock
16450 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
16453 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
16456 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
16459 * Returns a `BestBlock` as identified by the given block hash and height.
16461 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
16464 * Returns the best block hash.
16466 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
16469 * Returns the best block height.
16471 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
16474 * Creates a copy of the AccessError
16476 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
16479 * Utility method to constructs a new UnknownChain-variant AccessError
16481 enum LDKAccessError AccessError_unknown_chain(void);
16484 * Utility method to constructs a new UnknownTx-variant AccessError
16486 enum LDKAccessError AccessError_unknown_tx(void);
16489 * Calls the free function if one is set
16491 void Access_free(struct LDKAccess this_ptr);
16494 * Calls the free function if one is set
16496 void Listen_free(struct LDKListen this_ptr);
16499 * Calls the free function if one is set
16501 void Confirm_free(struct LDKConfirm this_ptr);
16504 * Creates a copy of the ChannelMonitorUpdateErr
16506 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
16509 * Utility method to constructs a new TemporaryFailure-variant ChannelMonitorUpdateErr
16511 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
16514 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateErr
16516 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
16519 * Calls the free function if one is set
16521 void Watch_free(struct LDKWatch this_ptr);
16524 * Calls the free function if one is set
16526 void Filter_free(struct LDKFilter this_ptr);
16529 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
16531 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
16534 * First block where the transaction output may have been spent.
16536 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
16538 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
16541 * First block where the transaction output may have been spent.
16543 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
16545 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
16548 * Outpoint identifying the transaction output.
16550 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
16553 * Outpoint identifying the transaction output.
16555 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
16558 * Spending condition of the transaction output.
16560 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
16563 * Spending condition of the transaction output.
16565 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
16568 * Constructs a new WatchedOutput given each field
16570 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
16573 * Creates a copy of the WatchedOutput
16575 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
16578 * Checks if two WatchedOutputs contain equal inner contents.
16580 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
16583 * Calls the free function if one is set
16585 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
16588 * Creates a copy of the ConfirmationTarget
16590 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
16593 * Utility method to constructs a new Background-variant ConfirmationTarget
16595 enum LDKConfirmationTarget ConfirmationTarget_background(void);
16598 * Utility method to constructs a new Normal-variant ConfirmationTarget
16600 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
16603 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
16605 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
16608 * Checks if two ConfirmationTargets contain equal inner contents.
16609 * This ignores pointers and is_owned flags and looks at the values in fields.
16611 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
16614 * Calls the free function if one is set
16616 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
16619 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
16621 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
16624 * Creates a copy of the MonitorUpdateId
16626 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
16629 * Checks if two MonitorUpdateIds contain equal inner contents.
16631 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
16634 * Checks if two MonitorUpdateIds contain equal inner contents.
16635 * This ignores pointers and is_owned flags and looks at the values in fields.
16636 * Two objects with NULL inner values will be considered "equal" here.
16638 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
16641 * Calls the free function if one is set
16643 void Persist_free(struct LDKPersist this_ptr);
16646 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
16648 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
16651 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
16653 void ChainMonitor_free(struct LDKChainMonitor this_obj);
16656 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
16658 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
16659 * will call back to it indicating transactions and outputs of interest. This allows clients to
16660 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
16661 * always need to fetch full blocks absent another means for determining which blocks contain
16662 * transactions relevant to the watched channels.
16664 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
16667 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
16668 * claims which are awaiting confirmation.
16670 * Includes the balances from each [`ChannelMonitor`] *except* those included in
16671 * `ignored_channels`, allowing you to filter out balances from channels which are still open
16672 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
16674 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
16675 * inclusion in the return value.
16677 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
16680 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
16681 * such [`ChannelMonitor`] is currently being monitored for.
16683 * Note that the result holds a mutex over our monitor set, and should not be held
16686 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
16689 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
16691 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
16692 * monitoring for on-chain state resolutions.
16694 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
16697 * Indicates the persistence of a [`ChannelMonitor`] has completed after
16698 * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation.
16700 * Thus, the anticipated use is, at a high level:
16701 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
16702 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
16703 * returning [`ChannelMonitorUpdateErr::TemporaryFailure`],
16704 * 2) once all remote copies are updated, you call this function with the
16705 * `completed_update_id` that completed, and once all pending updates have completed the
16706 * channel will be re-enabled.
16708 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
16709 * registered [`ChannelMonitor`]s.
16711 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);
16714 * Constructs a new Listen which calls the relevant methods on this_arg.
16715 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
16717 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
16720 * Constructs a new Confirm which calls the relevant methods on this_arg.
16721 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
16723 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
16726 * Constructs a new Watch which calls the relevant methods on this_arg.
16727 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
16729 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
16732 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
16733 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
16735 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
16738 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
16740 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
16743 * The sequence number of this update. Updates *must* be replayed in-order according to this
16744 * sequence number (and updates may panic if they are not). The update_id values are strictly
16745 * increasing and increase by one for each new update, with one exception specified below.
16747 * This sequence number is also used to track up to which points updates which returned
16748 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
16749 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
16751 * The only instance where update_id values are not strictly increasing is the case where we
16752 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
16753 * its docs for more details.
16755 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
16758 * The sequence number of this update. Updates *must* be replayed in-order according to this
16759 * sequence number (and updates may panic if they are not). The update_id values are strictly
16760 * increasing and increase by one for each new update, with one exception specified below.
16762 * This sequence number is also used to track up to which points updates which returned
16763 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
16764 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
16766 * The only instance where update_id values are not strictly increasing is the case where we
16767 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
16768 * its docs for more details.
16770 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
16773 * Creates a copy of the ChannelMonitorUpdate
16775 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
16778 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
16780 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
16783 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
16785 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
16788 * Frees any resources used by the MonitorEvent
16790 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
16793 * Creates a copy of the MonitorEvent
16795 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
16798 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
16800 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
16803 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
16805 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
16808 * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
16810 struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
16813 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
16815 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
16818 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
16820 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
16823 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
16825 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
16828 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
16830 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
16833 * Creates a copy of the HTLCUpdate
16835 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
16838 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
16840 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
16843 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
16845 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
16848 * Frees any resources used by the Balance
16850 void Balance_free(struct LDKBalance this_ptr);
16853 * Creates a copy of the Balance
16855 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
16858 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
16860 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
16863 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
16865 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
16868 * Utility method to constructs a new ContentiousClaimable-variant Balance
16870 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
16873 * Utility method to constructs a new MaybeClaimableHTLCAwaitingTimeout-variant Balance
16875 struct LDKBalance Balance_maybe_claimable_htlcawaiting_timeout(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
16878 * Checks if two Balances contain equal inner contents.
16879 * This ignores pointers and is_owned flags and looks at the values in fields.
16881 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
16884 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
16886 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
16889 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
16891 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
16894 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
16897 * panics if the given update is not the next update by update_id.
16899 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);
16902 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
16905 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
16908 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
16910 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
16913 * Gets a list of txids, with their output scripts (in the order they appear in the
16914 * transaction), which we must learn about spends of via block_connected().
16916 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
16919 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
16920 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
16921 * have been registered.
16923 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
16926 * Get the list of HTLCs who's status has been updated on chain. This should be called by
16927 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
16929 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
16932 * Gets the list of pending events which were generated by previous actions, clearing the list
16935 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
16936 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
16937 * no internal locking in ChannelMonitors.
16939 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
16942 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
16943 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
16944 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
16945 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
16946 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
16947 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
16948 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
16949 * out-of-band the other node operator to coordinate with him if option is available to you.
16950 * In any-case, choice is up to the user.
16952 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);
16955 * Processes transactions in a newly connected block, which may result in any of the following:
16956 * - update the monitor's state against resolved HTLCs
16957 * - punish the counterparty in the case of seeing a revoked commitment transaction
16958 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
16959 * - detect settled outputs for later spending
16960 * - schedule and bump any in-flight claims
16962 * Returns any new outputs to watch from `txdata`; after called, these are also included in
16963 * [`get_outputs_to_watch`].
16965 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
16967 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);
16970 * Determines if the disconnected block contained any transactions of interest and updates
16973 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);
16976 * Processes transactions confirmed in a block with the given header and height, returning new
16977 * outputs to watch. See [`block_connected`] for details.
16979 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
16980 * blocks. See [`chain::Confirm`] for calling expectations.
16982 * [`block_connected`]: Self::block_connected
16984 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);
16987 * Processes a transaction that was reorganized out of the chain.
16989 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
16990 * than blocks. See [`chain::Confirm`] for calling expectations.
16992 * [`block_disconnected`]: Self::block_disconnected
16994 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);
16997 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
16998 * [`block_connected`] for details.
17000 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
17001 * blocks. See [`chain::Confirm`] for calling expectations.
17003 * [`block_connected`]: Self::block_connected
17005 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);
17008 * Returns the set of txids that should be monitored for re-organization out of the chain.
17010 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
17013 * Gets the latest best block which was connected either via the [`chain::Listen`] or
17014 * [`chain::Confirm`] interfaces.
17016 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
17019 * Gets the balances in this channel which are either claimable by us if we were to
17020 * force-close the channel now or which are claimable on-chain (possibly awaiting
17023 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
17024 * included here until an [`Event::SpendableOutputs`] event has been generated for the
17025 * balance, or until our counterparty has claimed the balance and accrued several
17026 * confirmations on the claim transaction.
17028 * Note that the balances available when you or your counterparty have broadcasted revoked
17029 * state(s) may not be fully captured here.
17031 * See [`Balance`] for additional details on the types of claimable balances which
17032 * may be returned here and their meanings.
17034 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
17037 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
17039 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
17042 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
17044 void OutPoint_free(struct LDKOutPoint this_obj);
17047 * The referenced transaction's txid.
17049 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
17052 * The referenced transaction's txid.
17054 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17057 * The index of the referenced output in its transaction's vout.
17059 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
17062 * The index of the referenced output in its transaction's vout.
17064 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
17067 * Constructs a new OutPoint given each field
17069 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
17072 * Creates a copy of the OutPoint
17074 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
17077 * Checks if two OutPoints contain equal inner contents.
17078 * This ignores pointers and is_owned flags and looks at the values in fields.
17079 * Two objects with NULL inner values will be considered "equal" here.
17081 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
17084 * Checks if two OutPoints contain equal inner contents.
17086 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
17089 * Convert an `OutPoint` to a lightning channel id.
17091 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
17094 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
17096 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
17099 * Read a OutPoint from a byte array, created by OutPoint_write
17101 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
17104 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
17106 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
17109 * The outpoint which is spendable
17111 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
17114 * The outpoint which is spendable
17116 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
17119 * Per commitment point to derive delayed_payment_key by key holder
17121 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
17124 * Per commitment point to derive delayed_payment_key by key holder
17126 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17129 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
17130 * the witness_script.
17132 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
17135 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
17136 * the witness_script.
17138 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
17141 * The output which is referenced by the given outpoint
17143 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
17146 * The revocation point specific to the commitment transaction which was broadcast. Used to
17147 * derive the witnessScript for this output.
17149 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
17152 * The revocation point specific to the commitment transaction which was broadcast. Used to
17153 * derive the witnessScript for this output.
17155 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17158 * Arbitrary identification information returned by a call to
17159 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
17160 * the channel to spend the output.
17162 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
17165 * Arbitrary identification information returned by a call to
17166 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
17167 * the channel to spend the output.
17169 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17172 * The value of the channel which this output originated from, possibly indirectly.
17174 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
17177 * The value of the channel which this output originated from, possibly indirectly.
17179 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
17182 * Constructs a new DelayedPaymentOutputDescriptor given each field
17184 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);
17187 * Creates a copy of the DelayedPaymentOutputDescriptor
17189 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
17192 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
17194 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
17197 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
17199 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
17202 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
17204 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
17207 * The outpoint which is spendable
17209 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
17212 * The outpoint which is spendable
17214 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
17217 * The output which is referenced by the given outpoint
17219 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
17222 * Arbitrary identification information returned by a call to
17223 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
17224 * the channel to spend the output.
17226 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
17229 * Arbitrary identification information returned by a call to
17230 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
17231 * the channel to spend the output.
17233 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17236 * The value of the channel which this transactions spends.
17238 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
17241 * The value of the channel which this transactions spends.
17243 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
17246 * Constructs a new StaticPaymentOutputDescriptor given each field
17248 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);
17251 * Creates a copy of the StaticPaymentOutputDescriptor
17253 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
17256 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
17258 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
17261 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
17263 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
17266 * Frees any resources used by the SpendableOutputDescriptor
17268 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
17271 * Creates a copy of the SpendableOutputDescriptor
17273 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
17276 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
17278 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
17281 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
17283 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
17286 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
17288 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
17291 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
17293 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
17296 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
17298 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
17301 * Calls the free function if one is set
17303 void BaseSign_free(struct LDKBaseSign this_ptr);
17306 * Creates a copy of a Sign
17308 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
17311 * Calls the free function if one is set
17313 void Sign_free(struct LDKSign this_ptr);
17316 * Calls the free function if one is set
17318 void KeysInterface_free(struct LDKKeysInterface this_ptr);
17321 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
17323 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
17326 * Private key of anchor tx
17328 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
17331 * Private key of anchor tx
17333 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
17336 * Holder secret key for blinded revocation pubkey
17338 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
17341 * Holder secret key for blinded revocation pubkey
17343 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
17346 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
17348 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
17351 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
17353 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
17356 * Holder secret key used in HTLC tx
17358 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
17361 * Holder secret key used in HTLC tx
17363 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
17366 * Holder htlc secret key used in commitment tx htlc outputs
17368 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
17371 * Holder htlc secret key used in commitment tx htlc outputs
17373 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
17378 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
17383 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17386 * Creates a copy of the InMemorySigner
17388 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
17391 * Create a new InMemorySigner
17393 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);
17396 * Counterparty pubkeys.
17397 * Will panic if ready_channel wasn't called.
17399 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
17402 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
17403 * transactions, ie the amount of time that we have to wait to recover our funds if we
17404 * broadcast a transaction.
17405 * Will panic if ready_channel wasn't called.
17407 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
17410 * The contest_delay value specified by us and applied on transactions broadcastable
17411 * by our counterparty, ie the amount of time that they have to wait to recover their funds
17412 * if they broadcast a transaction.
17413 * Will panic if ready_channel wasn't called.
17415 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
17418 * Whether the holder is the initiator
17419 * Will panic if ready_channel wasn't called.
17421 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
17425 * Will panic if ready_channel wasn't called.
17427 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
17430 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
17431 * building transactions.
17433 * Will panic if ready_channel wasn't called.
17435 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
17438 * Whether anchors should be used.
17439 * Will panic if ready_channel wasn't called.
17441 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
17444 * Sign the single input of spend_tx at index `input_idx` which spends the output
17445 * described by descriptor, returning the witness stack for the input.
17447 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
17448 * or is not spending the outpoint described by `descriptor.outpoint`.
17450 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);
17453 * Sign the single input of spend_tx at index `input_idx` which spends the output
17454 * described by descriptor, returning the witness stack for the input.
17456 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
17457 * is not spending the outpoint described by `descriptor.outpoint`, or does not have a
17458 * sequence set to `descriptor.to_self_delay`.
17460 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);
17463 * Constructs a new BaseSign which calls the relevant methods on this_arg.
17464 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
17466 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
17469 * Constructs a new Sign which calls the relevant methods on this_arg.
17470 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
17472 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
17475 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
17477 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
17480 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
17482 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
17485 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
17487 void KeysManager_free(struct LDKKeysManager this_obj);
17490 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
17491 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
17492 * starting_time isn't strictly required to actually be a time, but it must absolutely,
17493 * without a doubt, be unique to this instance. ie if you start multiple times with the same
17494 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
17495 * simply use the current time (with very high precision).
17497 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
17498 * obviously, starting_time should be unique every time you reload the library - it is only
17499 * used to generate new ephemeral key data (which will be stored by the individual channel if
17502 * Note that the seed is required to recover certain on-chain funds independent of
17503 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
17504 * channel, and some on-chain during-closing funds.
17506 * Note that until the 0.1 release there is no guarantee of backward compatibility between
17507 * versions. Once the library is more fully supported, the docs will be updated to include a
17508 * detailed description of the guarantee.
17510 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
17513 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
17515 * Key derivation parameters are accessible through a per-channel secrets
17516 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
17517 * onchain output detection for which a corresponding delayed_payment_key must be derived.
17519 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]);
17522 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
17523 * output to the given change destination (if sufficient change value remains). The
17524 * transaction will have a feerate, at least, of the given value.
17526 * Returns `Err(())` if the output value is greater than the input value minus required fee or
17527 * if a descriptor was duplicated.
17529 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
17531 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
17532 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
17534 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);
17537 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
17538 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
17540 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
17543 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
17545 void ChannelManager_free(struct LDKChannelManager this_obj);
17548 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
17550 void ChainParameters_free(struct LDKChainParameters this_obj);
17553 * The network for determining the `chain_hash` in Lightning messages.
17555 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
17558 * The network for determining the `chain_hash` in Lightning messages.
17560 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
17563 * The hash and height of the latest block successfully connected.
17565 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
17567 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
17570 * The hash and height of the latest block successfully connected.
17572 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
17574 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
17577 * Constructs a new ChainParameters given each field
17579 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
17582 * Creates a copy of the ChainParameters
17584 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
17587 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
17589 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
17592 * Base routing fee in millisatoshis.
17594 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
17597 * Base routing fee in millisatoshis.
17599 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
17602 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
17604 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
17607 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
17609 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
17612 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
17613 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
17614 * `cltv_expiry_delta` for more details.
17616 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
17619 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
17620 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
17621 * `cltv_expiry_delta` for more details.
17623 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
17626 * Constructs a new CounterpartyForwardingInfo given each field
17628 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);
17631 * Creates a copy of the CounterpartyForwardingInfo
17633 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
17636 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
17638 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
17641 * The node_id of our counterparty
17643 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
17646 * The node_id of our counterparty
17648 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
17651 * The Features the channel counterparty provided upon last connection.
17652 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
17653 * many routing-relevant features are present in the init context.
17655 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
17658 * The Features the channel counterparty provided upon last connection.
17659 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
17660 * many routing-relevant features are present in the init context.
17662 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
17665 * The value, in satoshis, that must always be held in the channel for our counterparty. This
17666 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
17667 * claiming at least this value on chain.
17669 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
17671 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
17673 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
17676 * The value, in satoshis, that must always be held in the channel for our counterparty. This
17677 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
17678 * claiming at least this value on chain.
17680 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
17682 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
17684 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
17687 * Information on the fees and requirements that the counterparty requires when forwarding
17688 * payments to us through this channel.
17690 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
17692 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
17695 * Information on the fees and requirements that the counterparty requires when forwarding
17696 * payments to us through this channel.
17698 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
17700 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
17703 * Constructs a new ChannelCounterparty given each field
17705 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);
17708 * Creates a copy of the ChannelCounterparty
17710 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
17713 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
17715 void ChannelDetails_free(struct LDKChannelDetails this_obj);
17718 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
17719 * thereafter this is the txid of the funding transaction xor the funding transaction output).
17720 * Note that this means this value is *not* persistent - it can change once during the
17721 * lifetime of the channel.
17723 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
17726 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
17727 * thereafter this is the txid of the funding transaction xor the funding transaction output).
17728 * Note that this means this value is *not* persistent - it can change once during the
17729 * lifetime of the channel.
17731 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
17734 * Parameters which apply to our counterparty. See individual fields for more information.
17736 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17739 * Parameters which apply to our counterparty. See individual fields for more information.
17741 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
17744 * The Channel's funding transaction output, if we've negotiated the funding transaction with
17745 * our counterparty already.
17747 * Note that, if this has been set, `channel_id` will be equivalent to
17748 * `funding_txo.unwrap().to_channel_id()`.
17750 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
17752 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17755 * The Channel's funding transaction output, if we've negotiated the funding transaction with
17756 * our counterparty already.
17758 * Note that, if this has been set, `channel_id` will be equivalent to
17759 * `funding_txo.unwrap().to_channel_id()`.
17761 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
17763 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
17766 * The position of the funding transaction in the chain. None if the funding transaction has
17767 * not yet been confirmed and the channel fully opened.
17769 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17772 * The position of the funding transaction in the chain. None if the funding transaction has
17773 * not yet been confirmed and the channel fully opened.
17775 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17778 * The value, in satoshis, of this channel as appears in the funding output
17780 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17783 * The value, in satoshis, of this channel as appears in the funding output
17785 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
17788 * The value, in satoshis, that must always be held in the channel for us. This value ensures
17789 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
17790 * this value on chain.
17792 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
17794 * This value will be `None` for outbound channels until the counterparty accepts the channel.
17796 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
17798 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17801 * The value, in satoshis, that must always be held in the channel for us. This value ensures
17802 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
17803 * this value on chain.
17805 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
17807 * This value will be `None` for outbound channels until the counterparty accepts the channel.
17809 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
17811 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
17814 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
17816 uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17819 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
17821 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
17824 * Our total balance. This is the amount we would get if we close the channel.
17825 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
17826 * amount is not likely to be recoverable on close.
17828 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
17829 * balance is not available for inclusion in new outbound HTLCs). This further does not include
17830 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
17831 * This does not consider any on-chain fees.
17833 * See also [`ChannelDetails::outbound_capacity_msat`]
17835 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17838 * Our total balance. This is the amount we would get if we close the channel.
17839 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
17840 * amount is not likely to be recoverable on close.
17842 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
17843 * balance is not available for inclusion in new outbound HTLCs). This further does not include
17844 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
17845 * This does not consider any on-chain fees.
17847 * See also [`ChannelDetails::outbound_capacity_msat`]
17849 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
17852 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
17853 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
17854 * available for inclusion in new outbound HTLCs). This further does not include any pending
17855 * outgoing HTLCs which are awaiting some other resolution to be sent.
17857 * See also [`ChannelDetails::balance_msat`]
17859 * This value is not exact. Due to various in-flight changes, feerate changes, and our
17860 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
17861 * should be able to spend nearly this amount.
17863 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17866 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
17867 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
17868 * available for inclusion in new outbound HTLCs). This further does not include any pending
17869 * outgoing HTLCs which are awaiting some other resolution to be sent.
17871 * See also [`ChannelDetails::balance_msat`]
17873 * This value is not exact. Due to various in-flight changes, feerate changes, and our
17874 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
17875 * should be able to spend nearly this amount.
17877 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
17880 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
17881 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
17882 * available for inclusion in new inbound HTLCs).
17883 * Note that there are some corner cases not fully handled here, so the actual available
17884 * inbound capacity may be slightly higher than this.
17886 * This value is not exact. Due to various in-flight changes, feerate changes, and our
17887 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
17888 * However, our counterparty should be able to spend nearly this amount.
17890 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17893 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
17894 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
17895 * available for inclusion in new inbound HTLCs).
17896 * Note that there are some corner cases not fully handled here, so the actual available
17897 * inbound capacity may be slightly higher than this.
17899 * This value is not exact. Due to various in-flight changes, feerate changes, and our
17900 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
17901 * However, our counterparty should be able to spend nearly this amount.
17903 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
17906 * The number of required confirmations on the funding transaction before the funding will be
17907 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
17908 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
17909 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
17910 * [`ChannelHandshakeLimits::max_minimum_depth`].
17912 * This value will be `None` for outbound channels until the counterparty accepts the channel.
17914 * [`is_outbound`]: ChannelDetails::is_outbound
17915 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
17916 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
17918 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17921 * The number of required confirmations on the funding transaction before the funding will be
17922 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
17923 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
17924 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
17925 * [`ChannelHandshakeLimits::max_minimum_depth`].
17927 * This value will be `None` for outbound channels until the counterparty accepts the channel.
17929 * [`is_outbound`]: ChannelDetails::is_outbound
17930 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
17931 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
17933 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
17936 * The number of blocks (after our commitment transaction confirms) that we will need to wait
17937 * until we can claim our funds after we force-close the channel. During this time our
17938 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
17939 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
17940 * time to claim our non-HTLC-encumbered funds.
17942 * This value will be `None` for outbound channels until the counterparty accepts the channel.
17944 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17947 * The number of blocks (after our commitment transaction confirms) that we will need to wait
17948 * until we can claim our funds after we force-close the channel. During this time our
17949 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
17950 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
17951 * time to claim our non-HTLC-encumbered funds.
17953 * This value will be `None` for outbound channels until the counterparty accepts the channel.
17955 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
17958 * True if the channel was initiated (and thus funded) by us.
17960 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17963 * True if the channel was initiated (and thus funded) by us.
17965 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
17968 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
17969 * channel is not currently being shut down. `funding_locked` message exchange implies the
17970 * required confirmation count has been reached (and we were connected to the peer at some
17971 * point after the funding transaction received enough confirmations). The required
17972 * confirmation count is provided in [`confirmations_required`].
17974 * [`confirmations_required`]: ChannelDetails::confirmations_required
17976 bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17979 * True if the channel is confirmed, funding_locked messages have been exchanged, and the
17980 * channel is not currently being shut down. `funding_locked` message exchange implies the
17981 * required confirmation count has been reached (and we were connected to the peer at some
17982 * point after the funding transaction received enough confirmations). The required
17983 * confirmation count is provided in [`confirmations_required`].
17985 * [`confirmations_required`]: ChannelDetails::confirmations_required
17987 void ChannelDetails_set_is_funding_locked(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
17990 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
17991 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
17993 * This is a strict superset of `is_funding_locked`.
17995 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
17998 * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
17999 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
18001 * This is a strict superset of `is_funding_locked`.
18003 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
18006 * True if this channel is (or will be) publicly-announced.
18008 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
18011 * True if this channel is (or will be) publicly-announced.
18013 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
18016 * Constructs a new ChannelDetails given each field
18018 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg);
18021 * Creates a copy of the ChannelDetails
18023 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
18026 * Frees any resources used by the PaymentSendFailure
18028 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
18031 * Creates a copy of the PaymentSendFailure
18033 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
18036 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
18038 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
18041 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
18043 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
18046 * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
18048 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
18051 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
18053 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
18056 * Constructs a new ChannelManager to hold several channels and route between them.
18058 * This is the main \"logic hub\" for all channel-related actions, and implements
18059 * ChannelMessageHandler.
18061 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
18063 * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`!
18065 * Users need to notify the new ChannelManager when a new block is connected or
18066 * disconnected using its `block_connected` and `block_disconnected` methods, starting
18067 * from after `params.latest_hash`.
18069 MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, struct LDKChainParameters params);
18072 * Gets the current configuration applied to all new channels, as
18074 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
18077 * Creates a new outbound channel to the given remote node and with the given value.
18079 * `user_channel_id` will be provided back as in
18080 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
18081 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
18082 * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
18083 * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
18086 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
18087 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
18089 * Note that we do not check if you are currently connected to the given peer. If no
18090 * connection is available, the outbound `open_channel` message may fail to send, resulting in
18091 * the channel eventually being silently forgotten (dropped on reload).
18093 * Returns the new Channel's temporary `channel_id`. This ID will appear as
18094 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
18095 * [`ChannelDetails::channel_id`] until after
18096 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
18097 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
18098 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
18100 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
18101 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
18102 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
18104 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
18106 MUST_USE_RES struct LDKCResult__u832APIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_channel_id, struct LDKUserConfig override_config);
18109 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
18110 * more information.
18112 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
18115 * Gets the list of usable channels, in random order. Useful as an argument to
18116 * get_route to ensure non-announced channels are used.
18118 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
18119 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
18122 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
18125 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
18126 * will be accepted on the given channel, and after additional timeout/the closing of all
18127 * pending HTLCs, the channel will be closed on chain.
18129 * * If we are the channel initiator, we will pay between our [`Background`] and
18130 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
18132 * * If our counterparty is the channel initiator, we will require a channel closing
18133 * transaction feerate of at least our [`Background`] feerate or the feerate which
18134 * would appear on a force-closure transaction, whichever is lower. We will allow our
18135 * counterparty to pay as much fee as they'd like, however.
18137 * May generate a SendShutdown message event on success, which should be relayed.
18139 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
18140 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
18141 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
18143 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
18146 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
18147 * will be accepted on the given channel, and after additional timeout/the closing of all
18148 * pending HTLCs, the channel will be closed on chain.
18150 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
18151 * the channel being closed or not:
18152 * * If we are the channel initiator, we will pay at least this feerate on the closing
18153 * transaction. The upper-bound is set by
18154 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
18155 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
18156 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
18157 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
18158 * will appear on a force-closure transaction, whichever is lower).
18160 * May generate a SendShutdown message event on success, which should be relayed.
18162 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
18163 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
18164 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
18166 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_target_feerate(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], uint32_t target_feerate_sats_per_1000_weight);
18169 * Force closes a channel, immediately broadcasting the latest local commitment transaction to
18170 * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
18172 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
18175 * Force close all channels, immediately broadcasting the latest local commitment transaction
18176 * for each to the chain and rejecting new HTLCs on each.
18178 void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
18181 * Sends a payment along a given route.
18183 * Value parameters are provided via the last hop in route, see documentation for RouteHop
18184 * fields for more info.
18186 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
18187 * payment), we don't do anything to stop you! We always try to ensure that if the provided
18188 * next hop knows the preimage to payment_hash they can claim an additional amount as
18189 * specified in the last hop in the route! Thus, you should probably do your own
18190 * payment_preimage tracking (which you should already be doing as they represent \"proof of
18191 * payment\") and prevent double-sends yourself.
18193 * May generate SendHTLCs message(s) event on success, which should be relayed.
18195 * Each path may have a different return value, and PaymentSendValue may return a Vec with
18196 * each entry matching the corresponding-index entry in the route paths, see
18197 * PaymentSendFailure for more info.
18199 * In general, a path may raise:
18200 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
18201 * node public key) is specified.
18202 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
18203 * (including due to previous monitor update failure or new permanent monitor update
18205 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
18206 * relevant updates.
18208 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
18209 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
18210 * different route unless you intend to pay twice!
18212 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
18213 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
18214 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
18215 * must not contain multiple paths as multi-path payments require a recipient-provided
18217 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
18218 * bit set (either as required or as available). If multiple paths are present in the Route,
18219 * we assume the invoice had the basic_mpp feature set.
18221 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
18223 MUST_USE_RES struct LDKCResult_PaymentIdPaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
18226 * Retries a payment along the given [`Route`].
18228 * Errors returned are a superset of those returned from [`send_payment`], so see
18229 * [`send_payment`] documentation for more details on errors. This method will also error if the
18230 * retry amount puts the payment more than 10% over the payment's total amount, if the payment
18231 * for the given `payment_id` cannot be found (likely due to timeout or success), or if
18232 * further retries have been disabled with [`abandon_payment`].
18234 * [`send_payment`]: [`ChannelManager::send_payment`]
18235 * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
18237 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_retry_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
18240 * Signals that no further retries for the given payment will occur.
18242 * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
18243 * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
18244 * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
18245 * pending HTLCs for this payment.
18247 * Note that calling this method does *not* prevent a payment from succeeding. You must still
18248 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
18249 * determine the ultimate status of a payment.
18251 * [`retry_payment`]: Self::retry_payment
18252 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
18253 * [`Event::PaymentSent`]: events::Event::PaymentSent
18255 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
18258 * Send a spontaneous payment, which is a payment that does not require the recipient to have
18259 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
18260 * the preimage, it must be a cryptographically secure random value that no intermediate node
18261 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
18262 * never reach the recipient.
18264 * See [`send_payment`] documentation for more details on the return value of this function.
18266 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
18267 * [`send_payment`] for more information about the risks of duplicate preimage usage.
18269 * Note that `route` must have exactly one path.
18271 * [`send_payment`]: Self::send_payment
18273 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
18275 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
18278 * Call this upon creation of a funding transaction for the given channel.
18280 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
18281 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
18283 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
18284 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
18286 * May panic if the output found in the funding transaction is duplicative with some other
18287 * channel (note that this should be trivially prevented by using unique funding transaction
18288 * keys per-channel).
18290 * Do NOT broadcast the funding transaction yourself. When we have safely received our
18291 * counterparty's signature the funding transaction will automatically be broadcast via the
18292 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
18294 * Note that this includes RBF or similar transaction replacement strategies - lightning does
18295 * not currently support replacing a funding transaction on an existing channel. Instead,
18296 * create a new channel with a conflicting funding transaction.
18298 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
18299 * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
18301 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 LDKTransaction funding_transaction);
18304 * Regenerates channel_announcements and generates a signed node_announcement from the given
18305 * arguments, providing them in corresponding events via
18306 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
18307 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
18308 * announcement to ensure that the lightning P2P network is aware of the channels we have and
18309 * our network addresses.
18311 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
18312 * node to humans. They carry no in-protocol meaning.
18314 * `addresses` represent the set (possibly empty) of socket addresses on which this node
18315 * accepts incoming connections. These will be included in the node_announcement, publicly
18316 * tying these addresses together and to this node. If you wish to preserve user privacy,
18317 * addresses should likely contain only Tor Onion addresses.
18319 * Panics if `addresses` is absurdly large (more than 500).
18321 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
18323 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
18326 * Processes HTLCs which are pending waiting on random forward delay.
18328 * Should only really ever be called in response to a PendingHTLCsForwardable event.
18329 * Will likely generate further events.
18331 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
18334 * Performs actions which should happen on startup and roughly once per minute thereafter.
18336 * This currently includes:
18337 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
18338 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
18339 * than a minute, informing the network that they should no longer attempt to route over
18342 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
18343 * estimate fetches.
18345 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
18348 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
18349 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
18350 * along the path (including in our own channel on which we received it).
18351 * Returns false if no payment was found to fail backwards, true if the process of failing the
18352 * HTLC backwards has been started.
18354 MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
18357 * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
18358 * [`MessageSendEvent`]s needed to claim the payment.
18360 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
18361 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
18362 * event matches your expectation. If you fail to do so and call this method, you may provide
18363 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
18365 * Returns whether any HTLCs were claimed, and thus if any new [`MessageSendEvent`]s are now
18366 * pending for processing via [`get_and_clear_pending_msg_events`].
18368 * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
18369 * [`create_inbound_payment`]: Self::create_inbound_payment
18370 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
18371 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
18373 MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
18376 * Gets the node_id held by this ChannelManager
18378 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
18381 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
18384 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
18385 * [`PaymentHash`] and [`PaymentPreimage`] for you.
18387 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
18388 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
18389 * passed directly to [`claim_funds`].
18391 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
18393 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
18394 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
18398 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
18399 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
18401 * Errors if `min_value_msat` is greater than total bitcoin supply.
18403 * [`claim_funds`]: Self::claim_funds
18404 * [`PaymentReceived`]: events::Event::PaymentReceived
18405 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
18406 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
18408 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
18411 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
18412 * serialized state with LDK node(s) running 0.0.103 and earlier.
18415 * This method is deprecated and will be removed soon.
18417 * [`create_inbound_payment`]: Self::create_inbound_payment
18419 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ChannelManager_create_inbound_payment_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
18422 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
18423 * stored external to LDK.
18425 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
18426 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
18427 * the `min_value_msat` provided here, if one is provided.
18429 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
18430 * note that LDK will not stop you from registering duplicate payment hashes for inbound
18433 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
18434 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
18435 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
18436 * sender \"proof-of-payment\" unless they have paid the required amount.
18438 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
18439 * in excess of the current time. This should roughly match the expiry time set in the invoice.
18440 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
18441 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
18442 * invoices when no timeout is set.
18444 * Note that we use block header time to time-out pending inbound payments (with some margin
18445 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
18446 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
18447 * If you need exact expiry semantics, you should enforce them upon receipt of
18448 * [`PaymentReceived`].
18450 * May panic if `invoice_expiry_delta_secs` is greater than one year.
18452 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
18453 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
18455 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
18456 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
18460 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
18461 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
18463 * Errors if `min_value_msat` is greater than total bitcoin supply.
18465 * [`create_inbound_payment`]: Self::create_inbound_payment
18466 * [`PaymentReceived`]: events::Event::PaymentReceived
18468 MUST_USE_RES struct LDKCResult_PaymentSecretNoneZ 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);
18471 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
18472 * serialized state with LDK node(s) running 0.0.103 and earlier.
18475 * This method is deprecated and will be removed soon.
18477 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
18479 MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ ChannelManager_create_inbound_payment_for_hash_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs);
18482 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
18483 * previously returned from [`create_inbound_payment`].
18485 * [`create_inbound_payment`]: Self::create_inbound_payment
18487 MUST_USE_RES struct LDKCResult_PaymentPreimageAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
18490 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
18491 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
18493 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
18496 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
18497 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
18499 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
18502 * Constructs a new Listen which calls the relevant methods on this_arg.
18503 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
18505 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
18508 * Constructs a new Confirm which calls the relevant methods on this_arg.
18509 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
18511 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
18514 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
18515 * indicating whether persistence is necessary. Only one listener on
18516 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
18519 * Note that this method is not available with the `no-std` feature.
18521 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
18524 * Blocks until ChannelManager needs to be persisted. Only one listener on
18525 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
18528 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
18531 * Gets the latest best block which was connected either via the [`chain::Listen`] or
18532 * [`chain::Confirm`] interfaces.
18534 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
18537 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
18538 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
18540 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
18543 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
18545 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
18548 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
18550 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
18553 * The keys provider which will give us relevant keys. Some keys will be loaded during
18554 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
18557 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
18560 * The keys provider which will give us relevant keys. Some keys will be loaded during
18561 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
18564 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
18567 * The fee_estimator for use in the ChannelManager in the future.
18569 * No calls to the FeeEstimator will be made during deserialization.
18571 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
18574 * The fee_estimator for use in the ChannelManager in the future.
18576 * No calls to the FeeEstimator will be made during deserialization.
18578 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
18581 * The chain::Watch for use in the ChannelManager in the future.
18583 * No calls to the chain::Watch will be made during deserialization. It is assumed that
18584 * you have deserialized ChannelMonitors separately and will add them to your
18585 * chain::Watch after deserializing this ChannelManager.
18587 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
18590 * The chain::Watch for use in the ChannelManager in the future.
18592 * No calls to the chain::Watch will be made during deserialization. It is assumed that
18593 * you have deserialized ChannelMonitors separately and will add them to your
18594 * chain::Watch after deserializing this ChannelManager.
18596 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
18599 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
18600 * used to broadcast the latest local commitment transactions of channels which must be
18601 * force-closed during deserialization.
18603 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
18606 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
18607 * used to broadcast the latest local commitment transactions of channels which must be
18608 * force-closed during deserialization.
18610 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
18613 * The Logger for use in the ChannelManager and which may be used to log information during
18616 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
18619 * The Logger for use in the ChannelManager and which may be used to log information during
18622 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
18625 * Default settings used for new channels. Any existing channels will continue to use the
18626 * runtime settings which were stored when the ChannelManager was serialized.
18628 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
18631 * Default settings used for new channels. Any existing channels will continue to use the
18632 * runtime settings which were stored when the ChannelManager was serialized.
18634 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
18637 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
18638 * HashMap for you. This is primarily useful for C bindings where it is not practical to
18639 * populate a HashMap directly from C.
18641 MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKKeysInterface keys_manager, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors);
18644 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
18646 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
18649 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
18651 void DecodeError_free(struct LDKDecodeError this_obj);
18654 * Creates a copy of the DecodeError
18656 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
18659 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
18661 void Init_free(struct LDKInit this_obj);
18664 * The relevant features which the sender supports
18666 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
18669 * The relevant features which the sender supports
18671 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
18674 * Constructs a new Init given each field
18676 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg);
18679 * Creates a copy of the Init
18681 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
18684 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
18686 void ErrorMessage_free(struct LDKErrorMessage this_obj);
18689 * The channel ID involved in the error
18691 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
18694 * The channel ID involved in the error
18696 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18699 * A possibly human-readable error description.
18700 * The string should be sanitized before it is used (e.g. emitted to logs
18701 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
18702 * vulnerability in the terminal emulator or the logging subsystem.
18704 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
18707 * A possibly human-readable error description.
18708 * The string should be sanitized before it is used (e.g. emitted to logs
18709 * or printed to stdout). Otherwise, a well crafted error message may trigger a security
18710 * vulnerability in the terminal emulator or the logging subsystem.
18712 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
18715 * Constructs a new ErrorMessage given each field
18717 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
18720 * Creates a copy of the ErrorMessage
18722 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
18725 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
18727 void Ping_free(struct LDKPing this_obj);
18730 * The desired response length
18732 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
18735 * The desired response length
18737 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
18740 * The ping packet size.
18741 * This field is not sent on the wire. byteslen zeros are sent.
18743 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
18746 * The ping packet size.
18747 * This field is not sent on the wire. byteslen zeros are sent.
18749 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
18752 * Constructs a new Ping given each field
18754 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
18757 * Creates a copy of the Ping
18759 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
18762 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
18764 void Pong_free(struct LDKPong this_obj);
18767 * The pong packet size.
18768 * This field is not sent on the wire. byteslen zeros are sent.
18770 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
18773 * The pong packet size.
18774 * This field is not sent on the wire. byteslen zeros are sent.
18776 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
18779 * Constructs a new Pong given each field
18781 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
18784 * Creates a copy of the Pong
18786 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
18789 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
18791 void OpenChannel_free(struct LDKOpenChannel this_obj);
18794 * The genesis hash of the blockchain where the channel is to be opened
18796 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
18799 * The genesis hash of the blockchain where the channel is to be opened
18801 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18804 * A temporary channel ID, until the funding outpoint is announced
18806 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
18809 * A temporary channel ID, until the funding outpoint is announced
18811 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18814 * The channel value
18816 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18819 * The channel value
18821 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
18824 * The amount to push to the counterparty as part of the open, in milli-satoshi
18826 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18829 * The amount to push to the counterparty as part of the open, in milli-satoshi
18831 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
18834 * The threshold below which outputs on transactions broadcast by sender will be omitted
18836 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18839 * The threshold below which outputs on transactions broadcast by sender will be omitted
18841 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
18844 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
18846 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18849 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
18851 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
18854 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
18856 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18859 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
18861 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
18864 * The minimum HTLC size incoming to sender, in milli-satoshi
18866 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18869 * The minimum HTLC size incoming to sender, in milli-satoshi
18871 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
18874 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
18876 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18879 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
18881 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
18884 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
18886 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18889 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
18891 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
18894 * The maximum number of inbound HTLCs towards sender
18896 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18899 * The maximum number of inbound HTLCs towards sender
18901 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
18904 * The sender's key controlling the funding transaction
18906 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18909 * The sender's key controlling the funding transaction
18911 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18914 * Used to derive a revocation key for transactions broadcast by counterparty
18916 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18919 * Used to derive a revocation key for transactions broadcast by counterparty
18921 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18924 * A payment key to sender for transactions broadcast by counterparty
18926 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18929 * A payment key to sender for transactions broadcast by counterparty
18931 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18934 * Used to derive a payment key to sender for transactions broadcast by sender
18936 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18939 * Used to derive a payment key to sender for transactions broadcast by sender
18941 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18944 * Used to derive an HTLC payment key to sender
18946 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18949 * Used to derive an HTLC payment key to sender
18951 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18954 * The first to-be-broadcast-by-sender transaction's per commitment point
18956 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18959 * The first to-be-broadcast-by-sender transaction's per commitment point
18961 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
18966 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18971 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
18974 * The channel type that this channel will represent. If none is set, we derive the channel
18975 * type from the intersection of our feature bits with our counterparty's feature bits from
18976 * the Init message.
18978 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18980 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
18983 * The channel type that this channel will represent. If none is set, we derive the channel
18984 * type from the intersection of our feature bits with our counterparty's feature bits from
18985 * the Init message.
18987 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18989 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
18992 * Creates a copy of the OpenChannel
18994 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
18997 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
18999 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
19002 * A temporary channel ID, until the funding outpoint is announced
19004 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
19007 * A temporary channel ID, until the funding outpoint is announced
19009 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19012 * The threshold below which outputs on transactions broadcast by sender will be omitted
19014 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19017 * The threshold below which outputs on transactions broadcast by sender will be omitted
19019 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
19022 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
19024 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19027 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
19029 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
19032 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
19034 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19037 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
19039 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
19042 * The minimum HTLC size incoming to sender, in milli-satoshi
19044 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19047 * The minimum HTLC size incoming to sender, in milli-satoshi
19049 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
19052 * Minimum depth of the funding transaction before the channel is considered open
19054 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19057 * Minimum depth of the funding transaction before the channel is considered open
19059 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
19062 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
19064 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19067 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
19069 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
19072 * The maximum number of inbound HTLCs towards sender
19074 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19077 * The maximum number of inbound HTLCs towards sender
19079 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
19082 * The sender's key controlling the funding transaction
19084 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19087 * The sender's key controlling the funding transaction
19089 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19092 * Used to derive a revocation key for transactions broadcast by counterparty
19094 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19097 * Used to derive a revocation key for transactions broadcast by counterparty
19099 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19102 * A payment key to sender for transactions broadcast by counterparty
19104 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19107 * A payment key to sender for transactions broadcast by counterparty
19109 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19112 * Used to derive a payment key to sender for transactions broadcast by sender
19114 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19117 * Used to derive a payment key to sender for transactions broadcast by sender
19119 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19122 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
19124 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19127 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
19129 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19132 * The first to-be-broadcast-by-sender transaction's per commitment point
19134 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
19137 * The first to-be-broadcast-by-sender transaction's per commitment point
19139 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19142 * Creates a copy of the AcceptChannel
19144 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
19147 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
19149 void FundingCreated_free(struct LDKFundingCreated this_obj);
19152 * A temporary channel ID, until the funding is established
19154 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
19157 * A temporary channel ID, until the funding is established
19159 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19162 * The funding transaction ID
19164 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
19167 * The funding transaction ID
19169 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19172 * The specific output index funding this channel
19174 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
19177 * The specific output index funding this channel
19179 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
19182 * The signature of the channel initiator (funder) on the initial commitment transaction
19184 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
19187 * The signature of the channel initiator (funder) on the initial commitment transaction
19189 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
19192 * Constructs a new FundingCreated given each field
19194 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 LDKSignature signature_arg);
19197 * Creates a copy of the FundingCreated
19199 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
19202 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
19204 void FundingSigned_free(struct LDKFundingSigned this_obj);
19209 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
19214 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19217 * The signature of the channel acceptor (fundee) on the initial commitment transaction
19219 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
19222 * The signature of the channel acceptor (fundee) on the initial commitment transaction
19224 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
19227 * Constructs a new FundingSigned given each field
19229 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
19232 * Creates a copy of the FundingSigned
19234 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
19237 * Frees any resources used by the FundingLocked, if is_owned is set and inner is non-NULL.
19239 void FundingLocked_free(struct LDKFundingLocked this_obj);
19244 const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32];
19249 void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19252 * The per-commitment point of the second commitment transaction
19254 struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr);
19257 * The per-commitment point of the second commitment transaction
19259 void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19262 * Constructs a new FundingLocked given each field
19264 MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg);
19267 * Creates a copy of the FundingLocked
19269 struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig);
19272 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
19274 void Shutdown_free(struct LDKShutdown this_obj);
19279 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
19284 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19287 * The destination of this peer's funds on closing.
19288 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
19290 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
19293 * The destination of this peer's funds on closing.
19294 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
19296 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
19299 * Constructs a new Shutdown given each field
19301 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
19304 * Creates a copy of the Shutdown
19306 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
19309 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
19311 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
19314 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
19317 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
19320 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
19323 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
19326 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
19329 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
19332 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
19335 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
19338 * Constructs a new ClosingSignedFeeRange given each field
19340 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
19343 * Creates a copy of the ClosingSignedFeeRange
19345 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
19348 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
19350 void ClosingSigned_free(struct LDKClosingSigned this_obj);
19355 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
19360 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19363 * The proposed total fee for the closing transaction
19365 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
19368 * The proposed total fee for the closing transaction
19370 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
19373 * A signature on the closing transaction
19375 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
19378 * A signature on the closing transaction
19380 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
19383 * The minimum and maximum fees which the sender is willing to accept, provided only by new
19386 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19388 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
19391 * The minimum and maximum fees which the sender is willing to accept, provided only by new
19394 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
19396 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
19399 * Constructs a new ClosingSigned given each field
19401 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
19404 * Creates a copy of the ClosingSigned
19406 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
19409 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
19411 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
19416 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
19421 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19426 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
19431 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
19434 * The HTLC value in milli-satoshi
19436 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
19439 * The HTLC value in milli-satoshi
19441 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
19444 * The payment hash, the pre-image of which controls HTLC redemption
19446 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
19449 * The payment hash, the pre-image of which controls HTLC redemption
19451 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19454 * The expiry height of the HTLC
19456 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
19459 * The expiry height of the HTLC
19461 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
19464 * Creates a copy of the UpdateAddHTLC
19466 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
19469 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
19471 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
19476 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
19481 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19486 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
19491 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
19494 * The pre-image of the payment hash, allowing HTLC redemption
19496 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
19499 * The pre-image of the payment hash, allowing HTLC redemption
19501 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19504 * Constructs a new UpdateFulfillHTLC given each field
19506 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
19509 * Creates a copy of the UpdateFulfillHTLC
19511 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
19514 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
19516 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
19521 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
19526 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19531 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
19536 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
19539 * Creates a copy of the UpdateFailHTLC
19541 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
19544 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
19546 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
19551 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
19556 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19561 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
19566 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
19571 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
19576 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
19579 * Creates a copy of the UpdateFailMalformedHTLC
19581 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
19584 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
19586 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
19591 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
19596 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19599 * A signature on the commitment transaction
19601 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
19604 * A signature on the commitment transaction
19606 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
19609 * Signatures on the HTLC transactions
19611 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
19614 * Constructs a new CommitmentSigned given each field
19616 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
19619 * Creates a copy of the CommitmentSigned
19621 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
19624 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
19626 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
19631 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
19636 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19639 * The secret corresponding to the per-commitment point
19641 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
19644 * The secret corresponding to the per-commitment point
19646 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19649 * The next sender-broadcast commitment transaction's per-commitment point
19651 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
19654 * The next sender-broadcast commitment transaction's per-commitment point
19656 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19659 * Constructs a new RevokeAndACK given each field
19661 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);
19664 * Creates a copy of the RevokeAndACK
19666 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
19669 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
19671 void UpdateFee_free(struct LDKUpdateFee this_obj);
19676 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
19681 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19684 * Fee rate per 1000-weight of the transaction
19686 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
19689 * Fee rate per 1000-weight of the transaction
19691 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
19694 * Constructs a new UpdateFee given each field
19696 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
19699 * Creates a copy of the UpdateFee
19701 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
19704 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
19706 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
19709 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
19710 * belonging to the recipient
19712 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
19715 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
19716 * belonging to the recipient
19718 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19721 * The sender's per-commitment point for their current commitment transaction
19723 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
19726 * The sender's per-commitment point for their current commitment transaction
19728 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19731 * Constructs a new DataLossProtect given each field
19733 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
19736 * Creates a copy of the DataLossProtect
19738 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
19741 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
19743 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
19748 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
19753 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19756 * The next commitment number for the sender
19758 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
19761 * The next commitment number for the sender
19763 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
19766 * The next commitment number for the recipient
19768 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
19771 * The next commitment number for the recipient
19773 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
19776 * Creates a copy of the ChannelReestablish
19778 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
19781 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
19783 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
19788 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
19793 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19796 * The short channel ID
19798 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
19801 * The short channel ID
19803 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
19806 * A signature by the node key
19808 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
19811 * A signature by the node key
19813 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
19816 * A signature by the funding key
19818 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
19821 * A signature by the funding key
19823 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
19826 * Constructs a new AnnouncementSignatures given each field
19828 MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKSignature node_signature_arg, struct LDKSignature bitcoin_signature_arg);
19831 * Creates a copy of the AnnouncementSignatures
19833 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
19836 * Frees any resources used by the NetAddress
19838 void NetAddress_free(struct LDKNetAddress this_ptr);
19841 * Creates a copy of the NetAddress
19843 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
19846 * Utility method to constructs a new IPv4-variant NetAddress
19848 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
19851 * Utility method to constructs a new IPv6-variant NetAddress
19853 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
19856 * Utility method to constructs a new OnionV2-variant NetAddress
19858 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
19861 * Utility method to constructs a new OnionV3-variant NetAddress
19863 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
19866 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
19868 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
19871 * Read a NetAddress from a byte array, created by NetAddress_write
19873 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
19876 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
19878 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
19881 * The advertised features
19883 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
19886 * The advertised features
19888 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
19891 * A strictly monotonic announcement counter, with gaps allowed
19893 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
19896 * A strictly monotonic announcement counter, with gaps allowed
19898 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
19901 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
19904 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
19907 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
19910 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19913 * An RGB color for UI purposes
19915 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
19918 * An RGB color for UI purposes
19920 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
19923 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
19926 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
19929 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
19932 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19935 * List of addresses on which this node is reachable
19937 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
19940 * Creates a copy of the UnsignedNodeAnnouncement
19942 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
19945 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
19947 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
19950 * The signature by the node key
19952 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
19955 * The signature by the node key
19957 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
19960 * The actual content of the announcement
19962 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
19965 * The actual content of the announcement
19967 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
19970 * Constructs a new NodeAnnouncement given each field
19972 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
19975 * Creates a copy of the NodeAnnouncement
19977 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
19980 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
19982 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
19985 * The advertised channel features
19987 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
19990 * The advertised channel features
19992 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
19995 * The genesis hash of the blockchain where the channel is to be opened
19997 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
20000 * The genesis hash of the blockchain where the channel is to be opened
20002 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20005 * The short channel ID
20007 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
20010 * The short channel ID
20012 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
20015 * One of the two node_ids which are endpoints of this channel
20017 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
20020 * One of the two node_ids which are endpoints of this channel
20022 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20025 * The other of the two node_ids which are endpoints of this channel
20027 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
20030 * The other of the two node_ids which are endpoints of this channel
20032 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20035 * The funding key for the first node
20037 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
20040 * The funding key for the first node
20042 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20045 * The funding key for the second node
20047 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
20050 * The funding key for the second node
20052 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20055 * Creates a copy of the UnsignedChannelAnnouncement
20057 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
20060 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
20062 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
20065 * Authentication of the announcement by the first public node
20067 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
20070 * Authentication of the announcement by the first public node
20072 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
20075 * Authentication of the announcement by the second public node
20077 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
20080 * Authentication of the announcement by the second public node
20082 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
20085 * Proof of funding UTXO ownership by the first public node
20087 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
20090 * Proof of funding UTXO ownership by the first public node
20092 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
20095 * Proof of funding UTXO ownership by the second public node
20097 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
20100 * Proof of funding UTXO ownership by the second public node
20102 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
20105 * The actual announcement
20107 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
20110 * The actual announcement
20112 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
20115 * Constructs a new ChannelAnnouncement given each field
20117 MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKSignature node_signature_1_arg, struct LDKSignature node_signature_2_arg, struct LDKSignature bitcoin_signature_1_arg, struct LDKSignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg);
20120 * Creates a copy of the ChannelAnnouncement
20122 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
20125 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
20127 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
20130 * The genesis hash of the blockchain where the channel is to be opened
20132 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
20135 * The genesis hash of the blockchain where the channel is to be opened
20137 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20140 * The short channel ID
20142 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
20145 * The short channel ID
20147 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
20150 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
20152 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
20155 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
20157 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
20162 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
20167 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
20170 * The number of blocks such that if:
20171 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
20172 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
20173 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
20174 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
20175 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
20176 * forwarding. Note that the HTLC sender is the one who originally sets this value when
20177 * constructing the route.
20179 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
20182 * The number of blocks such that if:
20183 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
20184 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
20185 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
20186 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
20187 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
20188 * forwarding. Note that the HTLC sender is the one who originally sets this value when
20189 * constructing the route.
20191 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
20194 * The minimum HTLC size incoming to sender, in milli-satoshi
20196 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
20199 * The minimum HTLC size incoming to sender, in milli-satoshi
20201 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
20204 * The base HTLC fee charged by sender, in milli-satoshi
20206 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
20209 * The base HTLC fee charged by sender, in milli-satoshi
20211 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
20214 * The amount to fee multiplier, in micro-satoshi
20216 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
20219 * The amount to fee multiplier, in micro-satoshi
20221 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
20224 * Creates a copy of the UnsignedChannelUpdate
20226 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
20229 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
20231 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
20234 * A signature of the channel update
20236 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
20239 * A signature of the channel update
20241 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
20244 * The actual channel update
20246 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
20249 * The actual channel update
20251 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
20254 * Constructs a new ChannelUpdate given each field
20256 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
20259 * Creates a copy of the ChannelUpdate
20261 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
20264 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
20266 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
20269 * The genesis hash of the blockchain being queried
20271 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
20274 * The genesis hash of the blockchain being queried
20276 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20279 * The height of the first block for the channel UTXOs being queried
20281 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
20284 * The height of the first block for the channel UTXOs being queried
20286 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
20289 * The number of blocks to include in the query results
20291 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
20294 * The number of blocks to include in the query results
20296 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
20299 * Constructs a new QueryChannelRange given each field
20301 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
20304 * Creates a copy of the QueryChannelRange
20306 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
20309 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
20311 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
20314 * The genesis hash of the blockchain being queried
20316 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
20319 * The genesis hash of the blockchain being queried
20321 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20324 * The height of the first block in the range of the reply
20326 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
20329 * The height of the first block in the range of the reply
20331 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
20334 * The number of blocks included in the range of the reply
20336 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
20339 * The number of blocks included in the range of the reply
20341 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
20344 * True when this is the final reply for a query
20346 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
20349 * True when this is the final reply for a query
20351 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
20354 * The short_channel_ids in the channel range
20356 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
20359 * Constructs a new ReplyChannelRange given each field
20361 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);
20364 * Creates a copy of the ReplyChannelRange
20366 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
20369 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
20371 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
20374 * The genesis hash of the blockchain being queried
20376 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
20379 * The genesis hash of the blockchain being queried
20381 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20384 * The short_channel_ids that are being queried
20386 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
20389 * Constructs a new QueryShortChannelIds given each field
20391 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
20394 * Creates a copy of the QueryShortChannelIds
20396 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
20399 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
20401 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
20404 * The genesis hash of the blockchain that was queried
20406 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
20409 * The genesis hash of the blockchain that was queried
20411 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20414 * Indicates if the query recipient maintains up-to-date channel
20415 * information for the chain_hash
20417 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
20420 * Indicates if the query recipient maintains up-to-date channel
20421 * information for the chain_hash
20423 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
20426 * Constructs a new ReplyShortChannelIdsEnd given each field
20428 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
20431 * Creates a copy of the ReplyShortChannelIdsEnd
20433 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
20436 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
20438 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
20441 * The genesis hash of the blockchain for channel and node information
20443 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
20446 * The genesis hash of the blockchain for channel and node information
20448 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20451 * The starting unix timestamp
20453 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
20456 * The starting unix timestamp
20458 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
20461 * The range of information in seconds
20463 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
20466 * The range of information in seconds
20468 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
20471 * Constructs a new GossipTimestampFilter given each field
20473 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
20476 * Creates a copy of the GossipTimestampFilter
20478 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
20481 * Frees any resources used by the ErrorAction
20483 void ErrorAction_free(struct LDKErrorAction this_ptr);
20486 * Creates a copy of the ErrorAction
20488 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
20491 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
20493 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
20496 * Utility method to constructs a new IgnoreError-variant ErrorAction
20498 struct LDKErrorAction ErrorAction_ignore_error(void);
20501 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
20503 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
20506 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
20508 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
20511 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
20513 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
20516 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
20518 void LightningError_free(struct LDKLightningError this_obj);
20521 * A human-readable message describing the error
20523 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
20526 * A human-readable message describing the error
20528 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
20531 * The action which should be taken against the offending peer.
20533 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
20536 * The action which should be taken against the offending peer.
20538 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
20541 * Constructs a new LightningError given each field
20543 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
20546 * Creates a copy of the LightningError
20548 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
20551 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
20553 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
20556 * update_add_htlc messages which should be sent
20558 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
20561 * update_add_htlc messages which should be sent
20563 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
20566 * update_fulfill_htlc messages which should be sent
20568 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
20571 * update_fulfill_htlc messages which should be sent
20573 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
20576 * update_fail_htlc messages which should be sent
20578 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
20581 * update_fail_htlc messages which should be sent
20583 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
20586 * update_fail_malformed_htlc messages which should be sent
20588 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
20591 * update_fail_malformed_htlc messages which should be sent
20593 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
20596 * An update_fee message which should be sent
20598 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20600 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
20603 * An update_fee message which should be sent
20605 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20607 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
20610 * Finally, the commitment_signed message which should be sent
20612 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
20615 * Finally, the commitment_signed message which should be sent
20617 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
20620 * Constructs a new CommitmentUpdate given each field
20622 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);
20625 * Creates a copy of the CommitmentUpdate
20627 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
20630 * Calls the free function if one is set
20632 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
20635 * Calls the free function if one is set
20637 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
20640 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
20642 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
20645 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
20647 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
20650 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
20652 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
20655 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
20657 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
20660 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
20662 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
20665 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
20667 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
20670 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
20672 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
20675 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
20677 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
20680 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
20682 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
20685 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
20687 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
20690 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
20692 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
20695 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
20697 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
20700 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
20702 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
20705 * Read a FundingCreated from a byte array, created by FundingCreated_write
20707 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
20710 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
20712 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
20715 * Read a FundingSigned from a byte array, created by FundingSigned_write
20717 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
20720 * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read
20722 struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj);
20725 * Read a FundingLocked from a byte array, created by FundingLocked_write
20727 struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser);
20730 * Serialize the Init object into a byte array which can be read by Init_read
20732 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
20735 * Read a Init from a byte array, created by Init_write
20737 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
20740 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
20742 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
20745 * Read a OpenChannel from a byte array, created by OpenChannel_write
20747 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
20750 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
20752 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
20755 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
20757 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
20760 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
20762 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
20765 * Read a Shutdown from a byte array, created by Shutdown_write
20767 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
20770 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
20772 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
20775 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
20777 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
20780 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
20782 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
20785 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
20787 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
20790 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
20792 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
20795 * Read a UpdateFee from a byte array, created by UpdateFee_write
20797 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
20800 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
20802 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
20805 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
20807 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
20810 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
20812 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
20815 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
20817 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
20820 * Serialize the Ping object into a byte array which can be read by Ping_read
20822 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
20825 * Read a Ping from a byte array, created by Ping_write
20827 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
20830 * Serialize the Pong object into a byte array which can be read by Pong_read
20832 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
20835 * Read a Pong from a byte array, created by Pong_write
20837 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
20840 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
20842 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
20845 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
20847 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
20850 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
20852 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
20855 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
20857 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
20860 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
20862 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
20865 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
20867 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
20870 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
20872 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
20875 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
20877 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
20880 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
20882 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
20885 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
20887 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
20890 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
20892 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
20895 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
20897 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
20900 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
20902 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
20905 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
20907 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
20910 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
20912 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
20915 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
20917 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
20920 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
20922 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
20925 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
20927 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
20930 *\n\t * Calculates the overflow safe ending block height for the query.\n\t * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`\n\t
20932 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
20935 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
20937 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
20940 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
20942 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
20945 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
20947 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
20950 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
20952 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
20955 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
20957 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
20960 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
20962 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
20965 * Calls the free function if one is set
20967 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
20970 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
20972 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
20975 * Constructs a new IgnoringMessageHandler given each field
20977 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
20980 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
20981 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
20983 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
20986 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
20987 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
20989 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
20992 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
20993 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
20995 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
20998 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
20999 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
21001 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
21004 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
21006 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
21009 * Constructs a new ErroringMessageHandler
21011 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
21014 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
21015 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
21017 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
21020 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
21021 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
21023 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
21026 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
21028 void MessageHandler_free(struct LDKMessageHandler this_obj);
21031 * A message handler which handles messages specific to channels. Usually this is just a
21032 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
21034 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
21036 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
21039 * A message handler which handles messages specific to channels. Usually this is just a
21040 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
21042 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
21044 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
21047 * A message handler which handles messages updating our knowledge of the network channel
21048 * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
21049 * [`IgnoringMessageHandler`].
21051 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
21053 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
21056 * A message handler which handles messages updating our knowledge of the network channel
21057 * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
21058 * [`IgnoringMessageHandler`].
21060 * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
21062 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
21065 * Constructs a new MessageHandler given each field
21067 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
21070 * Creates a copy of a SocketDescriptor
21072 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
21075 * Calls the free function if one is set
21077 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
21080 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
21082 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
21085 * Used to indicate that we probably can't make any future connections to this peer, implying
21086 * we should go ahead and force-close any channels we have with it.
21088 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
21091 * Used to indicate that we probably can't make any future connections to this peer, implying
21092 * we should go ahead and force-close any channels we have with it.
21094 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
21097 * Constructs a new PeerHandleError given each field
21099 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
21102 * Creates a copy of the PeerHandleError
21104 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
21107 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
21109 void PeerManager_free(struct LDKPeerManager this_obj);
21112 * Constructs a new PeerManager with the given message handlers and node_id secret key
21113 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
21114 * cryptographically secure random bytes.
21116 MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKCustomMessageHandler custom_message_handler);
21119 * Get the list of node ids for peers which have completed the initial handshake.
21121 * For outbound connections, this will be the same as the their_node_id parameter passed in to
21122 * new_outbound_connection, however entries will only appear once the initial handshake has
21123 * completed and we are sure the remote peer has the private key for the given node_id.
21125 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
21128 * Indicates a new outbound connection has been established to a node with the given node_id.
21129 * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
21130 * descriptor but must disconnect the connection immediately.
21132 * Returns a small number of bytes to send to the remote node (currently always 50).
21134 * Panics if descriptor is duplicative with some other descriptor which has not yet been
21135 * [`socket_disconnected()`].
21137 * [`socket_disconnected()`]: PeerManager::socket_disconnected
21139 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);
21142 * Indicates a new inbound connection has been established.
21144 * May refuse the connection by returning an Err, but will never write bytes to the remote end
21145 * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
21146 * call socket_disconnected for the new descriptor but must disconnect the connection
21149 * Panics if descriptor is duplicative with some other descriptor which has not yet been
21150 * [`socket_disconnected()`].
21152 * [`socket_disconnected()`]: PeerManager::socket_disconnected
21154 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
21157 * Indicates that there is room to write data to the given socket descriptor.
21159 * May return an Err to indicate that the connection should be closed.
21161 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
21162 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
21163 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
21164 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
21167 * [`send_data`]: SocketDescriptor::send_data
21168 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
21170 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
21173 * Indicates that data was read from the given socket descriptor.
21175 * May return an Err to indicate that the connection should be closed.
21177 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
21178 * Thus, however, you should call [`process_events`] after any `read_event` to generate
21179 * [`send_data`] calls to handle responses.
21181 * If `Ok(true)` is returned, further read_events should not be triggered until a
21182 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
21185 * [`send_data`]: SocketDescriptor::send_data
21186 * [`process_events`]: PeerManager::process_events
21188 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);
21191 * Checks for any events generated by our handlers and processes them. Includes sending most
21192 * response messages as well as messages generated by calls to handler functions directly (eg
21193 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
21195 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
21198 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
21199 * or one of the other clients provided in our language bindings.
21201 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
21202 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
21203 * [`send_data`]: SocketDescriptor::send_data
21205 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
21208 * Indicates that the given socket descriptor's connection is now closed.
21210 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
21213 * Disconnect a peer given its node id.
21215 * Set `no_connection_possible` to true to prevent any further connection with this peer,
21216 * force-closing any channels we have with it.
21218 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
21219 * peer. Thus, be very careful about reentrancy issues.
21221 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
21223 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
21226 * Disconnects all currently-connected peers. This is useful on platforms where there may be
21227 * an indication that TCP sockets have stalled even if we weren't around to time them out
21228 * using regular ping/pongs.
21230 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
21233 * Send pings to each peer and disconnect those which did not respond to the last round of
21236 * This may be called on any timescale you want, however, roughly once every five to ten
21237 * seconds is preferred. The call rate determines both how often we send a ping to our peers
21238 * and how much time they have to respond before we disconnect them.
21240 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
21243 * [`send_data`]: SocketDescriptor::send_data
21245 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
21248 * Gets the weight for an HTLC-Success transaction.
21250 uint64_t htlc_success_tx_weight(bool opt_anchors);
21253 * Gets the weight for an HTLC-Timeout transaction.
21255 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
21258 * Build the commitment secret from the seed and the commitment number
21260 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
21263 * Build a closing transaction
21265 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);
21268 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
21269 * from the base secret and the per_commitment_point.
21271 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
21272 * generated (ie our own).
21274 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
21277 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
21278 * from the base point and the per_commitment_key. This is the public equivalent of
21279 * derive_private_key - using only public keys to derive a public key instead of private keys.
21281 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
21282 * generated (ie our own).
21284 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
21287 * Derives a per-commitment-transaction revocation key from its constituent parts.
21289 * Only the cheating participant owns a valid witness to propagate a revoked
21290 * commitment transaction, thus per_commitment_secret always come from cheater
21291 * and revocation_base_secret always come from punisher, which is the broadcaster
21292 * of the transaction spending with this key knowledge.
21294 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
21295 * generated (ie our own).
21297 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
21300 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
21301 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
21302 * public key instead of private keys.
21304 * Only the cheating participant owns a valid witness to propagate a revoked
21305 * commitment transaction, thus per_commitment_point always come from cheater
21306 * and revocation_base_point always come from punisher, which is the broadcaster
21307 * of the transaction spending with this key knowledge.
21309 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
21310 * generated (ie our own).
21312 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
21315 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
21317 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
21320 * The broadcaster's per-commitment public key which was used to derive the other keys.
21322 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
21325 * The broadcaster's per-commitment public key which was used to derive the other keys.
21327 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21330 * The revocation key which is used to allow the broadcaster of the commitment
21331 * transaction to provide their counterparty the ability to punish them if they broadcast
21334 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
21337 * The revocation key which is used to allow the broadcaster of the commitment
21338 * transaction to provide their counterparty the ability to punish them if they broadcast
21341 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21344 * Broadcaster's HTLC Key
21346 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
21349 * Broadcaster's HTLC Key
21351 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21354 * Countersignatory's HTLC Key
21356 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
21359 * Countersignatory's HTLC Key
21361 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21364 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
21366 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
21369 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
21371 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21374 * Constructs a new TxCreationKeys given each field
21376 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);
21379 * Creates a copy of the TxCreationKeys
21381 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
21384 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
21386 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
21389 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
21391 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
21394 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
21396 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
21399 * The public key which is used to sign all commitment transactions, as it appears in the
21400 * on-chain channel lock-in 2-of-2 multisig output.
21402 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
21405 * The public key which is used to sign all commitment transactions, as it appears in the
21406 * on-chain channel lock-in 2-of-2 multisig output.
21408 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21411 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
21412 * revocation keys. This is combined with the per-commitment-secret generated by the
21413 * counterparty to create a secret which the counterparty can reveal to revoke previous
21416 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
21419 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
21420 * revocation keys. This is combined with the per-commitment-secret generated by the
21421 * counterparty to create a secret which the counterparty can reveal to revoke previous
21424 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21427 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
21428 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
21429 * static across every commitment transaction.
21431 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
21434 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
21435 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
21436 * static across every commitment transaction.
21438 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21441 * The base point which is used (with derive_public_key) to derive a per-commitment payment
21442 * public key which receives non-HTLC-encumbered funds which are only available for spending
21443 * after some delay (or can be claimed via the revocation path).
21445 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
21448 * The base point which is used (with derive_public_key) to derive a per-commitment payment
21449 * public key which receives non-HTLC-encumbered funds which are only available for spending
21450 * after some delay (or can be claimed via the revocation path).
21452 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21455 * The base point which is used (with derive_public_key) to derive a per-commitment public key
21456 * which is used to encumber HTLC-in-flight outputs.
21458 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
21461 * The base point which is used (with derive_public_key) to derive a per-commitment public key
21462 * which is used to encumber HTLC-in-flight outputs.
21464 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21467 * Constructs a new ChannelPublicKeys given each field
21469 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);
21472 * Creates a copy of the ChannelPublicKeys
21474 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
21477 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
21479 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
21482 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
21484 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
21487 * Create per-state keys from channel base points and the per-commitment point.
21488 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
21490 MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ 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);
21493 * Generate per-state keys from channel static keys.
21494 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
21496 MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
21499 * A script either spendable by the revocation
21500 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
21501 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
21503 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
21506 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
21508 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
21511 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
21512 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
21513 * need to compare this value to whether the commitment transaction in question is that of
21514 * the counterparty or our own.
21516 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
21519 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
21520 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
21521 * need to compare this value to whether the commitment transaction in question is that of
21522 * the counterparty or our own.
21524 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
21527 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
21528 * this divided by 1000.
21530 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
21533 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
21534 * this divided by 1000.
21536 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
21539 * The CLTV lock-time at which this HTLC expires.
21541 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
21544 * The CLTV lock-time at which this HTLC expires.
21546 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
21549 * The hash of the preimage which unlocks this HTLC.
21551 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
21554 * The hash of the preimage which unlocks this HTLC.
21556 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21559 * The position within the commitment transactions' outputs. This may be None if the value is
21560 * below the dust limit (in which case no output appears in the commitment transaction and the
21561 * value is spent to additional transaction fees).
21563 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
21566 * The position within the commitment transactions' outputs. This may be None if the value is
21567 * below the dust limit (in which case no output appears in the commitment transaction and the
21568 * value is spent to additional transaction fees).
21570 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
21573 * Constructs a new HTLCOutputInCommitment given each field
21575 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);
21578 * Creates a copy of the HTLCOutputInCommitment
21580 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
21583 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
21585 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
21588 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
21590 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
21593 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
21594 * does not need to have its previous_output_index filled.
21596 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
21599 * Gets the redeemscript for a funding output from the two funding public keys.
21600 * Note that the order of funding public keys does not matter.
21602 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
21605 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
21606 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
21607 * transaction which needs signing, and can be used to construct an HTLC transaction which is
21608 * broadcastable given a counterparty HTLC signature.
21610 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
21611 * commitment transaction).
21613 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, bool opt_anchors, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
21616 * Gets the witnessScript for an anchor output from the funding public key.
21617 * The witness in the spending input must be:
21618 * <BIP 143 funding_signature>
21619 * After 16 blocks of confirmation, an alternative satisfying witness could be:
21621 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
21623 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
21626 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
21628 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
21631 * Holder public keys
21633 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
21636 * Holder public keys
21638 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
21641 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
21643 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
21646 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
21648 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
21651 * Whether the holder is the initiator of this channel.
21652 * This is an input to the commitment number obscure factor computation.
21654 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
21657 * Whether the holder is the initiator of this channel.
21658 * This is an input to the commitment number obscure factor computation.
21660 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
21663 * The late-bound counterparty channel transaction parameters.
21664 * These parameters are populated at the point in the protocol where the counterparty provides them.
21666 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21668 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
21671 * The late-bound counterparty channel transaction parameters.
21672 * These parameters are populated at the point in the protocol where the counterparty provides them.
21674 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21676 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
21679 * The late-bound funding outpoint
21681 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21683 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
21686 * The late-bound funding outpoint
21688 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21690 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
21693 * Are anchors used for this channel. Boolean is serialization backwards-compatible
21695 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
21698 * Are anchors used for this channel. Boolean is serialization backwards-compatible
21700 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
21703 * Constructs a new ChannelTransactionParameters given each field
21705 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, enum LDKCOption_NoneZ opt_anchors_arg);
21708 * Creates a copy of the ChannelTransactionParameters
21710 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
21713 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
21715 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
21718 * Counter-party public keys
21720 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
21723 * Counter-party public keys
21725 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
21728 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
21730 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
21733 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
21735 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
21738 * Constructs a new CounterpartyChannelTransactionParameters given each field
21740 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
21743 * Creates a copy of the CounterpartyChannelTransactionParameters
21745 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
21748 * Whether the late bound parameters are populated.
21750 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
21753 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
21754 * given that the holder is the broadcaster.
21756 * self.is_populated() must be true before calling this function.
21758 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
21761 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
21762 * given that the counterparty is the broadcaster.
21764 * self.is_populated() must be true before calling this function.
21766 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
21769 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
21771 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
21774 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
21776 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
21779 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
21781 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
21784 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
21786 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
21789 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
21791 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
21794 * Get the channel pubkeys for the broadcaster
21796 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
21799 * Get the channel pubkeys for the countersignatory
21801 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
21804 * Get the contest delay applicable to the transactions.
21805 * Note that the contest delay was selected by the countersignatory.
21807 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
21810 * Whether the channel is outbound from the broadcaster.
21812 * The boolean representing the side that initiated the channel is
21813 * an input to the commitment number obscure factor computation.
21815 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
21818 * The funding outpoint
21820 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
21823 * Whether to use anchors for this channel
21825 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
21828 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
21830 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
21833 * Our counterparty's signature for the transaction
21835 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
21838 * Our counterparty's signature for the transaction
21840 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
21843 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
21845 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
21848 * Creates a copy of the HolderCommitmentTransaction
21850 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
21853 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
21855 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
21858 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
21860 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
21863 * Create a new holder transaction with the given counterparty signatures.
21864 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
21866 MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKSignature counterparty_sig, struct LDKCVec_SignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key);
21869 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
21871 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
21874 * The commitment transaction
21876 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
21879 * The commitment transaction
21881 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
21884 * The txid for the commitment transaction.
21886 * This is provided as a performance optimization, instead of calling transaction.txid()
21889 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
21892 * The txid for the commitment transaction.
21894 * This is provided as a performance optimization, instead of calling transaction.txid()
21897 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21900 * Constructs a new BuiltCommitmentTransaction given each field
21902 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
21905 * Creates a copy of the BuiltCommitmentTransaction
21907 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
21910 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
21912 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
21915 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
21917 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
21920 * Get the SIGHASH_ALL sighash value of the transaction.
21922 * This can be used to verify a signature.
21924 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);
21927 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
21928 * because we are about to broadcast a holder transaction.
21930 MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
21933 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
21935 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
21938 * Creates a copy of the ClosingTransaction
21940 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
21943 * Checks if two ClosingTransactions contain equal inner contents.
21945 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
21948 * Construct an object of the class
21950 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);
21953 * Trust our pre-built transaction.
21955 * Applies a wrapper which allows access to the transaction.
21957 * This should only be used if you fully trust the builder of this object. It should not
21958 * be used by an external signer - instead use the verify function.
21960 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
21963 * Verify our pre-built transaction.
21965 * Applies a wrapper which allows access to the transaction.
21967 * An external validating signer must call this method before signing
21968 * or using the built transaction.
21970 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
21973 * The value to be sent to the holder, or zero if the output will be omitted
21975 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
21978 * The value to be sent to the counterparty, or zero if the output will be omitted
21980 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
21983 * The destination of the holder's output
21985 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
21988 * The destination of the counterparty's output
21990 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
21993 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
21995 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
21998 * The pre-built Bitcoin commitment transaction
22000 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
22003 * Get the SIGHASH_ALL sighash value of the transaction.
22005 * This can be used to verify a signature.
22007 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);
22010 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
22011 * because we are about to broadcast a holder transaction.
22013 MUST_USE_RES struct LDKSignature TrustedClosingTransaction_sign(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
22016 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
22018 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
22021 * Creates a copy of the CommitmentTransaction
22023 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
22026 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
22028 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
22031 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
22033 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
22036 * The backwards-counting commitment number
22038 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
22041 * The value to be sent to the broadcaster
22043 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
22046 * The value to be sent to the counterparty
22048 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
22051 * The feerate paid per 1000-weight-unit in this commitment transaction.
22053 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
22056 * Trust our pre-built transaction and derived transaction creation public keys.
22058 * Applies a wrapper which allows access to these fields.
22060 * This should only be used if you fully trust the builder of this object. It should not
22061 * be used by an external signer - instead use the verify function.
22063 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
22066 * Verify our pre-built transaction and derived transaction creation public keys.
22068 * Applies a wrapper which allows access to these fields.
22070 * An external validating signer must call this method before signing
22071 * or using the built transaction.
22073 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);
22076 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
22078 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
22081 * The transaction ID of the built Bitcoin transaction
22083 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
22086 * The pre-built Bitcoin commitment transaction
22088 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
22091 * The pre-calculated transaction creation public keys.
22093 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
22096 * Should anchors be used.
22098 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
22101 * Get a signature for each HTLC which was included in the commitment transaction (ie for
22102 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
22104 * The returned Vec has one entry for each HTLC, and in the same order.
22106 MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ 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);
22109 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
22110 * shared secret first. This prevents on-chain observers from discovering how many commitment
22111 * transactions occurred in a channel before it was closed.
22113 * This function gets the shared secret from relevant channel public keys and can be used to
22114 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
22116 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
22119 * Checks if two InitFeaturess contain equal inner contents.
22120 * This ignores pointers and is_owned flags and looks at the values in fields.
22121 * Two objects with NULL inner values will be considered "equal" here.
22123 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
22126 * Checks if two NodeFeaturess contain equal inner contents.
22127 * This ignores pointers and is_owned flags and looks at the values in fields.
22128 * Two objects with NULL inner values will be considered "equal" here.
22130 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
22133 * Checks if two ChannelFeaturess contain equal inner contents.
22134 * This ignores pointers and is_owned flags and looks at the values in fields.
22135 * Two objects with NULL inner values will be considered "equal" here.
22137 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
22140 * Checks if two InvoiceFeaturess contain equal inner contents.
22141 * This ignores pointers and is_owned flags and looks at the values in fields.
22142 * Two objects with NULL inner values will be considered "equal" here.
22144 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
22147 * Checks if two ChannelTypeFeaturess contain equal inner contents.
22148 * This ignores pointers and is_owned flags and looks at the values in fields.
22149 * Two objects with NULL inner values will be considered "equal" here.
22151 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
22154 * Creates a copy of the InitFeatures
22156 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
22159 * Creates a copy of the NodeFeatures
22161 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
22164 * Creates a copy of the ChannelFeatures
22166 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
22169 * Creates a copy of the InvoiceFeatures
22171 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
22174 * Creates a copy of the ChannelTypeFeatures
22176 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
22179 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
22181 void InitFeatures_free(struct LDKInitFeatures this_obj);
22184 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
22186 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
22189 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
22191 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
22194 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
22196 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
22199 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
22201 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
22204 * Create a blank Features with no features set
22206 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
22209 * Creates a Features with the bits set which are known by the implementation
22211 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
22214 * Returns true if this `Features` object contains unknown feature flags which are set as
22217 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
22220 * Create a blank Features with no features set
22222 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
22225 * Creates a Features with the bits set which are known by the implementation
22227 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
22230 * Returns true if this `Features` object contains unknown feature flags which are set as
22233 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
22236 * Create a blank Features with no features set
22238 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
22241 * Creates a Features with the bits set which are known by the implementation
22243 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
22246 * Returns true if this `Features` object contains unknown feature flags which are set as
22249 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
22252 * Create a blank Features with no features set
22254 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
22257 * Creates a Features with the bits set which are known by the implementation
22259 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
22262 * Returns true if this `Features` object contains unknown feature flags which are set as
22265 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
22268 * Create a blank Features with no features set
22270 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
22273 * Creates a Features with the bits set which are known by the implementation
22275 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
22278 * Returns true if this `Features` object contains unknown feature flags which are set as
22281 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
22284 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
22286 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
22289 * Read a InitFeatures from a byte array, created by InitFeatures_write
22291 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
22294 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
22296 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
22299 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
22301 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
22304 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
22306 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
22309 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
22311 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
22314 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
22316 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
22319 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
22321 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
22324 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
22326 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
22329 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
22331 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
22334 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
22336 void ShutdownScript_free(struct LDKShutdownScript this_obj);
22339 * Creates a copy of the ShutdownScript
22341 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
22344 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
22346 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
22349 * The script that did not meet the requirements from [BOLT #2].
22351 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
22353 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
22356 * The script that did not meet the requirements from [BOLT #2].
22358 * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
22360 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
22363 * Constructs a new InvalidShutdownScript given each field
22365 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
22368 * Creates a copy of the InvalidShutdownScript
22370 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
22373 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
22375 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
22378 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
22380 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
22383 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
22385 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
22388 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
22390 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
22393 * Generates a witness script pubkey from the given segwit version and program.
22395 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
22396 * [`ShutdownScript::new_p2wsh`] instead.
22400 * This function may return an error if `program` is invalid for the segwit `version`.
22402 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(uint8_t version, struct LDKu8slice program);
22405 * Converts the shutdown script into the underlying [`Script`].
22407 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
22410 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
22412 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22414 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
22417 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
22419 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
22421 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
22424 * Calls the free function if one is set
22426 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
22429 * Calls the free function if one is set
22431 void Type_free(struct LDKType this_ptr);
22434 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
22436 void NodeId_free(struct LDKNodeId this_obj);
22439 * Creates a copy of the NodeId
22441 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
22444 * Create a new NodeId from a public key
22446 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
22449 * Get the public key slice from this NodeId
22451 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
22454 * Checks if two NodeIds contain equal inner contents.
22456 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
22459 * Serialize the NodeId object into a byte array which can be read by NodeId_read
22461 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
22464 * Read a NodeId from a byte array, created by NodeId_write
22466 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
22469 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
22471 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
22474 * Creates a copy of the NetworkGraph
22476 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
22479 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
22481 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
22484 * Frees any resources used by the NetworkUpdate
22486 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
22489 * Creates a copy of the NetworkUpdate
22491 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
22494 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
22496 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
22499 * Utility method to constructs a new ChannelClosed-variant NetworkUpdate
22501 struct LDKNetworkUpdate NetworkUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent);
22504 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
22506 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
22509 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
22511 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
22514 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
22516 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
22519 * Constructs a new EventHandler which calls the relevant methods on this_arg.
22520 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
22522 struct LDKEventHandler NetGraphMsgHandler_as_EventHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
22525 * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
22527 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
22530 * Creates a new tracker of the actual state of the network of channels and nodes,
22531 * assuming an existing Network Graph.
22532 * Chain monitor is used to make sure announced channels exist on-chain,
22533 * channel data is correct, and that the announcement is signed with
22534 * channel owners' keys.
22536 MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
22539 * Adds a provider used to check new announcements. Does not affect
22540 * existing announcements unless they are updated.
22541 * Add, update or remove the provider would replace the current one.
22543 void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
22546 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
22547 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
22549 struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
22552 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
22553 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
22555 struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
22558 * Frees any resources used by the DirectionalChannelInfo, if is_owned is set and inner is non-NULL.
22560 void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj);
22563 * When the last update to the channel direction was issued.
22564 * Value is opaque, as set in the announcement.
22566 uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
22569 * When the last update to the channel direction was issued.
22570 * Value is opaque, as set in the announcement.
22572 void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val);
22575 * Whether the channel can be currently used for payments (in this one direction).
22577 bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
22580 * Whether the channel can be currently used for payments (in this one direction).
22582 void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val);
22585 * The difference in CLTV values that you must have when routing through this channel.
22587 uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
22590 * The difference in CLTV values that you must have when routing through this channel.
22592 void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val);
22595 * The minimum value, which must be relayed to the next hop via the channel
22597 uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
22600 * The minimum value, which must be relayed to the next hop via the channel
22602 void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val);
22605 * The maximum value which may be relayed to the next hop via the channel.
22607 struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
22610 * The maximum value which may be relayed to the next hop via the channel.
22612 void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22615 * Fees charged when the channel is used for routing
22617 struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
22620 * Fees charged when the channel is used for routing
22622 void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
22625 * Most recent update for the channel received from the network
22626 * Mostly redundant with the data we store in fields explicitly.
22627 * Everything else is useful only for sending out for initial routing sync.
22628 * Not stored if contains excess data to prevent DoS.
22630 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22632 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
22635 * Most recent update for the channel received from the network
22636 * Mostly redundant with the data we store in fields explicitly.
22637 * Everything else is useful only for sending out for initial routing sync.
22638 * Not stored if contains excess data to prevent DoS.
22640 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22642 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
22645 * Constructs a new DirectionalChannelInfo given each field
22647 MUST_USE_RES struct LDKDirectionalChannelInfo DirectionalChannelInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg);
22650 * Creates a copy of the DirectionalChannelInfo
22652 struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig);
22655 * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read
22657 struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj);
22660 * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write
22662 struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser);
22665 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
22667 void ChannelInfo_free(struct LDKChannelInfo this_obj);
22670 * Protocol features of a channel communicated during its announcement
22672 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
22675 * Protocol features of a channel communicated during its announcement
22677 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
22680 * Source node of the first direction of a channel
22682 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
22685 * Source node of the first direction of a channel
22687 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
22690 * Details about the first direction of a channel
22692 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22694 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
22697 * Details about the first direction of a channel
22699 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22701 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
22704 * Source node of the second direction of a channel
22706 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
22709 * Source node of the second direction of a channel
22711 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
22714 * Details about the second direction of a channel
22716 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22718 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
22721 * Details about the second direction of a channel
22723 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22725 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
22728 * The channel capacity as seen on-chain, if chain lookup is available.
22730 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
22733 * The channel capacity as seen on-chain, if chain lookup is available.
22735 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22738 * An initial announcement of the channel
22739 * Mostly redundant with the data we store in fields explicitly.
22740 * Everything else is useful only for sending out for initial routing sync.
22741 * Not stored if contains excess data to prevent DoS.
22743 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22745 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
22748 * An initial announcement of the channel
22749 * Mostly redundant with the data we store in fields explicitly.
22750 * Everything else is useful only for sending out for initial routing sync.
22751 * Not stored if contains excess data to prevent DoS.
22753 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22755 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
22758 * Creates a copy of the ChannelInfo
22760 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
22763 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
22765 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
22768 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
22770 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
22773 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
22775 void RoutingFees_free(struct LDKRoutingFees this_obj);
22778 * Flat routing fee in satoshis
22780 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
22783 * Flat routing fee in satoshis
22785 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
22788 * Liquidity-based routing fee in millionths of a routed amount.
22789 * In other words, 10000 is 1%.
22791 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
22794 * Liquidity-based routing fee in millionths of a routed amount.
22795 * In other words, 10000 is 1%.
22797 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
22800 * Constructs a new RoutingFees given each field
22802 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
22805 * Checks if two RoutingFeess contain equal inner contents.
22806 * This ignores pointers and is_owned flags and looks at the values in fields.
22807 * Two objects with NULL inner values will be considered "equal" here.
22809 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
22812 * Creates a copy of the RoutingFees
22814 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
22817 * Checks if two RoutingFeess contain equal inner contents.
22819 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
22822 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
22824 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
22827 * Read a RoutingFees from a byte array, created by RoutingFees_write
22829 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
22832 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
22834 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
22837 * Protocol features the node announced support for
22839 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
22842 * Protocol features the node announced support for
22844 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
22847 * When the last known update to the node state was issued.
22848 * Value is opaque, as set in the announcement.
22850 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
22853 * When the last known update to the node state was issued.
22854 * Value is opaque, as set in the announcement.
22856 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
22859 * Color assigned to the node
22861 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
22864 * Color assigned to the node
22866 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
22869 * Moniker assigned to the node.
22870 * May be invalid or malicious (eg control chars),
22871 * should not be exposed to the user.
22873 const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32];
22876 * Moniker assigned to the node.
22877 * May be invalid or malicious (eg control chars),
22878 * should not be exposed to the user.
22880 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22883 * Internet-level addresses via which one can connect to the node
22885 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
22888 * An initial announcement of the node
22889 * Mostly redundant with the data we store in fields explicitly.
22890 * Everything else is useful only for sending out for initial routing sync.
22891 * Not stored if contains excess data to prevent DoS.
22893 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22895 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
22898 * An initial announcement of the node
22899 * Mostly redundant with the data we store in fields explicitly.
22900 * Everything else is useful only for sending out for initial routing sync.
22901 * Not stored if contains excess data to prevent DoS.
22903 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22905 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
22908 * Constructs a new NodeAnnouncementInfo given each field
22910 MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKThirtyTwoBytes alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg);
22913 * Creates a copy of the NodeAnnouncementInfo
22915 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
22918 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
22920 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
22923 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
22925 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
22928 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
22930 void NodeInfo_free(struct LDKNodeInfo this_obj);
22933 * All valid channels a node has announced
22935 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
22938 * Lowest fees enabling routing via any of the enabled, known channels to a node.
22939 * The two fields (flat and proportional fee) are independent,
22940 * meaning they don't have to refer to the same channel.
22942 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22944 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
22947 * Lowest fees enabling routing via any of the enabled, known channels to a node.
22948 * The two fields (flat and proportional fee) are independent,
22949 * meaning they don't have to refer to the same channel.
22951 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22953 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
22956 * More information about a node from node_announcement.
22957 * Optional because we store a Node entry after learning about it from
22958 * a channel announcement, but before receiving a node announcement.
22960 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22962 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
22965 * More information about a node from node_announcement.
22966 * Optional because we store a Node entry after learning about it from
22967 * a channel announcement, but before receiving a node announcement.
22969 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22971 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
22974 * Constructs a new NodeInfo given each field
22976 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
22979 * Creates a copy of the NodeInfo
22981 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
22984 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
22986 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
22989 * Read a NodeInfo from a byte array, created by NodeInfo_write
22991 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
22994 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
22996 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
22999 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
23001 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser);
23004 * Creates a new, empty, network graph.
23006 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
23009 * Returns a read-only view of the network graph.
23011 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
23014 * For an already known node (from channel announcements), update its stored properties from a
23015 * given node announcement.
23017 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
23018 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
23019 * routing messages from a source using a protocol other than the lightning P2P protocol.
23021 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
23024 * For an already known node (from channel announcements), update its stored properties from a
23025 * given node announcement without verifying the associated signatures. Because we aren't
23026 * given the associated signatures here we cannot relay the node announcement to any of our
23029 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);
23032 * Store or update channel info from a channel announcement.
23034 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
23035 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
23036 * routing messages from a source using a protocol other than the lightning P2P protocol.
23038 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
23039 * the corresponding UTXO exists on chain and is correctly-formatted.
23041 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_AccessZ chain_access);
23044 * Store or update channel info from a channel announcement without verifying the associated
23045 * signatures. Because we aren't given the associated signatures here we cannot relay the
23046 * channel announcement to any of our peers.
23048 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
23049 * the corresponding UTXO exists on chain and is correctly-formatted.
23051 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_AccessZ chain_access);
23054 * Close a channel if a corresponding HTLC fail was sent.
23055 * If permanent, removes a channel from the local storage.
23056 * May cause the removal of nodes too, if this was their last channel.
23057 * If not permanent, makes channels unavailable for routing.
23059 void NetworkGraph_close_channel_from_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
23062 * Marks a node in the graph as failed.
23064 void NetworkGraph_fail_node(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
23067 * Removes information about channels that we haven't heard any updates about in some time.
23068 * This can be used regularly to prune the network graph of channels that likely no longer
23071 * While there is no formal requirement that nodes regularly re-broadcast their channel
23072 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
23073 * pruning occur for updates which are at least two weeks old, which we implement here.
23075 * This function takes the current unix time as an argument. For users with the `std` feature
23076 * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable.
23078 void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
23081 * For an already known (from announcement) channel, update info about one of the directions
23084 * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
23085 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
23086 * routing messages from a source using a protocol other than the lightning P2P protocol.
23088 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
23089 * materially in the future will be rejected.
23091 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
23094 * For an already known (from announcement) channel, update info about one of the directions
23095 * of the channel without verifying the associated signatures. Because we aren't given the
23096 * associated signatures here we cannot relay the channel update to any of our peers.
23098 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
23099 * materially in the future will be rejected.
23101 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
23104 * Get network addresses by node id.
23105 * Returns None if the requested node is completely unknown,
23106 * or if node announcement for the node was never received.
23108 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
23111 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
23113 void RouteHop_free(struct LDKRouteHop this_obj);
23116 * The node_id of the node at this hop.
23118 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
23121 * The node_id of the node at this hop.
23123 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23126 * The node_announcement features of the node at this hop. For the last hop, these may be
23127 * amended to match the features present in the invoice this node generated.
23129 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
23132 * The node_announcement features of the node at this hop. For the last hop, these may be
23133 * amended to match the features present in the invoice this node generated.
23135 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
23138 * The channel that should be used from the previous hop to reach this node.
23140 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
23143 * The channel that should be used from the previous hop to reach this node.
23145 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
23148 * The channel_announcement features of the channel that should be used from the previous hop
23149 * to reach this node.
23151 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
23154 * The channel_announcement features of the channel that should be used from the previous hop
23155 * to reach this node.
23157 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
23160 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
23161 * For the last hop, this should be the full value of the payment (might be more than
23162 * requested if we had to match htlc_minimum_msat).
23164 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
23167 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
23168 * For the last hop, this should be the full value of the payment (might be more than
23169 * requested if we had to match htlc_minimum_msat).
23171 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
23174 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
23175 * expected at the destination, in excess of the current block height.
23177 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
23180 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
23181 * expected at the destination, in excess of the current block height.
23183 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
23186 * Constructs a new RouteHop given each field
23188 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);
23191 * Creates a copy of the RouteHop
23193 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
23196 * Checks if two RouteHops contain equal inner contents.
23198 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
23201 * Checks if two RouteHops contain equal inner contents.
23202 * This ignores pointers and is_owned flags and looks at the values in fields.
23203 * Two objects with NULL inner values will be considered "equal" here.
23205 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
23208 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
23210 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
23213 * Read a RouteHop from a byte array, created by RouteHop_write
23215 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
23218 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
23220 void Route_free(struct LDKRoute this_obj);
23223 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
23224 * last RouteHop in each path must be the same.
23225 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
23226 * destination. Thus, this must always be at least length one. While the maximum length of any
23227 * given path is variable, keeping the length of any path to less than 20 should currently
23228 * ensure it is viable.
23230 struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
23233 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
23234 * last RouteHop in each path must be the same.
23235 * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
23236 * destination. Thus, this must always be at least length one. While the maximum length of any
23237 * given path is variable, keeping the length of any path to less than 20 should currently
23238 * ensure it is viable.
23240 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
23243 * The `payee` parameter passed to [`find_route`].
23244 * This is used by `ChannelManager` to track information which may be required for retries,
23245 * provided back to you via [`Event::PaymentPathFailed`].
23247 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
23249 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23251 struct LDKPayee Route_get_payee(const struct LDKRoute *NONNULL_PTR this_ptr);
23254 * The `payee` parameter passed to [`find_route`].
23255 * This is used by `ChannelManager` to track information which may be required for retries,
23256 * provided back to you via [`Event::PaymentPathFailed`].
23258 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
23260 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23262 void Route_set_payee(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPayee val);
23265 * Constructs a new Route given each field
23267 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPayee payee_arg);
23270 * Creates a copy of the Route
23272 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
23275 * Checks if two Routes contain equal inner contents.
23277 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
23280 * Checks if two Routes contain equal inner contents.
23281 * This ignores pointers and is_owned flags and looks at the values in fields.
23282 * Two objects with NULL inner values will be considered "equal" here.
23284 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
23287 * Returns the total amount of fees paid on this [`Route`].
23289 * This doesn't include any extra payment made to the recipient, which can happen in excess of
23290 * the amount passed to [`find_route`]'s `params.final_value_msat`.
23292 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
23295 * Returns the total amount paid on this [`Route`], excluding the fees.
23297 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
23300 * Serialize the Route object into a byte array which can be read by Route_read
23302 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
23305 * Read a Route from a byte array, created by Route_write
23307 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
23310 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
23312 void RouteParameters_free(struct LDKRouteParameters this_obj);
23315 * The recipient of the failed payment path.
23317 struct LDKPayee RouteParameters_get_payee(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
23320 * The recipient of the failed payment path.
23322 void RouteParameters_set_payee(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
23325 * The amount in msats sent on the failed payment path.
23327 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
23330 * The amount in msats sent on the failed payment path.
23332 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
23335 * The CLTV on the final hop of the failed payment path.
23337 uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
23340 * The CLTV on the final hop of the failed payment path.
23342 void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
23345 * Constructs a new RouteParameters given each field
23347 MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPayee payee_arg, uint64_t final_value_msat_arg, uint32_t final_cltv_expiry_delta_arg);
23350 * Creates a copy of the RouteParameters
23352 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
23355 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
23357 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
23360 * Read a RouteParameters from a byte array, created by RouteParameters_write
23362 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
23365 * Frees any resources used by the Payee, if is_owned is set and inner is non-NULL.
23367 void Payee_free(struct LDKPayee this_obj);
23370 * The node id of the payee.
23372 struct LDKPublicKey Payee_get_pubkey(const struct LDKPayee *NONNULL_PTR this_ptr);
23375 * The node id of the payee.
23377 void Payee_set_pubkey(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23380 * Features supported by the payee.
23382 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
23383 * does not contain any features.
23385 * [`for_keysend`]: Self::for_keysend
23387 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23389 struct LDKInvoiceFeatures Payee_get_features(const struct LDKPayee *NONNULL_PTR this_ptr);
23392 * Features supported by the payee.
23394 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
23395 * does not contain any features.
23397 * [`for_keysend`]: Self::for_keysend
23399 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23401 void Payee_set_features(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
23404 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
23406 struct LDKCVec_RouteHintZ Payee_get_route_hints(const struct LDKPayee *NONNULL_PTR this_ptr);
23409 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
23411 void Payee_set_route_hints(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
23414 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
23416 struct LDKCOption_u64Z Payee_get_expiry_time(const struct LDKPayee *NONNULL_PTR this_ptr);
23419 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
23421 void Payee_set_expiry_time(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23424 * Constructs a new Payee given each field
23426 MUST_USE_RES struct LDKPayee Payee_new(struct LDKPublicKey pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKCVec_RouteHintZ route_hints_arg, struct LDKCOption_u64Z expiry_time_arg);
23429 * Creates a copy of the Payee
23431 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
23434 * Checks if two Payees contain equal inner contents.
23436 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
23439 * Checks if two Payees contain equal inner contents.
23440 * This ignores pointers and is_owned flags and looks at the values in fields.
23441 * Two objects with NULL inner values will be considered "equal" here.
23443 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
23446 * Serialize the Payee object into a byte array which can be read by Payee_read
23448 struct LDKCVec_u8Z Payee_write(const struct LDKPayee *NONNULL_PTR obj);
23451 * Read a Payee from a byte array, created by Payee_write
23453 struct LDKCResult_PayeeDecodeErrorZ Payee_read(struct LDKu8slice ser);
23456 * Creates a payee with the node id of the given `pubkey`.
23458 MUST_USE_RES struct LDKPayee Payee_from_node_id(struct LDKPublicKey pubkey);
23461 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
23463 MUST_USE_RES struct LDKPayee Payee_for_keysend(struct LDKPublicKey pubkey);
23466 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
23468 void RouteHint_free(struct LDKRouteHint this_obj);
23470 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
23472 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
23475 * Constructs a new RouteHint given each field
23477 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
23480 * Creates a copy of the RouteHint
23482 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
23485 * Checks if two RouteHints contain equal inner contents.
23487 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
23490 * Checks if two RouteHints contain equal inner contents.
23491 * This ignores pointers and is_owned flags and looks at the values in fields.
23492 * Two objects with NULL inner values will be considered "equal" here.
23494 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
23497 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
23499 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
23502 * Read a RouteHint from a byte array, created by RouteHint_write
23504 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
23507 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
23509 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
23512 * The node_id of the non-target end of the route
23514 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
23517 * The node_id of the non-target end of the route
23519 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23522 * The short_channel_id of this channel
23524 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
23527 * The short_channel_id of this channel
23529 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
23532 * The fees which must be paid to use this channel
23534 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
23537 * The fees which must be paid to use this channel
23539 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
23542 * The difference in CLTV values between this node and the next node.
23544 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
23547 * The difference in CLTV values between this node and the next node.
23549 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
23552 * The minimum value, in msat, which must be relayed to the next hop.
23554 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
23557 * The minimum value, in msat, which must be relayed to the next hop.
23559 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23562 * The maximum value in msat available for routing with a single HTLC.
23564 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
23567 * The maximum value in msat available for routing with a single HTLC.
23569 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23572 * Constructs a new RouteHintHop given each field
23574 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);
23577 * Creates a copy of the RouteHintHop
23579 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
23582 * Checks if two RouteHintHops contain equal inner contents.
23584 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
23587 * Checks if two RouteHintHops contain equal inner contents.
23588 * This ignores pointers and is_owned flags and looks at the values in fields.
23589 * Two objects with NULL inner values will be considered "equal" here.
23591 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
23594 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
23596 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
23599 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
23601 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
23604 * Finds a route from us (payer) to the given target node (payee).
23606 * If the payee provided features in their invoice, they should be provided via `params.payee`.
23607 * Without this, MPP will only be used if the payee's features are available in the network graph.
23609 * Private routing paths between a public node and the target may be included in `params.payee`.
23611 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
23612 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of our local
23613 * channels from [`NetworkGraph`] will be ignored, and only those in `first_hops` will be used.
23615 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
23616 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
23617 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
23621 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
23622 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
23627 * Panics if first_hops contains channels without short_channel_ids;
23628 * [`ChannelManager::list_usable_channels`] will never include such channels.
23630 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
23631 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
23633 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
23635 struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR params, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer);
23638 * Calls the free function if one is set
23640 void Score_free(struct LDKScore this_ptr);
23643 * Calls the free function if one is set
23645 void LockableScore_free(struct LDKLockableScore this_ptr);
23648 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
23650 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
23653 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
23655 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
23658 * Frees any resources used by the Scorer, if is_owned is set and inner is non-NULL.
23660 void Scorer_free(struct LDKScorer this_obj);
23663 * Frees any resources used by the ScoringParameters, if is_owned is set and inner is non-NULL.
23665 void ScoringParameters_free(struct LDKScoringParameters this_obj);
23668 * A fixed penalty in msats to apply to each channel.
23670 * Default value: 500 msat
23672 uint64_t ScoringParameters_get_base_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
23675 * A fixed penalty in msats to apply to each channel.
23677 * Default value: 500 msat
23679 void ScoringParameters_set_base_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
23682 * A penalty in msats to apply to a channel upon failing to relay a payment.
23684 * This accumulates for each failure but may be reduced over time based on
23685 * [`failure_penalty_half_life`] or when successfully routing through a channel.
23687 * Default value: 1,024,000 msat
23689 * [`failure_penalty_half_life`]: Self::failure_penalty_half_life
23691 uint64_t ScoringParameters_get_failure_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
23694 * A penalty in msats to apply to a channel upon failing to relay a payment.
23696 * This accumulates for each failure but may be reduced over time based on
23697 * [`failure_penalty_half_life`] or when successfully routing through a channel.
23699 * Default value: 1,024,000 msat
23701 * [`failure_penalty_half_life`]: Self::failure_penalty_half_life
23703 void ScoringParameters_set_failure_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
23706 * When the amount being sent over a channel is this many 1024ths of the total channel
23707 * capacity, we begin applying [`overuse_penalty_msat_per_1024th`].
23709 * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
23711 * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th
23713 uint16_t ScoringParameters_get_overuse_penalty_start_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
23716 * When the amount being sent over a channel is this many 1024ths of the total channel
23717 * capacity, we begin applying [`overuse_penalty_msat_per_1024th`].
23719 * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel)
23721 * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th
23723 void ScoringParameters_set_overuse_penalty_start_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint16_t val);
23726 * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
23727 * over the channel exceeds [`overuse_penalty_start_1024th`] by.
23729 * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty
23730 * to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
23732 * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th
23734 uint64_t ScoringParameters_get_overuse_penalty_msat_per_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
23737 * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent
23738 * over the channel exceeds [`overuse_penalty_start_1024th`] by.
23740 * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty
23741 * to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel)
23743 * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th
23745 void ScoringParameters_set_overuse_penalty_msat_per_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
23748 * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
23751 * Successfully routing through a channel will immediately cut the penalty in half as well.
23755 * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will
23758 * [`failure_penalty_msat`]: Self::failure_penalty_msat
23760 uint64_t ScoringParameters_get_failure_penalty_half_life(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
23763 * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are
23766 * Successfully routing through a channel will immediately cut the penalty in half as well.
23770 * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will
23773 * [`failure_penalty_msat`]: Self::failure_penalty_msat
23775 void ScoringParameters_set_failure_penalty_half_life(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
23778 * Constructs a new ScoringParameters given each field
23780 MUST_USE_RES struct LDKScoringParameters ScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t failure_penalty_msat_arg, uint16_t overuse_penalty_start_1024th_arg, uint64_t overuse_penalty_msat_per_1024th_arg, uint64_t failure_penalty_half_life_arg);
23783 * Serialize the ScoringParameters object into a byte array which can be read by ScoringParameters_read
23785 struct LDKCVec_u8Z ScoringParameters_write(const struct LDKScoringParameters *NONNULL_PTR obj);
23788 * Read a ScoringParameters from a byte array, created by ScoringParameters_write
23790 struct LDKCResult_ScoringParametersDecodeErrorZ ScoringParameters_read(struct LDKu8slice ser);
23793 * Creates a new scorer using the given scoring parameters.
23795 MUST_USE_RES struct LDKScorer Scorer_new(struct LDKScoringParameters params);
23798 * Creates a "default" Scorer. See struct and individual field documentaiton for details on which values are used.
23800 MUST_USE_RES struct LDKScorer Scorer_default(void);
23803 * Creates a "default" ScoringParameters. See struct and individual field documentaiton for details on which values are used.
23805 MUST_USE_RES struct LDKScoringParameters ScoringParameters_default(void);
23808 * Constructs a new Score which calls the relevant methods on this_arg.
23809 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
23811 struct LDKScore Scorer_as_Score(const struct LDKScorer *NONNULL_PTR this_arg);
23814 * Serialize the Scorer object into a byte array which can be read by Scorer_read
23816 struct LDKCVec_u8Z Scorer_write(const struct LDKScorer *NONNULL_PTR obj);
23819 * Read a Scorer from a byte array, created by Scorer_write
23821 struct LDKCResult_ScorerDecodeErrorZ Scorer_read(struct LDKu8slice ser);
23824 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
23826 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
23829 * Initialize a new FilesystemPersister and set the path to the individual channels'
23832 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
23835 * Get the directory which was provided when this persister was initialized.
23837 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
23840 * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
23841 * initialization, within a file called \"manager\".
23843 MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
23846 * Read `ChannelMonitor`s from disk.
23848 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
23851 * Constructs a new Persist which calls the relevant methods on this_arg.
23852 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
23854 struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
23857 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
23859 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
23862 * Calls the free function if one is set
23864 void ChannelManagerPersister_free(struct LDKChannelManagerPersister this_ptr);
23867 * Start a background thread that takes care of responsibilities enumerated in the [top-level
23870 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
23871 * `persist_manager` returns an error. In case of an error, the error is retrieved by calling
23872 * either [`join`] or [`stop`].
23874 * # Data Persistence
23876 * `persist_manager` is responsible for writing out the [`ChannelManager`] to disk, and/or
23877 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
23878 * [`ChannelManager`]. See [`FilesystemPersister::persist_manager`] for Rust-Lightning's
23879 * provided implementation.
23881 * Typically, users should either implement [`ChannelManagerPersister`] to never return an
23882 * error or call [`join`] and handle any error that may arise. For the latter case,
23883 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
23887 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
23888 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
23889 * functionality implemented by other handlers.
23890 * * [`NetGraphMsgHandler`] if given will update the [`NetworkGraph`] based on payment failures.
23892 * [top-level documentation]: BackgroundProcessor
23893 * [`join`]: Self::join
23894 * [`stop`]: Self::stop
23895 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
23896 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
23897 * [`FilesystemPersister::persist_manager`]: lightning_persister::FilesystemPersister::persist_manager
23898 * [`NetworkGraph`]: lightning::routing::network_graph::NetworkGraph
23900 * Note that net_graph_msg_handler (or a relevant inner pointer) may be NULL or all-0s to represent None
23902 MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKChannelManagerPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKNetGraphMsgHandler net_graph_msg_handler, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger);
23905 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
23906 * [`ChannelManager`].
23910 * This function panics if the background thread has panicked such as while persisting or
23913 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
23915 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
23918 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
23919 * [`ChannelManager`].
23923 * This function panics if the background thread has panicked such as while persisting or
23926 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
23928 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
23931 * **Call this function on startup to ensure that all assumptions about the platform are valid.**
23933 * Unfortunately we have to make assumptions about the upper bounds of the `SystemTime` type on
23934 * your platform which we can't fully verify at compile time and which isn't part of it's contract.
23935 * To our best knowledge our assumptions hold for all platforms officially supported by rust, but
23936 * since this check is fast we recommend to do it anyway.
23938 * If this function fails this is considered a bug. Please open an issue describing your
23939 * platform and stating your current system time.
23942 * If the check fails this function panics. By calling this function on startup you ensure that
23943 * this wont happen at an arbitrary later point in time.
23945 void check_platform(void);
23948 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
23950 void Invoice_free(struct LDKInvoice this_obj);
23953 * Checks if two Invoices contain equal inner contents.
23954 * This ignores pointers and is_owned flags and looks at the values in fields.
23955 * Two objects with NULL inner values will be considered "equal" here.
23957 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
23960 * Creates a copy of the Invoice
23962 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
23965 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
23967 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
23970 * Checks if two SignedRawInvoices contain equal inner contents.
23971 * This ignores pointers and is_owned flags and looks at the values in fields.
23972 * Two objects with NULL inner values will be considered "equal" here.
23974 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
23977 * Creates a copy of the SignedRawInvoice
23979 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
23982 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
23984 void RawInvoice_free(struct LDKRawInvoice this_obj);
23989 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
23994 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
23997 * Checks if two RawInvoices contain equal inner contents.
23998 * This ignores pointers and is_owned flags and looks at the values in fields.
23999 * Two objects with NULL inner values will be considered "equal" here.
24001 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
24004 * Creates a copy of the RawInvoice
24006 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
24009 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
24011 void RawDataPart_free(struct LDKRawDataPart this_obj);
24014 * generation time of the invoice
24016 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
24019 * generation time of the invoice
24021 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
24024 * Checks if two RawDataParts contain equal inner contents.
24025 * This ignores pointers and is_owned flags and looks at the values in fields.
24026 * Two objects with NULL inner values will be considered "equal" here.
24028 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
24031 * Creates a copy of the RawDataPart
24033 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
24036 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
24038 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
24041 * Checks if two PositiveTimestamps contain equal inner contents.
24042 * This ignores pointers and is_owned flags and looks at the values in fields.
24043 * Two objects with NULL inner values will be considered "equal" here.
24045 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
24048 * Creates a copy of the PositiveTimestamp
24050 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
24053 * Creates a copy of the SiPrefix
24055 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
24058 * Utility method to constructs a new Milli-variant SiPrefix
24060 enum LDKSiPrefix SiPrefix_milli(void);
24063 * Utility method to constructs a new Micro-variant SiPrefix
24065 enum LDKSiPrefix SiPrefix_micro(void);
24068 * Utility method to constructs a new Nano-variant SiPrefix
24070 enum LDKSiPrefix SiPrefix_nano(void);
24073 * Utility method to constructs a new Pico-variant SiPrefix
24075 enum LDKSiPrefix SiPrefix_pico(void);
24078 * Checks if two SiPrefixs contain equal inner contents.
24079 * This ignores pointers and is_owned flags and looks at the values in fields.
24081 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
24084 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
24085 * This is effectively 10^12 * the prefix multiplier
24087 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
24090 * Creates a copy of the Currency
24092 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
24095 * Utility method to constructs a new Bitcoin-variant Currency
24097 enum LDKCurrency Currency_bitcoin(void);
24100 * Utility method to constructs a new BitcoinTestnet-variant Currency
24102 enum LDKCurrency Currency_bitcoin_testnet(void);
24105 * Utility method to constructs a new Regtest-variant Currency
24107 enum LDKCurrency Currency_regtest(void);
24110 * Utility method to constructs a new Simnet-variant Currency
24112 enum LDKCurrency Currency_simnet(void);
24115 * Utility method to constructs a new Signet-variant Currency
24117 enum LDKCurrency Currency_signet(void);
24120 * Checks if two Currencys contain equal inner contents.
24122 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
24125 * Checks if two Currencys contain equal inner contents.
24126 * This ignores pointers and is_owned flags and looks at the values in fields.
24128 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
24131 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
24133 void Sha256_free(struct LDKSha256 this_obj);
24136 * Creates a copy of the Sha256
24138 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
24141 * Checks if two Sha256s contain equal inner contents.
24143 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
24146 * Checks if two Sha256s contain equal inner contents.
24147 * This ignores pointers and is_owned flags and looks at the values in fields.
24148 * Two objects with NULL inner values will be considered "equal" here.
24150 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
24153 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
24155 void Description_free(struct LDKDescription this_obj);
24158 * Creates a copy of the Description
24160 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
24163 * Checks if two Descriptions contain equal inner contents.
24165 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
24168 * Checks if two Descriptions contain equal inner contents.
24169 * This ignores pointers and is_owned flags and looks at the values in fields.
24170 * Two objects with NULL inner values will be considered "equal" here.
24172 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
24175 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
24177 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
24179 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
24181 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24184 * Constructs a new PayeePubKey given each field
24186 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
24189 * Creates a copy of the PayeePubKey
24191 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
24194 * Checks if two PayeePubKeys contain equal inner contents.
24196 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
24199 * Checks if two PayeePubKeys contain equal inner contents.
24200 * This ignores pointers and is_owned flags and looks at the values in fields.
24201 * Two objects with NULL inner values will be considered "equal" here.
24203 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
24206 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
24208 void ExpiryTime_free(struct LDKExpiryTime this_obj);
24211 * Creates a copy of the ExpiryTime
24213 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
24216 * Checks if two ExpiryTimes contain equal inner contents.
24218 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
24221 * Checks if two ExpiryTimes contain equal inner contents.
24222 * This ignores pointers and is_owned flags and looks at the values in fields.
24223 * Two objects with NULL inner values will be considered "equal" here.
24225 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
24228 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
24230 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
24232 uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
24234 void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
24237 * Constructs a new MinFinalCltvExpiry given each field
24239 MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
24242 * Creates a copy of the MinFinalCltvExpiry
24244 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
24247 * Checks if two MinFinalCltvExpirys contain equal inner contents.
24249 uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
24252 * Checks if two MinFinalCltvExpirys contain equal inner contents.
24253 * This ignores pointers and is_owned flags and looks at the values in fields.
24254 * Two objects with NULL inner values will be considered "equal" here.
24256 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
24259 * Frees any resources used by the Fallback
24261 void Fallback_free(struct LDKFallback this_ptr);
24264 * Creates a copy of the Fallback
24266 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
24269 * Utility method to constructs a new SegWitProgram-variant Fallback
24271 struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
24274 * Utility method to constructs a new PubKeyHash-variant Fallback
24276 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
24279 * Utility method to constructs a new ScriptHash-variant Fallback
24281 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
24284 * Checks if two Fallbacks contain equal inner contents.
24286 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
24289 * Checks if two Fallbacks contain equal inner contents.
24290 * This ignores pointers and is_owned flags and looks at the values in fields.
24292 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
24295 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
24297 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
24300 * Creates a copy of the InvoiceSignature
24302 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
24305 * Checks if two InvoiceSignatures contain equal inner contents.
24306 * This ignores pointers and is_owned flags and looks at the values in fields.
24307 * Two objects with NULL inner values will be considered "equal" here.
24309 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
24312 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
24314 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
24317 * Creates a copy of the PrivateRoute
24319 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
24322 * Checks if two PrivateRoutes contain equal inner contents.
24324 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
24327 * Checks if two PrivateRoutes contain equal inner contents.
24328 * This ignores pointers and is_owned flags and looks at the values in fields.
24329 * Two objects with NULL inner values will be considered "equal" here.
24331 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
24334 * Disassembles the `SignedRawInvoice` into its three parts:
24336 * 2. hash of the raw invoice
24339 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
24342 * The `RawInvoice` which was signed.
24344 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
24347 * The hash of the `RawInvoice` that was signed.
24349 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
24352 * InvoiceSignature for the invoice.
24354 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
24357 * Recovers the public key used for signing the invoice from the recoverable signature.
24359 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
24362 * Checks if the signature is valid for the included payee public key or if none exists if it's
24363 * valid for the recovered signature (which should always be true?).
24365 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
24368 * Calculate the hash of the encoded `RawInvoice`
24370 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
24374 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24376 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
24380 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24382 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
24386 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24388 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
24392 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24394 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
24398 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24400 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
24404 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24406 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
24410 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24412 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
24416 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24418 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
24420 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
24422 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
24424 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
24427 * Create a new `PositiveTimestamp` from a unix timestamp in the Range
24428 * `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
24429 * `CreationError::TimestampOutOfBounds`.
24431 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
24434 * Create a new `PositiveTimestamp` from a `SystemTime` with a corresponding unix timestamp in
24435 * the Range `0...SYSTEM_TIME_MAX_UNIX_TIMESTAMP - MAX_EXPIRY_TIME`, otherwise return a
24436 * `CreationError::TimestampOutOfBounds`.
24438 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
24441 * Returns the UNIX timestamp representing the stored time
24443 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
24446 * Returns a reference to the internal `SystemTime` time representation
24448 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
24451 * Transform the `Invoice` into it's unchecked version
24453 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
24456 * Check that the invoice is signed correctly and that key recovery works
24458 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
24461 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
24463 * use lightning_invoice::*;
24465 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
24466 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
24467 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
24468 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
24469 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
24470 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
24471 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
24472 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
24473 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
24474 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
24475 * j5r6drg6k6zcqj0fcwg\";
24477 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
24479 * assert!(Invoice::from_signed(signed).is_ok());
24482 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
24485 * Returns the `Invoice`'s timestamp (should equal it's creation time)
24487 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
24490 * Returns the hash to which we will receive the preimage on completion of the payment
24492 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
24495 * Get the payee's public key if one was included in the invoice
24497 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24499 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
24502 * Get the payment secret if one was included in the invoice
24504 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
24507 * Get the invoice features if they were included in the invoice
24509 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24511 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
24514 * Recover the payee's public key (only to be used if none was included in the invoice)
24516 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
24519 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
24521 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
24524 * Returns whether the invoice has expired.
24526 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
24529 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
24530 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
24532 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
24535 * Returns a list of all routes included in the invoice
24537 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
24540 * Returns a list of all routes included in the invoice as the underlying hints
24542 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
24545 * Returns the currency for which the invoice was issued
24547 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
24550 * Returns the amount if specified in the invoice as millisatoshis.
24552 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
24555 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
24556 * returns `CreationError::DescriptionTooLong` otherwise
24558 * Please note that single characters may use more than one byte due to UTF8 encoding.
24560 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
24563 * Returns the underlying description `String`
24565 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
24568 * Construct an `ExpiryTime` from seconds. If there exists a `PositiveTimestamp` which would
24569 * overflow on adding the `EpiryTime` to it then this function will return a
24570 * `CreationError::ExpiryTimeOutOfBounds`.
24572 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_seconds(uint64_t seconds);
24575 * Construct an `ExpiryTime` from a `Duration`. If there exists a `PositiveTimestamp` which
24576 * would overflow on adding the `EpiryTime` to it then this function will return a
24577 * `CreationError::ExpiryTimeOutOfBounds`.
24579 MUST_USE_RES struct LDKCResult_ExpiryTimeCreationErrorZ ExpiryTime_from_duration(uint64_t duration);
24582 * Returns the expiry time in seconds
24584 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
24587 * Returns a reference to the underlying `Duration` (=expiry time)
24589 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
24592 * Creates a new (partial) route from a list of hops
24594 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
24597 * Returns the underlying list of hops
24599 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
24602 * Creates a copy of the CreationError
24604 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
24607 * Utility method to constructs a new DescriptionTooLong-variant CreationError
24609 enum LDKCreationError CreationError_description_too_long(void);
24612 * Utility method to constructs a new RouteTooLong-variant CreationError
24614 enum LDKCreationError CreationError_route_too_long(void);
24617 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
24619 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
24622 * Utility method to constructs a new ExpiryTimeOutOfBounds-variant CreationError
24624 enum LDKCreationError CreationError_expiry_time_out_of_bounds(void);
24627 * Utility method to constructs a new InvalidAmount-variant CreationError
24629 enum LDKCreationError CreationError_invalid_amount(void);
24632 * Checks if two CreationErrors contain equal inner contents.
24633 * This ignores pointers and is_owned flags and looks at the values in fields.
24635 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
24638 * Get the string representation of a CreationError object
24640 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
24643 * Creates a copy of the SemanticError
24645 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
24648 * Utility method to constructs a new NoPaymentHash-variant SemanticError
24650 enum LDKSemanticError SemanticError_no_payment_hash(void);
24653 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
24655 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
24658 * Utility method to constructs a new NoDescription-variant SemanticError
24660 enum LDKSemanticError SemanticError_no_description(void);
24663 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
24665 enum LDKSemanticError SemanticError_multiple_descriptions(void);
24668 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
24670 enum LDKSemanticError SemanticError_no_payment_secret(void);
24673 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
24675 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
24678 * Utility method to constructs a new InvalidFeatures-variant SemanticError
24680 enum LDKSemanticError SemanticError_invalid_features(void);
24683 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
24685 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
24688 * Utility method to constructs a new InvalidSignature-variant SemanticError
24690 enum LDKSemanticError SemanticError_invalid_signature(void);
24693 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
24695 enum LDKSemanticError SemanticError_imprecise_amount(void);
24698 * Checks if two SemanticErrors contain equal inner contents.
24699 * This ignores pointers and is_owned flags and looks at the values in fields.
24701 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
24704 * Get the string representation of a SemanticError object
24706 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
24709 * Frees any resources used by the SignOrCreationError
24711 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
24714 * Creates a copy of the SignOrCreationError
24716 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
24719 * Utility method to constructs a new SignError-variant SignOrCreationError
24721 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
24724 * Utility method to constructs a new CreationError-variant SignOrCreationError
24726 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
24729 * Checks if two SignOrCreationErrors contain equal inner contents.
24730 * This ignores pointers and is_owned flags and looks at the values in fields.
24732 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
24735 * Get the string representation of a SignOrCreationError object
24737 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
24740 * Frees any resources used by the InvoicePayer, if is_owned is set and inner is non-NULL.
24742 void InvoicePayer_free(struct LDKInvoicePayer this_obj);
24745 * Calls the free function if one is set
24747 void Payer_free(struct LDKPayer this_ptr);
24750 * Calls the free function if one is set
24752 void Router_free(struct LDKRouter this_ptr);
24755 * Frees any resources used by the RetryAttempts, if is_owned is set and inner is non-NULL.
24757 void RetryAttempts_free(struct LDKRetryAttempts this_obj);
24759 uintptr_t RetryAttempts_get_a(const struct LDKRetryAttempts *NONNULL_PTR this_ptr);
24761 void RetryAttempts_set_a(struct LDKRetryAttempts *NONNULL_PTR this_ptr, uintptr_t val);
24764 * Constructs a new RetryAttempts given each field
24766 MUST_USE_RES struct LDKRetryAttempts RetryAttempts_new(uintptr_t a_arg);
24769 * Creates a copy of the RetryAttempts
24771 struct LDKRetryAttempts RetryAttempts_clone(const struct LDKRetryAttempts *NONNULL_PTR orig);
24774 * Checks if two RetryAttemptss contain equal inner contents.
24775 * This ignores pointers and is_owned flags and looks at the values in fields.
24776 * Two objects with NULL inner values will be considered "equal" here.
24778 bool RetryAttempts_eq(const struct LDKRetryAttempts *NONNULL_PTR a, const struct LDKRetryAttempts *NONNULL_PTR b);
24781 * Checks if two RetryAttemptss contain equal inner contents.
24783 uint64_t RetryAttempts_hash(const struct LDKRetryAttempts *NONNULL_PTR o);
24786 * Frees any resources used by the PaymentError
24788 void PaymentError_free(struct LDKPaymentError this_ptr);
24791 * Creates a copy of the PaymentError
24793 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
24796 * Utility method to constructs a new Invoice-variant PaymentError
24798 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
24801 * Utility method to constructs a new Routing-variant PaymentError
24803 struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
24806 * Utility method to constructs a new Sending-variant PaymentError
24808 struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
24811 * Creates an invoice payer that retries failed payment paths.
24813 * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
24814 * `retry_attempts` has been exceeded for a given [`Invoice`].
24816 MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetryAttempts retry_attempts);
24819 * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
24821 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
24822 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
24825 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
24828 * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
24829 * case a retry is needed.
24831 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
24832 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
24835 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_zero_value_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats);
24838 * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
24839 * case a retry is needed.
24841 * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never
24842 * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you.
24844 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_pubkey(const struct LDKInvoicePayer *NONNULL_PTR this_arg, struct LDKPublicKey pubkey, struct LDKThirtyTwoBytes payment_preimage, uint64_t amount_msats, uint32_t final_cltv_expiry_delta);
24847 * Removes the payment cached by the given payment hash.
24849 * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
24850 * [`EventHandler`]. Otherwise, calling this method is unnecessary.
24852 void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
24855 * Constructs a new EventHandler which calls the relevant methods on this_arg.
24856 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
24858 struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
24861 * Utility to construct an invoice. Generally, unless you want to do something like a custom
24862 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
24863 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
24864 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
24865 * that the payment secret is valid when the invoice is paid.
24867 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description);
24870 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
24872 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
24875 * Creates a new router using the given [`NetworkGraph`] and [`Logger`].
24877 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
24880 * Constructs a new Router which calls the relevant methods on this_arg.
24881 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
24883 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
24886 * Constructs a new Payer which calls the relevant methods on this_arg.
24887 * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
24889 struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
24892 * Read a SiPrefix object from a string
24894 struct LDKCResult_SiPrefixNoneZ SiPrefix_from_str(struct LDKStr s);
24897 * Read a Invoice object from a string
24899 struct LDKCResult_InvoiceNoneZ Invoice_from_str(struct LDKStr s);
24902 * Read a SignedRawInvoice object from a string
24904 struct LDKCResult_SignedRawInvoiceNoneZ SignedRawInvoice_from_str(struct LDKStr s);
24907 * Get the string representation of a Invoice object
24909 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
24912 * Get the string representation of a SignedRawInvoice object
24914 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
24917 * Get the string representation of a Currency object
24919 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
24922 * Get the string representation of a SiPrefix object
24924 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
24926 #endif /* LDK_C_BINDINGS_H */
24928 #include "ldk_ver.h"