+ uint16_t (*type_id)(const void *this_arg);
+ /**
+ * Return a human-readable "debug" string describing this object
+ */
+ struct LDKStr (*debug_str)(const void *this_arg);
+ /**
+ * Serialize the object into a byte array
+ */
+ struct LDKCVec_u8Z (*write)(const void *this_arg);
+ /**
+ * Called, if set, after this Type has been cloned into a duplicate object.
+ * The new Type is provided, and should be mutated as needed to perform a
+ * deep copy of the object pointed to by this_arg or avoid any double-freeing.
+ */
+ void (*cloned)(struct LDKType *NONNULL_PTR new_Type);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKType;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_PublicKeyTypeZ {
+ /**
+ * The element at position 0
+ */
+ struct LDKPublicKey a;
+ /**
+ * The element at position 1
+ */
+ struct LDKType b;
+} LDKC2Tuple_PublicKeyTypeZ;
+
+/**
+ * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKC2Tuple_PublicKeyTypeZ *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_C2Tuple_PublicKeyTypeZZ;
+
+/**
+ * The contents of an onion message.
+ */
+typedef struct LDKOnionMessageContents {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Returns the TLV type identifying the message contents. MUST be >= 64.
+ */
+ uint64_t (*tlv_type)(const void *this_arg);
+ /**
+ * Returns the message type
+ */
+ struct LDKStr (*msg_type)(const void *this_arg);
+ /**
+ * Serialize the object into a byte array
+ */
+ struct LDKCVec_u8Z (*write)(const void *this_arg);
+ /**
+ * Return a human-readable "debug" string describing this object
+ */
+ struct LDKStr (*debug_str)(const void *this_arg);
+ /**
+ * Called, if set, after this OnionMessageContents has been cloned into a duplicate object.
+ * The new OnionMessageContents is provided, and should be mutated as needed to perform a
+ * deep copy of the object pointed to by this_arg or avoid any double-freeing.
+ */
+ void (*cloned)(struct LDKOnionMessageContents *NONNULL_PTR new_OnionMessageContents);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKOnionMessageContents;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ {
+ /**
+ * The element at position 0
+ */
+ struct LDKOnionMessageContents a;
+ /**
+ * The element at position 1
+ */
+ struct LDKResponseInstruction b;
+} LDKC2Tuple_OnionMessageContentsResponseInstructionZ;
+
+/**
+ * An enum which can either contain a crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ or not
+ */
+typedef enum LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Tag {
+ /**
+ * When we're in this state, this COption_C2Tuple_OnionMessageContentsResponseInstructionZZ contains a crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ
+ */
+ LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Some,
+ /**
+ * When we're in this state, this COption_C2Tuple_OnionMessageContentsResponseInstructionZZ contains nothing
+ */
+ LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Sentinel,
+} LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Tag;
+
+typedef struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ {
+ LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ_Tag tag;
+ union {
+ struct {
+ struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ some;
+ };
+ };
+} LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ;
+
+/**
+ * An enum which can either contain a crate::lightning::onion_message::packet::OnionMessageContents or not
+ */
+typedef enum LDKCOption_OnionMessageContentsZ_Tag {
+ /**
+ * When we're in this state, this COption_OnionMessageContentsZ contains a crate::lightning::onion_message::packet::OnionMessageContents
+ */
+ LDKCOption_OnionMessageContentsZ_Some,
+ /**
+ * When we're in this state, this COption_OnionMessageContentsZ contains nothing
+ */
+ LDKCOption_OnionMessageContentsZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_OnionMessageContentsZ_Sentinel,
+} LDKCOption_OnionMessageContentsZ_Tag;
+
+typedef struct LDKCOption_OnionMessageContentsZ {
+ LDKCOption_OnionMessageContentsZ_Tag tag;
+ union {
+ struct {
+ struct LDKOnionMessageContents some;
+ };
+ };
+} LDKCOption_OnionMessageContentsZ;
+
+/**
+ * The contents of CResult_COption_OnionMessageContentsZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCOption_OnionMessageContentsZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_OnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_OnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ {
+ /**
+ * The contents of this CResult_COption_OnionMessageContentsZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_COption_OnionMessageContentsZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_COption_OnionMessageContentsZDecodeErrorZ;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ {
+ /**
+ * The element at position 0
+ */
+ struct LDKOnionMessageContents a;
+ /**
+ * The element at position 1
+ */
+ struct LDKMessageSendInstructions b;
+} LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ;
+
+/**
+ * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OnionMessageContentsMessageSendInstructionsZs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ;
+
+/**
+ * An enum which can either contain a crate::lightning::ln::wire::Type or not
+ */
+typedef enum LDKCOption_TypeZ_Tag {
+ /**
+ * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
+ */
+ LDKCOption_TypeZ_Some,
+ /**
+ * When we're in this state, this COption_TypeZ contains nothing
+ */
+ LDKCOption_TypeZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_TypeZ_Sentinel,
+} LDKCOption_TypeZ_Tag;
+
+typedef struct LDKCOption_TypeZ {
+ LDKCOption_TypeZ_Tag tag;
+ union {
+ struct {
+ struct LDKType some;
+ };
+ };
+} LDKCOption_TypeZ;
+
+/**
+ * The contents of CResult_COption_TypeZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCOption_TypeZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_COption_TypeZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
+ /**
+ * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_COption_TypeZDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::lightning::ln::msgs::SocketAddress or not
+ */
+typedef enum LDKCOption_SocketAddressZ_Tag {
+ /**
+ * When we're in this state, this COption_SocketAddressZ contains a crate::lightning::ln::msgs::SocketAddress
+ */
+ LDKCOption_SocketAddressZ_Some,
+ /**
+ * When we're in this state, this COption_SocketAddressZ contains nothing
+ */
+ LDKCOption_SocketAddressZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_SocketAddressZ_Sentinel,
+} LDKCOption_SocketAddressZ_Tag;
+
+typedef struct LDKCOption_SocketAddressZ {
+ LDKCOption_SocketAddressZ_Tag tag;
+ union {
+ struct {
+ struct LDKSocketAddress some;
+ };
+ };
+} LDKCOption_SocketAddressZ;
+
+
+
+/**
+ * Details of a connected peer as returned by [`PeerManager::list_peers`].
+ */
+typedef struct MUST_USE_STRUCT LDKPeerDetails {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePeerDetails *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPeerDetails;
+
+/**
+ * A dynamically-allocated array of crate::lightning::ln::peer_handler::PeerDetailss of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_PeerDetailsZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKPeerDetails *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_PeerDetailsZ;
+
+
+
+/**
+ * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
+ * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
+ * descriptor.
+ */
+typedef struct MUST_USE_STRUCT LDKPeerHandleError {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePeerHandleError *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPeerHandleError;
+
+/**
+ * The contents of CResult_CVec_u8ZPeerHandleErrorZ
+ */
+typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCVec_u8Z *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKPeerHandleError *err;
+} LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
+
+/**
+ * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
+ /**
+ * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
+ /**
+ * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_CVec_u8ZPeerHandleErrorZ;
+
+/**
+ * The contents of CResult_NonePeerHandleErrorZ
+ */
+typedef union LDKCResult_NonePeerHandleErrorZPtr {
+ /**
+ * Note that this value is always NULL, as there are no contents in the OK variant
+ */
+ void *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKPeerHandleError *err;
+} LDKCResult_NonePeerHandleErrorZPtr;
+
+/**
+ * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
+ * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_NonePeerHandleErrorZ {
+ /**
+ * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_NonePeerHandleErrorZPtr contents;
+ /**
+ * Whether this CResult_NonePeerHandleErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_NonePeerHandleErrorZ;
+
+/**
+ * The contents of CResult_boolPeerHandleErrorZ
+ */
+typedef union LDKCResult_boolPeerHandleErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ bool *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKPeerHandleError *err;
+} LDKCResult_boolPeerHandleErrorZPtr;
+
+/**
+ * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
+ * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_boolPeerHandleErrorZ {
+ /**
+ * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_boolPeerHandleErrorZPtr contents;
+ /**
+ * Whether this CResult_boolPeerHandleErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_boolPeerHandleErrorZ;
+
+/**
+ * All-encompassing standard error type that processing can return
+ */
+typedef enum LDKGraphSyncError_Tag {
+ /**
+ * Error trying to read the update data, typically due to an erroneous data length indication
+ * that is greater than the actual amount of data provided
+ */
+ LDKGraphSyncError_DecodeError,
+ /**
+ * Error applying the patch to the network graph, usually the result of updates that are too
+ * old or missing prerequisite data to the application of updates out of order
+ */
+ LDKGraphSyncError_LightningError,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKGraphSyncError_Sentinel,
+} LDKGraphSyncError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKGraphSyncError {
+ LDKGraphSyncError_Tag tag;
+ union {
+ struct {
+ struct LDKDecodeError decode_error;
+ };
+ struct {
+ struct LDKLightningError lightning_error;
+ };
+ };
+} LDKGraphSyncError;
+
+/**
+ * The contents of CResult_u32GraphSyncErrorZ
+ */
+typedef union LDKCResult_u32GraphSyncErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ uint32_t *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKGraphSyncError *err;
+} LDKCResult_u32GraphSyncErrorZPtr;
+
+/**
+ * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
+ * containing a u32 on success and a crate::lightning_rapid_gossip_sync::GraphSyncError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_u32GraphSyncErrorZ {
+ /**
+ * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_u32GraphSyncErrorZPtr contents;
+ /**
+ * Whether this CResult_u32GraphSyncErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_u32GraphSyncErrorZ;
+
+/**
+ * The contents of CResult_CVec_u8ZIOErrorZ
+ */
+typedef union LDKCResult_CVec_u8ZIOErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCVec_u8Z *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKIOError *err;
+} LDKCResult_CVec_u8ZIOErrorZPtr;
+
+/**
+ * A CResult_CVec_u8ZIOErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::IOError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CVec_u8ZIOErrorZ {
+ /**
+ * The contents of this CResult_CVec_u8ZIOErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_CVec_u8ZIOErrorZPtr contents;
+ /**
+ * Whether this CResult_CVec_u8ZIOErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_CVec_u8ZIOErrorZ;
+
+/**
+ * The contents of CResult_CVec_StrZIOErrorZ
+ */
+typedef union LDKCResult_CVec_StrZIOErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCVec_StrZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKIOError *err;
+} LDKCResult_CVec_StrZIOErrorZPtr;
+
+/**
+ * A CResult_CVec_StrZIOErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::CVec_StrZ on success and a crate::c_types::IOError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CVec_StrZIOErrorZ {
+ /**
+ * The contents of this CResult_CVec_StrZIOErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_CVec_StrZIOErrorZPtr contents;
+ /**
+ * Whether this CResult_CVec_StrZIOErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_CVec_StrZIOErrorZ;
+
+/**
+ * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ;
+
+/**
+ * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ
+ */
+typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKIOError *err;
+} LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr;
+
+/**
+ * A CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ on success and a crate::c_types::IOError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ {
+ /**
+ * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr contents;
+ /**
+ * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ;
+
+/**
+ * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ
+ */
+typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKIOError *err;
+} LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr;
+
+/**
+ * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::c_types::IOError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ {
+ /**
+ * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr contents;
+ /**
+ * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ;
+
+/**
+ * The contents of CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ
+ */
+typedef union LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKUnsignedInvoiceRequest *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKBolt12SemanticError *err;
+} LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr;
+
+/**
+ * A CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::invoice_request::UnsignedInvoiceRequest on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ {
+ /**
+ * The contents of this CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZPtr contents;
+ /**
+ * Whether this CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ;
+
+/**
+ * The contents of CResult_InvoiceRequestBolt12SemanticErrorZ
+ */
+typedef union LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKInvoiceRequest *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKBolt12SemanticError *err;
+} LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr;
+
+/**
+ * A CResult_InvoiceRequestBolt12SemanticErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::invoice_request::InvoiceRequest on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ {
+ /**
+ * The contents of this CResult_InvoiceRequestBolt12SemanticErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_InvoiceRequestBolt12SemanticErrorZPtr contents;
+ /**
+ * Whether this CResult_InvoiceRequestBolt12SemanticErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_InvoiceRequestBolt12SemanticErrorZ;
+
+
+
+/**
+ * Builds a [`Bolt12Invoice`] from either:
+ * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
+ * - a [`Refund`] for the \"offer for money\" flow.
+ *
+ * See [module-level documentation] for usage.
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Refund`]: crate::offers::refund::Refund
+ * [module-level documentation]: self
+ */
+typedef struct MUST_USE_STRUCT LDKInvoiceWithExplicitSigningPubkeyBuilder {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeInvoiceWithExplicitSigningPubkeyBuilder *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKInvoiceWithExplicitSigningPubkeyBuilder;
+
+/**
+ * The contents of CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ
+ */
+typedef union LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKInvoiceWithExplicitSigningPubkeyBuilder *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKBolt12SemanticError *err;
+} LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr;
+
+/**
+ * A CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::invoice::InvoiceWithExplicitSigningPubkeyBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ {
+ /**
+ * The contents of this CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZPtr contents;
+ /**
+ * Whether this CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ;
+
+
+
+/**
+ * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify_using_metadata`] or
+ * [`InvoiceRequest::verify_using_recipient_data`] and exposes different ways to respond depending
+ * on whether the signing keys were derived.
+ */
+typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeVerifiedInvoiceRequest *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKVerifiedInvoiceRequest;
+
+/**
+ * The contents of CResult_VerifiedInvoiceRequestNoneZ
+ */
+typedef union LDKCResult_VerifiedInvoiceRequestNoneZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKVerifiedInvoiceRequest *result;
+ /**
+ * Note that this value is always NULL, as there are no contents in the Err variant
+ */
+ void *err;
+} LDKCResult_VerifiedInvoiceRequestNoneZPtr;
+
+/**
+ * A CResult_VerifiedInvoiceRequestNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::invoice_request::VerifiedInvoiceRequest on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_VerifiedInvoiceRequestNoneZ {
+ /**
+ * The contents of this CResult_VerifiedInvoiceRequestNoneZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_VerifiedInvoiceRequestNoneZPtr contents;
+ /**
+ * Whether this CResult_VerifiedInvoiceRequestNoneZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_VerifiedInvoiceRequestNoneZ;
+
+
+
+/**
+ * Builds a [`Bolt12Invoice`] from either:
+ * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or
+ * - a [`Refund`] for the \"offer for money\" flow.
+ *
+ * See [module-level documentation] for usage.
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Refund`]: crate::offers::refund::Refund
+ * [module-level documentation]: self
+ */
+typedef struct MUST_USE_STRUCT LDKInvoiceWithDerivedSigningPubkeyBuilder {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeInvoiceWithDerivedSigningPubkeyBuilder *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKInvoiceWithDerivedSigningPubkeyBuilder;
+
+/**
+ * The contents of CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ
+ */
+typedef union LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKInvoiceWithDerivedSigningPubkeyBuilder *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKBolt12SemanticError *err;
+} LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr;
+
+/**
+ * A CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::invoice::InvoiceWithDerivedSigningPubkeyBuilder on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ {
+ /**
+ * The contents of this CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZPtr contents;
+ /**
+ * Whether this CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ;
+
+
+
+/**
+ * Fields sent in an [`InvoiceRequest`] message to include in [`PaymentContext::Bolt12Offer`].
+ *
+ * [`PaymentContext::Bolt12Offer`]: crate::blinded_path::payment::PaymentContext::Bolt12Offer
+ */
+typedef struct MUST_USE_STRUCT LDKInvoiceRequestFields {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeInvoiceRequestFields *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKInvoiceRequestFields;
+
+/**
+ * The contents of CResult_InvoiceRequestFieldsDecodeErrorZ
+ */
+typedef union LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKInvoiceRequestFields *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr;
+
+/**
+ * A CResult_InvoiceRequestFieldsDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::invoice_request::InvoiceRequestFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ {
+ /**
+ * The contents of this CResult_InvoiceRequestFieldsDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_InvoiceRequestFieldsDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_InvoiceRequestFieldsDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_InvoiceRequestFieldsDecodeErrorZ;
+
+/**
+ * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_WitnessZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKWitness *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_WitnessZ;
+
+/**
+ * An enum which can either contain a crate::c_types::ECDSASignature or not
+ */
+typedef enum LDKCOption_ECDSASignatureZ_Tag {
+ /**
+ * When we're in this state, this COption_ECDSASignatureZ contains a crate::c_types::ECDSASignature
+ */
+ LDKCOption_ECDSASignatureZ_Some,
+ /**
+ * When we're in this state, this COption_ECDSASignatureZ contains nothing
+ */
+ LDKCOption_ECDSASignatureZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_ECDSASignatureZ_Sentinel,
+} LDKCOption_ECDSASignatureZ_Tag;
+
+typedef struct LDKCOption_ECDSASignatureZ {
+ LDKCOption_ECDSASignatureZ_Tag tag;
+ union {
+ struct {
+ struct LDKECDSASignature some;
+ };
+ };
+} LDKCOption_ECDSASignatureZ;
+
+/**
+ * An enum which can either contain a i64 or not
+ */
+typedef enum LDKCOption_i64Z_Tag {
+ /**
+ * When we're in this state, this COption_i64Z contains a i64
+ */
+ LDKCOption_i64Z_Some,
+ /**
+ * When we're in this state, this COption_i64Z contains nothing
+ */
+ LDKCOption_i64Z_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_i64Z_Sentinel,
+} LDKCOption_i64Z_Tag;
+
+typedef struct LDKCOption_i64Z {
+ LDKCOption_i64Z_Tag tag;
+ union {
+ struct {
+ int64_t some;
+ };
+ };
+} LDKCOption_i64Z;
+
+/**
+ * The contents of CResult_SocketAddressDecodeErrorZ
+ */
+typedef union LDKCResult_SocketAddressDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKSocketAddress *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_SocketAddressDecodeErrorZPtr;
+
+/**
+ * A CResult_SocketAddressDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_SocketAddressDecodeErrorZ {
+ /**
+ * The contents of this CResult_SocketAddressDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_SocketAddressDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_SocketAddressDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_SocketAddressDecodeErrorZ;
+
+/**
+ * The contents of CResult_SocketAddressSocketAddressParseErrorZ
+ */
+typedef union LDKCResult_SocketAddressSocketAddressParseErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKSocketAddress *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKSocketAddressParseError *err;
+} LDKCResult_SocketAddressSocketAddressParseErrorZPtr;
+
+/**
+ * A CResult_SocketAddressSocketAddressParseErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::SocketAddressParseError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_SocketAddressSocketAddressParseErrorZ {
+ /**
+ * The contents of this CResult_SocketAddressSocketAddressParseErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_SocketAddressSocketAddressParseErrorZPtr contents;
+ /**
+ * Whether this CResult_SocketAddressSocketAddressParseErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_SocketAddressSocketAddressParseErrorZ;
+
+
+
+/**
+ * An [`update_add_htlc`] message to be sent to or received from a peer.
+ *
+ * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
+ */
+typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeUpdateAddHTLC *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKUpdateAddHTLC;
+
+/**
+ * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_UpdateAddHTLCZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKUpdateAddHTLC *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_UpdateAddHTLCZ;
+
+
+
+/**
+ * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
+ *
+ * [`update_fulfill_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
+ */
+typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeUpdateFulfillHTLC *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKUpdateFulfillHTLC;
+
+/**
+ * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_UpdateFulfillHTLCZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKUpdateFulfillHTLC *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_UpdateFulfillHTLCZ;
+
+
+
+/**
+ * An [`update_fail_htlc`] message to be sent to or received from a peer.
+ *
+ * [`update_fail_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
+ */
+typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeUpdateFailHTLC *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKUpdateFailHTLC;
+
+/**
+ * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_UpdateFailHTLCZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKUpdateFailHTLC *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_UpdateFailHTLCZ;
+
+
+
+/**
+ * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
+ *
+ * [`update_fail_malformed_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
+ */
+typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeUpdateFailMalformedHTLC *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKUpdateFailMalformedHTLC;
+
+/**
+ * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKUpdateFailMalformedHTLC *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_UpdateFailMalformedHTLCZ;
+
+/**
+ * The contents of CResult_AcceptChannelDecodeErrorZ
+ */
+typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKAcceptChannel *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_AcceptChannelDecodeErrorZPtr;
+
+/**
+ * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
+ /**
+ * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_AcceptChannelDecodeErrorZ;
+
+/**
+ * The contents of CResult_AcceptChannelV2DecodeErrorZ
+ */
+typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKAcceptChannelV2 *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_AcceptChannelV2DecodeErrorZPtr;
+
+/**
+ * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
+ /**
+ * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_AcceptChannelV2DecodeErrorZ;
+
+/**
+ * The contents of CResult_StfuDecodeErrorZ
+ */
+typedef union LDKCResult_StfuDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKStfu *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_StfuDecodeErrorZPtr;
+
+/**
+ * A CResult_StfuDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::Stfu on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_StfuDecodeErrorZ {
+ /**
+ * The contents of this CResult_StfuDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_StfuDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_StfuDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_StfuDecodeErrorZ;
+
+/**
+ * The contents of CResult_SpliceInitDecodeErrorZ
+ */
+typedef union LDKCResult_SpliceInitDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKSpliceInit *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_SpliceInitDecodeErrorZPtr;
+
+/**
+ * A CResult_SpliceInitDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::SpliceInit on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_SpliceInitDecodeErrorZ {
+ /**
+ * The contents of this CResult_SpliceInitDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_SpliceInitDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_SpliceInitDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_SpliceInitDecodeErrorZ;
+
+/**
+ * The contents of CResult_SpliceAckDecodeErrorZ
+ */
+typedef union LDKCResult_SpliceAckDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKSpliceAck *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_SpliceAckDecodeErrorZPtr;
+
+/**
+ * A CResult_SpliceAckDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::SpliceAck on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_SpliceAckDecodeErrorZ {
+ /**
+ * The contents of this CResult_SpliceAckDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_SpliceAckDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_SpliceAckDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_SpliceAckDecodeErrorZ;
+
+/**
+ * The contents of CResult_SpliceLockedDecodeErrorZ
+ */
+typedef union LDKCResult_SpliceLockedDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKSpliceLocked *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_SpliceLockedDecodeErrorZPtr;
+
+/**
+ * A CResult_SpliceLockedDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::SpliceLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_SpliceLockedDecodeErrorZ {
+ /**
+ * The contents of this CResult_SpliceLockedDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_SpliceLockedDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_SpliceLockedDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_SpliceLockedDecodeErrorZ;
+
+/**
+ * The contents of CResult_TxAddInputDecodeErrorZ
+ */
+typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTxAddInput *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_TxAddInputDecodeErrorZPtr;
+
+/**
+ * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TxAddInputDecodeErrorZ {
+ /**
+ * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TxAddInputDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TxAddInputDecodeErrorZ;
+
+/**
+ * The contents of CResult_TxAddOutputDecodeErrorZ
+ */
+typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTxAddOutput *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_TxAddOutputDecodeErrorZPtr;
+
+/**
+ * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
+ /**
+ * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TxAddOutputDecodeErrorZ;
+
+/**
+ * The contents of CResult_TxRemoveInputDecodeErrorZ
+ */
+typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTxRemoveInput *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_TxRemoveInputDecodeErrorZPtr;
+
+/**
+ * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
+ /**
+ * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TxRemoveInputDecodeErrorZ;
+
+/**
+ * The contents of CResult_TxRemoveOutputDecodeErrorZ
+ */
+typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTxRemoveOutput *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_TxRemoveOutputDecodeErrorZPtr;
+
+/**
+ * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
+ /**
+ * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TxRemoveOutputDecodeErrorZ;
+
+/**
+ * The contents of CResult_TxCompleteDecodeErrorZ
+ */
+typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTxComplete *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_TxCompleteDecodeErrorZPtr;
+
+/**
+ * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TxCompleteDecodeErrorZ {
+ /**
+ * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TxCompleteDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TxCompleteDecodeErrorZ;
+
+/**
+ * The contents of CResult_TxSignaturesDecodeErrorZ
+ */
+typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTxSignatures *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_TxSignaturesDecodeErrorZPtr;
+
+/**
+ * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
+ /**
+ * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TxSignaturesDecodeErrorZ;
+
+/**
+ * The contents of CResult_TxInitRbfDecodeErrorZ
+ */
+typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTxInitRbf *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_TxInitRbfDecodeErrorZPtr;
+
+/**
+ * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
+ /**
+ * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TxInitRbfDecodeErrorZ;
+
+/**
+ * The contents of CResult_TxAckRbfDecodeErrorZ
+ */
+typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTxAckRbf *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_TxAckRbfDecodeErrorZPtr;
+
+/**
+ * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
+ /**
+ * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TxAckRbfDecodeErrorZ;
+
+/**
+ * The contents of CResult_TxAbortDecodeErrorZ
+ */
+typedef union LDKCResult_TxAbortDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTxAbort *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_TxAbortDecodeErrorZPtr;
+
+/**
+ * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TxAbortDecodeErrorZ {
+ /**
+ * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TxAbortDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TxAbortDecodeErrorZ;
+
+/**
+ * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
+ */
+typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKAnnouncementSignatures *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
+
+/**
+ * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
+ /**
+ * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_AnnouncementSignaturesDecodeErrorZ;
+
+/**
+ * The contents of CResult_ChannelReestablishDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKChannelReestablish *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelReestablishDecodeErrorZPtr;
+
+/**
+ * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
+ /**
+ * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ChannelReestablishDecodeErrorZ;
+
+/**
+ * The contents of CResult_ClosingSignedDecodeErrorZ
+ */
+typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKClosingSigned *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ClosingSignedDecodeErrorZPtr;
+
+/**
+ * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
+ /**
+ * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ClosingSignedDecodeErrorZ;
+
+
+
+/**
+ * The minimum and maximum fees which the sender is willing to place on the closing transaction.
+ *
+ * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
+ * to use.
+ */
+typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeClosingSignedFeeRange *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKClosingSignedFeeRange;
+
+/**
+ * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
+ */
+typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKClosingSignedFeeRange *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
+
+/**
+ * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
+ /**
+ * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
+
+
+
+/**
+ * Optional batch parameters for `commitment_signed` message.
+ */
+typedef struct MUST_USE_STRUCT LDKCommitmentSignedBatch {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeCommitmentSignedBatch *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKCommitmentSignedBatch;
+
+/**
+ * The contents of CResult_CommitmentSignedBatchDecodeErrorZ
+ */
+typedef union LDKCResult_CommitmentSignedBatchDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCommitmentSignedBatch *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_CommitmentSignedBatchDecodeErrorZPtr;
+
+/**
+ * A CResult_CommitmentSignedBatchDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::CommitmentSignedBatch on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CommitmentSignedBatchDecodeErrorZ {
+ /**
+ * The contents of this CResult_CommitmentSignedBatchDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_CommitmentSignedBatchDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_CommitmentSignedBatchDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_CommitmentSignedBatchDecodeErrorZ;
+
+
+
+/**
+ * A [`commitment_signed`] message to be sent to or received from a peer.
+ *
+ * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
+ */
+typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeCommitmentSigned *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKCommitmentSigned;
+
+/**
+ * The contents of CResult_CommitmentSignedDecodeErrorZ
+ */
+typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCommitmentSigned *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_CommitmentSignedDecodeErrorZPtr;
+
+/**
+ * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
+ /**
+ * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_CommitmentSignedDecodeErrorZ;
+
+/**
+ * The contents of CResult_FundingCreatedDecodeErrorZ
+ */
+typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKFundingCreated *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_FundingCreatedDecodeErrorZPtr;
+
+/**
+ * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
+ /**
+ * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_FundingCreatedDecodeErrorZ;
+
+/**
+ * The contents of CResult_FundingSignedDecodeErrorZ
+ */
+typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKFundingSigned *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_FundingSignedDecodeErrorZPtr;
+
+/**
+ * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_FundingSignedDecodeErrorZ {
+ /**
+ * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_FundingSignedDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_FundingSignedDecodeErrorZ;
+
+/**
+ * The contents of CResult_ChannelReadyDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKChannelReady *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelReadyDecodeErrorZPtr;
+
+/**
+ * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
+ /**
+ * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ChannelReadyDecodeErrorZ;
+
+
+
+/**
+ * An [`init`] message to be sent to or received from a peer.
+ *
+ * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
+ */
+typedef struct MUST_USE_STRUCT LDKInit {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeInit *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKInit;
+
+/**
+ * The contents of CResult_InitDecodeErrorZ
+ */
+typedef union LDKCResult_InitDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKInit *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_InitDecodeErrorZPtr;
+
+/**
+ * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_InitDecodeErrorZ {
+ /**
+ * The contents of this CResult_InitDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_InitDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_InitDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_InitDecodeErrorZ;
+
+/**
+ * The contents of CResult_OpenChannelDecodeErrorZ
+ */
+typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKOpenChannel *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_OpenChannelDecodeErrorZPtr;
+
+/**
+ * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OpenChannelDecodeErrorZ {
+ /**
+ * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_OpenChannelDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_OpenChannelDecodeErrorZ;
+
+/**
+ * The contents of CResult_OpenChannelV2DecodeErrorZ
+ */
+typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKOpenChannelV2 *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_OpenChannelV2DecodeErrorZPtr;
+
+/**
+ * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
+ /**
+ * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_OpenChannelV2DecodeErrorZ;
+
+/**
+ * The contents of CResult_RevokeAndACKDecodeErrorZ
+ */
+typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKRevokeAndACK *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_RevokeAndACKDecodeErrorZPtr;
+
+/**
+ * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
+ /**
+ * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_RevokeAndACKDecodeErrorZ;
+
+/**
+ * The contents of CResult_ShutdownDecodeErrorZ
+ */
+typedef union LDKCResult_ShutdownDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKShutdown *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ShutdownDecodeErrorZPtr;
+
+/**
+ * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ShutdownDecodeErrorZ {
+ /**
+ * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ShutdownDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ShutdownDecodeErrorZ;
+
+/**
+ * The contents of CResult_UpdateFailHTLCDecodeErrorZ
+ */
+typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKUpdateFailHTLC *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
+
+/**
+ * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
+ /**
+ * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_UpdateFailHTLCDecodeErrorZ;
+
+/**
+ * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
+ */
+typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKUpdateFailMalformedHTLC *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
+
+/**
+ * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
+ /**
+ * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
+
+
+
+/**
+ * An [`update_fee`] message to be sent to or received from a peer
+ *
+ * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
+ */
+typedef struct MUST_USE_STRUCT LDKUpdateFee {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeUpdateFee *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKUpdateFee;
+
+/**
+ * The contents of CResult_UpdateFeeDecodeErrorZ
+ */
+typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKUpdateFee *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_UpdateFeeDecodeErrorZPtr;
+
+/**
+ * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
+ /**
+ * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_UpdateFeeDecodeErrorZ;
+
+/**
+ * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
+ */
+typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKUpdateFulfillHTLC *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
+
+/**
+ * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
+ /**
+ * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
+
+/**
+ * The contents of CResult_OnionPacketDecodeErrorZ
+ */
+typedef union LDKCResult_OnionPacketDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKOnionPacket *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_OnionPacketDecodeErrorZPtr;
+
+/**
+ * A CResult_OnionPacketDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::OnionPacket on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OnionPacketDecodeErrorZ {
+ /**
+ * The contents of this CResult_OnionPacketDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_OnionPacketDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_OnionPacketDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_OnionPacketDecodeErrorZ;
+
+/**
+ * The contents of CResult_UpdateAddHTLCDecodeErrorZ
+ */
+typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKUpdateAddHTLC *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
+
+/**
+ * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
+ /**
+ * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_UpdateAddHTLCDecodeErrorZ;
+
+
+
+/**
+ * An onion message to be sent to or received from a peer.
+ *
+ */
+typedef struct MUST_USE_STRUCT LDKOnionMessage {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeOnionMessage *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKOnionMessage;
+
+/**
+ * The contents of CResult_OnionMessageDecodeErrorZ
+ */
+typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKOnionMessage *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_OnionMessageDecodeErrorZPtr;
+
+/**
+ * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OnionMessageDecodeErrorZ {
+ /**
+ * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_OnionMessageDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_OnionMessageDecodeErrorZ;
+
+/**
+ * The contents of CResult_FinalOnionHopDataDecodeErrorZ
+ */
+typedef union LDKCResult_FinalOnionHopDataDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKFinalOnionHopData *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_FinalOnionHopDataDecodeErrorZPtr;
+
+/**
+ * A CResult_FinalOnionHopDataDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::FinalOnionHopData on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_FinalOnionHopDataDecodeErrorZ {
+ /**
+ * The contents of this CResult_FinalOnionHopDataDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_FinalOnionHopDataDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_FinalOnionHopDataDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_FinalOnionHopDataDecodeErrorZ;
+
+
+
+/**
+ * A [`ping`] message to be sent to or received from a peer.
+ *
+ * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
+ */
+typedef struct MUST_USE_STRUCT LDKPing {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePing *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPing;
+
+/**
+ * The contents of CResult_PingDecodeErrorZ
+ */
+typedef union LDKCResult_PingDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKPing *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_PingDecodeErrorZPtr;
+
+/**
+ * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PingDecodeErrorZ {
+ /**
+ * The contents of this CResult_PingDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_PingDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_PingDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_PingDecodeErrorZ;
+
+
+
+/**
+ * A [`pong`] message to be sent to or received from a peer.
+ *
+ * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
+ */
+typedef struct MUST_USE_STRUCT LDKPong {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePong *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPong;
+
+/**
+ * The contents of CResult_PongDecodeErrorZ
+ */
+typedef union LDKCResult_PongDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKPong *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_PongDecodeErrorZPtr;
+
+/**
+ * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PongDecodeErrorZ {
+ /**
+ * The contents of this CResult_PongDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_PongDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_PongDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_PongDecodeErrorZ;
+
+/**
+ * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
+ */
+typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKUnsignedChannelAnnouncement *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
+
+/**
+ * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
+ /**
+ * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
+
+/**
+ * The contents of CResult_ChannelAnnouncementDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKChannelAnnouncement *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
+
+/**
+ * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
+ /**
+ * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ChannelAnnouncementDecodeErrorZ;
+
+/**
+ * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
+ */
+typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKUnsignedChannelUpdate *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
+
+/**
+ * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
+ /**
+ * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
+
+/**
+ * The contents of CResult_ChannelUpdateDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKChannelUpdate *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelUpdateDecodeErrorZPtr;
+
+/**
+ * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
+ /**
+ * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ChannelUpdateDecodeErrorZ;
+
+/**
+ * The contents of CResult_ErrorMessageDecodeErrorZ
+ */
+typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKErrorMessage *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ErrorMessageDecodeErrorZPtr;
+
+/**
+ * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
+ /**
+ * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ErrorMessageDecodeErrorZ;
+
+/**
+ * The contents of CResult_WarningMessageDecodeErrorZ
+ */
+typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKWarningMessage *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_WarningMessageDecodeErrorZPtr;
+
+/**
+ * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_WarningMessageDecodeErrorZ {
+ /**
+ * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_WarningMessageDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_WarningMessageDecodeErrorZ;
+
+/**
+ * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
+ */
+typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKUnsignedNodeAnnouncement *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
+
+/**
+ * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
+ /**
+ * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
+
+/**
+ * The contents of CResult_NodeAnnouncementDecodeErrorZ
+ */
+typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKNodeAnnouncement *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_NodeAnnouncementDecodeErrorZPtr;
+
+/**
+ * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
+ /**
+ * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_NodeAnnouncementDecodeErrorZ;
+
+/**
+ * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
+ */
+typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKQueryShortChannelIds *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
+
+/**
+ * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
+ /**
+ * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_QueryShortChannelIdsDecodeErrorZ;
+
+
+
+/**
+ * A [`reply_short_channel_ids_end`] message is sent as a reply to a
+ * message. The query recipient makes a best
+ * effort to respond based on their local network view which may not be
+ * a perfect view of the network.
+ *
+ * [`reply_short_channel_ids_end`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages
+ */
+typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeReplyShortChannelIdsEnd *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKReplyShortChannelIdsEnd;
+
+/**
+ * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
+ */
+typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKReplyShortChannelIdsEnd *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
+
+/**
+ * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
+ /**
+ * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
+
+/**
+ * The contents of CResult_QueryChannelRangeDecodeErrorZ
+ */
+typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKQueryChannelRange *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_QueryChannelRangeDecodeErrorZPtr;
+
+/**
+ * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
+ /**
+ * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_QueryChannelRangeDecodeErrorZ;
+
+/**
+ * The contents of CResult_ReplyChannelRangeDecodeErrorZ
+ */
+typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKReplyChannelRange *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
+
+/**
+ * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
+ /**
+ * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ReplyChannelRangeDecodeErrorZ;
+
+/**
+ * The contents of CResult_GossipTimestampFilterDecodeErrorZ
+ */
+typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKGossipTimestampFilter *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
+
+/**
+ * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
+ /**
+ * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_GossipTimestampFilterDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::lightning::ln::channel_state::InboundHTLCStateDetails or not
+ */
+typedef enum LDKCOption_InboundHTLCStateDetailsZ_Tag {
+ /**
+ * When we're in this state, this COption_InboundHTLCStateDetailsZ contains a crate::lightning::ln::channel_state::InboundHTLCStateDetails
+ */
+ LDKCOption_InboundHTLCStateDetailsZ_Some,
+ /**
+ * When we're in this state, this COption_InboundHTLCStateDetailsZ contains nothing
+ */
+ LDKCOption_InboundHTLCStateDetailsZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_InboundHTLCStateDetailsZ_Sentinel,
+} LDKCOption_InboundHTLCStateDetailsZ_Tag;
+
+typedef struct LDKCOption_InboundHTLCStateDetailsZ {
+ LDKCOption_InboundHTLCStateDetailsZ_Tag tag;
+ union {
+ struct {
+ enum LDKInboundHTLCStateDetails some;
+ };
+ };
+} LDKCOption_InboundHTLCStateDetailsZ;
+
+/**
+ * The contents of CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCOption_InboundHTLCStateDetailsZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_InboundHTLCStateDetailsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ {
+ /**
+ * The contents of this CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ;
+
+
+
+/**
+ * Exposes details around pending inbound HTLCs.
+ */
+typedef struct MUST_USE_STRUCT LDKInboundHTLCDetails {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeInboundHTLCDetails *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKInboundHTLCDetails;
+
+/**
+ * The contents of CResult_InboundHTLCDetailsDecodeErrorZ
+ */
+typedef union LDKCResult_InboundHTLCDetailsDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKInboundHTLCDetails *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_InboundHTLCDetailsDecodeErrorZPtr;
+
+/**
+ * A CResult_InboundHTLCDetailsDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_state::InboundHTLCDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_InboundHTLCDetailsDecodeErrorZ {
+ /**
+ * The contents of this CResult_InboundHTLCDetailsDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_InboundHTLCDetailsDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_InboundHTLCDetailsDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_InboundHTLCDetailsDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::lightning::ln::channel_state::OutboundHTLCStateDetails or not
+ */
+typedef enum LDKCOption_OutboundHTLCStateDetailsZ_Tag {
+ /**
+ * When we're in this state, this COption_OutboundHTLCStateDetailsZ contains a crate::lightning::ln::channel_state::OutboundHTLCStateDetails
+ */
+ LDKCOption_OutboundHTLCStateDetailsZ_Some,
+ /**
+ * When we're in this state, this COption_OutboundHTLCStateDetailsZ contains nothing
+ */
+ LDKCOption_OutboundHTLCStateDetailsZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_OutboundHTLCStateDetailsZ_Sentinel,
+} LDKCOption_OutboundHTLCStateDetailsZ_Tag;
+
+typedef struct LDKCOption_OutboundHTLCStateDetailsZ {
+ LDKCOption_OutboundHTLCStateDetailsZ_Tag tag;
+ union {
+ struct {
+ enum LDKOutboundHTLCStateDetails some;
+ };
+ };
+} LDKCOption_OutboundHTLCStateDetailsZ;
+
+/**
+ * The contents of CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCOption_OutboundHTLCStateDetailsZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_OutboundHTLCStateDetailsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ {
+ /**
+ * The contents of this CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ;
+
+
+
+/**
+ * Exposes details around pending outbound HTLCs.
+ */
+typedef struct MUST_USE_STRUCT LDKOutboundHTLCDetails {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeOutboundHTLCDetails *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKOutboundHTLCDetails;
+
+/**
+ * The contents of CResult_OutboundHTLCDetailsDecodeErrorZ
+ */
+typedef union LDKCResult_OutboundHTLCDetailsDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKOutboundHTLCDetails *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_OutboundHTLCDetailsDecodeErrorZPtr;
+
+/**
+ * A CResult_OutboundHTLCDetailsDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_state::OutboundHTLCDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ {
+ /**
+ * The contents of this CResult_OutboundHTLCDetailsDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_OutboundHTLCDetailsDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_OutboundHTLCDetailsDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_OutboundHTLCDetailsDecodeErrorZ;
+
+
+
+/**
+ * Information needed for constructing an invoice route hint for this channel.
+ */
+typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeCounterpartyForwardingInfo *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKCounterpartyForwardingInfo;
+
+/**
+ * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
+ */
+typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCounterpartyForwardingInfo *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
+
+/**
+ * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_state::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
+ /**
+ * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
+
+
+
+/**
+ * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
+ * to better separate parameters.
+ */
+typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelCounterparty *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChannelCounterparty;
+
+/**
+ * The contents of CResult_ChannelCounterpartyDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKChannelCounterparty *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
+
+/**
+ * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_state::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
+ /**
+ * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ChannelCounterpartyDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::lightning::ln::channel_state::ChannelShutdownState or not
+ */
+typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
+ /**
+ * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channel_state::ChannelShutdownState
+ */
+ LDKCOption_ChannelShutdownStateZ_Some,
+ /**
+ * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
+ */
+ LDKCOption_ChannelShutdownStateZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_ChannelShutdownStateZ_Sentinel,
+} LDKCOption_ChannelShutdownStateZ_Tag;
+
+typedef struct LDKCOption_ChannelShutdownStateZ {
+ LDKCOption_ChannelShutdownStateZ_Tag tag;
+ union {
+ struct {
+ enum LDKChannelShutdownState some;
+ };
+ };
+} LDKCOption_ChannelShutdownStateZ;
+
+/**
+ * A dynamically-allocated array of crate::lightning::ln::channel_state::InboundHTLCDetailss of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_InboundHTLCDetailsZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKInboundHTLCDetails *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_InboundHTLCDetailsZ;
+
+/**
+ * A dynamically-allocated array of crate::lightning::ln::channel_state::OutboundHTLCDetailss of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_OutboundHTLCDetailsZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKOutboundHTLCDetails *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_OutboundHTLCDetailsZ;
+
+/**
+ * The contents of CResult_ChannelDetailsDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKChannelDetails *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelDetailsDecodeErrorZPtr;
+
+/**
+ * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_state::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
+ /**
+ * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ChannelDetailsDecodeErrorZ;
+
+/**
+ * The contents of CResult_ChannelShutdownStateDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ enum LDKChannelShutdownState *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
+
+/**
+ * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_state::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
+ /**
+ * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ChannelShutdownStateDecodeErrorZ;
+
+
+
+/**
+ * A simple future which can complete once, and calls some callback(s) when it does so.
+ */
+typedef struct MUST_USE_STRUCT LDKFuture {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeFuture *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKFuture;
+
+/**
+ * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_FutureZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKFuture *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_FutureZ;
+
+/**
+ * The contents of CResult_HeldHtlcAvailableDecodeErrorZ
+ */
+typedef union LDKCResult_HeldHtlcAvailableDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKHeldHtlcAvailable *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_HeldHtlcAvailableDecodeErrorZPtr;
+
+/**
+ * A CResult_HeldHtlcAvailableDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::async_payments::HeldHtlcAvailable on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_HeldHtlcAvailableDecodeErrorZ {
+ /**
+ * The contents of this CResult_HeldHtlcAvailableDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_HeldHtlcAvailableDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_HeldHtlcAvailableDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_HeldHtlcAvailableDecodeErrorZ;
+
+/**
+ * The contents of CResult_ReleaseHeldHtlcDecodeErrorZ
+ */
+typedef union LDKCResult_ReleaseHeldHtlcDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKReleaseHeldHtlc *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ReleaseHeldHtlcDecodeErrorZPtr;
+
+/**
+ * A CResult_ReleaseHeldHtlcDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::async_payments::ReleaseHeldHtlc on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ {
+ /**
+ * The contents of this CResult_ReleaseHeldHtlcDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ReleaseHeldHtlcDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ReleaseHeldHtlcDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ReleaseHeldHtlcDecodeErrorZ;
+
+/**
+ * The contents of CResult_AsyncPaymentsMessageDecodeErrorZ
+ */
+typedef union LDKCResult_AsyncPaymentsMessageDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKAsyncPaymentsMessage *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_AsyncPaymentsMessageDecodeErrorZPtr;
+
+/**
+ * A CResult_AsyncPaymentsMessageDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::async_payments::AsyncPaymentsMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ {
+ /**
+ * The contents of this CResult_AsyncPaymentsMessageDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_AsyncPaymentsMessageDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_AsyncPaymentsMessageDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_AsyncPaymentsMessageDecodeErrorZ;
+
+/**
+ * The contents of CResult_OffersMessageDecodeErrorZ
+ */
+typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKOffersMessage *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_OffersMessageDecodeErrorZPtr;
+
+/**
+ * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OffersMessageDecodeErrorZ {
+ /**
+ * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_OffersMessageDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_OffersMessageDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
+ */
+typedef enum LDKCOption_HTLCClaimZ_Tag {
+ /**
+ * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
+ */
+ LDKCOption_HTLCClaimZ_Some,
+ /**
+ * When we're in this state, this COption_HTLCClaimZ contains nothing
+ */
+ LDKCOption_HTLCClaimZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_HTLCClaimZ_Sentinel,
+} LDKCOption_HTLCClaimZ_Tag;
+
+typedef struct LDKCOption_HTLCClaimZ {
+ LDKCOption_HTLCClaimZ_Tag tag;
+ union {
+ struct {
+ enum LDKHTLCClaim some;
+ };
+ };
+} LDKCOption_HTLCClaimZ;
+
+
+
+/**
+ * Implements the per-commitment secret storage scheme from
+ * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
+ *
+ * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
+ * or so.
+ */
+typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeCounterpartyCommitmentSecrets *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKCounterpartyCommitmentSecrets;
+
+/**
+ * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
+ */
+typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCounterpartyCommitmentSecrets *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
+
+/**
+ * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
+ /**
+ * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
+
+
+
+/**
+ * The set of public keys which are used in the creation of one commitment transaction.
+ * These are derived from the channel base keys and per-commitment data.
+ *
+ * A broadcaster key is provided from potential broadcaster of the computed transaction.
+ * A countersignatory key is coming from a protocol participant unable to broadcast the
+ * transaction.
+ *
+ * These keys are assumed to be good, either because the code derived them from
+ * channel basepoints via the new function, or they were obtained via
+ * CommitmentTransaction.trust().keys() because we trusted the source of the
+ * pre-calculated keys.
+ */
+typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeTxCreationKeys *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKTxCreationKeys;
+
+/**
+ * The contents of CResult_TxCreationKeysDecodeErrorZ
+ */
+typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTxCreationKeys *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_TxCreationKeysDecodeErrorZPtr;
+
+/**
+ * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
+ /**
+ * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TxCreationKeysDecodeErrorZ;
+
+/**
+ * The contents of CResult_ChannelPublicKeysDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKChannelPublicKeys *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
+
+/**
+ * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
+ /**
+ * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ChannelPublicKeysDecodeErrorZ;
+
+/**
+ * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
+ */
+typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKHTLCOutputInCommitment *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
+
+/**
+ * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
+ /**
+ * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
+
+
+
+/**
+ * Late-bound per-channel counterparty data used to build transactions.
+ */
+typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeCounterpartyChannelTransactionParameters *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKCounterpartyChannelTransactionParameters;
+
+/**
+ * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
+ */
+typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCounterpartyChannelTransactionParameters *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
+
+/**
+ * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
+ /**
+ * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
+
+/**
+ * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKChannelTransactionParameters *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
+
+/**
+ * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
+ /**
+ * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ChannelTransactionParametersDecodeErrorZ;
+
+/**
+ * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
+ */
+typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKHolderCommitmentTransaction *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
+
+/**
+ * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
+ /**
+ * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
+
+
+
+/**
+ * A pre-built Bitcoin commitment transaction and its txid.
+ */
+typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeBuiltCommitmentTransaction *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKBuiltCommitmentTransaction;
+
+/**
+ * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
+ */
+typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKBuiltCommitmentTransaction *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
+
+/**
+ * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
+ /**
+ * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
+
+
+
+/**
+ * A wrapper on ClosingTransaction indicating that the built bitcoin
+ * transaction is trusted.
+ *
+ * See trust() and verify() functions on CommitmentTransaction.
+ *
+ * This structure implements Deref.
+ */
+typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeTrustedClosingTransaction *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKTrustedClosingTransaction;
+
+/**
+ * The contents of CResult_TrustedClosingTransactionNoneZ
+ */
+typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTrustedClosingTransaction *result;
+ /**
+ * Note that this value is always NULL, as there are no contents in the Err variant
+ */
+ void *err;
+} LDKCResult_TrustedClosingTransactionNoneZPtr;
+
+/**
+ * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
+ /**
+ * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
+ /**
+ * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TrustedClosingTransactionNoneZ;
+
+/**
+ * The contents of CResult_CommitmentTransactionDecodeErrorZ
+ */
+typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCommitmentTransaction *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_CommitmentTransactionDecodeErrorZPtr;
+
+/**
+ * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
+ /**
+ * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_CommitmentTransactionDecodeErrorZ;
+
+
+
+/**
+ * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
+ * transaction and the transaction creation keys) are trusted.
+ *
+ * See trust() and verify() functions on CommitmentTransaction.
+ *
+ * This structure implements Deref.
+ */
+typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeTrustedCommitmentTransaction *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKTrustedCommitmentTransaction;
+
+/**
+ * The contents of CResult_TrustedCommitmentTransactionNoneZ
+ */
+typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTrustedCommitmentTransaction *result;
+ /**
+ * Note that this value is always NULL, as there are no contents in the Err variant
+ */
+ void *err;
+} LDKCResult_TrustedCommitmentTransactionNoneZPtr;
+
+/**
+ * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
+ /**
+ * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
+ /**
+ * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TrustedCommitmentTransactionNoneZ;
+
+/**
+ * The contents of CResult_CVec_ECDSASignatureZNoneZ
+ */
+typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCVec_ECDSASignatureZ *result;
+ /**
+ * Note that this value is always NULL, as there are no contents in the Err variant
+ */
+ void *err;
+} LDKCResult_CVec_ECDSASignatureZNoneZPtr;
+
+/**
+ * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
+ /**
+ * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
+ /**
+ * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_CVec_ECDSASignatureZNoneZ;
+
+/**
+ * An enum which can either contain a usize or not
+ */
+typedef enum LDKCOption_usizeZ_Tag {
+ /**
+ * When we're in this state, this COption_usizeZ contains a usize
+ */
+ LDKCOption_usizeZ_Some,
+ /**
+ * When we're in this state, this COption_usizeZ contains nothing
+ */
+ LDKCOption_usizeZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_usizeZ_Sentinel,
+} LDKCOption_usizeZ_Tag;
+
+typedef struct LDKCOption_usizeZ {
+ LDKCOption_usizeZ_Tag tag;
+ union {
+ struct {
+ uintptr_t some;
+ };
+ };
+} LDKCOption_usizeZ;
+
+/**
+ * The contents of CResult_ShutdownScriptDecodeErrorZ
+ */
+typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKShutdownScript *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ShutdownScriptDecodeErrorZPtr;
+
+/**
+ * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
+ /**
+ * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ShutdownScriptDecodeErrorZ;
+
+
+
+/**
+ * An error occurring when converting from [`ScriptBuf`] to [`ShutdownScript`].
+ */
+typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeInvalidShutdownScript *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKInvalidShutdownScript;
+
+/**
+ * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
+ */
+typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKShutdownScript *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKInvalidShutdownScript *err;
+} LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
+
+/**
+ * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
+ /**
+ * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
+ /**
+ * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
+
+/**
+ * `FundingInfo` holds information about a channel's funding transaction.
+ *
+ * When LDK is set to manual propagation of the funding transaction
+ * (via [`ChannelManager::unsafe_manual_funding_transaction_generated`),
+ * LDK does not have the full transaction data. Instead, the `OutPoint`
+ * for the funding is provided here.
+ *
+ * [`ChannelManager::unsafe_manual_funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::unsafe_manual_funding_transaction_generated
+ */
+typedef enum LDKFundingInfo_Tag {
+ /**
+ * The full funding `Transaction`.
+ */
+ LDKFundingInfo_Tx,
+ /**
+ * The `OutPoint` of the funding.
+ */
+ LDKFundingInfo_OutPoint,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKFundingInfo_Sentinel,
+} LDKFundingInfo_Tag;
+
+typedef struct LDKFundingInfo_LDKTx_Body {
+ /**
+ * The funding transaction
+ */
+ struct LDKTransaction transaction;
+} LDKFundingInfo_LDKTx_Body;
+
+typedef struct LDKFundingInfo_LDKOutPoint_Body {
+ /**
+ * The outpoint of the funding
+ */
+ struct LDKOutPoint outpoint;
+} LDKFundingInfo_LDKOutPoint_Body;
+
+typedef struct MUST_USE_STRUCT LDKFundingInfo {
+ LDKFundingInfo_Tag tag;
+ union {
+ LDKFundingInfo_LDKTx_Body tx;
+ LDKFundingInfo_LDKOutPoint_Body out_point;
+ };
+} LDKFundingInfo;
+
+/**
+ * The contents of CResult_FundingInfoDecodeErrorZ
+ */
+typedef union LDKCResult_FundingInfoDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKFundingInfo *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_FundingInfoDecodeErrorZPtr;
+
+/**
+ * A CResult_FundingInfoDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::events::FundingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_FundingInfoDecodeErrorZ {
+ /**
+ * The contents of this CResult_FundingInfoDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_FundingInfoDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_FundingInfoDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_FundingInfoDecodeErrorZ;
+
+/**
+ * Some information provided on receipt of payment depends on whether the payment received is a
+ * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
+ */
+typedef enum LDKPaymentPurpose_Tag {
+ /**
+ * A payment for a BOLT 11 invoice.
+ */
+ LDKPaymentPurpose_Bolt11InvoicePayment,
+ /**
+ * A payment for a BOLT 12 [`Offer`].
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ */
+ LDKPaymentPurpose_Bolt12OfferPayment,
+ /**
+ * A payment for a BOLT 12 [`Refund`].
+ *
+ * [`Refund`]: crate::offers::refund::Refund
+ */
+ LDKPaymentPurpose_Bolt12RefundPayment,
+ /**
+ * Because this is a spontaneous payment, the payer generated their own preimage rather than us
+ * (the payee) providing a preimage.
+ */
+ LDKPaymentPurpose_SpontaneousPayment,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKPaymentPurpose_Sentinel,
+} LDKPaymentPurpose_Tag;
+
+typedef struct LDKPaymentPurpose_LDKBolt11InvoicePayment_Body {
+ /**
+ * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
+ * [`ChannelManager::create_inbound_payment`]. When handling [`Event::PaymentClaimable`],
+ * this can be passed directly to [`ChannelManager::claim_funds`] to claim the payment. No
+ * action is needed when seen in [`Event::PaymentClaimed`].
+ *
+ * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
+ * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+ */
+ struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
+ /**
+ * The \"payment secret\". This authenticates the sender to the recipient, preventing a
+ * number of deanonymization attacks during the routing process.
+ * It is provided here for your reference, however its accuracy is enforced directly by
+ * [`ChannelManager`] using the values you previously provided to
+ * [`ChannelManager::create_inbound_payment`] or
+ * [`ChannelManager::create_inbound_payment_for_hash`].
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
+ * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
+ */
+ struct LDKThirtyTwoBytes payment_secret;
+} LDKPaymentPurpose_LDKBolt11InvoicePayment_Body;
+
+typedef struct LDKPaymentPurpose_LDKBolt12OfferPayment_Body {
+ /**
+ * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
+ * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
+ * when seen in [`Event::PaymentClaimed`].
+ *
+ * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+ */
+ struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
+ /**
+ * The secret used to authenticate the sender to the recipient, preventing a number of
+ * de-anonymization attacks while routing a payment.
+ *
+ * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
+ */
+ struct LDKThirtyTwoBytes payment_secret;
+ /**
+ * The context of the payment such as information about the corresponding [`Offer`] and
+ * [`InvoiceRequest`].
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ */
+ struct LDKBolt12OfferContext payment_context;
+} LDKPaymentPurpose_LDKBolt12OfferPayment_Body;
+
+typedef struct LDKPaymentPurpose_LDKBolt12RefundPayment_Body {
+ /**
+ * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be
+ * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed
+ * when seen in [`Event::PaymentClaimed`].
+ *
+ * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+ */
+ struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
+ /**
+ * The secret used to authenticate the sender to the recipient, preventing a number of
+ * de-anonymization attacks while routing a payment.
+ *
+ * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details.
+ */
+ struct LDKThirtyTwoBytes payment_secret;
+ /**
+ * The context of the payment such as information about the corresponding [`Refund`].
+ *
+ * [`Refund`]: crate::offers::refund::Refund
+ */
+ struct LDKBolt12RefundContext payment_context;
+} LDKPaymentPurpose_LDKBolt12RefundPayment_Body;
+
+typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
+ LDKPaymentPurpose_Tag tag;
+ union {
+ LDKPaymentPurpose_LDKBolt11InvoicePayment_Body bolt11_invoice_payment;
+ LDKPaymentPurpose_LDKBolt12OfferPayment_Body bolt12_offer_payment;
+ LDKPaymentPurpose_LDKBolt12RefundPayment_Body bolt12_refund_payment;
+ struct {
+ struct LDKThirtyTwoBytes spontaneous_payment;
+ };
+ };
+} LDKPaymentPurpose;
+
+/**
+ * The contents of CResult_PaymentPurposeDecodeErrorZ
+ */
+typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKPaymentPurpose *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_PaymentPurposeDecodeErrorZPtr;
+
+/**
+ * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
+ /**
+ * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_PaymentPurposeDecodeErrorZ;
+
+
+
+/**
+ * Information about an HTLC that is part of a payment that can be claimed.
+ */
+typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeClaimedHTLC *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKClaimedHTLC;
+
+/**
+ * The contents of CResult_ClaimedHTLCDecodeErrorZ
+ */
+typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKClaimedHTLC *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ClaimedHTLCDecodeErrorZPtr;
+
+/**
+ * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
+ /**
+ * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ClaimedHTLCDecodeErrorZ;
+
+/**
+ * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
+ * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
+ *
+ * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
+ * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
+ */
+typedef enum LDKPathFailure_Tag {
+ /**
+ * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
+ * error.
+ */
+ LDKPathFailure_InitialSend,
+ /**
+ * A hop on the path failed to forward our payment.
+ */
+ LDKPathFailure_OnPath,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKPathFailure_Sentinel,
+} LDKPathFailure_Tag;
+
+typedef struct LDKPathFailure_LDKInitialSend_Body {
+ /**
+ * The error surfaced from initial send.
+ */
+ struct LDKAPIError err;
+} LDKPathFailure_LDKInitialSend_Body;
+
+typedef struct LDKPathFailure_LDKOnPath_Body {
+ /**
+ * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
+ * decisions can take into account the update.
+ *
+ * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
+ * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
+ */
+ struct LDKCOption_NetworkUpdateZ network_update;
+} LDKPathFailure_LDKOnPath_Body;
+
+typedef struct MUST_USE_STRUCT LDKPathFailure {
+ LDKPathFailure_Tag tag;
+ union {
+ LDKPathFailure_LDKInitialSend_Body initial_send;
+ LDKPathFailure_LDKOnPath_Body on_path;
+ };
+} LDKPathFailure;
+
+/**
+ * An enum which can either contain a crate::lightning::events::PathFailure or not
+ */
+typedef enum LDKCOption_PathFailureZ_Tag {
+ /**
+ * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
+ */
+ LDKCOption_PathFailureZ_Some,
+ /**
+ * When we're in this state, this COption_PathFailureZ contains nothing
+ */
+ LDKCOption_PathFailureZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_PathFailureZ_Sentinel,
+} LDKCOption_PathFailureZ_Tag;
+
+typedef struct LDKCOption_PathFailureZ {
+ LDKCOption_PathFailureZ_Tag tag;
+ union {
+ struct {
+ struct LDKPathFailure some;
+ };
+ };
+} LDKCOption_PathFailureZ;
+
+/**
+ * The contents of CResult_COption_PathFailureZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCOption_PathFailureZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_COption_PathFailureZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
+ /**
+ * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_COption_PathFailureZDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::lightning::events::ClosureReason or not
+ */
+typedef enum LDKCOption_ClosureReasonZ_Tag {
+ /**
+ * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
+ */
+ LDKCOption_ClosureReasonZ_Some,
+ /**
+ * When we're in this state, this COption_ClosureReasonZ contains nothing
+ */
+ LDKCOption_ClosureReasonZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_ClosureReasonZ_Sentinel,
+} LDKCOption_ClosureReasonZ_Tag;
+
+typedef struct LDKCOption_ClosureReasonZ {
+ LDKCOption_ClosureReasonZ_Tag tag;
+ union {
+ struct {
+ struct LDKClosureReason some;
+ };
+ };
+} LDKCOption_ClosureReasonZ;
+
+/**
+ * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCOption_ClosureReasonZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
+ /**
+ * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_COption_ClosureReasonZDecodeErrorZ;
+
+/**
+ * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
+ */
+typedef enum LDKHTLCDestination_Tag {
+ /**
+ * We tried forwarding to a channel but failed to do so. An example of such an instance is when
+ * there is insufficient capacity in our outbound channel.
+ */
+ LDKHTLCDestination_NextHopChannel,
+ /**
+ * Scenario where we are unsure of the next node to forward the HTLC to.
+ */
+ LDKHTLCDestination_UnknownNextHop,
+ /**
+ * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
+ * intercept HTLC.
+ */
+ LDKHTLCDestination_InvalidForward,
+ /**
+ * We couldn't decode the incoming onion to obtain the forwarding details.
+ */
+ LDKHTLCDestination_InvalidOnion,
+ /**
+ * Failure scenario where an HTLC may have been forwarded to be intended for us,
+ * but is invalid for some reason, so we reject it.
+ *
+ * Some of the reasons may include:
+ * * HTLC Timeouts
+ * * Excess HTLCs for a payment that we have already fully received, over-paying for the
+ * payment,
+ * * The counterparty node modified the HTLC in transit,
+ * * A probing attack where an intermediary node is trying to detect if we are the ultimate
+ * recipient for a payment.
+ */
+ LDKHTLCDestination_FailedPayment,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKHTLCDestination_Sentinel,
+} LDKHTLCDestination_Tag;
+
+typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
+ /**
+ * The `node_id` of the next node. For backwards compatibility, this field is
+ * marked as optional, versions prior to 0.0.110 may not always be able to provide
+ * counterparty node information.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * The outgoing `channel_id` between us and the next node.
+ */
+ struct LDKChannelId channel_id;
+} LDKHTLCDestination_LDKNextHopChannel_Body;
+
+typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
+ /**
+ * Short channel id we are requesting to forward an HTLC to.
+ */
+ uint64_t requested_forward_scid;
+} LDKHTLCDestination_LDKUnknownNextHop_Body;
+
+typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
+ /**
+ * Short channel id we are requesting to forward an HTLC to.
+ */
+ uint64_t requested_forward_scid;
+} LDKHTLCDestination_LDKInvalidForward_Body;
+
+typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
+ /**
+ * The payment hash of the payment we attempted to process.
+ */
+ struct LDKThirtyTwoBytes payment_hash;
+} LDKHTLCDestination_LDKFailedPayment_Body;
+
+typedef struct MUST_USE_STRUCT LDKHTLCDestination {
+ LDKHTLCDestination_Tag tag;
+ union {
+ LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
+ LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
+ LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
+ LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
+ };
+} LDKHTLCDestination;
+
+/**
+ * An enum which can either contain a crate::lightning::events::HTLCDestination or not
+ */
+typedef enum LDKCOption_HTLCDestinationZ_Tag {
+ /**
+ * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
+ */
+ LDKCOption_HTLCDestinationZ_Some,
+ /**
+ * When we're in this state, this COption_HTLCDestinationZ contains nothing
+ */
+ LDKCOption_HTLCDestinationZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_HTLCDestinationZ_Sentinel,
+} LDKCOption_HTLCDestinationZ_Tag;
+
+typedef struct LDKCOption_HTLCDestinationZ {
+ LDKCOption_HTLCDestinationZ_Tag tag;
+ union {
+ struct {
+ struct LDKHTLCDestination some;
+ };
+ };
+} LDKCOption_HTLCDestinationZ;
+
+/**
+ * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCOption_HTLCDestinationZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
+ /**
+ * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
+ */
+typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
+ /**
+ * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
+ */
+ LDKCOption_PaymentFailureReasonZ_Some,
+ /**
+ * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
+ */
+ LDKCOption_PaymentFailureReasonZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_PaymentFailureReasonZ_Sentinel,
+} LDKCOption_PaymentFailureReasonZ_Tag;
+
+typedef struct LDKCOption_PaymentFailureReasonZ {
+ LDKCOption_PaymentFailureReasonZ_Tag tag;
+ union {
+ struct {
+ enum LDKPaymentFailureReason some;
+ };
+ };
+} LDKCOption_PaymentFailureReasonZ;
+
+/**
+ * The contents of CResult_COption_PaymentFailureReasonZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_PaymentFailureReasonZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCOption_PaymentFailureReasonZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_COption_PaymentFailureReasonZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_PaymentFailureReasonZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_PaymentFailureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ {
+ /**
+ * The contents of this CResult_COption_PaymentFailureReasonZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_COption_PaymentFailureReasonZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_COption_PaymentFailureReasonZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::c_types::U128 or not
+ */
+typedef enum LDKCOption_U128Z_Tag {
+ /**
+ * When we're in this state, this COption_U128Z contains a crate::c_types::U128
+ */
+ LDKCOption_U128Z_Some,
+ /**
+ * When we're in this state, this COption_U128Z contains nothing
+ */
+ LDKCOption_U128Z_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_U128Z_Sentinel,
+} LDKCOption_U128Z_Tag;
+
+typedef struct LDKCOption_U128Z {
+ LDKCOption_U128Z_Tag tag;
+ union {
+ struct {
+ struct LDKU128 some;
+ };
+ };
+} LDKCOption_U128Z;
+
+/**
+ * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_ClaimedHTLCZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKClaimedHTLC *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_ClaimedHTLCZ;
+
+
+
+/**
+ * The `Responder` struct creates an appropriate [`ResponseInstruction`] for responding to a
+ * message.
+ */
+typedef struct MUST_USE_STRUCT LDKResponder {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeResponder *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKResponder;
+
+
+
+/**
+ * A subset of [`CommonOpenChannelFields`], containing various parameters which are set by the
+ * channel initiator and which are not part of the channel funding transaction.
+ */
+typedef struct MUST_USE_STRUCT LDKChannelParameters {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelParameters *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChannelParameters;
+
+
+
+/**
+ * A descriptor used to sign for a commitment transaction's anchor output.
+ */
+typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeAnchorDescriptor *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKAnchorDescriptor;
+
+/**
+ * Represents the different types of transactions, originating from LDK, to be bumped.
+ */
+typedef enum LDKBumpTransactionEvent_Tag {
+ /**
+ * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
+ * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
+ * they may need additional fees to be attached through a child transaction using the popular
+ * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
+ * child transaction must include the anchor input described within `anchor_descriptor` along
+ * with additional inputs to meet the target feerate. Failure to meet the target feerate
+ * decreases the confirmation odds of the transaction package (which includes the commitment
+ * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
+ * is constructed, it must be fully signed for and broadcast by the consumer of the event
+ * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
+ * broadcast first, as the child anchor transaction depends on it.
+ *
+ * The consumer should be able to sign for any of the additional inputs included within the
+ * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
+ * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
+ * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
+ * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
+ * full witness required to spend.
+ *
+ * It is possible to receive more than one instance of this event if a valid child anchor
+ * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
+ * be taken by the consumer of the event to ensure any future iterations of the child anchor
+ * transaction adhere to the [Replace-By-Fee
+ * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
+ * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
+ * these events is not user-controlled, users may ignore/drop the event if they are no longer
+ * able to commit external confirmed funds to the child anchor transaction.
+ *
+ * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
+ * determine whether a significant portion of the channel's funds are allocated to HTLCs,
+ * enabling users to make their own decisions regarding the importance of the commitment
+ * transaction's confirmation. Note that this is not required, but simply exists as an option
+ * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
+ * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
+ * be not urgent.
+ *
+ * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
+ * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_anchor_input
+ * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
+ */
+ LDKBumpTransactionEvent_ChannelClose,
+ /**
+ * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
+ * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
+ * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
+ * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
+ * for a timely confirmation within the chain. These additional inputs and/or outputs must be
+ * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
+ * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
+ * loss of funds. Once the transaction meets the target feerate, it must be signed for and
+ * broadcast by the consumer of the event.
+ *
+ * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
+ * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
+ * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
+ * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
+ * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
+ * to spend.
+ *
+ * It is possible to receive more than one instance of this event if a valid HTLC transaction
+ * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
+ * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
+ * the [Replace-By-Fee
+ * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
+ * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
+ * these events is not user-controlled, users may ignore/drop the event if either they are no
+ * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
+ * to the HTLC transaction is greater in value than the HTLCs being claimed.
+ *
+ * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
+ * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_htlc_transaction
+ */
+ LDKBumpTransactionEvent_HTLCResolution,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKBumpTransactionEvent_Sentinel,
+} LDKBumpTransactionEvent_Tag;
+
+typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
+ /**
+ * The `channel_id` of the channel which has been closed.
+ */
+ struct LDKChannelId channel_id;
+ /**
+ * Counterparty in the closed channel.
+ */
+ struct LDKPublicKey counterparty_node_id;
+ /**
+ * The unique identifier for the claim of the anchor output in the commitment transaction.
+ *
+ * The identifier must map to the set of external UTXOs assigned to the claim, such that
+ * they can be reused when a new claim with the same identifier needs to be made, resulting
+ * in a fee-bumping attempt.
+ */
+ struct LDKThirtyTwoBytes claim_id;
+ /**
+ * The target feerate that the transaction package, which consists of the commitment
+ * transaction and the to-be-crafted child anchor transaction, must meet.
+ */
+ uint32_t package_target_feerate_sat_per_1000_weight;
+ /**
+ * The channel's commitment transaction to bump the fee of. This transaction should be
+ * broadcast along with the anchor transaction constructed as a result of consuming this
+ * event.
+ */
+ struct LDKTransaction commitment_tx;
+ /**
+ * The absolute fee in satoshis of the commitment transaction. This can be used along the
+ * with weight of the commitment transaction to determine its feerate.
+ */
+ uint64_t commitment_tx_fee_satoshis;
+ /**
+ * The descriptor to sign the anchor input of the anchor transaction constructed as a
+ * result of consuming this event.
+ */
+ struct LDKAnchorDescriptor anchor_descriptor;
+ /**
+ * The set of pending HTLCs on the commitment transaction that need to be resolved once the
+ * commitment transaction confirms.
+ */
+ struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
+} LDKBumpTransactionEvent_LDKChannelClose_Body;
+
+typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
+ /**
+ * The `channel_id` of the channel which has been closed.
+ */
+ struct LDKChannelId channel_id;
+ /**
+ * Counterparty in the closed channel.
+ */
+ struct LDKPublicKey counterparty_node_id;
+ /**
+ * The unique identifier for the claim of the HTLCs in the confirmed commitment
+ * transaction.
+ *
+ * The identifier must map to the set of external UTXOs assigned to the claim, such that
+ * they can be reused when a new claim with the same identifier needs to be made, resulting
+ * in a fee-bumping attempt.
+ */
+ struct LDKThirtyTwoBytes claim_id;
+ /**
+ * The target feerate that the resulting HTLC transaction must meet.
+ */
+ uint32_t target_feerate_sat_per_1000_weight;
+ /**
+ * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
+ * by the same transaction.
+ */
+ struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
+ /**
+ * The locktime required for the resulting HTLC transaction.
+ */
+ uint32_t tx_lock_time;
+} LDKBumpTransactionEvent_LDKHTLCResolution_Body;
+
+typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
+ LDKBumpTransactionEvent_Tag tag;
+ union {
+ LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
+ LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
+ };
+} LDKBumpTransactionEvent;
+
+/**
+ * An Event which you should probably take some action in response to.
+ *
+ * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
+ * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
+ * written as it makes no sense to respond to it after reconnecting to peers).
+ */
+typedef enum LDKEvent_Tag {
+ /**
+ * Used to indicate that the client should generate a funding transaction with the given
+ * parameters and then call [`ChannelManager::funding_transaction_generated`].
+ * Generated in [`ChannelManager`] message handling.
+ * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
+ * counterparty can steal your funds!
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`), but won't be persisted across restarts.
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
+ */
+ LDKEvent_FundingGenerationReady,
+ /**
+ * Used to indicate that the counterparty node has provided the signature(s) required to
+ * recover our funds in case they go offline.
+ *
+ * It is safe (and your responsibility) to broadcast the funding transaction upon receiving this
+ * event.
+ *
+ * This event is only emitted if you called
+ * [`ChannelManager::unsafe_manual_funding_transaction_generated`] instead of
+ * [`ChannelManager::funding_transaction_generated`].
+ *
+ * [`ChannelManager::unsafe_manual_funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::unsafe_manual_funding_transaction_generated
+ * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
+ */
+ LDKEvent_FundingTxBroadcastSafe,
+ /**
+ * Indicates that we've been offered a payment and it needs to be claimed via calling
+ * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
+ *
+ * Note that if the preimage is not known, you should call
+ * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
+ * to free up resources for this HTLC and avoid network congestion.
+ *
+ * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
+ * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
+ * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
+ * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
+ * If you don't intend to check for custom TLVs, you can simply use
+ * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
+ *
+ * If you fail to call [`ChannelManager::claim_funds`],
+ * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
+ * [`ChannelManager::fail_htlc_backwards`], or
+ * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
+ * be automatically failed.
+ *
+ * # Note
+ * LDK will not stop an inbound payment from being paid multiple times, so multiple
+ * `PaymentClaimable` events may be generated for the same payment. In such a case it is
+ * polite (and required in the lightning specification) to fail the payment the second time
+ * and give the sender their money back rather than accepting double payment.
+ *
+ * # Note
+ * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ *
+ * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+ * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
+ * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
+ * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
+ * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
+ */
+ LDKEvent_PaymentClaimable,
+ /**
+ * Indicates a payment has been claimed and we've received money!
+ *
+ * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
+ * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
+ * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
+ * [`Event::PaymentClaimable`] event.
+ *
+ * # Note
+ * LDK will not stop an inbound payment from being paid multiple times, so multiple
+ * `PaymentClaimable` events may be generated for the same payment. If you then call
+ * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
+ * multiple `PaymentClaimed` events.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ *
+ * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+ */
+ LDKEvent_PaymentClaimed,
+ /**
+ * Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
+ *
+ * Typically, this happens when a [`MessageRouter`] is unable to find a complete path to a
+ * [`Destination`]. Once a connection is established, any messages buffered by an
+ * [`OnionMessageHandler`] may be sent.
+ *
+ * This event will not be generated for onion message forwards; only for sends including
+ * replies. Handlers should connect to the node otherwise any buffered messages may be lost.
+ *
+ * # Failure Behavior and Persistence
+ * This event won't be replayed after failures-to-handle
+ * (i.e., the event handler returning `Err(ReplayEvent ())`), and also won't be persisted
+ * across restarts.
+ *
+ * [`OnionMessage`]: msgs::OnionMessage
+ * [`MessageRouter`]: crate::onion_message::messenger::MessageRouter
+ * [`Destination`]: crate::onion_message::messenger::Destination
+ * [`OnionMessageHandler`]: crate::ln::msgs::OnionMessageHandler
+ */
+ LDKEvent_ConnectionNeeded,
+ /**
+ * Indicates a [`Bolt12Invoice`] in response to an [`InvoiceRequest`] or a [`Refund`] was
+ * received.
+ *
+ * This event will only be generated if [`UserConfig::manually_handle_bolt12_invoices`] is set.
+ * Use [`ChannelManager::send_payment_for_bolt12_invoice`] to pay the invoice or
+ * [`ChannelManager::abandon_payment`] to abandon the associated payment. See those docs for
+ * further details.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Refund`]: crate::offers::refund::Refund
+ * [`UserConfig::manually_handle_bolt12_invoices`]: crate::util::config::UserConfig::manually_handle_bolt12_invoices
+ * [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ */
+ LDKEvent_InvoiceReceived,
+ /**
+ * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
+ * and we got back the payment preimage for it).
+ *
+ * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
+ * event. In this situation, you SHOULD treat this payment as having succeeded.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ */
+ LDKEvent_PaymentSent,
+ /**
+ * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
+ * provide failure information for each path attempt in the payment, including retries.
+ *
+ * This event is provided once there are no further pending HTLCs for the payment and the
+ * payment is no longer retryable, due either to the [`Retry`] provided or
+ * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
+ *
+ * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
+ * a payment after an [`Event::PaymentSent`] event for this same payment has already been
+ * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
+ * and the payment MUST be treated as having succeeded.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ *
+ * [`Retry`]: crate::ln::channelmanager::Retry
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ */
+ LDKEvent_PaymentFailed,
+ /**
+ * Indicates that a path for an outbound payment was successful.
+ *
+ * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
+ * [`Event::PaymentSent`] for obtaining the payment preimage.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ */
+ LDKEvent_PaymentPathSuccessful,
+ /**
+ * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
+ * handle the HTLC.
+ *
+ * Note that this does *not* indicate that all paths for an MPP payment have failed, see
+ * [`Event::PaymentFailed`].
+ *
+ * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
+ * been exhausted.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ *
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ */
+ LDKEvent_PaymentPathFailed,
+ /**
+ * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ */
+ LDKEvent_ProbeSuccessful,
+ /**
+ * Indicates that a probe payment we sent failed at an intermediary node on the path.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ */
+ LDKEvent_ProbeFailed,
+ /**
+ * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
+ * a time in the future.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be regenerated after restarts.
+ *
+ * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
+ */
+ LDKEvent_PendingHTLCsForwardable,
+ /**
+ * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
+ * you've encoded an intercept scid in the receiver's invoice route hints using
+ * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
+ *
+ * [`ChannelManager::forward_intercepted_htlc`] or
+ * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
+ * their docs for more information.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ *
+ * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
+ * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
+ * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
+ * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
+ */
+ LDKEvent_HTLCIntercepted,
+ /**
+ * Used to indicate that an output which you should know how to spend was confirmed on chain
+ * and is now spendable.
+ *
+ * Such an output will *never* be spent directly by LDK, and are not at risk of your
+ * counterparty spending them due to some kind of timeout. Thus, you need to store them
+ * somewhere and spend them when you create on-chain transactions.
+ *
+ * You may hand them to the [`OutputSweeper`] utility which will store and (re-)generate spending
+ * transactions for you.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ *
+ * [`OutputSweeper`]: crate::util::sweep::OutputSweeper
+ */
+ LDKEvent_SpendableOutputs,
+ /**
+ * This event is generated when a payment has been successfully forwarded through us and a
+ * forwarding fee earned.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ */
+ LDKEvent_PaymentForwarded,
+ /**
+ * Used to indicate that a channel with the given `channel_id` is being opened and pending
+ * confirmation on-chain.
+ *
+ * This event is emitted when the funding transaction has been signed and is broadcast to the
+ * network. For 0conf channels it will be immediately followed by the corresponding
+ * [`Event::ChannelReady`] event.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ */
+ LDKEvent_ChannelPending,
+ /**
+ * Used to indicate that a channel with the given `channel_id` is ready to
+ * be used. This event is emitted either when the funding transaction has been confirmed
+ * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
+ * establishment.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ */
+ LDKEvent_ChannelReady,
+ /**
+ * Used to indicate that a channel that got past the initial handshake with the given `channel_id` is in the
+ * process of closure. This includes previously opened channels, and channels that time out from not being funded.
+ *
+ * Note that this event is only triggered for accepted channels: if the
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
+ * rejected, no `ChannelClosed` event will be sent.
+ *
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ */
+ LDKEvent_ChannelClosed,
+ /**
+ * Used to indicate to the user that they can abandon the funding transaction and recycle the
+ * inputs for another purpose.
+ *
+ * This event is not guaranteed to be generated for channels that are closed due to a restart.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ */
+ LDKEvent_DiscardFunding,
+ /**
+ * Indicates a request to open a new channel by a peer.
+ *
+ * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
+ * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
+ * event will _not_ be triggered if the channel is rejected.
+ *
+ * The event is only triggered when a new open channel request is received and the
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ *
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ */
+ LDKEvent_OpenChannelRequest,
+ /**
+ * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
+ * forward it.
+ *
+ * Some scenarios where this event may be sent include:
+ * * Insufficient capacity in the outbound channel
+ * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
+ * * When an unknown SCID is requested for forwarding a payment.
+ * * Expected MPP amount has already been reached
+ * * The HTLC has timed out
+ *
+ * This event, however, does not get generated if an HTLC fails to meet the forwarding
+ * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
+ */
+ LDKEvent_HTLCHandlingFailed,
+ /**
+ * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
+ * requires confirmed external funds to be readily available to spend.
+ *
+ * LDK does not currently generate this event unless the
+ * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
+ * It is limited to the scope of channels with anchor outputs.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`), but will only be regenerated as needed after restarts.
+ *
+ * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
+ */
+ LDKEvent_BumpTransaction,
+ /**
+ * We received an onion message that is intended to be forwarded to a peer
+ * that is currently offline. This event will only be generated if the
+ * `OnionMessenger` was initialized with
+ * [`OnionMessenger::new_with_offline_peer_interception`], see its docs.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`), but won't be persisted across restarts.
+ *
+ * [`OnionMessenger::new_with_offline_peer_interception`]: crate::onion_message::messenger::OnionMessenger::new_with_offline_peer_interception
+ */
+ LDKEvent_OnionMessageIntercepted,
+ /**
+ * Indicates that an onion message supporting peer has come online and it may
+ * be time to forward any onion messages that were previously intercepted for
+ * them. This event will only be generated if the `OnionMessenger` was
+ * initialized with
+ * [`OnionMessenger::new_with_offline_peer_interception`], see its docs.
+ *
+ * # Failure Behavior and Persistence
+ * This event will eventually be replayed after failures-to-handle (i.e., the event handler
+ * returning `Err(ReplayEvent ())`), but won't be persisted across restarts.
+ *
+ * [`OnionMessenger::new_with_offline_peer_interception`]: crate::onion_message::messenger::OnionMessenger::new_with_offline_peer_interception
+ */
+ LDKEvent_OnionMessagePeerConnected,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKEvent_Sentinel,
+} LDKEvent_Tag;
+
+typedef struct LDKEvent_LDKFundingGenerationReady_Body {
+ /**
+ * The random channel_id we picked which you'll need to pass into
+ * [`ChannelManager::funding_transaction_generated`].
+ *
+ * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
+ */
+ struct LDKChannelId temporary_channel_id;
+ /**
+ * The counterparty's node_id, which you'll need to pass back into
+ * [`ChannelManager::funding_transaction_generated`].
+ *
+ * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
+ */
+ struct LDKPublicKey counterparty_node_id;
+ /**
+ * The value, in satoshis, that the output should have.
+ */
+ uint64_t channel_value_satoshis;
+ /**
+ * The script which should be used in the transaction output.
+ */
+ struct LDKCVec_u8Z output_script;
+ /**
+ * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
+ * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+ * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
+ * serialized with LDK versions prior to 0.0.113.
+ *
+ * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ */
+ struct LDKU128 user_channel_id;
+} LDKEvent_LDKFundingGenerationReady_Body;
+
+typedef struct LDKEvent_LDKFundingTxBroadcastSafe_Body {
+ /**
+ * The `channel_id` indicating which channel has reached this stage.
+ */
+ struct LDKChannelId channel_id;
+ /**
+ * The `user_channel_id` value passed in to [`ChannelManager::create_channel`].
+ *
+ * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+ */
+ struct LDKU128 user_channel_id;
+ /**
+ * The outpoint of the channel's funding transaction.
+ */
+ struct LDKOutPoint funding_txo;
+ /**
+ * The `node_id` of the channel counterparty.
+ */
+ struct LDKPublicKey counterparty_node_id;
+ /**
+ * The `temporary_channel_id` this channel used to be known by during channel establishment.
+ */
+ struct LDKChannelId former_temporary_channel_id;
+} LDKEvent_LDKFundingTxBroadcastSafe_Body;
+
+typedef struct LDKEvent_LDKPaymentClaimable_Body {
+ /**
+ * The node that will receive the payment after it has been claimed.
+ * This is useful to identify payments received via [phantom nodes].
+ * This field will always be filled in when the event was generated by LDK versions
+ * 0.0.113 and above.
+ *
+ * [phantom nodes]: crate::sign::PhantomKeysManager
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKPublicKey receiver_node_id;
+ /**
+ * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
+ * not stop you from registering duplicate payment hashes for inbound payments.
+ */
+ struct LDKThirtyTwoBytes payment_hash;
+ /**
+ * The fields in the onion which were received with each HTLC. Only fields which were
+ * identical in each HTLC involved in the payment will be included here.
+ *
+ * Payments received on LDK versions prior to 0.0.115 will have this field unset.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKRecipientOnionFields onion_fields;
+ /**
+ * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
+ * than the invoice amount.
+ *
+ * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
+ * and the previous hop took an extra fee.
+ *
+ * # Note
+ * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
+ * field, you may lose money!
+ *
+ * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
+ */
+ uint64_t amount_msat;
+ /**
+ * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
+ * taken by our channel counterparty.
+ *
+ * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
+ *
+ * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
+ */
+ uint64_t counterparty_skimmed_fee_msat;
+ /**
+ * Information for claiming this received payment, based on whether the purpose of the
+ * payment is to pay an invoice or to send a spontaneous payment.
+ */
+ struct LDKPaymentPurpose purpose;
+ /**
+ * The `channel_id` indicating over which channel we received the payment.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKChannelId via_channel_id;
+ /**
+ * The `user_channel_id` indicating over which channel we received the payment.
+ */
+ struct LDKCOption_U128Z via_user_channel_id;
+ /**
+ * The block height at which this payment will be failed back and will no longer be
+ * eligible for claiming.
+ *
+ * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
+ * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
+ *
+ * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+ */
+ struct LDKCOption_u32Z claim_deadline;
+} LDKEvent_LDKPaymentClaimable_Body;
+
+typedef struct LDKEvent_LDKPaymentClaimed_Body {
+ /**
+ * The node that received the payment.
+ * This is useful to identify payments which were received via [phantom nodes].
+ * This field will always be filled in when the event was generated by LDK versions
+ * 0.0.113 and above.
+ *
+ * [phantom nodes]: crate::sign::PhantomKeysManager
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKPublicKey receiver_node_id;
+ /**
+ * The payment hash of the claimed payment. Note that LDK will not stop you from
+ * registering duplicate payment hashes for inbound payments.
+ */
+ struct LDKThirtyTwoBytes payment_hash;
+ /**
+ * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
+ * invoice amount.
+ */
+ uint64_t amount_msat;
+ /**
+ * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
+ * spontaneous payment.
+ */
+ struct LDKPaymentPurpose purpose;
+ /**
+ * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
+ * to LDK version 0.0.117.
+ */
+ struct LDKCVec_ClaimedHTLCZ htlcs;
+ /**
+ * The sender-intended sum total of all the MPP parts. This will be `None` for events
+ * serialized prior to LDK version 0.0.117.
+ */
+ struct LDKCOption_u64Z sender_intended_total_msat;
+ /**
+ * The fields in the onion which were received with each HTLC. Only fields which were
+ * identical in each HTLC involved in the payment will be included here.
+ *
+ * Payments received on LDK versions prior to 0.0.124 will have this field unset.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKRecipientOnionFields onion_fields;
+} LDKEvent_LDKPaymentClaimed_Body;
+
+typedef struct LDKEvent_LDKConnectionNeeded_Body {
+ /**
+ * The node id for the node needing a connection.
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * Sockets for connecting to the node.
+ */
+ struct LDKCVec_SocketAddressZ addresses;
+} LDKEvent_LDKConnectionNeeded_Body;
+
+typedef struct LDKEvent_LDKInvoiceReceived_Body {
+ /**
+ * The `payment_id` associated with payment for the invoice.
+ */
+ struct LDKThirtyTwoBytes payment_id;
+ /**
+ * The invoice to pay.
+ */
+ struct LDKBolt12Invoice invoice;
+ /**
+ * The context of the [`BlindedMessagePath`] used to send the invoice.
+ *
+ * [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath
+ */
+ struct LDKCOption_OffersContextZ context;
+ /**
+ * A responder for replying with an [`InvoiceError`] if needed.
+ *
+ * `None` if the invoice wasn't sent with a reply path.
+ *
+ * [`InvoiceError`]: crate::offers::invoice_error::InvoiceError
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKResponder responder;
+} LDKEvent_LDKInvoiceReceived_Body;
+
+typedef struct LDKEvent_LDKPaymentSent_Body {
+ /**
+ * The `payment_id` passed to [`ChannelManager::send_payment`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ */
+ struct LDKCOption_ThirtyTwoBytesZ payment_id;
+ /**
+ * The preimage to the hash given to ChannelManager::send_payment.
+ * Note that this serves as a payment receipt, if you wish to have such a thing, you must
+ * store it somehow!
+ */
+ struct LDKThirtyTwoBytes payment_preimage;
+ /**
+ * The hash that was given to [`ChannelManager::send_payment`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ */
+ struct LDKThirtyTwoBytes payment_hash;
+ /**
+ * The total fee which was spent at intermediate hops in this payment, across all paths.
+ *
+ * Note that, like [`Route::get_total_fees`] this does *not* include any potential
+ * overpayment to the recipient node.
+ *
+ * If the recipient or an intermediate node misbehaves and gives us free money, this may
+ * overstate the amount paid, though this is unlikely.
+ *
+ * This is only `None` for payments initiated on LDK versions prior to 0.0.103.
+ *
+ * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
+ */
+ struct LDKCOption_u64Z fee_paid_msat;
+} LDKEvent_LDKPaymentSent_Body;
+
+typedef struct LDKEvent_LDKPaymentFailed_Body {
+ /**
+ * The `payment_id` passed to [`ChannelManager::send_payment`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ */
+ struct LDKThirtyTwoBytes payment_id;
+ /**
+ * The hash that was given to [`ChannelManager::send_payment`]. `None` if the payment failed
+ * before receiving an invoice when paying a BOLT12 [`Offer`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ * [`Offer`]: crate::offers::offer::Offer
+ */
+ struct LDKCOption_ThirtyTwoBytesZ payment_hash;
+ /**
+ * The reason the payment failed. This is only `None` for events generated or serialized
+ * by versions prior to 0.0.115, or when downgrading to a version with a reason that was
+ * added after.
+ */
+ struct LDKCOption_PaymentFailureReasonZ reason;
+} LDKEvent_LDKPaymentFailed_Body;
+
+typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
+ /**
+ * The `payment_id` passed to [`ChannelManager::send_payment`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ */
+ struct LDKThirtyTwoBytes payment_id;
+ /**
+ * The hash that was given to [`ChannelManager::send_payment`].
+ *
+ * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ */
+ struct LDKCOption_ThirtyTwoBytesZ payment_hash;
+ /**
+ * The payment path that was successful.
+ *
+ * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
+ */
+ struct LDKPath path;
+} LDKEvent_LDKPaymentPathSuccessful_Body;
+
+typedef struct LDKEvent_LDKPaymentPathFailed_Body {
+ /**
+ * The `payment_id` passed to [`ChannelManager::send_payment`].
+ *
+ * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ */
+ struct LDKCOption_ThirtyTwoBytesZ payment_id;
+ /**
+ * The hash that was given to [`ChannelManager::send_payment`].
+ *
+ * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+ */
+ struct LDKThirtyTwoBytes payment_hash;
+ /**
+ * Indicates the payment was rejected for some reason by the recipient. This implies that
+ * the payment has failed, not just the route in question. If this is not set, the payment may
+ * be retried via a different route.
+ */
+ bool payment_failed_permanently;
+ /**
+ * Extra error details based on the failure type. May contain an update that needs to be
+ * applied to the [`NetworkGraph`].
+ *
+ * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
+ */
+ struct LDKPathFailure failure;
+ /**
+ * The payment path that failed.
+ */
+ struct LDKPath path;
+ /**
+ * The channel responsible for the failed payment path.
+ *
+ * Note that for route hints or for the first hop in a path this may be an SCID alias and
+ * may not refer to a channel in the public network graph. These aliases may also collide
+ * with channels in the public network graph.
+ *
+ * If this is `Some`, then the corresponding channel should be avoided when the payment is
+ * retried. May be `None` for older [`Event`] serializations.
+ */
+ struct LDKCOption_u64Z short_channel_id;
+} LDKEvent_LDKPaymentPathFailed_Body;
+
+typedef struct LDKEvent_LDKProbeSuccessful_Body {
+ /**
+ * The id returned by [`ChannelManager::send_probe`].
+ *
+ * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
+ */
+ struct LDKThirtyTwoBytes payment_id;
+ /**
+ * The hash generated by [`ChannelManager::send_probe`].
+ *
+ * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
+ */
+ struct LDKThirtyTwoBytes payment_hash;
+ /**
+ * The payment path that was successful.
+ */
+ struct LDKPath path;
+} LDKEvent_LDKProbeSuccessful_Body;
+
+typedef struct LDKEvent_LDKProbeFailed_Body {
+ /**
+ * The id returned by [`ChannelManager::send_probe`].
+ *
+ * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
+ */
+ struct LDKThirtyTwoBytes payment_id;
+ /**
+ * The hash generated by [`ChannelManager::send_probe`].
+ *
+ * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
+ */
+ struct LDKThirtyTwoBytes payment_hash;
+ /**
+ * The payment path that failed.
+ */
+ struct LDKPath path;
+ /**
+ * The channel responsible for the failed probe.
+ *
+ * Note that for route hints or for the first hop in a path this may be an SCID alias and
+ * may not refer to a channel in the public network graph. These aliases may also collide
+ * with channels in the public network graph.
+ */
+ struct LDKCOption_u64Z short_channel_id;
+} LDKEvent_LDKProbeFailed_Body;
+
+typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
+ /**
+ * The minimum amount of time that should be waited prior to calling
+ * process_pending_htlc_forwards. To increase the effort required to correlate payments,
+ * you should wait a random amount of time in roughly the range (now + time_forwardable,
+ * now + 5*time_forwardable).
+ */
+ uint64_t time_forwardable;
+} LDKEvent_LDKPendingHTLCsForwardable_Body;
+
+typedef struct LDKEvent_LDKHTLCIntercepted_Body {
+ /**
+ * An id to help LDK identify which HTLC is being forwarded or failed.
+ */
+ struct LDKThirtyTwoBytes intercept_id;
+ /**
+ * The fake scid that was programmed as the next hop's scid, generated using
+ * [`ChannelManager::get_intercept_scid`].
+ *
+ * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
+ */
+ uint64_t requested_next_hop_scid;
+ /**
+ * The payment hash used for this HTLC.
+ */
+ struct LDKThirtyTwoBytes payment_hash;
+ /**
+ * How many msats were received on the inbound edge of this HTLC.
+ */
+ uint64_t inbound_amount_msat;
+ /**
+ * How many msats the payer intended to route to the next node. Depending on the reason you are
+ * intercepting this payment, you might take a fee by forwarding less than this amount.
+ * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
+ *
+ * Note that LDK will NOT check that expected fees were factored into this value. You MUST
+ * check that whatever fee you want has been included here or subtract it as required. Further,
+ * LDK will not stop you from forwarding more than you received.
+ */
+ uint64_t expected_outbound_amount_msat;
+} LDKEvent_LDKHTLCIntercepted_Body;
+
+typedef struct LDKEvent_LDKSpendableOutputs_Body {
+ /**
+ * The outputs which you should store as spendable by you.
+ */
+ struct LDKCVec_SpendableOutputDescriptorZ outputs;
+ /**
+ * The `channel_id` indicating which channel the spendable outputs belong to.
+ *
+ * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKChannelId channel_id;
+} LDKEvent_LDKSpendableOutputs_Body;
+
+typedef struct LDKEvent_LDKPaymentForwarded_Body {
+ /**
+ * The channel id of the incoming channel between the previous node and us.
+ *
+ * This is only `None` for events generated or serialized by versions prior to 0.0.107.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKChannelId prev_channel_id;
+ /**
+ * The channel id of the outgoing channel between the next node and us.
+ *
+ * This is only `None` for events generated or serialized by versions prior to 0.0.107.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKChannelId next_channel_id;
+ /**
+ * The `user_channel_id` of the incoming channel between the previous node and us.
+ *
+ * This is only `None` for events generated or serialized by versions prior to 0.0.122.
+ */
+ struct LDKCOption_U128Z prev_user_channel_id;
+ /**
+ * The `user_channel_id` of the outgoing channel between the next node and us.
+ *
+ * This will be `None` if the payment was settled via an on-chain transaction. See the
+ * caveat described for the `total_fee_earned_msat` field. Moreover it will be `None` for
+ * events generated or serialized by versions prior to 0.0.122.
+ */
+ struct LDKCOption_U128Z next_user_channel_id;
+ /**
+ * The total fee, in milli-satoshis, which was earned as a result of the payment.
+ *
+ * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
+ * was pending, the amount the next hop claimed will have been rounded down to the nearest
+ * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
+ * claimed the full value in millisatoshis from the source. In this case,
+ * `claim_from_onchain_tx` will be set.
+ *
+ * If the channel which sent us the payment has been force-closed, we will claim the funds
+ * via an on-chain transaction. In that case we do not yet know the on-chain transaction
+ * fees which we will spend and will instead set this to `None`. It is possible duplicate
+ * `PaymentForwarded` events are generated for the same payment iff `total_fee_earned_msat` is
+ * `None`.
+ */
+ struct LDKCOption_u64Z total_fee_earned_msat;
+ /**
+ * The share of the total fee, in milli-satoshis, which was withheld in addition to the
+ * forwarding fee.
+ *
+ * This will only be `Some` if we forwarded an intercepted HTLC with less than the
+ * expected amount. This means our counterparty accepted to receive less than the invoice
+ * amount, e.g., by claiming the payment featuring a corresponding
+ * [`PaymentClaimable::counterparty_skimmed_fee_msat`].
+ *
+ * Will also always be `None` for events serialized with LDK prior to version 0.0.122.
+ *
+ * The caveat described above the `total_fee_earned_msat` field applies here as well.
+ *
+ * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: Self::PaymentClaimable::counterparty_skimmed_fee_msat
+ */
+ struct LDKCOption_u64Z skimmed_fee_msat;
+ /**
+ * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
+ * transaction.
+ */
+ bool claim_from_onchain_tx;
+ /**
+ * The final amount forwarded, in milli-satoshis, after the fee is deducted.
+ *
+ * The caveat described above the `total_fee_earned_msat` field applies here as well.
+ */
+ struct LDKCOption_u64Z outbound_amount_forwarded_msat;
+} LDKEvent_LDKPaymentForwarded_Body;
+
+typedef struct LDKEvent_LDKChannelPending_Body {
+ /**
+ * The `channel_id` of the channel that is pending confirmation.
+ */
+ struct LDKChannelId channel_id;
+ /**
+ * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
+ * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+ * `user_channel_id` will be randomized for an inbound channel.
+ *
+ * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ */
+ struct LDKU128 user_channel_id;
+ /**
+ * The `temporary_channel_id` this channel used to be known by during channel establishment.
+ *
+ * Will be `None` for channels created prior to LDK version 0.0.115.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKChannelId former_temporary_channel_id;
+ /**
+ * The `node_id` of the channel counterparty.
+ */
+ struct LDKPublicKey counterparty_node_id;
+ /**
+ * The outpoint of the channel's funding transaction.
+ */
+ struct LDKOutPoint funding_txo;
+ /**
+ * The features that this channel will operate with.
+ *
+ * Will be `None` for channels created prior to LDK version 0.0.122.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKChannelTypeFeatures channel_type;
+} LDKEvent_LDKChannelPending_Body;
+
+typedef struct LDKEvent_LDKChannelReady_Body {
+ /**
+ * The `channel_id` of the channel that is ready.
+ */
+ struct LDKChannelId channel_id;
+ /**
+ * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
+ * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+ * `user_channel_id` will be randomized for an inbound channel.
+ *
+ * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ */
+ struct LDKU128 user_channel_id;
+ /**
+ * The `node_id` of the channel counterparty.
+ */
+ struct LDKPublicKey counterparty_node_id;
+ /**
+ * The features that this channel will operate with.
+ */
+ struct LDKChannelTypeFeatures channel_type;
+} LDKEvent_LDKChannelReady_Body;
+
+typedef struct LDKEvent_LDKChannelClosed_Body {
+ /**
+ * The `channel_id` of the channel which has been closed. Note that on-chain transactions
+ * resolving the channel are likely still awaiting confirmation.
+ */
+ struct LDKChannelId channel_id;
+ /**
+ * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
+ * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+ * `user_channel_id` will be randomized for inbound channels.
+ * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
+ * zero for objects serialized with LDK versions prior to 0.0.102.
+ *
+ * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ */
+ struct LDKU128 user_channel_id;
+ /**
+ * The reason the channel was closed.
+ */
+ struct LDKClosureReason reason;
+ /**
+ * Counterparty in the closed channel.
+ *
+ * This field will be `None` for objects serialized prior to LDK 0.0.117.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKPublicKey counterparty_node_id;
+ /**
+ * Channel capacity of the closing channel (sats).
+ *
+ * This field will be `None` for objects serialized prior to LDK 0.0.117.
+ */
+ struct LDKCOption_u64Z channel_capacity_sats;
+ /**
+ * The original channel funding TXO; this helps checking for the existence and confirmation
+ * status of the closing tx.
+ * Note that for instances serialized in v0.0.119 or prior this will be missing (None).
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKOutPoint channel_funding_txo;
+} LDKEvent_LDKChannelClosed_Body;
+
+typedef struct LDKEvent_LDKDiscardFunding_Body {
+ /**
+ * The channel_id of the channel which has been closed.
+ */
+ struct LDKChannelId channel_id;
+ /**
+ * The full transaction received from the user
+ */
+ struct LDKFundingInfo funding_info;
+} LDKEvent_LDKDiscardFunding_Body;
+
+typedef struct LDKEvent_LDKOpenChannelRequest_Body {
+ /**
+ * The temporary channel ID of the channel requested to be opened.
+ *
+ * When responding to the request, the `temporary_channel_id` should be passed
+ * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
+ * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
+ *
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
+ */
+ struct LDKChannelId temporary_channel_id;
+ /**
+ * The node_id of the counterparty requesting to open the channel.
+ *
+ * When responding to the request, the `counterparty_node_id` should be passed
+ * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
+ * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
+ * request.
+ *
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
+ */
+ struct LDKPublicKey counterparty_node_id;
+ /**
+ * The channel value of the requested channel.
+ */
+ uint64_t funding_satoshis;
+ /**
+ * Our starting balance in the channel if the request is accepted, in milli-satoshi.
+ */
+ uint64_t push_msat;
+ /**
+ * The features that this channel will operate with. If you reject the channel, a
+ * well-behaved counterparty may automatically re-attempt the channel with a new set of
+ * feature flags.
+ *
+ * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
+ * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
+ * 0.0.106.
+ *
+ * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
+ * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
+ * 0.0.107. Channels setting this type also need to get manually accepted via
+ * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
+ * or will be rejected otherwise.
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ */
+ struct LDKChannelTypeFeatures channel_type;
+ /**
+ * True if this channel is (or will be) publicly-announced.
+ */
+ bool is_announced;
+ /**
+ * Channel parameters given by the counterparty.
+ */
+ struct LDKChannelParameters params;
+} LDKEvent_LDKOpenChannelRequest_Body;
+
+typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
+ /**
+ * The channel over which the HTLC was received.
+ */
+ struct LDKChannelId prev_channel_id;
+ /**
+ * Destination of the HTLC that failed to be processed.
+ */
+ struct LDKHTLCDestination failed_next_destination;
+} LDKEvent_LDKHTLCHandlingFailed_Body;
+
+typedef struct LDKEvent_LDKOnionMessageIntercepted_Body {
+ /**
+ * The node id of the offline peer.
+ */
+ struct LDKPublicKey peer_node_id;
+ /**
+ * The onion message intended to be forwarded to `peer_node_id`.
+ */
+ struct LDKOnionMessage message;
+} LDKEvent_LDKOnionMessageIntercepted_Body;
+
+typedef struct LDKEvent_LDKOnionMessagePeerConnected_Body {
+ /**
+ * The node id of the peer we just connected to, who advertises support for
+ * onion messages.
+ */
+ struct LDKPublicKey peer_node_id;
+} LDKEvent_LDKOnionMessagePeerConnected_Body;
+
+typedef struct MUST_USE_STRUCT LDKEvent {
+ LDKEvent_Tag tag;
+ union {
+ LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
+ LDKEvent_LDKFundingTxBroadcastSafe_Body funding_tx_broadcast_safe;
+ LDKEvent_LDKPaymentClaimable_Body payment_claimable;
+ LDKEvent_LDKPaymentClaimed_Body payment_claimed;
+ LDKEvent_LDKConnectionNeeded_Body connection_needed;
+ LDKEvent_LDKInvoiceReceived_Body invoice_received;
+ LDKEvent_LDKPaymentSent_Body payment_sent;
+ LDKEvent_LDKPaymentFailed_Body payment_failed;
+ LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
+ LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
+ LDKEvent_LDKProbeSuccessful_Body probe_successful;
+ LDKEvent_LDKProbeFailed_Body probe_failed;
+ LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
+ LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
+ LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
+ LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
+ LDKEvent_LDKChannelPending_Body channel_pending;
+ LDKEvent_LDKChannelReady_Body channel_ready;
+ LDKEvent_LDKChannelClosed_Body channel_closed;
+ LDKEvent_LDKDiscardFunding_Body discard_funding;
+ LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
+ LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
+ struct {
+ struct LDKBumpTransactionEvent bump_transaction;
+ };
+ LDKEvent_LDKOnionMessageIntercepted_Body onion_message_intercepted;
+ LDKEvent_LDKOnionMessagePeerConnected_Body onion_message_peer_connected;
+ };
+} LDKEvent;
+
+/**
+ * An enum which can either contain a crate::lightning::events::Event or not
+ */
+typedef enum LDKCOption_EventZ_Tag {
+ /**
+ * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
+ */
+ LDKCOption_EventZ_Some,
+ /**
+ * When we're in this state, this COption_EventZ contains nothing
+ */
+ LDKCOption_EventZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_EventZ_Sentinel,
+} LDKCOption_EventZ_Tag;
+
+typedef struct LDKCOption_EventZ {
+ LDKCOption_EventZ_Tag tag;
+ union {
+ struct {
+ struct LDKEvent some;
+ };
+ };
+} LDKCOption_EventZ;
+
+/**
+ * The contents of CResult_COption_EventZDecodeErrorZ
+ */
+typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKCOption_EventZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_COption_EventZDecodeErrorZPtr;
+
+/**
+ * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_COption_EventZDecodeErrorZ {
+ /**
+ * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_COption_EventZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_COption_EventZDecodeErrorZ;
+
+/**
+ * The contents of CResult_NonceDecodeErrorZ
+ */
+typedef union LDKCResult_NonceDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKNonce *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_NonceDecodeErrorZPtr;
+
+/**
+ * A CResult_NonceDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::nonce::Nonce on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_NonceDecodeErrorZ {
+ /**
+ * The contents of this CResult_NonceDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_NonceDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_NonceDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_NonceDecodeErrorZ;
+
+/**
+ * A dynamically-allocated array of crate::lightning_types::routing::RouteHintHops of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_RouteHintHopZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKRouteHintHop *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_RouteHintHopZ;
+
+/**
+ * Sub-errors which don't have specific information in them use this type.
+ */
+typedef struct LDKError {
+ /**
+ * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
+ */
+ uint8_t _dummy;
+} LDKError;
+
+/**
+ * Errors that indicate what is wrong with the invoice. They have some granularity for debug
+ * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
+ */
+typedef enum LDKBolt11ParseError_Tag {
+ LDKBolt11ParseError_Bech32Error,
+ LDKBolt11ParseError_ParseAmountError,
+ LDKBolt11ParseError_MalformedSignature,
+ LDKBolt11ParseError_BadPrefix,
+ LDKBolt11ParseError_UnknownCurrency,
+ LDKBolt11ParseError_UnknownSiPrefix,
+ LDKBolt11ParseError_MalformedHRP,
+ LDKBolt11ParseError_TooShortDataPart,
+ LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
+ LDKBolt11ParseError_DescriptionDecodeError,
+ LDKBolt11ParseError_PaddingError,
+ LDKBolt11ParseError_IntegerOverflowError,
+ LDKBolt11ParseError_InvalidSegWitProgramLength,
+ LDKBolt11ParseError_InvalidPubKeyHashLength,
+ LDKBolt11ParseError_InvalidScriptHashLength,
+ LDKBolt11ParseError_InvalidRecoveryId,
+ LDKBolt11ParseError_InvalidSliceLength,
+ /**
+ * Not an error, but used internally to signal that a part of the invoice should be ignored
+ * according to BOLT11
+ */
+ LDKBolt11ParseError_Skip,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKBolt11ParseError_Sentinel,
+} LDKBolt11ParseError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
+ LDKBolt11ParseError_Tag tag;
+ union {
+ struct {
+ struct LDKBech32Error bech32_error;
+ };
+ struct {
+ struct LDKError parse_amount_error;
+ };
+ struct {
+ enum LDKSecp256k1Error malformed_signature;
+ };
+ struct {
+ struct LDKError description_decode_error;
+ };
+ struct {
+ struct LDKStr invalid_slice_length;
+ };
+ };
+} LDKBolt11ParseError;
+
+/**
+ * The contents of CResult_SiPrefixBolt11ParseErrorZ
+ */
+typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ enum LDKSiPrefix *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKBolt11ParseError *err;
+} LDKCResult_SiPrefixBolt11ParseErrorZPtr;
+
+/**
+ * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
+ /**
+ * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
+ /**
+ * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_SiPrefixBolt11ParseErrorZ;
+
+
+
+/**
+ * Represents a syntactically and semantically correct lightning BOLT11 invoice.
+ *
+ * There are three ways to construct a `Bolt11Invoice`:
+ * 1. using [`InvoiceBuilder`]
+ * 2. using [`Bolt11Invoice::from_signed`]
+ * 3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
+ *
+ * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
+ */
+typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeBolt11Invoice *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKBolt11Invoice;
+
+/**
+ * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
+ * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
+ * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
+ */
+typedef enum LDKParseOrSemanticError_Tag {
+ /**
+ * The invoice couldn't be decoded
+ */
+ LDKParseOrSemanticError_ParseError,
+ /**
+ * The invoice could be decoded but violates the BOLT11 standard
+ */
+ LDKParseOrSemanticError_SemanticError,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKParseOrSemanticError_Sentinel,
+} LDKParseOrSemanticError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
+ LDKParseOrSemanticError_Tag tag;
+ union {
+ struct {
+ struct LDKBolt11ParseError parse_error;
+ };
+ struct {
+ enum LDKBolt11SemanticError semantic_error;
+ };
+ };
+} LDKParseOrSemanticError;
+
+/**
+ * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
+ */
+typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKBolt11Invoice *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKParseOrSemanticError *err;
+} LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
+
+/**
+ * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
+ /**
+ * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
+ /**
+ * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
+
+
+
+/**
+ * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
+ * invalid.
+ *
+ * # Invariants
+ * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
+ */
+typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeSignedRawBolt11Invoice *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKSignedRawBolt11Invoice;
+
+/**
+ * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
+ */
+typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKSignedRawBolt11Invoice *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKBolt11ParseError *err;
+} LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
+
+/**
+ * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
+ /**
+ * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
+ /**
+ * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
+
+
+
+/**
+ * Recoverable signature
+ */
+typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeBolt11InvoiceSignature *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKBolt11InvoiceSignature;
+
+/**
+ * A tuple of 3 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
+ /**
+ * The element at position 0
+ */
+ struct LDKRawBolt11Invoice a;
+ /**
+ * The element at position 1
+ */
+ struct LDKThirtyTwoBytes b;
+ /**
+ * The element at position 2
+ */
+ struct LDKBolt11InvoiceSignature c;
+} LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
+
+
+
+/**
+ * Payee public key
+ */
+typedef struct MUST_USE_STRUCT LDKPayeePubKey {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePayeePubKey *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPayeePubKey;
+
+/**
+ * The contents of CResult_PayeePubKeySecp256k1ErrorZ
+ */
+typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKPayeePubKey *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKSecp256k1Error *err;
+} LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
+
+/**
+ * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
+ /**
+ * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
+ /**
+ * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_PayeePubKeySecp256k1ErrorZ;
+
+
+
+/**
+ * Private routing information
+ *
+ * # Invariants
+ * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
+ *
+ */
+typedef struct MUST_USE_STRUCT LDKPrivateRoute {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePrivateRoute *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPrivateRoute;
+
+/**
+ * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_PrivateRouteZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKPrivateRoute *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_PrivateRouteZ;
+
+
+
+/**
+ * A timestamp that refers to a date after 1 January 1970.
+ *
+ * # Invariants
+ *
+ * The Unix timestamp representing the stored time has to be positive and no greater than
+ * [`MAX_TIMESTAMP`].
+ */
+typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePositiveTimestamp *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPositiveTimestamp;
+
+/**
+ * The contents of CResult_PositiveTimestampCreationErrorZ
+ */
+typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKPositiveTimestamp *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKCreationError *err;
+} LDKCResult_PositiveTimestampCreationErrorZPtr;
+
+/**
+ * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
+ /**
+ * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
+ /**
+ * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_PositiveTimestampCreationErrorZ;
+
+/**
+ * The contents of CResult_NoneBolt11SemanticErrorZ
+ */
+typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
+ /**
+ * Note that this value is always NULL, as there are no contents in the OK variant
+ */
+ void *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKBolt11SemanticError *err;
+} LDKCResult_NoneBolt11SemanticErrorZPtr;
+
+/**
+ * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
+ * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
+ /**
+ * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
+ /**
+ * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_NoneBolt11SemanticErrorZ;
+
+/**
+ * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
+ */
+typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKBolt11Invoice *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKBolt11SemanticError *err;
+} LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
+
+/**
+ * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
+ /**
+ * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
+ /**
+ * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
+
+
+
+/**
+ * Description string
+ *
+ * # Invariants
+ * The description can be at most 639 __bytes__ long
+ */
+typedef struct MUST_USE_STRUCT LDKDescription {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeDescription *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKDescription;
+
+/**
+ * The contents of CResult_DescriptionCreationErrorZ
+ */
+typedef union LDKCResult_DescriptionCreationErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKDescription *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKCreationError *err;
+} LDKCResult_DescriptionCreationErrorZPtr;
+
+/**
+ * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_DescriptionCreationErrorZ {
+ /**
+ * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_DescriptionCreationErrorZPtr contents;
+ /**
+ * Whether this CResult_DescriptionCreationErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_DescriptionCreationErrorZ;
+
+/**
+ * The contents of CResult_PrivateRouteCreationErrorZ
+ */
+typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKPrivateRoute *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ enum LDKCreationError *err;
+} LDKCResult_PrivateRouteCreationErrorZPtr;
+
+/**
+ * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PrivateRouteCreationErrorZ {
+ /**
+ * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_PrivateRouteCreationErrorZPtr contents;
+ /**
+ * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_PrivateRouteCreationErrorZ;
+
+/**
+ * The contents of CResult_OutPointDecodeErrorZ
+ */
+typedef union LDKCResult_OutPointDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKOutPoint *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_OutPointDecodeErrorZPtr;
+
+/**
+ * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OutPointDecodeErrorZ {
+ /**
+ * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_OutPointDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_OutPointDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_OutPointDecodeErrorZ;
+
+
+
+/**
+ * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
+ * variable-length integers except that it is serialized in big-endian instead of little-endian.
+ *
+ * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
+ * encoded in several different ways, which we must check for at deserialization-time. Thus, if
+ * you're looking for an example of a variable-length integer to use for your own project, move
+ * along, this is a rather poor design.
+ */
+typedef struct MUST_USE_STRUCT LDKBigSize {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeBigSize *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKBigSize;
+
+/**
+ * The contents of CResult_BigSizeDecodeErrorZ
+ */
+typedef union LDKCResult_BigSizeDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKBigSize *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_BigSizeDecodeErrorZPtr;
+
+/**
+ * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_BigSizeDecodeErrorZ {
+ /**
+ * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_BigSizeDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_BigSizeDecodeErrorZ;
+
+/**
+ * The contents of CResult_UntrustedStringDecodeErrorZ
+ */
+typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKUntrustedString *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_UntrustedStringDecodeErrorZPtr;
+
+/**
+ * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_types::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
+ /**
+ * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_UntrustedStringDecodeErrorZ;
+
+/**
+ * The contents of CResult_HostnameDecodeErrorZ
+ */
+typedef union LDKCResult_HostnameDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKHostname *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_HostnameDecodeErrorZPtr;
+
+/**
+ * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_HostnameDecodeErrorZ {
+ /**
+ * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_HostnameDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_HostnameDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_HostnameDecodeErrorZ;
+
+
+
+/**
+ * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
+ * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
+ *
+ * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
+ */
+typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeTransactionU16LenLimited *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKTransactionU16LenLimited;
+
+/**
+ * The contents of CResult_TransactionU16LenLimitedNoneZ
+ */
+typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTransactionU16LenLimited *result;
+ /**
+ * Note that this value is always NULL, as there are no contents in the Err variant
+ */
+ void *err;
+} LDKCResult_TransactionU16LenLimitedNoneZPtr;
+
+/**
+ * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
+ /**
+ * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
+ /**
+ * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TransactionU16LenLimitedNoneZ;
+
+/**
+ * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
+ */
+typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTransactionU16LenLimited *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
+
+/**
+ * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
+ /**
+ * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
+
+/**
+ * The contents of CResult_ChannelIdDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelIdDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKChannelId *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ChannelIdDecodeErrorZPtr;
+
+/**
+ * A CResult_ChannelIdDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::types::ChannelId on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ChannelIdDecodeErrorZ {
+ /**
+ * The contents of this CResult_ChannelIdDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ChannelIdDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ChannelIdDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ChannelIdDecodeErrorZ;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple__u832u16Z {
+ /**
+ * The element at position 0
+ */
+ struct LDKThirtyTwoBytes a;
+ /**
+ * The element at position 1
+ */
+ uint16_t b;
+} LDKC2Tuple__u832u16Z;
+
+
+
+/**
+ * Information needed to route a payment across a [`BlindedPaymentPath`].
+ */
+typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeBlindedPayInfo *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKBlindedPayInfo;
+
+/**
+ * The contents of CResult_BlindedPayInfoDecodeErrorZ
+ */
+typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKBlindedPayInfo *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_BlindedPayInfoDecodeErrorZPtr;
+
+/**
+ * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
+ /**
+ * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_BlindedPayInfoDecodeErrorZ;
+
+/**
+ * The contents of CResult_BlindedPaymentPathNoneZ
+ */
+typedef union LDKCResult_BlindedPaymentPathNoneZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKBlindedPaymentPath *result;
+ /**
+ * Note that this value is always NULL, as there are no contents in the Err variant
+ */
+ void *err;
+} LDKCResult_BlindedPaymentPathNoneZPtr;
+
+/**
+ * A CResult_BlindedPaymentPathNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::BlindedPaymentPath on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_BlindedPaymentPathNoneZ {
+ /**
+ * The contents of this CResult_BlindedPaymentPathNoneZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_BlindedPaymentPathNoneZPtr contents;
+ /**
+ * Whether this CResult_BlindedPaymentPathNoneZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_BlindedPaymentPathNoneZ;
+
+
+
+/**
+ * An intermediate node, its outbound channel, and relay parameters.
+ */
+typedef struct MUST_USE_STRUCT LDKPaymentForwardNode {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePaymentForwardNode *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPaymentForwardNode;
+
+/**
+ * A dynamically-allocated array of crate::lightning::blinded_path::payment::PaymentForwardNodes of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_PaymentForwardNodeZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKPaymentForwardNode *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_PaymentForwardNodeZ;
+
+
+
+/**
+ * Parameters for relaying over a given [`BlindedHop`].
+ *
+ * [`BlindedHop`]: crate::blinded_path::BlindedHop
+ */
+typedef struct MUST_USE_STRUCT LDKPaymentRelay {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePaymentRelay *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPaymentRelay;
+
+/**
+ * The contents of CResult_PaymentRelayDecodeErrorZ
+ */
+typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKPaymentRelay *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_PaymentRelayDecodeErrorZPtr;
+
+/**
+ * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
+ /**
+ * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_PaymentRelayDecodeErrorZ;
+
+
+
+/**
+ * Constraints for relaying over a given [`BlindedHop`].
+ *
+ * [`BlindedHop`]: crate::blinded_path::BlindedHop
+ */
+typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePaymentConstraints *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPaymentConstraints;
+
+/**
+ * The contents of CResult_PaymentConstraintsDecodeErrorZ
+ */
+typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKPaymentConstraints *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_PaymentConstraintsDecodeErrorZPtr;
+
+/**
+ * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
+ /**
+ * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_PaymentConstraintsDecodeErrorZ;
+
+/**
+ * The contents of CResult_PaymentContextDecodeErrorZ
+ */
+typedef union LDKCResult_PaymentContextDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKPaymentContext *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_PaymentContextDecodeErrorZPtr;
+
+/**
+ * A CResult_PaymentContextDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::PaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PaymentContextDecodeErrorZ {
+ /**
+ * The contents of this CResult_PaymentContextDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_PaymentContextDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_PaymentContextDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_PaymentContextDecodeErrorZ;
+
+/**
+ * The contents of CResult_UnknownPaymentContextDecodeErrorZ
+ */
+typedef union LDKCResult_UnknownPaymentContextDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKUnknownPaymentContext *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_UnknownPaymentContextDecodeErrorZPtr;
+
+/**
+ * A CResult_UnknownPaymentContextDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::UnknownPaymentContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_UnknownPaymentContextDecodeErrorZ {
+ /**
+ * The contents of this CResult_UnknownPaymentContextDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_UnknownPaymentContextDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_UnknownPaymentContextDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_UnknownPaymentContextDecodeErrorZ;
+
+/**
+ * The contents of CResult_Bolt12OfferContextDecodeErrorZ
+ */
+typedef union LDKCResult_Bolt12OfferContextDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKBolt12OfferContext *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_Bolt12OfferContextDecodeErrorZPtr;
+
+/**
+ * A CResult_Bolt12OfferContextDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::Bolt12OfferContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_Bolt12OfferContextDecodeErrorZ {
+ /**
+ * The contents of this CResult_Bolt12OfferContextDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_Bolt12OfferContextDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_Bolt12OfferContextDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_Bolt12OfferContextDecodeErrorZ;
+
+/**
+ * The contents of CResult_Bolt12RefundContextDecodeErrorZ
+ */
+typedef union LDKCResult_Bolt12RefundContextDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKBolt12RefundContext *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_Bolt12RefundContextDecodeErrorZPtr;
+
+/**
+ * A CResult_Bolt12RefundContextDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::payment::Bolt12RefundContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_Bolt12RefundContextDecodeErrorZ {
+ /**
+ * The contents of this CResult_Bolt12RefundContextDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_Bolt12RefundContextDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_Bolt12RefundContextDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_Bolt12RefundContextDecodeErrorZ;
+
+/**
+ * The contents of CResult_ResponderDecodeErrorZ
+ */
+typedef union LDKCResult_ResponderDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKResponder *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ResponderDecodeErrorZPtr;
+
+/**
+ * A CResult_ResponderDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::messenger::Responder on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ResponderDecodeErrorZ {
+ /**
+ * The contents of this CResult_ResponderDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ResponderDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ResponderDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ResponderDecodeErrorZ;
+
+/**
+ * An enum which can either contain a crate::lightning::blinded_path::message::MessageContext or not
+ */
+typedef enum LDKCOption_MessageContextZ_Tag {
+ /**
+ * When we're in this state, this COption_MessageContextZ contains a crate::lightning::blinded_path::message::MessageContext
+ */
+ LDKCOption_MessageContextZ_Some,
+ /**
+ * When we're in this state, this COption_MessageContextZ contains nothing
+ */
+ LDKCOption_MessageContextZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_MessageContextZ_Sentinel,
+} LDKCOption_MessageContextZ_Tag;
+
+typedef struct LDKCOption_MessageContextZ {
+ LDKCOption_MessageContextZ_Tag tag;
+ union {
+ struct {
+ struct LDKMessageContext some;
+ };
+ };
+} LDKCOption_MessageContextZ;
+
+/**
+ * A tuple of 3 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ {
+ /**
+ * The element at position 0
+ */
+ struct LDKPublicKey a;
+ /**
+ * The element at position 1
+ */
+ struct LDKOnionMessage b;
+ /**
+ * The element at position 2
+ */
+ struct LDKCOption_CVec_SocketAddressZZ c;
+} LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ;
+
+/**
+ * Errors that may occur when [sending an onion message].
+ *
+ * [sending an onion message]: OnionMessenger::send_onion_message
+ */
+typedef enum LDKSendError_Tag {
+ /**
+ * Errored computing onion message packet keys.
+ */
+ LDKSendError_Secp256k1,
+ /**
+ * Because implementations such as Eclair will drop onion messages where the message packet
+ * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
+ */
+ LDKSendError_TooBigPacket,
+ /**
+ * The provided [`Destination`] was an invalid [`BlindedMessagePath`] due to not having any
+ * blinded hops.
+ */
+ LDKSendError_TooFewBlindedHops,
+ /**
+ * The first hop is not a peer and doesn't have a known [`SocketAddress`].
+ */
+ LDKSendError_InvalidFirstHop,
+ /**
+ * Indicates that a path could not be found by the [`MessageRouter`].
+ *
+ * This occurs when either:
+ * - No path from the sender to the destination was found to send the onion message
+ * - No reply path to the sender could be created when responding to an onion message
+ */
+ LDKSendError_PathNotFound,
+ /**
+ * Onion message contents must have a TLV type >= 64.
+ */
+ LDKSendError_InvalidMessage,
+ /**
+ * Our next-hop peer's buffer was full or our total outbound buffer was full.
+ */
+ LDKSendError_BufferFull,
+ /**
+ * Failed to retrieve our node id from the provided [`NodeSigner`].
+ *
+ * [`NodeSigner`]: crate::sign::NodeSigner
+ */
+ LDKSendError_GetNodeIdFailed,
+ /**
+ * The provided [`Destination`] has a blinded path with an unresolved introduction node. An
+ * attempt to resolve it in the [`MessageRouter`] when finding an [`OnionMessagePath`] likely
+ * failed.
+ */
+ LDKSendError_UnresolvedIntroductionNode,
+ /**
+ * We attempted to send to a blinded path where we are the introduction node, and failed to
+ * advance the blinded path to make the second hop the new introduction node. Either
+ * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
+ * new blinding point, or we were attempting to send to ourselves.
+ */
+ LDKSendError_BlindedPathAdvanceFailed,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKSendError_Sentinel,
+} LDKSendError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKSendError {
+ LDKSendError_Tag tag;
+ union {
+ struct {
+ enum LDKSecp256k1Error secp256k1;
+ };
+ struct {
+ struct LDKPublicKey invalid_first_hop;
+ };
+ };
+} LDKSendError;
+
+/**
+ * The contents of CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ
+ */
+typedef union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKSendError *err;
+} LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr;
+
+/**
+ * A CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ {
+ /**
+ * The contents of this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr contents;
+ /**
+ * Whether this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ;
+
+/**
+ * The next hop to forward an onion message along its path.
+ *
+ * Note that payment blinded paths always specify their next hop using an explicit node id.
+ */
+typedef enum LDKNextMessageHop_Tag {
+ /**
+ * The node id of the next hop.
+ */
+ LDKNextMessageHop_NodeId,
+ /**
+ * The short channel id leading to the next hop.
+ */
+ LDKNextMessageHop_ShortChannelId,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKNextMessageHop_Sentinel,
+} LDKNextMessageHop_Tag;
+
+typedef struct MUST_USE_STRUCT LDKNextMessageHop {
+ LDKNextMessageHop_Tag tag;
+ union {
+ struct {
+ struct LDKPublicKey node_id;
+ };
+ struct {
+ uint64_t short_channel_id;
+ };
+ };
+} LDKNextMessageHop;
+
+/**
+ * The contents of an [`OnionMessage`] as read from the wire.
+ *
+ * [`OnionMessage`]: crate::ln::msgs::OnionMessage
+ */
+typedef enum LDKParsedOnionMessageContents_Tag {
+ /**
+ * A message related to BOLT 12 Offers.
+ */
+ LDKParsedOnionMessageContents_Offers,
+ /**
+ * A custom onion message specified by the user.
+ */
+ LDKParsedOnionMessageContents_Custom,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKParsedOnionMessageContents_Sentinel,
+} LDKParsedOnionMessageContents_Tag;
+
+typedef struct MUST_USE_STRUCT LDKParsedOnionMessageContents {
+ LDKParsedOnionMessageContents_Tag tag;
+ union {
+ struct {
+ struct LDKOffersMessage offers;
+ };
+ struct {
+ struct LDKOnionMessageContents custom;
+ };
+ };
+} LDKParsedOnionMessageContents;
+
+/**
+ * A processed incoming onion message, containing either a Forward (another onion message)
+ * or a Receive payload with decrypted contents.
+ */
+typedef enum LDKPeeledOnion_Tag {
+ /**
+ * Forwarded onion, with the next node id and a new onion
+ */
+ LDKPeeledOnion_Forward,
+ /**
+ * Received onion message, with decrypted contents, context, and reply path
+ */
+ LDKPeeledOnion_Receive,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKPeeledOnion_Sentinel,
+} LDKPeeledOnion_Tag;
+
+typedef struct LDKPeeledOnion_LDKForward_Body {
+ struct LDKNextMessageHop _0;
+ struct LDKOnionMessage _1;
+} LDKPeeledOnion_LDKForward_Body;
+
+typedef struct LDKPeeledOnion_LDKReceive_Body {
+ struct LDKParsedOnionMessageContents _0;
+ struct LDKCOption_MessageContextZ _1;
+ /**
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKBlindedMessagePath _2;
+} LDKPeeledOnion_LDKReceive_Body;
+
+typedef struct MUST_USE_STRUCT LDKPeeledOnion {
+ LDKPeeledOnion_Tag tag;
+ union {
+ LDKPeeledOnion_LDKForward_Body forward;
+ LDKPeeledOnion_LDKReceive_Body receive;
+ };
+} LDKPeeledOnion;
+
+/**
+ * The contents of CResult_PeeledOnionNoneZ
+ */
+typedef union LDKCResult_PeeledOnionNoneZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKPeeledOnion *result;
+ /**
+ * Note that this value is always NULL, as there are no contents in the Err variant
+ */
+ void *err;
+} LDKCResult_PeeledOnionNoneZPtr;
+
+/**
+ * A CResult_PeeledOnionNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::messenger::PeeledOnion on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PeeledOnionNoneZ {
+ /**
+ * The contents of this CResult_PeeledOnionNoneZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_PeeledOnionNoneZPtr contents;
+ /**
+ * Whether this CResult_PeeledOnionNoneZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_PeeledOnionNoneZ;
+
+/**
+ * Result of successfully [sending an onion message].
+ *
+ * [sending an onion message]: OnionMessenger::send_onion_message
+ */
+typedef enum LDKSendSuccess_Tag {
+ /**
+ * The message was buffered and will be sent once it is processed by
+ * [`OnionMessageHandler::next_onion_message_for_peer`].
+ */
+ LDKSendSuccess_Buffered,
+ /**
+ * The message was buffered and will be sent once the node is connected as a peer and it is
+ * processed by [`OnionMessageHandler::next_onion_message_for_peer`].
+ */
+ LDKSendSuccess_BufferedAwaitingConnection,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKSendSuccess_Sentinel,
+} LDKSendSuccess_Tag;
+
+typedef struct MUST_USE_STRUCT LDKSendSuccess {
+ LDKSendSuccess_Tag tag;
+ union {
+ struct {
+ struct LDKPublicKey buffered_awaiting_connection;
+ };
+ };
+} LDKSendSuccess;
+
+/**
+ * The contents of CResult_SendSuccessSendErrorZ
+ */
+typedef union LDKCResult_SendSuccessSendErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKSendSuccess *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKSendError *err;
+} LDKCResult_SendSuccessSendErrorZPtr;
+
+/**
+ * A CResult_SendSuccessSendErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::onion_message::messenger::SendSuccess on success and a crate::lightning::onion_message::messenger::SendError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_SendSuccessSendErrorZ {
+ /**
+ * The contents of this CResult_SendSuccessSendErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_SendSuccessSendErrorZPtr contents;
+ /**
+ * Whether this CResult_SendSuccessSendErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_SendSuccessSendErrorZ;
+
+/**
+ * The contents of CResult_NoneSendErrorZ
+ */
+typedef union LDKCResult_NoneSendErrorZPtr {
+ /**
+ * Note that this value is always NULL, as there are no contents in the OK variant
+ */
+ void *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKSendError *err;
+} LDKCResult_NoneSendErrorZPtr;
+
+/**
+ * A CResult_NoneSendErrorZ represents the result of a fallible operation,
+ * containing a () on success and a crate::lightning::onion_message::messenger::SendError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_NoneSendErrorZ {
+ /**
+ * The contents of this CResult_NoneSendErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_NoneSendErrorZPtr contents;
+ /**
+ * Whether this CResult_NoneSendErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_NoneSendErrorZ;
+
+/**
+ * The contents of CResult_BlindedHopDecodeErrorZ
+ */
+typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKBlindedHop *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_BlindedHopDecodeErrorZPtr;
+
+/**
+ * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_BlindedHopDecodeErrorZ {
+ /**
+ * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_BlindedHopDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_BlindedHopDecodeErrorZ;
+
+/**
+ * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_PhantomRouteHintsZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKPhantomRouteHints *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_PhantomRouteHintsZ;
+
+/**
+ * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
+ * may occur.
+ */
+typedef enum LDKSignOrCreationError_Tag {
+ /**
+ * An error occurred during signing
+ */
+ LDKSignOrCreationError_SignError,
+ /**
+ * An error occurred while building the transaction
+ */
+ LDKSignOrCreationError_CreationError,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKSignOrCreationError_Sentinel,
+} LDKSignOrCreationError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
+ LDKSignOrCreationError_Tag tag;
+ union {
+ struct {
+ enum LDKCreationError creation_error;
+ };
+ };
+} LDKSignOrCreationError;
+
+/**
+ * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
+ */
+typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKBolt11Invoice *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKSignOrCreationError *err;
+} LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
+
+/**
+ * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
+ /**
+ * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
+ /**
+ * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
+
+/**
+ * The contents of CResult_InvoiceErrorDecodeErrorZ
+ */
+typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKInvoiceError *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_InvoiceErrorDecodeErrorZPtr;
+
+/**
+ * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
+ /**
+ * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_InvoiceErrorDecodeErrorZ;
+
+
+
+/**
+ * The state of a spendable output currently tracked by an [`OutputSweeper`].
+ */
+typedef struct MUST_USE_STRUCT LDKTrackedSpendableOutput {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeTrackedSpendableOutput *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKTrackedSpendableOutput;
+
+/**
+ * The contents of CResult_TrackedSpendableOutputDecodeErrorZ
+ */
+typedef union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKTrackedSpendableOutput *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_TrackedSpendableOutputDecodeErrorZPtr;
+
+/**
+ * A CResult_TrackedSpendableOutputDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::sweep::TrackedSpendableOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_TrackedSpendableOutputDecodeErrorZ {
+ /**
+ * The contents of this CResult_TrackedSpendableOutputDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_TrackedSpendableOutputDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_TrackedSpendableOutputDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_TrackedSpendableOutputDecodeErrorZ;
+
+/**
+ * The current status of the output spend.
+ */
+typedef enum LDKOutputSpendStatus_Tag {
+ /**
+ * The output is tracked but an initial spending transaction hasn't been generated and
+ * broadcasted yet.
+ */
+ LDKOutputSpendStatus_PendingInitialBroadcast,
+ /**
+ * A transaction spending the output has been broadcasted but is pending its first confirmation on-chain.
+ */
+ LDKOutputSpendStatus_PendingFirstConfirmation,
+ /**
+ * A transaction spending the output has been confirmed on-chain but will be tracked until it
+ * reaches [`ANTI_REORG_DELAY`] confirmations.
+ */
+ LDKOutputSpendStatus_PendingThresholdConfirmations,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKOutputSpendStatus_Sentinel,
+} LDKOutputSpendStatus_Tag;
+
+typedef struct LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body {
+ /**
+ * The height at which we will first generate and broadcast a spending transaction.
+ */
+ struct LDKCOption_u32Z delayed_until_height;
+} LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body;
+
+typedef struct LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body {
+ /**
+ * The hash of the chain tip when we first broadcast a transaction spending this output.
+ */
+ struct LDKThirtyTwoBytes first_broadcast_hash;
+ /**
+ * The best height when we last broadcast a transaction spending this output.
+ */
+ uint32_t latest_broadcast_height;
+ /**
+ * The transaction spending this output we last broadcasted.
+ */
+ struct LDKTransaction latest_spending_tx;
+} LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body;
+
+typedef struct LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body {
+ /**
+ * The hash of the chain tip when we first broadcast a transaction spending this output.
+ */
+ struct LDKThirtyTwoBytes first_broadcast_hash;
+ /**
+ * The best height when we last broadcast a transaction spending this output.
+ */
+ uint32_t latest_broadcast_height;
+ /**
+ * The transaction spending this output we saw confirmed on-chain.
+ */
+ struct LDKTransaction latest_spending_tx;
+ /**
+ * The height at which the spending transaction was confirmed.
+ */
+ uint32_t confirmation_height;
+ /**
+ * The hash of the block in which the spending transaction was confirmed.
+ */
+ struct LDKThirtyTwoBytes confirmation_hash;
+} LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body;
+
+typedef struct MUST_USE_STRUCT LDKOutputSpendStatus {
+ LDKOutputSpendStatus_Tag tag;
+ union {
+ LDKOutputSpendStatus_LDKPendingInitialBroadcast_Body pending_initial_broadcast;
+ LDKOutputSpendStatus_LDKPendingFirstConfirmation_Body pending_first_confirmation;
+ LDKOutputSpendStatus_LDKPendingThresholdConfirmations_Body pending_threshold_confirmations;
+ };
+} LDKOutputSpendStatus;
+
+/**
+ * The contents of CResult_OutputSpendStatusDecodeErrorZ
+ */
+typedef union LDKCResult_OutputSpendStatusDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKOutputSpendStatus *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_OutputSpendStatusDecodeErrorZPtr;
+
+/**
+ * A CResult_OutputSpendStatusDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::sweep::OutputSpendStatus on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OutputSpendStatusDecodeErrorZ {
+ /**
+ * The contents of this CResult_OutputSpendStatusDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_OutputSpendStatusDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_OutputSpendStatusDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_OutputSpendStatusDecodeErrorZ;
+
+
+
+/**
+ * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
+ *
+ * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
+ * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
+ * [`Confirm::transactions_confirmed`].
+ *
+ * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
+ * may have been spent there. See [`Filter::register_output`] for details.
+ *
+ * Depending on your block source, you may need one or both of either [`Self::outpoint`] or
+ * [`Self::script_pubkey`].
+ *
+ * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
+ * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
+ */
+typedef struct MUST_USE_STRUCT LDKWatchedOutput {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeWatchedOutput *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKWatchedOutput;
+
+/**
+ * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
+ * channels.
+ *
+ * This is useful in order to have a [`Watch`] implementation convey to a chain source which
+ * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
+ * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
+ * receiving full blocks from a chain source, any further filtering is unnecessary.
+ *
+ * After an output has been registered, subsequent block retrievals from the chain source must not
+ * exclude any transactions matching the new criteria nor any in-block descendants of such
+ * transactions.
+ *
+ * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
+ * should not block on I/O. Implementations should instead queue the newly monitored data to be
+ * processed later. Then, in order to block until the data has been processed, any [`Watch`]
+ * invocation that has called the `Filter` must return [`InProgress`].
+ *
+ * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
+ * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
+ * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
+ */
+typedef struct LDKFilter {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
+ * a spending condition.
+ *
+ * This may be used, for example, to monitor for when a funding transaction confirms.
+ *
+ * The `script_pubkey` is provided for informational purposes and may be useful for block
+ * sources which only support filtering on scripts.
+ */
+ void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
+ /**
+ * Registers interest in spends of a transaction output.
+ *
+ * Note that this method might be called during processing of a new block. You therefore need
+ * to ensure that also dependent output spents within an already connected block are correctly
+ * handled, e.g., by re-scanning the block in question whenever new outputs have been
+ * registered mid-processing.
+ *
+ * This may be used, for example, to monitor for when a funding output is spent (by any
+ * transaction).
+ */
+ void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKFilter;
+
+/**
+ * An enum which can either contain a crate::lightning::chain::Filter or not
+ */
+typedef enum LDKCOption_FilterZ_Tag {
+ /**
+ * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
+ */
+ LDKCOption_FilterZ_Some,
+ /**
+ * When we're in this state, this COption_FilterZ contains nothing
+ */
+ LDKCOption_FilterZ_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKCOption_FilterZ_Sentinel,
+} LDKCOption_FilterZ_Tag;
+
+typedef struct LDKCOption_FilterZ {
+ LDKCOption_FilterZ_Tag tag;
+ union {
+ struct {
+ struct LDKFilter some;
+ };
+ };
+} LDKCOption_FilterZ;
+
+/**
+ * A dynamically-allocated array of crate::lightning::util::sweep::TrackedSpendableOutputs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_TrackedSpendableOutputZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKTrackedSpendableOutput *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_TrackedSpendableOutputZ;
+
+/**
+ * A helper trait that describes an on-chain wallet capable of returning a (change) destination
+ * script.
+ */
+typedef struct LDKChangeDestinationSource {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Returns a script pubkey which can be used as a change destination for
+ * [`OutputSpender::spend_spendable_outputs`].
+ *
+ * This method should return a different value each time it is called, to avoid linking
+ * on-chain funds controlled to the same user.
+ */
+ struct LDKCResult_CVec_u8ZNoneZ (*get_change_destination_script)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKChangeDestinationSource;
+
+/**
+ * Provides an interface that allows storage and retrieval of persisted values that are associated
+ * with given keys.
+ *
+ * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
+ * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
+ * ways, as long as per-namespace key uniqueness is asserted.
+ *
+ * Keys and namespaces are required to be valid ASCII strings in the range of
+ * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
+ * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
+ * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
+ * that concerns should always be separated by primary namespace first, before secondary
+ * namespaces are used. While the number of primary namespaces will be relatively small and is
+ * determined at compile time, there may be many secondary namespaces per primary namespace. Note
+ * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
+ * namespace, i.e., conflicts between keys and equally named
+ * primary namespaces/secondary namespaces must be avoided.
+ *
+ * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
+ * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
+ * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
+ */
+typedef struct LDKKVStore {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
+ * `key`.
+ *
+ * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
+ * `primary_namespace` and `secondary_namespace`.
+ *
+ * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
+ */
+ struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
+ /**
+ * Persists the given data under the given `key`.
+ *
+ * Will create the given `primary_namespace` and `secondary_namespace` if not already present
+ * in the store.
+ */
+ struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
+ /**
+ * Removes any data that had previously been persisted under the given `key`.
+ *
+ * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
+ * remove the given `key` at some point in time after the method returns, e.g., as part of an
+ * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
+ * [`KVStore::list`] might include the removed key until the changes are actually persisted.
+ *
+ * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
+ * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
+ * potentially get lost on crash after the method returns. Therefore, this flag should only be
+ * set for `remove` operations that can be safely replayed at a later time.
+ *
+ * Returns successfully if no data will be stored for the given `primary_namespace`,
+ * `secondary_namespace`, and `key`, independently of whether it was present before its
+ * invokation or not.
+ */
+ struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
+ /**
+ * Returns a list of keys that are stored under the given `secondary_namespace` in
+ * `primary_namespace`.
+ *
+ * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
+ * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
+ */
+ struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKKVStore;
+
+/**
+ * A trait that describes a wallet capable of creating a spending [`Transaction`] from a set of
+ * [`SpendableOutputDescriptor`]s.
+ */
+typedef struct LDKOutputSpender {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
+ * output to the given change destination (if sufficient change value remains). The
+ * transaction will have a feerate, at least, of the given value.
+ *
+ * The `locktime` argument is used to set the transaction's locktime. If `None`, the
+ * transaction will have a locktime of 0. It it recommended to set this to the current block
+ * height to avoid fee sniping, unless you have some specific reason to use a different
+ * locktime.
+ *
+ * Returns `Err(())` if the output value is greater than the input value minus required fee,
+ * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
+ * does not match the one we can spend.
+ */
+ struct LDKCResult_TransactionNoneZ (*spend_spendable_outputs)(const void *this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKOutputSpender;
+
+
+
+/**
+ * A utility that keeps track of [`SpendableOutputDescriptor`]s, persists them in a given
+ * [`KVStore`] and regularly retries sweeping them based on a callback given to the constructor
+ * methods.
+ *
+ * Users should call [`Self::track_spendable_outputs`] for any [`SpendableOutputDescriptor`]s received via [`Event::SpendableOutputs`].
+ *
+ * This needs to be notified of chain state changes either via its [`Listen`] or [`Confirm`]
+ * implementation and hence has to be connected with the utilized chain data sources.
+ *
+ * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users are
+ * required to give their chain data sources (i.e., [`Filter`] implementation) to the respective
+ * constructor.
+ *
+ * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
+ */
+typedef struct MUST_USE_STRUCT LDKOutputSweeper {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeOutputSweeper *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKOutputSweeper;
+
+/**
+ * The contents of CResult_OutputSweeperDecodeErrorZ
+ */
+typedef union LDKCResult_OutputSweeperDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKOutputSweeper *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_OutputSweeperDecodeErrorZPtr;
+
+/**
+ * A CResult_OutputSweeperDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::util::sweep::OutputSweeper on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OutputSweeperDecodeErrorZ {
+ /**
+ * The contents of this CResult_OutputSweeperDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_OutputSweeperDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_OutputSweeperDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_OutputSweeperDecodeErrorZ;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_BestBlockOutputSweeperZ {
+ /**
+ * The element at position 0
+ */
+ struct LDKBestBlock a;
+ /**
+ * The element at position 1
+ */
+ struct LDKOutputSweeper b;
+} LDKC2Tuple_BestBlockOutputSweeperZ;
+
+/**
+ * The contents of CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ
+ */
+typedef union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKC2Tuple_BestBlockOutputSweeperZ *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr;
+
+/**
+ * A CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::C2Tuple_BestBlockOutputSweeperZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ {
+ /**
+ * The contents of this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ;
+
+
+
+/**
+ * Base key used in conjunction with a `per_commitment_point` to generate a [`DelayedPaymentKey`].
+ *
+ * The delayed payment key is used to pay the commitment state broadcaster their
+ * non-HTLC-encumbered funds after a delay to give their counterparty a chance to punish if the
+ * state broadcasted was previously revoked.
+ */
+typedef struct MUST_USE_STRUCT LDKDelayedPaymentBasepoint {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeDelayedPaymentBasepoint *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKDelayedPaymentBasepoint;
+
+/**
+ * The contents of CResult_DelayedPaymentBasepointDecodeErrorZ
+ */
+typedef union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKDelayedPaymentBasepoint *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr;
+
+/**
+ * A CResult_DelayedPaymentBasepointDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::DelayedPaymentBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ {
+ /**
+ * The contents of this CResult_DelayedPaymentBasepointDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_DelayedPaymentBasepointDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_DelayedPaymentBasepointDecodeErrorZ;
+
+
+
+/**
+ * A derived key built from a [`DelayedPaymentBasepoint`] and `per_commitment_point`.
+ *
+ * The delayed payment key is used to pay the commitment state broadcaster their
+ * non-HTLC-encumbered funds after a delay. This delay gives their counterparty a chance to
+ * punish and claim all the channel funds if the state broadcasted was previously revoked.
+ *
+ * [See the BOLT specs]
+ * <https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation>
+ * for more information on key derivation details.
+ */
+typedef struct MUST_USE_STRUCT LDKDelayedPaymentKey {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeDelayedPaymentKey *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKDelayedPaymentKey;
+
+/**
+ * The contents of CResult_DelayedPaymentKeyDecodeErrorZ
+ */
+typedef union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKDelayedPaymentKey *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_DelayedPaymentKeyDecodeErrorZPtr;
+
+/**
+ * A CResult_DelayedPaymentKeyDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::DelayedPaymentKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_DelayedPaymentKeyDecodeErrorZ {
+ /**
+ * The contents of this CResult_DelayedPaymentKeyDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_DelayedPaymentKeyDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_DelayedPaymentKeyDecodeErrorZ;
+
+
+
+/**
+ * Base key used in conjunction with a `per_commitment_point` to generate an [`HtlcKey`].
+ *
+ * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
+ * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
+ * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
+ */
+typedef struct MUST_USE_STRUCT LDKHtlcBasepoint {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeHtlcBasepoint *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKHtlcBasepoint;
+
+/**
+ * The contents of CResult_HtlcBasepointDecodeErrorZ
+ */
+typedef union LDKCResult_HtlcBasepointDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKHtlcBasepoint *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_HtlcBasepointDecodeErrorZPtr;
+
+/**
+ * A CResult_HtlcBasepointDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::HtlcBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_HtlcBasepointDecodeErrorZ {
+ /**
+ * The contents of this CResult_HtlcBasepointDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_HtlcBasepointDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_HtlcBasepointDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_HtlcBasepointDecodeErrorZ;
+
+
+
+/**
+ * A derived key built from a [`HtlcBasepoint`] and `per_commitment_point`.
+ *
+ * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
+ * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
+ * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
+ *
+ * [See the BOLT specs]
+ * <https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation>
+ * for more information on key derivation details.
+ */
+typedef struct MUST_USE_STRUCT LDKHtlcKey {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeHtlcKey *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKHtlcKey;
+
+/**
+ * The contents of CResult_HtlcKeyDecodeErrorZ
+ */
+typedef union LDKCResult_HtlcKeyDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKHtlcKey *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_HtlcKeyDecodeErrorZPtr;
+
+/**
+ * A CResult_HtlcKeyDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::HtlcKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_HtlcKeyDecodeErrorZ {
+ /**
+ * The contents of this CResult_HtlcKeyDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_HtlcKeyDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_HtlcKeyDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_HtlcKeyDecodeErrorZ;
+
+
+
+/**
+ * Master key used in conjunction with per_commitment_point to generate [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
+ * A watcher can be given a [RevocationBasepoint] to generate per commitment [RevocationKey] to create justice transactions.
+ */
+typedef struct MUST_USE_STRUCT LDKRevocationBasepoint {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeRevocationBasepoint *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKRevocationBasepoint;
+
+/**
+ * The contents of CResult_RevocationBasepointDecodeErrorZ
+ */
+typedef union LDKCResult_RevocationBasepointDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKRevocationBasepoint *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_RevocationBasepointDecodeErrorZPtr;
+
+/**
+ * A CResult_RevocationBasepointDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::RevocationBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_RevocationBasepointDecodeErrorZ {
+ /**
+ * The contents of this CResult_RevocationBasepointDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_RevocationBasepointDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_RevocationBasepointDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_RevocationBasepointDecodeErrorZ;
+
+
+
+/**
+ * The revocation key is used to allow a channel party to revoke their state - giving their
+ * counterparty the required material to claim all of their funds if they broadcast that state.
+ *
+ * Each commitment transaction has a revocation key based on the basepoint and
+ * per_commitment_point which is used in both commitment and HTLC transactions.
+ *
+ * See [the BOLT spec for derivation details]
+ * <https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation>
+ */
+typedef struct MUST_USE_STRUCT LDKRevocationKey {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeRevocationKey *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKRevocationKey;
+
+/**
+ * The contents of CResult_RevocationKeyDecodeErrorZ
+ */
+typedef union LDKCResult_RevocationKeyDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKRevocationKey *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_RevocationKeyDecodeErrorZPtr;
+
+/**
+ * A CResult_RevocationKeyDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::channel_keys::RevocationKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_RevocationKeyDecodeErrorZ {
+ /**
+ * The contents of this CResult_RevocationKeyDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_RevocationKeyDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_RevocationKeyDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_RevocationKeyDecodeErrorZ;
+
+
+
+/**
+ * A read-only reference to a current ChannelMonitor.
+ *
+ * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
+ * released.
+ */
+typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeLockedChannelMonitor *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKLockedChannelMonitor;
+
+/**
+ * The contents of CResult_LockedChannelMonitorNoneZ
+ */
+typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKLockedChannelMonitor *result;
+ /**
+ * Note that this value is always NULL, as there are no contents in the Err variant
+ */
+ void *err;
+} LDKCResult_LockedChannelMonitorNoneZPtr;
+
+/**
+ * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_LockedChannelMonitorNoneZ {
+ /**
+ * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_LockedChannelMonitorNoneZPtr contents;
+ /**
+ * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_LockedChannelMonitorNoneZ;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_OutPointChannelIdZ {
+ /**
+ * The element at position 0
+ */
+ struct LDKOutPoint a;
+ /**
+ * The element at position 1
+ */
+ struct LDKChannelId b;
+} LDKC2Tuple_OutPointChannelIdZ;
+
+/**
+ * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointChannelIdZs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_C2Tuple_OutPointChannelIdZZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKC2Tuple_OutPointChannelIdZ *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_C2Tuple_OutPointChannelIdZZ;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_OutPointCVec_u64ZZ {
+ /**
+ * The element at position 0
+ */
+ struct LDKOutPoint a;
+ /**
+ * The element at position 1
+ */
+ struct LDKCVec_u64Z b;
+} LDKC2Tuple_OutPointCVec_u64ZZ;
+
+/**
+ * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_u64ZZs of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_C2Tuple_OutPointCVec_u64ZZZ {
+ /**
+ * The elements in the array.
+ * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+ */
+ struct LDKC2Tuple_OutPointCVec_u64ZZ *data;
+ /**
+ * The number of elements pointed to by `data`.
+ */
+ uintptr_t datalen;
+} LDKCVec_C2Tuple_OutPointCVec_u64ZZZ;
+
+/**
+ * The contents of CResult_BlindedMessagePathDecodeErrorZ
+ */
+typedef union LDKCResult_BlindedMessagePathDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKBlindedMessagePath *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_BlindedMessagePathDecodeErrorZPtr;
+
+/**
+ * A CResult_BlindedMessagePathDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::message::BlindedMessagePath on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_BlindedMessagePathDecodeErrorZ {
+ /**
+ * The contents of this CResult_BlindedMessagePathDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_BlindedMessagePathDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_BlindedMessagePathDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_BlindedMessagePathDecodeErrorZ;
+
+/**
+ * The contents of CResult_BlindedMessagePathNoneZ
+ */
+typedef union LDKCResult_BlindedMessagePathNoneZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKBlindedMessagePath *result;
+ /**
+ * Note that this value is always NULL, as there are no contents in the Err variant
+ */
+ void *err;
+} LDKCResult_BlindedMessagePathNoneZPtr;
+
+/**
+ * A CResult_BlindedMessagePathNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::message::BlindedMessagePath on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_BlindedMessagePathNoneZ {
+ /**
+ * The contents of this CResult_BlindedMessagePathNoneZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_BlindedMessagePathNoneZPtr contents;
+ /**
+ * Whether this CResult_BlindedMessagePathNoneZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_BlindedMessagePathNoneZ;
+
+/**
+ * The contents of CResult_MessageContextDecodeErrorZ
+ */
+typedef union LDKCResult_MessageContextDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKMessageContext *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_MessageContextDecodeErrorZPtr;
+
+/**
+ * A CResult_MessageContextDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::message::MessageContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_MessageContextDecodeErrorZ {
+ /**
+ * The contents of this CResult_MessageContextDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_MessageContextDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_MessageContextDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_MessageContextDecodeErrorZ;
+
+/**
+ * The contents of CResult_OffersContextDecodeErrorZ
+ */
+typedef union LDKCResult_OffersContextDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKOffersContext *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_OffersContextDecodeErrorZPtr;
+
+/**
+ * A CResult_OffersContextDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::blinded_path::message::OffersContext on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_OffersContextDecodeErrorZ {
+ /**
+ * The contents of this CResult_OffersContextDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_OffersContextDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_OffersContextDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_OffersContextDecodeErrorZ;
+
+/**
+ * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ */
+typedef struct LDKPersister {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ */
+ struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
+ /**
+ * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
+ */
+ struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
+ /**
+ * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
+ */
+ struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKPersister;
+
+
+
+/**
+ * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
+ * [`ChannelMonitorUpdate`]s.
+ *
+ * # Overview
+ *
+ * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
+ * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
+ * deleting) and complexity. This is because it writes channel monitor differential updates,
+ * whereas the other (default) implementation rewrites the entire monitor on each update. For
+ * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
+ * of megabytes (or more). Updates can be as small as a few hundred bytes.
+ *
+ * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
+ * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
+ * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
+ * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
+ * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
+ * sentinel bytes.
+ *
+ * # Storing monitors
+ *
+ * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
+ *
+ * - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
+ * - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
+ *
+ * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
+ * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
+ *
+ * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
+ *
+ * - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
+ * - secondary namespace: [the monitor's encoded outpoint name]
+ *
+ * Under that secondary namespace, each update is stored with a number string, like `21`, which
+ * represents its `update_id` value.
+ *
+ * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
+ *
+ * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
+ * - Index: `1`
+ *
+ * Full channel monitors would be stored at a single key:
+ *
+ * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
+ *
+ * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
+ *
+ * ```text
+ * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
+ * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
+ * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
+ * ```
+ * ... and so on.
+ *
+ * # Reading channel state from storage
+ *
+ * Channel state can be reconstructed by calling
+ * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
+ * list channel monitors themselves and load channels individually using
+ * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
+ *
+ * ## EXTREMELY IMPORTANT
+ *
+ * It is extremely important that your [`KVStore::read`] implementation uses the
+ * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
+ * that circumstance (not when there is really a permissions error, for example). This is because
+ * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
+ * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
+ * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
+ *
+ * # Pruning stale channel updates
+ *
+ * Stale updates are pruned when the consolidation threshold is reached according to `maximum_pending_updates`.
+ * Monitor updates in the range between the latest `update_id` and `update_id - maximum_pending_updates`
+ * are deleted.
+ * The `lazy` flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
+ * will complete. However, stale updates are not a problem for data integrity, since updates are
+ * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
+ *
+ * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
+ * would like to get rid of them, consider using the
+ * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
+ */
+typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeMonitorUpdatingPersister *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKMonitorUpdatingPersister;
+
+/**
+ * `Persist` defines behavior for persisting channel monitors: this could mean
+ * writing once to disk, and/or uploading to one or more backup services.
+ *
+ * Persistence can happen in one of two ways - synchronously completing before the trait method
+ * calls return or asynchronously in the background.
+ *
+ * # For those implementing synchronous persistence
+ *
+ * * If persistence completes fully (including any relevant `fsync()` calls), the implementation
+ * should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
+ * should continue.
+ *
+ * * If persistence fails for some reason, implementations should consider returning
+ * [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
+ * the background with [`ChainMonitor::list_pending_monitor_updates`] and
+ * [`ChainMonitor::get_monitor`].
+ *
+ * Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
+ * be marked as complete via [`ChainMonitor::channel_monitor_updated`].
+ *
+ * If at some point no further progress can be made towards persisting the pending updates, the
+ * node should simply shut down.
+ *
+ * * If the persistence has failed and cannot be retried further (e.g. because of an outage),
+ * [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
+ * an immediate panic and future operations in LDK generally failing.
+ *
+ * # For those implementing asynchronous persistence
+ *
+ * All calls should generally spawn a background task and immediately return
+ * [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
+ * [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
+ * [`ChannelMonitor::get_latest_update_id`] or [`ChannelMonitorUpdate::update_id`].
+ *
+ * Note that unlike the direct [`chain::Watch`] interface,
+ * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
+ *
+ * If at some point no further progress can be made towards persisting a pending update, the node
+ * should simply shut down. Until then, the background task should either loop indefinitely, or
+ * persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
+ * and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
+ * monitor updates may be marked completed).
+ *
+ * # Using remote watchtowers
+ *
+ * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
+ * update process described above while the watchtower is being updated. The following methods are
+ * provided for bulding transactions for a watchtower:
+ * [`ChannelMonitor::initial_counterparty_commitment_tx`],
+ * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
+ * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
+ * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
+ *
+ * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
+ * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
+ */
+typedef struct LDKPersist {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
+ * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
+ *
+ * The data can be stored any way you want, but the identifier provided by LDK is the
+ * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
+ * and the stored channel data). Note that you **must** persist every new monitor to disk.
+ *
+ * The [`ChannelMonitor::get_latest_update_id`] uniquely links this call to [`ChainMonitor::channel_monitor_updated`].
+ * For [`Persist::persist_new_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`]
+ * when you return [`ChannelMonitorUpdateStatus::InProgress`].
+ *
+ * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
+ * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`Writeable::write`]: crate::util::ser::Writeable::write
+ */
+ enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, const struct LDKChannelMonitor *NONNULL_PTR monitor);
+ /**
+ * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
+ * update.
+ *
+ * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
+ * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
+ * details.
+ *
+ * During blockchain synchronization operations, and in some rare cases, this may be called with
+ * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
+ * Note that after the full [`ChannelMonitor`] is persisted any previous
+ * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
+ * applied to the persisted [`ChannelMonitor`] as they were already applied.
+ *
+ * If an implementer chooses to persist the updates only, they need to make
+ * sure that all the updates are applied to the `ChannelMonitors` *before*
+ * the set of channel monitors is given to the `ChannelManager`
+ * deserialization routine. If there are any gaps in the persisted [`ChannelMonitorUpdate`]s,
+ * implementer can safely ignore [`ChannelMonitorUpdate`]s after the gap and load without them.
+ * See [`ChannelMonitor::update_monitor`] for
+ * applying a monitor update to a monitor. If full `ChannelMonitors` are
+ * persisted, then there is no need to persist individual updates.
+ *
+ * Note that there could be a performance tradeoff between persisting complete
+ * channel monitors on every update vs. persisting only updates and applying
+ * them in batches. The size of each monitor grows `O(number of state updates)`
+ * whereas updates are small and `O(1)`.
+ *
+ * The [`ChannelMonitorUpdate::update_id`] or [`ChannelMonitor::get_latest_update_id`] uniquely
+ * links this call to [`ChainMonitor::channel_monitor_updated`].
+ * For [`Persist::update_persisted_channel`], it is only necessary to call [`ChainMonitor::channel_monitor_updated`]
+ * when a [`ChannelMonitorUpdate`] is provided and when you return [`ChannelMonitorUpdateStatus::InProgress`].
+ *
+ * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
+ * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
+ * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
+ *
+ * [`Writeable::write`]: crate::util::ser::Writeable::write
+ *
+ * Note that monitor_update (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ enum LDKChannelMonitorUpdateStatus (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint, struct LDKChannelMonitorUpdate monitor_update, const struct LDKChannelMonitor *NONNULL_PTR monitor);
+ /**
+ * Prevents the channel monitor from being loaded on startup.
+ *
+ * Archiving the data in a backup location (rather than deleting it fully) is useful for
+ * hedging against data loss in case of unexpected failure.
+ */
+ void (*archive_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_funding_outpoint);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKPersist;
+
+/**
+ * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
+ * chain.
+ *
+ * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
+ * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
+ * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
+ * when needed.
+ *
+ * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
+ * entire header chain and only blocks with matching transaction data using BIP 157 filters or
+ * other similar filtering.
+ */
+typedef struct LDKListen {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Notifies the listener that a block was added at the given height, with the transaction data
+ * possibly filtered.
+ */
+ void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
+ /**
+ * Notifies the listener that a block was added at the given height.
+ */
+ void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
+ /**
+ * Notifies the listener that a block was removed at the given height.
+ */
+ void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKListen;
+
+/**
+ * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
+ * chain or unconfirmed during a chain reorganization.
+ *
+ * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
+ * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
+ * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
+ * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
+ * with reference to the confirmation status of the monitored objects.
+ *
+ * # Use
+ * The intended use is as follows:
+ * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
+ * outputs are, respectively, confirmed or spent on chain.
+ * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
+ * [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
+ * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
+ *
+ * # Order
+ *
+ * Clients must call these methods in chain order. Specifically:
+ * - Transactions which are confirmed in a particular block must be given before transactions
+ * confirmed in a later block.
+ * - Dependent transactions within the same block must be given in topological order, possibly in
+ * separate calls.
+ * - All unconfirmed transactions must be given after the original confirmations and before *any*
+ * reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
+ * never be interleaved, but always conduced *en bloc*.
+ * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
+ * in regard to the new block.
+ *
+ * See individual method documentation for further details.
+ *
+ * [`transactions_confirmed`]: Self::transactions_confirmed
+ * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
+ * [`best_block_updated`]: Self::best_block_updated
+ * [`get_relevant_txids`]: Self::get_relevant_txids
+ */
+typedef struct LDKConfirm {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Notifies LDK of transactions confirmed in a block with a given header and height.
+ *
+ * Must be called for any transactions registered by [`Filter::register_tx`] or any
+ * transactions spending an output registered by [`Filter::register_output`]. Such transactions
+ * appearing in the same block do not need to be included in the same call; instead, multiple
+ * calls with additional transactions may be made so long as they are made in [chain order].
+ *
+ * May be called before or after [`best_block_updated`] for the corresponding block. However,
+ * in the event of a chain reorganization, it must not be called with a `header` that is no
+ * longer in the chain as of the last call to [`best_block_updated`].
+ *
+ * [chain order]: Confirm#order
+ * [`best_block_updated`]: Self::best_block_updated
+ */
+ void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
+ /**
+ * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
+ *
+ * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
+ * reorganized out of the best chain or if it is no longer confirmed in the block with the
+ * given block hash. Once called, the given transaction will not be returned
+ * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
+ *
+ * [`get_relevant_txids`]: Self::get_relevant_txids
+ * [`transactions_confirmed`]: Self::transactions_confirmed
+ */
+ void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
+ /**
+ * Notifies LDK of an update to the best header connected at the given height.
+ *
+ * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
+ * blocks.
+ */
+ void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
+ /**
+ * Returns transactions that must be monitored for reorganization out of the chain along
+ * with the height and the hash of the block as part of which it had been previously confirmed.
+ *
+ * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
+ * 0.0.112 and prior, in which case you need to manually track previous confirmations.
+ *
+ * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
+ * confirmations to be safe from a chain reorganization. Will not include any transactions
+ * passed to [`transaction_unconfirmed`], unless later reconfirmed.
+ *
+ * Must be called to determine the subset of transactions that must be monitored for
+ * reorganization. Will be idempotent between calls but may change as a result of calls to the
+ * other interface methods. Thus, this is useful to determine which transactions must be
+ * given to [`transaction_unconfirmed`].
+ *
+ * If any of the returned transactions are confirmed in a block other than the one with the
+ * given hash at the given height, they need to be unconfirmed and reconfirmed via
+ * [`transaction_unconfirmed`] and [`transactions_confirmed`], respectively.
+ *
+ * [`transactions_confirmed`]: Self::transactions_confirmed
+ * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
+ */
+ struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKConfirm;
+
+/**
+ * A `enum` signalling to the [`OutputSweeper`] that it should delay spending an output until a
+ * future block height is reached.
+ */
+typedef enum LDKSpendingDelay_Tag {
+ /**
+ * A relative delay indicating we shouldn't spend the output before `cur_height + num_blocks`
+ * is reached.
+ */
+ LDKSpendingDelay_Relative,
+ /**
+ * An absolute delay indicating we shouldn't spend the output before `height` is reached.
+ */
+ LDKSpendingDelay_Absolute,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKSpendingDelay_Sentinel,
+} LDKSpendingDelay_Tag;
+
+typedef struct LDKSpendingDelay_LDKRelative_Body {
+ /**
+ * The number of blocks until we'll generate and broadcast the spending transaction.
+ */
+ uint32_t num_blocks;
+} LDKSpendingDelay_LDKRelative_Body;
+
+typedef struct LDKSpendingDelay_LDKAbsolute_Body {
+ /**
+ * The height at which we'll generate and broadcast the spending transaction.
+ */
+ uint32_t height;
+} LDKSpendingDelay_LDKAbsolute_Body;
+
+typedef struct MUST_USE_STRUCT LDKSpendingDelay {
+ LDKSpendingDelay_Tag tag;
+ union {
+ LDKSpendingDelay_LDKRelative_Body relative;
+ LDKSpendingDelay_LDKAbsolute_Body absolute;
+ };
+} LDKSpendingDelay;
+
+/**
+ * A callback which is called when a [`Future`] completes.
+ *
+ * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
+ * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
+ * instead.
+ *
+ * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
+ * futures when they receive a wake, rather than immediately executing them.
+ */
+typedef struct LDKFutureCallback {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * The method which is called.
+ */
+ void (*call)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKFutureCallback;
+
+
+
+/**
+ * A struct which can be used to select across many [`Future`]s at once without relying on a full
+ * async context.
+ */
+typedef struct MUST_USE_STRUCT LDKSleeper {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeSleeper *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKSleeper;
+
+
+
+/**
+ * Configuration we set when applicable.
+ *
+ * `Default::default()` provides sane defaults.
+ */
+typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelHandshakeConfig *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChannelHandshakeConfig;
+
+
+
+/**
+ * Optional channel limits which are applied during channel creation.
+ *
+ * These limits are only applied to our counterparty's limits, not our own.
+ *
+ * Use `0` or `<type>::max_value()` as appropriate to skip checking.
+ *
+ * Provides sane defaults for most configurations.
+ *
+ * Most additional limits are disabled except those with which specify a default in individual
+ * field documentation. Note that this may result in barely-usable channels, but since they
+ * are applied mostly only to incoming channels that's not much of a problem.
+ */
+typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelHandshakeLimits *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChannelHandshakeLimits;
+
+
+
+/**
+ * A parallel struct to [`ChannelConfig`] to define partial updates.
+ */
+typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelConfigUpdate *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChannelConfigUpdate;
+
+
+
+/**
+ * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
+ *
+ * `Default::default()` provides sane defaults for most configurations
+ * (but currently with zero relay fees!)
+ */
+typedef struct MUST_USE_STRUCT LDKUserConfig {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeUserConfig *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKUserConfig;
+
+
+
+/**
+ * An implementation of [`chain::Watch`] for monitoring channels.
+ *
+ * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
+ * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
+ * or used independently to monitor channels remotely. See the [module-level documentation] for
+ * details.
+ *
+ * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
+ * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
+ * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
+ * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
+ * environment with spotty connections, like on mobile.
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [module-level documentation]: crate::chain::chainmonitor
+ * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
+ */
+typedef struct MUST_USE_STRUCT LDKChainMonitor {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChainMonitor *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChainMonitor;
+
+/**
+ * A trait implemented for objects handling events from [`EventsProvider`].
+ *
+ * An async variation also exists for implementations of [`EventsProvider`] that support async
+ * event handling. The async event handler should satisfy the generic bounds: `F:
+ * core::future::Future<Output = Result<(), ReplayEvent>>, H: Fn(Event) -> F`.
+ */
+typedef struct LDKEventHandler {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Handles the given [`Event`].
+ *
+ * See [`EventsProvider`] for details that must be considered when implementing this method.
+ */
+ struct LDKCResult_NoneReplayEventZ (*handle_event)(const void *this_arg, struct LDKEvent event);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKEventHandler;
+
+/**
+ * A trait indicating an object may generate events.
+ *
+ * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
+ *
+ * Implementations of this trait may also feature an async version of event handling, as shown with
+ * [`ChannelManager::process_pending_events_async`] and
+ * [`ChainMonitor::process_pending_events_async`].
+ *
+ * # Requirements
+ *
+ * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
+ * event since the last invocation.
+ *
+ * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
+ * and replay any unhandled events on startup. An [`Event`] is considered handled when
+ * [`process_pending_events`] returns `Ok(())`, thus handlers MUST fully handle [`Event`]s and
+ * persist any relevant changes to disk *before* returning `Ok(())`. In case of an error (e.g.,
+ * persistence failure) implementors should return `Err(ReplayEvent())`, signalling to the
+ * [`EventsProvider`] to replay unhandled events on the next invocation (generally immediately).
+ * Note that some events might not be replayed, please refer to the documentation for
+ * the individual [`Event`] variants for more detail.
+ *
+ * Further, because an application may crash between an [`Event`] being handled and the
+ * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
+ * effect, [`Event`]s may be replayed.
+ *
+ * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
+ * consult the provider's documentation on the implication of processing events and how a handler
+ * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
+ * [`ChainMonitor::process_pending_events`]).
+ *
+ * (C-not implementable) As there is likely no reason for a user to implement this trait on their
+ * own type(s).
+ *
+ * [`process_pending_events`]: Self::process_pending_events
+ * [`handle_event`]: EventHandler::handle_event
+ * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
+ * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
+ * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
+ * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
+ */
+typedef struct LDKEventsProvider {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Processes any events generated since the last call using the given event handler.
+ *
+ * See the trait-level documentation for requirements.
+ */
+ void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKEventsProvider;
+
+/**
+ * This enum is used to specify which error data to send to peers when failing back an HTLC
+ * using [`ChannelManager::fail_htlc_backwards_with_reason`].
+ *
+ * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
+ */
+typedef enum LDKFailureCode_Tag {
+ /**
+ * We had a temporary error processing the payment. Useful if no other error codes fit
+ * and you want to indicate that the payer may want to retry.
+ */
+ LDKFailureCode_TemporaryNodeFailure,
+ /**
+ * We have a required feature which was not in this onion. For example, you may require
+ * some additional metadata that was not provided with this payment.
+ */
+ LDKFailureCode_RequiredNodeFeatureMissing,
+ /**
+ * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
+ * the HTLC is too close to the current block height for safe handling.
+ * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
+ * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
+ */
+ LDKFailureCode_IncorrectOrUnknownPaymentDetails,
+ /**
+ * We failed to process the payload after the onion was decrypted. You may wish to
+ * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
+ *
+ * If available, the tuple data may include the type number and byte offset in the
+ * decrypted byte stream where the failure occurred.
+ */
+ LDKFailureCode_InvalidOnionPayload,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKFailureCode_Sentinel,
+} LDKFailureCode_Tag;
+
+typedef struct MUST_USE_STRUCT LDKFailureCode {
+ LDKFailureCode_Tag tag;
+ union {
+ struct {
+ struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
+ };
+ };
+} LDKFailureCode;
+
+
+
+/**
+ * Chain-related parameters used to construct a new `ChannelManager`.
+ *
+ * Typically, the block-specific parameters are derived from the best block hash for the network,
+ * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
+ * are not needed when deserializing a previously constructed `ChannelManager`.
+ */
+typedef struct MUST_USE_STRUCT LDKChainParameters {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChainParameters *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChainParameters;
+
+/**
+ * A trait indicating an object may generate message send events
+ */
+typedef struct LDKMessageSendEventsProvider {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Gets the list of pending events which were generated by previous actions, clearing the list
+ * in the process.
+ */
+ struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKMessageSendEventsProvider;
+
+/**
+ * A trait to describe an object which can receive channel messages.
+ *
+ * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
+ * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
+ */
+typedef struct LDKChannelMessageHandler {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Handle an incoming `open_channel` message from the given peer.
+ */
+ void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `open_channel2` message from the given peer.
+ */
+ void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `accept_channel` message from the given peer.
+ */
+ void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `accept_channel2` message from the given peer.
+ */
+ void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `funding_created` message from the given peer.
+ */
+ void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `funding_signed` message from the given peer.
+ */
+ void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `channel_ready` message from the given peer.
+ */
+ void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `shutdown` message from the given peer.
+ */
+ void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `closing_signed` message from the given peer.
+ */
+ void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `stfu` message from the given peer.
+ */
+ void (*handle_stfu)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKStfu *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `tx_add_input message` from the given peer.
+ */
+ void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `tx_add_output` message from the given peer.
+ */
+ void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `tx_remove_input` message from the given peer.
+ */
+ void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `tx_remove_output` message from the given peer.
+ */
+ void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `tx_complete message` from the given peer.
+ */
+ void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `tx_signatures` message from the given peer.
+ */
+ void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `tx_init_rbf` message from the given peer.
+ */
+ void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `tx_ack_rbf` message from the given peer.
+ */
+ void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `tx_abort message` from the given peer.
+ */
+ void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `update_add_htlc` message from the given peer.
+ */
+ void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `update_fulfill_htlc` message from the given peer.
+ */
+ void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `update_fail_htlc` message from the given peer.
+ */
+ void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
+ */
+ void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `commitment_signed` message from the given peer.
+ */
+ void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `revoke_and_ack` message from the given peer.
+ */
+ void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `update_fee` message from the given peer.
+ */
+ void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `announcement_signatures` message from the given peer.
+ */
+ void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
+ /**
+ * Indicates a connection to the peer failed/an existing connection was lost.
+ */
+ void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
+ /**
+ * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
+ */
+ struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
+ /**
+ * Handle an incoming `channel_reestablish` message from the given peer.
+ */
+ void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `channel_update` message from the given peer.
+ */
+ void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `error` message from the given peer.
+ */
+ void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
+ /**
+ * Gets the node feature flags which this handler itself supports. All available handlers are
+ * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+ * which are broadcasted in our [`NodeAnnouncement`] message.
+ */
+ struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
+ /**
+ * Gets the init feature flags which should be sent to the given peer. All available handlers
+ * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+ * which are sent in our [`Init`] message.
+ *
+ * Note that this method is called before [`Self::peer_connected`].
+ */
+ struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
+ /**
+ * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
+ *
+ * If it's `None`, then no particular network chain hash compatibility will be enforced when
+ * connecting to peers.
+ */
+ struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_chain_hashes)(const void *this_arg);
+ /**
+ * Implementation of MessageSendEventsProvider for this object.
+ */
+ struct LDKMessageSendEventsProvider MessageSendEventsProvider;
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKChannelMessageHandler;
+
+/**
+ * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
+ *
+ * [`OnionMessage`]: crate::ln::msgs::OnionMessage
+ */
+typedef struct LDKOffersMessageHandler {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
+ * or replying with an error.
+ *
+ * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
+ *
+ * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
+ *
+ * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message, struct LDKCOption_OffersContextZ context, struct LDKResponder responder);
+ /**
+ * Releases any [`OffersMessage`]s that need to be sent.
+ *
+ * Typically, this is used for messages initiating a payment flow rather than in response to
+ * another message. The latter should use the return value of [`Self::handle_message`].
+ */
+ struct LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ (*release_pending_messages)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKOffersMessageHandler;
+
+/**
+ * A handler for an [`OnionMessage`] containing an async payments message as its payload.
+ *
+ * [`OnionMessage`]: crate::ln::msgs::OnionMessage
+ */
+typedef struct LDKAsyncPaymentsMessageHandler {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Handle a [`HeldHtlcAvailable`] message. A [`ReleaseHeldHtlc`] should be returned to release
+ * the held funds.
+ *
+ * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ (*held_htlc_available)(const void *this_arg, struct LDKHeldHtlcAvailable message, struct LDKResponder responder);
+ /**
+ * Handle a [`ReleaseHeldHtlc`] message. If authentication of the message succeeds, an HTLC
+ * should be released to the corresponding payee.
+ */
+ void (*release_held_htlc)(const void *this_arg, struct LDKReleaseHeldHtlc message);
+ /**
+ * Release any [`AsyncPaymentsMessage`]s that need to be sent.
+ *
+ * Typically, this is used for messages initiating an async payment flow rather than in response
+ * to another message.
+ */
+ struct LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ (*release_pending_messages)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKAsyncPaymentsMessageHandler;
+
+/**
+ * An interface for looking up the node id of a channel counterparty for the purpose of forwarding
+ * an [`OnionMessage`].
+ *
+ * [`OnionMessage`]: crate::ln::msgs::OnionMessage
+ */
+typedef struct LDKNodeIdLookUp {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Returns the node id of the forwarding node's channel counterparty with `short_channel_id`.
+ *
+ * Here, the forwarding node is referring to the node of the [`OnionMessenger`] parameterized
+ * by the [`NodeIdLookUp`] and the counterparty to one of that node's peers.
+ *
+ * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKPublicKey (*next_node_id)(const void *this_arg, uint64_t short_channel_id);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKNodeIdLookUp;
+
+
+
+/**
+ * Arguments for the creation of a ChannelManager that are not deserialized.
+ *
+ * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
+ * is:
+ * 1) Deserialize all stored [`ChannelMonitor`]s.
+ * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
+ * `<(BlockHash, ChannelManager)>::read(reader, args)`
+ * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
+ * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
+ * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
+ * same way you would handle a [`chain::Filter`] call using
+ * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
+ * 4) Reconnect blocks on your [`ChannelMonitor`]s.
+ * 5) Disconnect/connect blocks on the [`ChannelManager`].
+ * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
+ * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
+ * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
+ * the next step.
+ * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
+ * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
+ *
+ * Note that the ordering of #4-7 is not of importance, however all four must occur before you
+ * call any other methods on the newly-deserialized [`ChannelManager`].
+ *
+ * Note that because some channels may be closed during deserialization, it is critical that you
+ * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
+ * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
+ * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
+ * not force-close the same channels but consider them live), you may end up revoking a state for
+ * which you've already broadcasted the transaction.
+ *
+ * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
+ */
+typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeChannelManagerReadArgs *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKChannelManagerReadArgs;
+
+
+
+/**
+ * A set of keys that were HKDF-expanded from an initial call to
+ * [`NodeSigner::get_inbound_payment_key_material`].
+ *
+ * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
+ */
+typedef struct MUST_USE_STRUCT LDKExpandedKey {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeExpandedKey *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKExpandedKey;
+
+
+
+/**
+ * Contains fields that are both common to [`open_channel`] and `open_channel2` messages.
+ *
+ * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
+ */
+typedef struct MUST_USE_STRUCT LDKCommonOpenChannelFields {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeCommonOpenChannelFields *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKCommonOpenChannelFields;
+
+
+
+/**
+ * Contains fields that are both common to [`accept_channel`] and `accept_channel2` messages.
+ *
+ * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
+ */
+typedef struct MUST_USE_STRUCT LDKCommonAcceptChannelFields {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeCommonAcceptChannelFields *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKCommonAcceptChannelFields;
+
+
+
+/**
+ * Packet of hop data for next peer
+ */
+typedef struct MUST_USE_STRUCT LDKPacket {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePacket *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPacket;
+
+/**
+ * A trait to describe an object which can receive routing messages.
+ *
+ * # Implementor DoS Warnings
+ *
+ * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
+ * handling inbound queries. Implementors using an on-disk network graph should be aware of
+ * repeated disk I/O for queries accessing different parts of the network graph.
+ */
+typedef struct LDKRoutingMessageHandler {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
+ * `false` or returning an `Err` otherwise.
+ */
+ struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
+ /**
+ * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
+ * or returning an `Err` otherwise.
+ */
+ struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
+ /**
+ * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
+ * `false` or returning an `Err` otherwise.
+ */
+ struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
+ /**
+ * Gets channel announcements and updates required to dump our routing table to a remote node,
+ * starting at the `short_channel_id` indicated by `starting_point` and including announcements
+ * for a single channel.
+ */
+ struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
+ /**
+ * Gets a node announcement required to dump our routing table to a remote node, starting at
+ * the node *after* the provided pubkey and including up to one announcement immediately
+ * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
+ * If `None` is provided for `starting_point`, we start at the first node.
+ *
+ * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
+ /**
+ * Called when a connection is established with a peer. This can be used to
+ * perform routing table synchronization using a strategy defined by the
+ * implementor.
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
+ */
+ struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
+ /**
+ * Handles the reply of a query we initiated to learn about channels
+ * for a given range of blocks. We can expect to receive one or more
+ * replies to a single query.
+ */
+ struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
+ /**
+ * Handles the reply of a query we initiated asking for routing gossip
+ * messages for a list of channels. We should receive this message when
+ * a node has completed its best effort to send us the pertaining routing
+ * gossip messages.
+ */
+ struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
+ /**
+ * Handles when a peer asks us to send a list of `short_channel_id`s
+ * for the requested range of blocks.
+ */
+ struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
+ /**
+ * Handles when a peer asks us to send routing gossip messages for a
+ * list of `short_channel_id`s.
+ */
+ struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
+ /**
+ * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
+ * pending some async action. While there is no guarantee of the rate of future messages, the
+ * caller should seek to reduce the rate of new gossip messages handled, especially
+ * [`ChannelAnnouncement`]s.
+ */
+ bool (*processing_queue_high)(const void *this_arg);
+ /**
+ * Gets the node feature flags which this handler itself supports. All available handlers are
+ * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+ * which are broadcasted in our [`NodeAnnouncement`] message.
+ */
+ struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
+ /**
+ * Gets the init feature flags which should be sent to the given peer. All available handlers
+ * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+ * which are sent in our [`Init`] message.
+ *
+ * Note that this method is called before [`Self::peer_connected`].
+ */
+ struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
+ /**
+ * Implementation of MessageSendEventsProvider for this object.
+ */
+ struct LDKMessageSendEventsProvider MessageSendEventsProvider;
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKRoutingMessageHandler;
+
+/**
+ * A handler for received [`OnionMessage`]s and for providing generated ones to send.
+ */
+typedef struct LDKOnionMessageHandler {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Handle an incoming `onion_message` message from the given peer.
+ */
+ void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
+ /**
+ * Returns the next pending onion message for the peer with the given node id.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
+ /**
+ * Called when a connection is established with a peer. Can be used to track which peers
+ * advertise onion message support and are online.
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
+ */
+ struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
+ /**
+ * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
+ * drop and refuse to forward onion messages to this peer.
+ */
+ void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
+ /**
+ * Performs actions that should happen roughly every ten seconds after startup. Allows handlers
+ * to drop any buffered onion messages intended for prospective peers.
+ */
+ void (*timer_tick_occurred)(const void *this_arg);
+ /**
+ * Gets the node feature flags which this handler itself supports. All available handlers are
+ * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+ * which are broadcasted in our [`NodeAnnouncement`] message.
+ */
+ struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
+ /**
+ * Gets the init feature flags which should be sent to the given peer. All available handlers
+ * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+ * which are sent in our [`Init`] message.
+ *
+ * Note that this method is called before [`Self::peer_connected`].
+ */
+ struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKOnionMessageHandler;
+
+
+
+/**
+ * BOLT 4 onion packet including hop data for the next peer.
+ */
+typedef struct MUST_USE_STRUCT LDKTrampolineOnionPacket {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeTrampolineOnionPacket *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKTrampolineOnionPacket;
+
+/**
+ * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
+ * decoders.
+ */
+typedef struct LDKCustomMessageReader {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
+ * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
+ * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
+ * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
+ */
+ struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKCustomMessageReader;
+
+/**
+ * A handler provided to [`PeerManager`] for reading and handling custom messages.
+ *
+ * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
+ * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
+ * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
+ *
+ * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
+ * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
+ */
+typedef struct LDKCustomMessageHandler {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Handles the given message sent from `sender_node_id`, possibly producing messages for
+ * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
+ * to send.
+ */
+ struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
+ /**
+ * Returns the list of pending messages that were generated by the handler, clearing the list
+ * in the process. Each message is paired with the node id of the intended recipient. If no
+ * connection to the node exists, then the message is simply not sent.
+ */
+ struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
+ /**
+ * Indicates a peer disconnected.
+ */
+ void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
+ /**
+ * Handle a peer connecting.
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
+ */
+ struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
+ /**
+ * Gets the node feature flags which this handler itself supports. All available handlers are
+ * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+ * which are broadcasted in our [`NodeAnnouncement`] message.
+ *
+ * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
+ */
+ struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
+ /**
+ * Gets the init feature flags which should be sent to the given peer. All available handlers
+ * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+ * which are sent in our [`Init`] message.
+ *
+ * [`Init`]: crate::ln::msgs::Init
+ */
+ struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
+ /**
+ * Implementation of CustomMessageReader for this object.
+ */
+ struct LDKCustomMessageReader CustomMessageReader;
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKCustomMessageHandler;
+
+
+
+/**
+ * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
+ * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
+ */
+typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeIgnoringMessageHandler *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKIgnoringMessageHandler;
+
+/**
+ * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
+ * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
+ * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
+ * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
+ * message types.
+ *
+ * See [`OnionMessenger`] for example usage.
+ *
+ * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
+ * [`CustomMessage`]: Self::CustomMessage
+ */
+typedef struct LDKCustomOnionMessageHandler {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Called with the custom message that was received, returning a response to send, if any.
+ *
+ * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
+ *
+ * Note that responder (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ (*handle_custom_message)(const void *this_arg, struct LDKOnionMessageContents message, struct LDKCOption_CVec_u8ZZ context, struct LDKResponder responder);
+ /**
+ * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
+ * message type is unknown.
+ */
+ struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
+ /**
+ * Releases any [`Self::CustomMessage`]s that need to be sent.
+ *
+ * Typically, this is used for messages initiating a message flow rather than in response to
+ * another message. The latter should use the return value of [`Self::handle_custom_message`].
+ */
+ struct LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ (*release_pending_custom_messages)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKCustomOnionMessageHandler;
+
+
+
+/**
+ * A dummy struct which implements `ChannelMessageHandler` without having any channels.
+ * You can provide one of these as the route_handler in a MessageHandler.
+ */
+typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeErroringMessageHandler *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKErroringMessageHandler;
+
+
+
+/**
+ * Provides references to trait impls which handle different types of messages.
+ */
+typedef struct MUST_USE_STRUCT LDKMessageHandler {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeMessageHandler *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKMessageHandler;
+
+/**
+ * Provides an object which can be used to send data to and which uniquely identifies a connection
+ * to a remote host. You will need to be able to generate multiple of these which meet Eq and
+ * implement Hash to meet the PeerManager API.
+ *
+ * For efficiency, [`Clone`] should be relatively cheap for this type.
+ *
+ * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
+ * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
+ * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
+ * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
+ * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
+ * to simply use another value which is guaranteed to be globally unique instead.
+ */
+typedef struct LDKSocketDescriptor {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Attempts to send some data from the given slice to the peer.
+ *
+ * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
+ * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
+ * called and further write attempts may occur until that time.
+ *
+ * If the returned size is smaller than `data.len()`, a
+ * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
+ * written. Additionally, until a `send_data` event completes fully, no further
+ * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
+ * prevent denial-of-service issues, you should not read or buffer any data from the socket
+ * until then.
+ *
+ * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
+ * (indicating that read events should be paused to prevent DoS in the send buffer),
+ * `resume_read` may be set indicating that read events on this descriptor should resume. A
+ * `resume_read` of false carries no meaning, and should not cause any action.
+ */
+ uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
+ /**
+ * Disconnect the socket pointed to by this SocketDescriptor.
+ *
+ * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
+ * call (doing so is a noop).
+ */
+ void (*disconnect_socket)(void *this_arg);
+ /**
+ * Checks if two objects are equal given this object's this_arg pointer and another object.
+ */
+ bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
+ /**
+ * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
+ * This is used, for example, for inclusion of this object in a hash map.
+ */
+ uint64_t (*hash)(const void *this_arg);
+ /**
+ * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
+ * The new SocketDescriptor is provided, and should be mutated as needed to perform a
+ * deep copy of the object pointed to by this_arg or avoid any double-freeing.
+ */
+ void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKSocketDescriptor;
+
+
+
+/**
+ * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
+ * socket events into messages which it passes on to its [`MessageHandler`].
+ *
+ * Locks are taken internally, so you must never assume that reentrancy from a
+ * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
+ *
+ * Calls to [`read_event`] will decode relevant messages and pass them to the
+ * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
+ * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
+ * [`PeerManager`] functions related to the same connection must occur only in serial, making new
+ * calls only after previous ones have returned.
+ *
+ * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
+ * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
+ * essentially you should default to using a [`SimpleRefPeerManager`], and use a
+ * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
+ * you're using lightning-net-tokio.
+ *
+ * [`read_event`]: PeerManager::read_event
+ */
+typedef struct MUST_USE_STRUCT LDKPeerManager {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePeerManager *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPeerManager;
+
+/**
+ * Represents a valid secp256k1 secret key serialized as a 32 byte array.
+ */
+typedef struct LDKSecretKey {
+ /**
+ * The bytes of the secret key
+ */
+ uint8_t bytes[32];
+} LDKSecretKey;
+
+
+
+/**
+ * Static channel fields used to build transactions given per-commitment fields, organized by
+ * broadcaster/countersignatory.
+ *
+ * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
+ * as_holder_broadcastable and as_counterparty_broadcastable functions.
+ */
+typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeDirectedChannelTransactionParameters *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKDirectedChannelTransactionParameters;
+
+
+
+/**
+ * SHA-256 hash
+ */
+typedef struct MUST_USE_STRUCT LDKSha256 {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeSha256 *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKSha256;
+
+/**
+ * An error when attempting to pay a [`Bolt12Invoice`].
+ */
+typedef enum LDKBolt12PaymentError_Tag {
+ /**
+ * The invoice was not requested.
+ */
+ LDKBolt12PaymentError_UnexpectedInvoice,
+ /**
+ * Payment for an invoice with the corresponding [`PaymentId`] was already initiated.
+ */
+ LDKBolt12PaymentError_DuplicateInvoice,
+ /**
+ * The invoice was valid for the corresponding [`PaymentId`], but required unknown features.
+ */
+ LDKBolt12PaymentError_UnknownRequiredFeatures,
+ /**
+ * The invoice was valid for the corresponding [`PaymentId`], but sending the payment failed.
+ */
+ LDKBolt12PaymentError_SendingFailed,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKBolt12PaymentError_Sentinel,
+} LDKBolt12PaymentError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKBolt12PaymentError {
+ LDKBolt12PaymentError_Tag tag;
+ union {
+ struct {
+ enum LDKRetryableSendFailure sending_failed;
+ };
+ };
+} LDKBolt12PaymentError;
+
+
+
+/**
+ * Builds an [`Offer`] for the \"offer to be paid\" flow.
+ *
+ * See [module-level documentation] for usage.
+ *
+ * [module-level documentation]: self
+ */
+typedef struct MUST_USE_STRUCT LDKOfferWithExplicitMetadataBuilder {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeOfferWithExplicitMetadataBuilder *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKOfferWithExplicitMetadataBuilder;
+
+
+
+/**
+ * A string that displays only printable characters, replacing control characters with
+ * [`core::char::REPLACEMENT_CHARACTER`].
+ */
+typedef struct MUST_USE_STRUCT LDKPrintableString {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePrintableString *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPrintableString;
+
+
+
+/**
+ * Features used within an `offer`.
+ */
+typedef struct MUST_USE_STRUCT LDKOfferFeatures {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeOfferFeatures *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKOfferFeatures;
+
+/**
+ * Represents a tweaked X-only public key as required for BIP 340 (Taproot).
+ */
+typedef struct LDKTweakedPublicKey {
+ /**
+ * The bytes of the public key X coordinate
+ */
+ uint8_t x_coordinate[32];
+} LDKTweakedPublicKey;
+
+/**
+ * A function for signing an [`UnsignedBolt12Invoice`].
+ */
+typedef struct LDKSignBolt12InvoiceFn {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
+ */
+ struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR message);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKSignBolt12InvoiceFn;
+
+
+
+/**
+ * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
+ * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
+ *
+ * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
+ * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
+ */
+typedef struct MUST_USE_STRUCT LDKTaggedHash {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeTaggedHash *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKTaggedHash;
+
+
+
+/**
+ * Features used within an `invoice_request`.
+ */
+typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeInvoiceRequestFeatures *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKInvoiceRequestFeatures;
+
+
+
+/**
+ * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ */
+typedef struct MUST_USE_STRUCT LDKErroneousField {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeErroneousField *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKErroneousField;
+
+/**
+ * A function for signing an [`UnsignedInvoiceRequest`].
+ */
+typedef struct LDKSignInvoiceRequestFn {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
+ */
+ struct LDKCResult_SchnorrSignatureNoneZ (*sign_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR message);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKSignInvoiceRequestFn;
+
+/**
+ * Error when signing messages.
+ */
+typedef enum LDKSignError_Tag {
+ /**
+ * User-defined error when signing the message.
+ */
+ LDKSignError_Signing,
+ /**
+ * Error when verifying the produced signature using the given pubkey.
+ */
+ LDKSignError_Verification,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKSignError_Sentinel,
+} LDKSignError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKSignError {
+ LDKSignError_Tag tag;
+ union {
+ struct {
+ enum LDKSecp256k1Error verification;
+ };
+ };
+} LDKSignError;
+
+
+
+/**
+ * Receives and validates network updates from peers,
+ * stores authentic and relevant data as a network graph.
+ * This network graph is then used for routing payments.
+ * Provides interface to help with initial routing sync by
+ * serving historical announcements.
+ */
+typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeP2PGossipSync *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKP2PGossipSync;
+
+
+
+/**
+ * A read-only view of [`NetworkGraph`].
+ */
+typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeReadOnlyNetworkGraph *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKReadOnlyNetworkGraph;
+
+
+
+/**
+ * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
+ * source node to a target node.
+ */
+typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeDirectedChannelInfo *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKDirectedChannelInfo;
+
+/**
+ * The effective capacity of a channel for routing purposes.
+ *
+ * While this may be smaller than the actual channel capacity, amounts greater than
+ * [`Self::as_msat`] should not be routed through the channel.
+ */
+typedef enum LDKEffectiveCapacity_Tag {
+ /**
+ * The available liquidity in the channel known from being a channel counterparty, and thus a
+ * direct hop.
+ */
+ LDKEffectiveCapacity_ExactLiquidity,
+ /**
+ * The maximum HTLC amount in one direction as advertised on the gossip network.
+ */
+ LDKEffectiveCapacity_AdvertisedMaxHTLC,
+ /**
+ * The total capacity of the channel as determined by the funding transaction.
+ */
+ LDKEffectiveCapacity_Total,
+ /**
+ * A capacity sufficient to route any payment, typically used for private channels provided by
+ * an invoice.
+ */
+ LDKEffectiveCapacity_Infinite,
+ /**
+ * The maximum HTLC amount as provided by an invoice route hint.
+ */
+ LDKEffectiveCapacity_HintMaxHTLC,
+ /**
+ * A capacity that is unknown possibly because either the chain state is unavailable to know
+ * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
+ */
+ LDKEffectiveCapacity_Unknown,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKEffectiveCapacity_Sentinel,
+} LDKEffectiveCapacity_Tag;
+
+typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
+ /**
+ * Either the inbound or outbound liquidity depending on the direction, denominated in
+ * millisatoshi.
+ */
+ uint64_t liquidity_msat;
+} LDKEffectiveCapacity_LDKExactLiquidity_Body;
+
+typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
+ /**
+ * The maximum HTLC amount denominated in millisatoshi.
+ */
+ uint64_t amount_msat;
+} LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
+
+typedef struct LDKEffectiveCapacity_LDKTotal_Body {
+ /**
+ * The funding amount denominated in millisatoshi.
+ */
+ uint64_t capacity_msat;
+ /**
+ * The maximum HTLC amount denominated in millisatoshi.
+ */
+ uint64_t htlc_maximum_msat;
+} LDKEffectiveCapacity_LDKTotal_Body;
+
+typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
+ /**
+ * The maximum HTLC amount denominated in millisatoshi.
+ */
+ uint64_t amount_msat;
+} LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
+
+typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
+ LDKEffectiveCapacity_Tag tag;
+ union {
+ LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
+ LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
+ LDKEffectiveCapacity_LDKTotal_Body total;
+ LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
+ };
+} LDKEffectiveCapacity;
+
+
+
+/**
+ * A [`Router`] implemented using [`find_route`].
+ *
+ * # Privacy
+ *
+ * Implements [`MessageRouter`] by delegating to [`DefaultMessageRouter`]. See those docs for
+ * privacy implications.
+ */
+typedef struct MUST_USE_STRUCT LDKDefaultRouter {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeDefaultRouter *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKDefaultRouter;
+
+
+
+/**
+ * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
+ *
+ * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
+ * [`find_route`].
+ *
+ * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
+ */
+typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeScorerAccountingForInFlightHtlcs *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKScorerAccountingForInFlightHtlcs;
+
+/**
+ * The recipient of a payment, differing based on whether they've hidden their identity with route
+ * blinding.
+ */
+typedef enum LDKPayee_Tag {
+ /**
+ * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
+ * will be included in the final [`Route`].
+ */
+ LDKPayee_Blinded,
+ /**
+ * The recipient included these route hints in their BOLT11 invoice.
+ */
+ LDKPayee_Clear,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKPayee_Sentinel,
+} LDKPayee_Tag;
+
+typedef struct LDKPayee_LDKBlinded_Body {
+ /**
+ * Aggregated routing info and blinded paths, for routing to the payee without knowing their
+ * node id.
+ */
+ struct LDKCVec_BlindedPaymentPathZ route_hints;
+ /**
+ * Features supported by the payee.
+ *
+ * May be set from the payee's invoice. May be `None` if the invoice does not contain any
+ * features.
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKBolt12InvoiceFeatures features;
+} LDKPayee_LDKBlinded_Body;
+
+typedef struct LDKPayee_LDKClear_Body {
+ /**
+ * The node id of the payee.
+ */
+ struct LDKPublicKey node_id;
+ /**
+ * Hints for routing to the payee, containing channels connecting the payee to public nodes.
+ */
+ struct LDKCVec_RouteHintZ route_hints;
+ /**
+ * Features supported by the payee.
+ *
+ * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
+ * does not contain any features.
+ *
+ * [`for_keysend`]: PaymentParameters::for_keysend
+ *
+ * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ struct LDKBolt11InvoiceFeatures features;
+ /**
+ * The minimum CLTV delta at the end of the route. This value must not be zero.
+ */
+ uint32_t final_cltv_expiry_delta;
+} LDKPayee_LDKClear_Body;
+
+typedef struct MUST_USE_STRUCT LDKPayee {
+ LDKPayee_Tag tag;
+ union {
+ LDKPayee_LDKBlinded_Body blinded;
+ LDKPayee_LDKClear_Body clear;
+ };
+} LDKPayee;
+
+/**
+ * A trait which can both lookup and update routing channel penalty scores.
+ *
+ * This is used in places where both bounds are required and implemented for all types which
+ * implement [`ScoreLookUp`] and [`ScoreUpdate`].
+ *
+ * Bindings users may need to manually implement this for their custom scoring implementations.
+ */
+typedef struct LDKScore {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Implementation of ScoreLookUp for this object.
+ */
+ struct LDKScoreLookUp ScoreLookUp;
+ /**
+ * Implementation of ScoreUpdate for this object.
+ */
+ struct LDKScoreUpdate ScoreUpdate;
+ /**
+ * Serialize the object into a byte array
+ */
+ struct LDKCVec_u8Z (*write)(const void *this_arg);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKScore;
+
+
+
+/**
+ * A concrete implementation of [`LockableScore`] which supports multi-threading.
+ */
+typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeMultiThreadedLockableScore *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKMultiThreadedLockableScore;
+
+
+
+/**
+ * A locked `MultiThreadedLockableScore`.
+ */
+typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeMultiThreadedScoreLockRead *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKMultiThreadedScoreLockRead;
+
+
+
+/**
+ * A locked `MultiThreadedLockableScore`.
+ */
+typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeMultiThreadedScoreLockWrite *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKMultiThreadedScoreLockWrite;
+
+
+
+/**
+ * Parameters for configuring [`ProbabilisticScorer`].
+ *
+ * Used to configure decay parameters that are static throughout the lifetime of the scorer.
+ * these decay parameters affect the score of the channel penalty and are not changed on a
+ * per-route penalty cost call.
+ */
+typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeProbabilisticScoringDecayParameters *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKProbabilisticScoringDecayParameters;
+
+
+
+/**
+ * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
+ * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
+ *
+ * Your `node_id` is seed/0'.
+ * Unilateral closes may use seed/1'.
+ * Cooperative closes may use seed/2'.
+ * The two close keys may be needed to claim on-chain funds!
+ *
+ * This struct cannot be used for nodes that wish to support receiving phantom payments;
+ * [`PhantomKeysManager`] must be used instead.
+ *
+ * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
+ * previously issued invoices and attempts to pay previous invoices will fail.
+ */
+typedef struct MUST_USE_STRUCT LDKKeysManager {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeKeysManager *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKKeysManager;
+
+
+
+/**
+ * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
+ * payments.
+ *
+ * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
+ * paid to one of multiple nodes. This works because we encode the invoice route hints such that
+ * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
+ * itself without ever needing to forward to this fake node.
+ *
+ * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
+ * provide some fault tolerance, because payers will automatically retry paying other provided
+ * nodes in the case that one node goes down.
+ *
+ * Note that multi-path payments are not supported in phantom invoices for security reasons.
+ * Switching between this struct and [`KeysManager`] will invalidate any previously issued
+ * invoices and attempts to pay previous invoices will fail.
+ */
+typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativePhantomKeysManager *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKPhantomKeysManager;
+
+
+
+/**
+ * An implementation of [`EntropySource`] using ChaCha20.
+ */
+typedef struct MUST_USE_STRUCT LDKRandomBytes {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeRandomBytes *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKRandomBytes;
+
+
+
+/**
+ * A sender, receiver and forwarder of [`OnionMessage`]s.
+ *
+ * # Handling Messages
+ *
+ * `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
+ * messages to peers or delegating to the appropriate handler for the message type. Currently, the
+ * available handlers are:
+ * * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
+ * * [`CustomOnionMessageHandler`], for handling user-defined message types
+ *
+ * # Sending Messages
+ *
+ * [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
+ * a message, the matched handler may return a response message which `OnionMessenger` will send
+ * on its behalf.
+ *
+ * # Example
+ *
+ * ```
+ * # extern crate bitcoin;
+ * # use bitcoin::hashes::_export::_core::time::Duration;
+ * # use bitcoin::hex::FromHex;
+ * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self};
+ * # use lightning::blinded_path::EmptyNodeIdLookUp;
+ * # use lightning::blinded_path::message::{BlindedMessagePath, MessageForwardNode, MessageContext};
+ * # use lightning::sign::{EntropySource, KeysManager};
+ * # use lightning::ln::peer_handler::IgnoringMessageHandler;
+ * # use lightning::onion_message::messenger::{Destination, MessageRouter, MessageSendInstructions, OnionMessagePath, OnionMessenger};
+ * # use lightning::onion_message::packet::OnionMessageContents;
+ * # use lightning::util::logger::{Logger, Record};
+ * # use lightning::util::ser::{Writeable, Writer};
+ * # use lightning::io;
+ * # use std::sync::Arc;
+ * # struct FakeLogger;
+ * # impl Logger for FakeLogger {
+ * # fn log(&self, record: Record) { println!(\"{:?}\" , record); }
+ * # }
+ * # struct FakeMessageRouter {}
+ * # impl MessageRouter for FakeMessageRouter {
+ * # fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
+ * # let secp_ctx = Secp256k1::new();
+ * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
+ * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
+ * # let hop_node_id2 = hop_node_id1;
+ * # Ok(OnionMessagePath {
+ * # intermediate_nodes: vec![hop_node_id1, hop_node_id2],
+ * # destination,
+ * # first_node_addresses: None,
+ * # })
+ * # }
+ * # fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
+ * # &self, _recipient: PublicKey, _context: MessageContext, _peers: Vec<PublicKey>, _secp_ctx: &Secp256k1<T>
+ * # ) -> Result<Vec<BlindedMessagePath>, ()> {
+ * # unreachable!()
+ * # }
+ * # }
+ * # let seed = [42u8; 32];
+ * # let time = Duration::from_secs(123456);
+ * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
+ * # let logger = Arc::new(FakeLogger {});
+ * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
+ * # let secp_ctx = Secp256k1::new();
+ * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
+ * # let (hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1);
+ * # let destination_node_id = hop_node_id1;
+ * # let node_id_lookup = EmptyNodeIdLookUp {};
+ * # let message_router = Arc::new(FakeMessageRouter {});
+ * # let custom_message_handler = IgnoringMessageHandler {};
+ * # let offers_message_handler = IgnoringMessageHandler {};
+ * # let async_payments_message_handler = IgnoringMessageHandler {};
+ * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
+ * // ChannelManager.
+ * let onion_messenger = OnionMessenger::new(
+ * &keys_manager, &keys_manager, logger, &node_id_lookup, message_router,
+ * &offers_message_handler, &async_payments_message_handler, &custom_message_handler
+ * );
+ *
+ * # #[derive(Debug, Clone)]
+ * # struct YourCustomMessage {}
+ * impl Writeable for YourCustomMessage {
+ * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
+ * \t\t# Ok(())
+ * \t\t// Write your custom onion message to `w`
+ * \t}
+ * }
+ * impl OnionMessageContents for YourCustomMessage {
+ * \tfn tlv_type(&self) -> u64 {
+ * \t\t# let your_custom_message_type = 42;
+ * \t\tyour_custom_message_type
+ * \t}
+ * \tfn msg_type(&self) -> &'static str { \"YourCustomMessageType\" }
+ * }
+ * // Send a custom onion message to a node id.
+ * let destination = Destination::Node(destination_node_id);
+ * let instructions = MessageSendInstructions::WithoutReplyPath { destination };
+ * # let message = YourCustomMessage {};
+ * onion_messenger.send_onion_message(message, instructions);
+ *
+ * // Create a blinded path to yourself, for someone to send an onion message to.
+ * # let your_node_id = hop_node_id1;
+ * let hops = [
+ * \tMessageForwardNode { node_id: hop_node_id3, short_channel_id: None },
+ * \tMessageForwardNode { node_id: hop_node_id4, short_channel_id: None },
+ * ];
+ * let context = MessageContext::Custom(Vec::new());
+ * let blinded_path = BlindedMessagePath::new(&hops, your_node_id, context, &keys_manager, &secp_ctx).unwrap();
+ *
+ * // Send a custom onion message to a blinded path.
+ * let destination = Destination::BlindedPath(blinded_path);
+ * let instructions = MessageSendInstructions::WithoutReplyPath { destination };
+ * # let message = YourCustomMessage {};
+ * onion_messenger.send_onion_message(message, instructions);
+ * ```
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ */
+typedef struct MUST_USE_STRUCT LDKOnionMessenger {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeOnionMessenger *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKOnionMessenger;
+
+
+
+/**
+ * A [`MessageRouter`] that can only route to a directly connected [`Destination`].
+ *
+ * # Privacy
+ *
+ * Creating [`BlindedMessagePath`]s may affect privacy since, if a suitable path cannot be found,
+ * it will create a one-hop path using the recipient as the introduction node if it is a announced
+ * node. Otherwise, there is no way to find a path to the introduction node in order to send a
+ * message, and thus an `Err` is returned.
+ */
+typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeDefaultMessageRouter *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKDefaultMessageRouter;
+
+/**
+ * The unblinded node in a blinded path.
+ */
+typedef enum LDKIntroductionNode_Tag {
+ /**
+ * The node id of the introduction node.
+ */
+ LDKIntroductionNode_NodeId,
+ /**
+ * The short channel id of the channel leading to the introduction node. The [`Direction`]
+ * identifies which side of the channel is the introduction node.
+ */
+ LDKIntroductionNode_DirectedShortChannelId,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKIntroductionNode_Sentinel,
+} LDKIntroductionNode_Tag;
+
+typedef struct LDKIntroductionNode_LDKDirectedShortChannelId_Body {
+ enum LDKDirection _0;
+ uint64_t _1;
+} LDKIntroductionNode_LDKDirectedShortChannelId_Body;
+
+typedef struct MUST_USE_STRUCT LDKIntroductionNode {
+ LDKIntroductionNode_Tag tag;
+ union {
+ struct {
+ struct LDKPublicKey node_id;
+ };
+ LDKIntroductionNode_LDKDirectedShortChannelId_Body directed_short_channel_id;
+ };
+} LDKIntroductionNode;
+
+
+
+/**
+ * A [`NodeIdLookUp`] that always returns `None`.
+ */
+typedef struct MUST_USE_STRUCT LDKEmptyNodeIdLookUp {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeEmptyNodeIdLookUp *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKEmptyNodeIdLookUp;
+
+
+
+/**
+ * Data to construct a [`BlindedHop`] for forwarding a payment.
+ */
+typedef struct MUST_USE_STRUCT LDKForwardTlvs {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeForwardTlvs *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKForwardTlvs;
+
+/**
+ * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
+ * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
+ * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
+ * which can provide a default implementation of this trait when used with [`Wallet`].
+ */
+typedef struct LDKCoinSelectionSource {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
+ * available to spend. Implementations are free to pick their coin selection algorithm of
+ * choice, as long as the following requirements are met:
+ *
+ * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
+ * throughout coin selection, but must not be returned as part of the result.
+ * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
+ * throughout coin selection. In some cases, like when funding an anchor transaction, this
+ * set is empty. Implementations should ensure they handle this correctly on their end,
+ * e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
+ * provided, in which case a zero-value empty OP_RETURN output can be used instead.
+ * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
+ * inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
+ *
+ * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
+ * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
+ * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
+ * delaying block inclusion.
+ *
+ * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
+ * can be re-used within new fee-bumped iterations of the original claiming transaction,
+ * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
+ * transaction associated with it, and all of the available UTXOs have already been assigned to
+ * other claims, implementations must be willing to double spend their UTXOs. The choice of
+ * which UTXOs to double spend is left to the implementation, but it must strive to keep the
+ * set of other claims being double spent to a minimum.
+ */
+ struct LDKCResult_CoinSelectionNoneZ (*select_confirmed_utxos)(const void *this_arg, struct LDKThirtyTwoBytes claim_id, struct LDKCVec_InputZ must_spend, struct LDKCVec_TxOutZ must_pay_to, uint32_t target_feerate_sat_per_1000_weight);
+ /**
+ * Signs and provides the full witness for all inputs within the transaction known to the
+ * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
+ *
+ * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
+ * unsigned transaction and then sign it with your wallet.
+ */
+ struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKCoinSelectionSource;
+
+/**
+ * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
+ * provide a default implementation to [`CoinSelectionSource`].
+ */
+typedef struct LDKWalletSource {
+ /**
+ * An opaque pointer which is passed to your function implementations as an argument.
+ * This has no meaning in the LDK, and can be NULL or any other value.
+ */
+ void *this_arg;
+ /**
+ * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
+ */
+ struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
+ /**
+ * Returns a script to use for change above dust resulting from a successful coin selection
+ * attempt.
+ */
+ struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
+ /**
+ * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
+ * the transaction known to the wallet (i.e., any provided via
+ * [`WalletSource::list_confirmed_utxos`]).
+ *
+ * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
+ * unsigned transaction and then sign it with your wallet.
+ */
+ struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
+ /**
+ * Frees any resources associated with this object given its this_arg pointer.
+ * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+ */
+ void (*free)(void *this_arg);
+} LDKWalletSource;
+
+
+
+/**
+ * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
+ * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
+ * spends may happen.
+ */
+typedef struct MUST_USE_STRUCT LDKWallet {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeWallet *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKWallet;
+
+
+
+/**
+ * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
+ * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
+ * Replace-By-Fee (RBF).
+ *
+ * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
+ */
+typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeBumpTransactionEventHandler *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKBumpTransactionEventHandler;
+
+
+
+/**
+ * A [`KVStore`] implementation that writes to and reads from the file system.
+ */
+typedef struct MUST_USE_STRUCT LDKFilesystemStore {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeFilesystemStore *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKFilesystemStore;
+
+
+
+/**
+ * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
+ * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
+ * responsibilities are:
+ * * Processing [`Event`]s with a user-provided [`EventHandler`].
+ * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
+ * writing it to disk/backups by invoking the callback given to it at startup.
+ * [`ChannelManager`] persistence should be done in the background.
+ * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
+ * and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
+ * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
+ * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
+ *
+ * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
+ * upon as doing so may result in high latency.
+ *
+ * # Note
+ *
+ * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
+ * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
+ * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
+ * unilateral chain closure fees are at risk.
+ *
+ * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
+ * [`ChannelManager::timer_tick_occurred`]: lightning::ln::channelmanager::ChannelManager::timer_tick_occurred
+ * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
+ * [`Event`]: lightning::events::Event
+ * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
+ * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
+ *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
+ */
+typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeBackgroundProcessor *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKBackgroundProcessor;
+
+
+
+/**
+ * The main Rapid Gossip Sync object.
+ *
+ * See [crate-level documentation] for usage.
+ *
+ * [crate-level documentation]: crate
+ */
+typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeRapidGossipSync *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKRapidGossipSync;
+
+/**
+ * Either [`P2PGossipSync`] or [`RapidGossipSync`].
+ */
+typedef enum LDKGossipSync_Tag {
+ /**
+ * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
+ */
+ LDKGossipSync_P2P,
+ /**
+ * Rapid gossip sync from a trusted server.
+ */
+ LDKGossipSync_Rapid,
+ /**
+ * No gossip sync.
+ */
+ LDKGossipSync_None,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKGossipSync_Sentinel,
+} LDKGossipSync_Tag;
+
+typedef struct MUST_USE_STRUCT LDKGossipSync {
+ LDKGossipSync_Tag tag;
+ union {
+ struct {
+ /**
+ * Note that this field is expected to be a reference.
+ */
+ struct LDKP2PGossipSync p2p;
+ };
+ struct {
+ /**
+ * Note that this field is expected to be a reference.
+ */
+ struct LDKRapidGossipSync rapid;
+ };
+ };
+} LDKGossipSync;
+
+
+
+/**
+ * Data of the [`RawBolt11Invoice`] that is encoded in the data part
+ */
+typedef struct MUST_USE_STRUCT LDKRawDataPart {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeRawDataPart *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKRawDataPart;
+
+
+
+/**
+ * Positive duration that defines when (relatively to the timestamp) in the future the invoice
+ * expires
+ */
+typedef struct MUST_USE_STRUCT LDKExpiryTime {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeExpiryTime *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKExpiryTime;
+
+
+
+/**
+ * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
+ */
+typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeMinFinalCltvExpiryDelta *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKMinFinalCltvExpiryDelta;
+
+/**
+ * A 20-byte byte array.
+ */
+typedef struct LDKTwentyBytes {
+ /**
+ * The twenty bytes
+ */
+ uint8_t data[20];
+} LDKTwentyBytes;
+
+/**
+ * Fallback address in case no LN payment is possible
+ */
+typedef enum LDKFallback_Tag {
+ LDKFallback_SegWitProgram,
+ LDKFallback_PubKeyHash,
+ LDKFallback_ScriptHash,
+ /**
+ * Must be last for serialization purposes
+ */
+ LDKFallback_Sentinel,
+} LDKFallback_Tag;
+
+typedef struct LDKFallback_LDKSegWitProgram_Body {
+ struct LDKWitnessVersion version;
+ struct LDKCVec_u8Z program;
+} LDKFallback_LDKSegWitProgram_Body;
+
+typedef struct MUST_USE_STRUCT LDKFallback {
+ LDKFallback_Tag tag;
+ union {
+ LDKFallback_LDKSegWitProgram_Body seg_wit_program;
+ struct {
+ struct LDKTwentyBytes pub_key_hash;
+ };
+ struct {
+ struct LDKTwentyBytes script_hash;
+ };
+ };
+} LDKFallback;
+
+extern const uintptr_t MAX_BUF_SIZE;
+
+extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
+
+extern const uint64_t MAX_SCID_BLOCK;
+
+extern const uint64_t MAX_SCID_TX_INDEX;
+
+extern const uint64_t MAX_SCID_VOUT_INDEX;
+
+extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
+
+extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
+
+extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
+
+extern const uint32_t ANTI_REORG_DELAY;
+
+extern const uint16_t BREAKDOWN_TIMEOUT;
+
+extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
+
+extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
+
+extern const uint16_t MAX_HTLCS;
+
+extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
+
+extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
+
+extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
+
+extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
+
+extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
+
+extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
+
+extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
+
+extern const uintptr_t PAYER_NOTE_LIMIT;
+
+extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
+
+extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
+
+extern const uint8_t DEFAULT_MAX_PATH_COUNT;
+
+extern const uint8_t MAX_PATH_LENGTH_ESTIMATE;
+
+extern const uint64_t MAX_TIMESTAMP;
+
+extern const uint64_t DEFAULT_EXPIRY_TIME;
+
+extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
+
+extern const uint8_t TAG_PAYMENT_HASH;
+
+extern const uint8_t TAG_DESCRIPTION;
+
+extern const uint8_t TAG_PAYEE_PUB_KEY;
+
+extern const uint8_t TAG_DESCRIPTION_HASH;
+
+extern const uint8_t TAG_EXPIRY_TIME;
+
+extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
+
+extern const uint8_t TAG_FALLBACK;
+
+extern const uint8_t TAG_PRIVATE_ROUTE;
+
+extern const uint8_t TAG_PAYMENT_SECRET;
+
+extern const uint8_t TAG_PAYMENT_METADATA;
+
+extern const uint8_t TAG_FEATURES;
+
+struct LDKStr _ldk_get_compiled_version(void);
+
+struct LDKStr _ldk_c_bindings_get_compiled_version(void);
+
+/**
+ * Gets the 128-bit integer, as 16 little-endian bytes
+ */
+struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
+
+/**
+ * Constructs a new U128 from 16 little-endian bytes
+ */
+struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
+
+/**
+ * Constructs a new WitnessProgram given a version and program bytes.
+ *
+ * The program MUST be at least 2 bytes and no longer than 40 bytes long.
+ * Further, if the version is 0, the program MUST be either exactly 20 or exactly 32 bytes long.
+ */
+struct LDKWitnessProgram WitnessProgram_new(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
+
+/**
+ * Gets the `WitnessVersion` of the given `WitnessProgram`
+ */
+struct LDKWitnessVersion WitnessProgram_get_version(const struct LDKWitnessProgram *NONNULL_PTR prog);
+
+/**
+ * Gets the witness program bytes of the given `WitnessProgram`
+ */
+struct LDKu8slice WitnessProgram_get_program(const struct LDKWitnessProgram *NONNULL_PTR prog);
+
+/**
+ * Creates a new WitnessProgram which has the same data as `orig`
+ */
+struct LDKWitnessProgram WitnessProgram_clone(const struct LDKWitnessProgram *NONNULL_PTR orig);
+
+/**
+ * Releases any memory held by the given `WitnessProgram` (which is currently none)
+ */
+void WitnessProgram_free(struct LDKWitnessProgram o);
+
+/**
+ * Convenience function for constructing a new BigEndianScalar
+ */
+struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
+
+/**
+ * Creates a new BigEndianScalar which has the same data as `orig`
+ */
+struct LDKBigEndianScalar BigEndianScalar_clone(const struct LDKBigEndianScalar *NONNULL_PTR orig);
+
+/**
+ * Creates a new Bech32Error which has the same data as `orig`
+ */
+struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
+
+/**
+ * Releases any memory held by the given `Bech32Error` (which is currently none)
+ */
+void Bech32Error_free(struct LDKBech32Error o);
+
+/**
+ * Frees the data buffer, if data_is_owned is set and datalen > 0.
+ */
+void Transaction_free(struct LDKTransaction _res);
+
+/**
+ * Creates a new Witness which has the same data as `orig` but with a new buffer.
+ */
+struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
+
+/**
+ * Frees the data pointed to by data
+ */
+void Witness_free(struct LDKWitness _res);
+
+/**
+ * Convenience function for constructing a new TxIn
+ */
+struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
+
+/**
+ * Gets the `witness` in the given `TxIn`.
+ */
+struct LDKWitness TxIn_get_witness(const struct LDKTxIn *NONNULL_PTR txin);
+
+/**
+ * Gets the `script_sig` in the given `TxIn`.
+ */
+struct LDKu8slice TxIn_get_script_sig(const struct LDKTxIn *NONNULL_PTR txin);
+
+/**
+ * Gets the `sequence` in the given `TxIn`.
+ */
+uint32_t TxIn_get_sequence(const struct LDKTxIn *NONNULL_PTR txin);
+
+/**
+ * Gets the previous outpoint txid in the given `TxIn`.
+ */
+struct LDKThirtyTwoBytes TxIn_get_previous_txid(const struct LDKTxIn *NONNULL_PTR txin);
+
+/**
+ * Gets the previout outpoint index in the given `TxIn`.
+ */
+uint32_t TxIn_get_previous_vout(const struct LDKTxIn *NONNULL_PTR txin);
+
+/**
+ * Frees the witness and script_sig in a TxIn
+ */
+void TxIn_free(struct LDKTxIn _res);
+
+/**
+ * Convenience function for constructing a new TxOut
+ */
+struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
+
+/**
+ * Gets the `script_pubkey` in the given `TxOut`.
+ */
+struct LDKu8slice TxOut_get_script_pubkey(const struct LDKTxOut *NONNULL_PTR txout);
+
+/**
+ * Gets the value in the given `TxOut`.
+ */
+uint64_t TxOut_get_value(const struct LDKTxOut *NONNULL_PTR txout);
+
+/**
+ * Frees the data pointed to by script_pubkey.
+ */
+void TxOut_free(struct LDKTxOut _res);
+
+/**
+ * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
+ */
+struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
+
+/**
+ * Frees the data buffer, if chars_is_owned is set and len > 0.
+ */
+void Str_free(struct LDKStr _res);
+
+#if defined(LDK_DEBUG_BUILD)
+/**
+ * This function exists for memory safety testing purposes. It should never be used in production
+ * code
+ */
+const void *__unmangle_inner_ptr(const void *ptr);
+#endif
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_u8Z_free(struct LDKCVec_u8Z _res);
+
+/**
+ * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKRefundMaybeWithDerivedMetadataBuilder o);
+
+/**
+ * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.
+ */
+void CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(const struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RefundBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_ok(struct LDKRefund o);
+
+/**
+ * Creates a new CResult_RefundBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RefundBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RefundBolt12SemanticErrorZ.
+ */
+void CResult_RefundBolt12SemanticErrorZ_free(struct LDKCResult_RefundBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_RefundBolt12SemanticErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_clone(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_u64Z containing a u64
+ */
+struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
+
+/**
+ * Constructs a new COption_u64Z containing nothing
+ */
+struct LDKCOption_u64Z COption_u64Z_none(void);
+
+/**
+ * Frees any resources associated with the u64, if we are in the Some state
+ */
+void COption_u64Z_free(struct LDKCOption_u64Z _res);
+
+/**
+ * Creates a new COption_u64Z which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_BlindedMessagePathZ_free(struct LDKCVec_BlindedMessagePathZ _res);
+
+/**
+ * Creates a new CResult_RefundDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RefundDecodeErrorZ CResult_RefundDecodeErrorZ_ok(struct LDKRefund o);
+
+/**
+ * Creates a new CResult_RefundDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RefundDecodeErrorZ CResult_RefundDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RefundDecodeErrorZ_is_ok(const struct LDKCResult_RefundDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RefundDecodeErrorZ.
+ */
+void CResult_RefundDecodeErrorZ_free(struct LDKCResult_RefundDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RefundDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RefundDecodeErrorZ CResult_RefundDecodeErrorZ_clone(const struct LDKCResult_RefundDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
+ */
+struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
+
+/**
+ * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
+ */
+struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
+ */
+void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
+
+/**
+ * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RetryDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_ok(struct LDKRetry o);
+
+/**
+ * Creates a new CResult_RetryDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RetryDecodeErrorZ_is_ok(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RetryDecodeErrorZ.
+ */
+void CResult_RetryDecodeErrorZ_free(struct LDKCResult_RetryDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RetryDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NoneAPIErrorZ in the success state.
+ */
+struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
+
+/**
+ * Creates a new CResult_NoneAPIErrorZ in the error state.
+ */
+struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NoneAPIErrorZ.
+ */
+void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
+
+/**
+ * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
+
+/**
+ * Constructs a new COption_ThirtyTwoBytesZ containing a crate::c_types::ThirtyTwoBytes
+ */
+struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o);
+
+/**
+ * Constructs a new COption_ThirtyTwoBytesZ containing nothing
+ */
+struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
+ */
+void COption_ThirtyTwoBytesZ_free(struct LDKCOption_ThirtyTwoBytesZ _res);
+
+/**
+ * Creates a new COption_ThirtyTwoBytesZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
+ */
+struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
+
+/**
+ * Constructs a new COption_CVec_u8ZZ containing nothing
+ */
+struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
+ */
+void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
+
+/**
+ * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
+
+/**
+ * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
+ */
+void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_clone(const struct LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_u64CVec_u8ZZ from the contained elements.
+ */
+struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_new(uint64_t a, struct LDKCVec_u8Z b);
+
+/**
+ * Frees any resources used by the C2Tuple_u64CVec_u8ZZ.
+ */
+void C2Tuple_u64CVec_u8ZZ_free(struct LDKC2Tuple_u64CVec_u8ZZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_u64CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u64CVec_u8ZZZ _res);
+
+/**
+ * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state.
+ */
+struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_ok(struct LDKRecipientOnionFields o);
+
+/**
+ * Creates a new CResult_RecipientOnionFieldsNoneZ in the error state.
+ */
+struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RecipientOnionFieldsNoneZ_is_ok(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RecipientOnionFieldsNoneZ.
+ */
+void CResult_RecipientOnionFieldsNoneZ_free(struct LDKCResult_RecipientOnionFieldsNoneZ _res);
+
+/**
+ * Creates a new CResult_RecipientOnionFieldsNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKUnsignedBolt12Invoice o);
+
+/**
+ * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ.
+ */
+void CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(const struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKBolt12Invoice o);
+
+/**
+ * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_Bolt12InvoiceBolt12SemanticErrorZ.
+ */
+void CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_SchnorrSignatureNoneZ in the success state.
+ */
+struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o);
+
+/**
+ * Creates a new CResult_SchnorrSignatureNoneZ in the error state.
+ */
+struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_SchnorrSignatureNoneZ.
+ */
+void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res);
+
+/**
+ * Creates a new CResult_SchnorrSignatureNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_StrZ_free(struct LDKCVec_StrZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
+
+/**
+ * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
+ */
+struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o);
+
+/**
+ * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
+ */
+struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::derived::CVec_ThirtyTwoBytesZ, if we are in the Some state
+ */
+void COption_CVec_ThirtyTwoBytesZZ_free(struct LDKCOption_CVec_ThirtyTwoBytesZZ _res);
+
+/**
+ * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_AmountZ containing a crate::lightning::offers::offer::Amount
+ */
+struct LDKCOption_AmountZ COption_AmountZ_some(struct LDKAmount o);
+
+/**
+ * Constructs a new COption_AmountZ containing nothing
+ */
+struct LDKCOption_AmountZ COption_AmountZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::offers::offer::Amount, if we are in the Some state
+ */
+void COption_AmountZ_free(struct LDKCOption_AmountZ _res);
+
+/**
+ * Creates a new COption_AmountZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_AmountZ COption_AmountZ_clone(const struct LDKCOption_AmountZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_QuantityZ containing a crate::lightning::offers::offer::Quantity
+ */
+struct LDKCOption_QuantityZ COption_QuantityZ_some(struct LDKQuantity o);
+
+/**
+ * Constructs a new COption_QuantityZ containing nothing
+ */
+struct LDKCOption_QuantityZ COption_QuantityZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::offers::offer::Quantity, if we are in the Some state
+ */
+void COption_QuantityZ_free(struct LDKCOption_QuantityZ _res);
+
+/**
+ * Creates a new COption_QuantityZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_QuantityZ COption_QuantityZ_clone(const struct LDKCOption_QuantityZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ThirtyTwoBytesNoneZ in the success state.
+ */
+struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o);
+
+/**
+ * Creates a new CResult_ThirtyTwoBytesNoneZ in the error state.
+ */
+struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ThirtyTwoBytesNoneZ_is_ok(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ThirtyTwoBytesNoneZ.
+ */
+void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res);
+
+/**
+ * Creates a new CResult_ThirtyTwoBytesNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_Bolt12InvoiceDecodeErrorZ in the success state.
+ */
+struct LDKCResult_Bolt12InvoiceDecodeErrorZ CResult_Bolt12InvoiceDecodeErrorZ_ok(struct LDKBolt12Invoice o);
+
+/**
+ * Creates a new CResult_Bolt12InvoiceDecodeErrorZ in the error state.
+ */
+struct LDKCResult_Bolt12InvoiceDecodeErrorZ CResult_Bolt12InvoiceDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_Bolt12InvoiceDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_Bolt12InvoiceDecodeErrorZ.
+ */
+void CResult_Bolt12InvoiceDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_Bolt12InvoiceDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_Bolt12InvoiceDecodeErrorZ CResult_Bolt12InvoiceDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
+ */
+struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
+
+/**
+ * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
+ */
+struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
+ */
+void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
+ */
+struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
+
+/**
+ * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
+ */
+struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
+ */
+void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
+ */
+struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
+
+/**
+ * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
+ */
+struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
+ */
+void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
+
+/**
+ * Constructs a new COption_u32Z containing a u32
+ */
+struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
+
+/**
+ * Constructs a new COption_u32Z containing nothing
+ */
+struct LDKCOption_u32Z COption_u32Z_none(void);
+
+/**
+ * Frees any resources associated with the u32, if we are in the Some state
+ */
+void COption_u32Z_free(struct LDKCOption_u32Z _res);
+
+/**
+ * Creates a new COption_u32Z which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_clone(const struct LDKC2Tuple_CVec_u8Zu64Z *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_CVec_u8Zu64Z from the contained elements.
+ */
+struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_new(struct LDKCVec_u8Z a, uint64_t b);
+
+/**
+ * Frees any resources used by the C2Tuple_CVec_u8Zu64Z.
+ */
+void C2Tuple_CVec_u8Zu64Z_free(struct LDKC2Tuple_CVec_u8Zu64Z _res);
+
+/**
+ * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the success state.
+ */
+struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_ok(struct LDKC2Tuple_CVec_u8Zu64Z o);
+
+/**
+ * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the error state.
+ */
+struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C2Tuple_CVec_u8Zu64ZNoneZ_is_ok(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C2Tuple_CVec_u8Zu64ZNoneZ.
+ */
+void CResult_C2Tuple_CVec_u8Zu64ZNoneZ_free(struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_ok(struct LDKChannelDerivationParameters o);
+
+/**
+ * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelDerivationParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelDerivationParametersDecodeErrorZ.
+ */
+void CResult_ChannelDerivationParametersDecodeErrorZ_free(struct LDKCResult_ChannelDerivationParametersDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state.
+ */
+struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_ok(struct LDKHTLCDescriptor o);
+
+/**
+ * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the error state.
+ */
+struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_HTLCDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_HTLCDescriptorDecodeErrorZ.
+ */
+void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_HTLCDescriptorDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PublicKeyNoneZ in the success state.
+ */
+struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
+
+/**
+ * Creates a new CResult_PublicKeyNoneZ in the error state.
+ */
+struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PublicKeyNoneZ.
+ */
+void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
+
+/**
+ * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult__u832NoneZ in the success state.
+ */
+struct LDKCResult__u832NoneZ CResult__u832NoneZ_ok(struct LDKThirtyTwoBytes o);
+
+/**
+ * Creates a new CResult__u832NoneZ in the error state.
+ */
+struct LDKCResult__u832NoneZ CResult__u832NoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult__u832NoneZ_is_ok(const struct LDKCResult__u832NoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult__u832NoneZ.
+ */
+void CResult__u832NoneZ_free(struct LDKCResult__u832NoneZ _res);
+
+/**
+ * Creates a new CResult__u832NoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult__u832NoneZ CResult__u832NoneZ_clone(const struct LDKCResult__u832NoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NoneNoneZ in the success state.
+ */
+struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
+
+/**
+ * Creates a new CResult_NoneNoneZ in the error state.
+ */
+struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NoneNoneZ.
+ */
+void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
+
+/**
+ * Creates a new CResult_NoneNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
+ */
+struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o);
+
+/**
+ * Constructs a new COption_BigEndianScalarZ containing nothing
+ */
+struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
+ */
+void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
+
+/**
+ * Creates a new COption_BigEndianScalarZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
+ */
+struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
+
+/**
+ * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
+ */
+struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
+ */
+void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
+
+/**
+ * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ECDSASignatureNoneZ in the success state.
+ */
+struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o);
+
+/**
+ * Creates a new CResult_ECDSASignatureNoneZ in the error state.
+ */
+struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ECDSASignatureNoneZ_is_ok(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ECDSASignatureNoneZ.
+ */
+void CResult_ECDSASignatureNoneZ_free(struct LDKCResult_ECDSASignatureNoneZ _res);
+
+/**
+ * Creates a new CResult_ECDSASignatureNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TransactionNoneZ in the success state.
+ */
+struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
+
+/**
+ * Creates a new CResult_TransactionNoneZ in the error state.
+ */
+struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TransactionNoneZ.
+ */
+void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
+
+/**
+ * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_EcdsaChannelSignerDecodeErrorZ in the success state.
+ */
+struct LDKCResult_EcdsaChannelSignerDecodeErrorZ CResult_EcdsaChannelSignerDecodeErrorZ_ok(struct LDKEcdsaChannelSigner o);
+
+/**
+ * Creates a new CResult_EcdsaChannelSignerDecodeErrorZ in the error state.
+ */
+struct LDKCResult_EcdsaChannelSignerDecodeErrorZ CResult_EcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_EcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_EcdsaChannelSignerDecodeErrorZ.
+ */
+void CResult_EcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_EcdsaChannelSignerDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_EcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_EcdsaChannelSignerDecodeErrorZ CResult_EcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_EcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_CVec_u8ZNoneZ in the success state.
+ */
+struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o);
+
+/**
+ * Creates a new CResult_CVec_u8ZNoneZ in the error state.
+ */
+struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CVec_u8ZNoneZ_is_ok(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CVec_u8ZNoneZ.
+ */
+void CResult_CVec_u8ZNoneZ_free(struct LDKCResult_CVec_u8ZNoneZ _res);
+
+/**
+ * Creates a new CResult_CVec_u8ZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_clone(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ShutdownScriptNoneZ in the success state.
+ */
+struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
+
+/**
+ * Creates a new CResult_ShutdownScriptNoneZ in the error state.
+ */
+struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ShutdownScriptNoneZ.
+ */
+void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
+
+/**
+ * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_u16Z containing a u16
+ */
+struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
+
+/**
+ * Constructs a new COption_u16Z containing nothing
+ */
+struct LDKCOption_u16Z COption_u16Z_none(void);
+
+/**
+ * Frees any resources associated with the u16, if we are in the Some state
+ */
+void COption_u16Z_free(struct LDKCOption_u16Z _res);
+
+/**
+ * Creates a new COption_u16Z which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_boolZ containing a bool
+ */
+struct LDKCOption_boolZ COption_boolZ_some(bool o);
+
+/**
+ * Constructs a new COption_boolZ containing nothing
+ */
+struct LDKCOption_boolZ COption_boolZ_none(void);
+
+/**
+ * Frees any resources associated with the bool, if we are in the Some state
+ */
+void COption_boolZ_free(struct LDKCOption_boolZ _res);
+
+/**
+ * Creates a new COption_boolZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_boolZ COption_boolZ_clone(const struct LDKCOption_boolZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_WitnessNoneZ in the success state.
+ */
+struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_ok(struct LDKWitness o);
+
+/**
+ * Creates a new CResult_WitnessNoneZ in the error state.
+ */
+struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_WitnessNoneZ_is_ok(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_WitnessNoneZ.
+ */
+void CResult_WitnessNoneZ_free(struct LDKCResult_WitnessNoneZ _res);
+
+/**
+ * Creates a new CResult_WitnessNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_clone(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_ECDSASignatureZ_free(struct LDKCVec_ECDSASignatureZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(const struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ from the contained elements.
+ */
+struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(struct LDKECDSASignature a, struct LDKCVec_ECDSASignatureZ b);
+
+/**
+ * Frees any resources used by the C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ.
+ */
+void C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state.
+ */
+struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o);
+
+/**
+ * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the error state.
+ */
+struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.
+ */
+void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
+ */
+struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
+
+/**
+ * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
+ */
+struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
+ */
+void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
+ */
+struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
+
+/**
+ * Constructs a new COption_WriteableScoreZ containing nothing
+ */
+struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
+ */
+void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
+
+/**
+ * Creates a new CResult_NoneIOErrorZ in the success state.
+ */
+struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_ok(void);
+
+/**
+ * Creates a new CResult_NoneIOErrorZ in the error state.
+ */
+struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_err(enum LDKIOError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NoneIOErrorZ_is_ok(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NoneIOErrorZ.
+ */
+void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
+
+/**
+ * Creates a new CResult_NoneIOErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ from the contained elements.
+ */
+struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c);
+
+/**
+ * Frees any resources used by the C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.
+ */
+void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res);
+
+/**
+ * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the success state.
+ */
+struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o);
+
+/**
+ * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the error state.
+ */
+struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.
+ */
+void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res);
+
+/**
+ * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
+
+/**
+ * Creates a new CResult_RouteLightningErrorZ in the success state.
+ */
+struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
+
+/**
+ * Creates a new CResult_RouteLightningErrorZ in the error state.
+ */
+struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RouteLightningErrorZ.
+ */
+void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
+
+/**
+ * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_BlindedPaymentPathZ_free(struct LDKCVec_BlindedPaymentPathZ _res);
+
+/**
+ * Creates a new CResult_CVec_BlindedPaymentPathZNoneZ in the success state.
+ */
+struct LDKCResult_CVec_BlindedPaymentPathZNoneZ CResult_CVec_BlindedPaymentPathZNoneZ_ok(struct LDKCVec_BlindedPaymentPathZ o);
+
+/**
+ * Creates a new CResult_CVec_BlindedPaymentPathZNoneZ in the error state.
+ */
+struct LDKCResult_CVec_BlindedPaymentPathZNoneZ CResult_CVec_BlindedPaymentPathZNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CVec_BlindedPaymentPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CVec_BlindedPaymentPathZNoneZ.
+ */
+void CResult_CVec_BlindedPaymentPathZNoneZ_free(struct LDKCResult_CVec_BlindedPaymentPathZNoneZ _res);
+
+/**
+ * Creates a new CResult_CVec_BlindedPaymentPathZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CVec_BlindedPaymentPathZNoneZ CResult_CVec_BlindedPaymentPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPaymentPathZNoneZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
+
+/**
+ * Creates a new CResult_OnionMessagePathNoneZ in the success state.
+ */
+struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
+
+/**
+ * Creates a new CResult_OnionMessagePathNoneZ in the error state.
+ */
+struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OnionMessagePathNoneZ.
+ */
+void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
+
+/**
+ * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_CVec_BlindedMessagePathZNoneZ in the success state.
+ */
+struct LDKCResult_CVec_BlindedMessagePathZNoneZ CResult_CVec_BlindedMessagePathZNoneZ_ok(struct LDKCVec_BlindedMessagePathZ o);
+
+/**
+ * Creates a new CResult_CVec_BlindedMessagePathZNoneZ in the error state.
+ */
+struct LDKCResult_CVec_BlindedMessagePathZNoneZ CResult_CVec_BlindedMessagePathZNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CVec_BlindedMessagePathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CVec_BlindedMessagePathZNoneZ.
+ */
+void CResult_CVec_BlindedMessagePathZNoneZ_free(struct LDKCResult_CVec_BlindedMessagePathZNoneZ _res);
+
+/**
+ * Creates a new CResult_CVec_BlindedMessagePathZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CVec_BlindedMessagePathZNoneZ CResult_CVec_BlindedMessagePathZNoneZ_clone(const struct LDKCResult_CVec_BlindedMessagePathZNoneZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_MessageForwardNodeZ_free(struct LDKCVec_MessageForwardNodeZ _res);
+
+/**
+ * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
+ */
+struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
+
+/**
+ * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
+ */
+struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
+ */
+void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
+
+/**
+ * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
+ */
+void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
+
+/**
+ * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
+
+/**
+ * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
+ */
+void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_PathZ_free(struct LDKCVec_PathZ _res);
+
+/**
+ * Creates a new CResult_RouteDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
+
+/**
+ * Creates a new CResult_RouteDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RouteDecodeErrorZ.
+ */
+void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
+
+/**
+ * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
+ */
+void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_u64Z_free(struct LDKCVec_u64Z _res);
+
+/**
+ * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
+ */
+struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
+
+/**
+ * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
+ */
+struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
+ */
+void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
+
+/**
+ * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
+
+/**
+ * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
+ */
+void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
+
+/**
+ * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
+ */
+void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
+ */
+struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
+
+/**
+ * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
+ */
+struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
+ */
+void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_u64u64Z from the contained elements.
+ */
+struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
+
+/**
+ * Frees any resources used by the C2Tuple_u64u64Z.
+ */
+void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
+
+/**
+ * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
+ */
+struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
+
+/**
+ * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
+ */
+struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
+ */
+void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
+
+/**
+ * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_Z from the contained elements.
+ */
+struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
+
+/**
+ * Frees any resources used by the C2Tuple_Z.
+ */
+void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
+
+/**
+ * Creates a new C2Tuple__u1632_u1632Z from the contained elements.
+ */
+struct LDKC2Tuple__u1632_u1632Z C2Tuple__u1632_u1632Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
+
+/**
+ * Frees any resources used by the C2Tuple__u1632_u1632Z.
+ */
+void C2Tuple__u1632_u1632Z_free(struct LDKC2Tuple__u1632_u1632Z _res);
+
+/**
+ * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
+ */
+struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(struct LDKC2Tuple__u1632_u1632Z o);
+
+/**
+ * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
+ */
+struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::derived::C2Tuple__u1632_u1632Z, if we are in the Some state
+ */
+void COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ _res);
+
+/**
+ * Constructs a new COption_f64Z containing a f64
+ */
+struct LDKCOption_f64Z COption_f64Z_some(double o);
+
+/**
+ * Constructs a new COption_f64Z containing nothing
+ */
+struct LDKCOption_f64Z COption_f64Z_none(void);
+
+/**
+ * Frees any resources associated with the f64, if we are in the Some state
+ */
+void COption_f64Z_free(struct LDKCOption_f64Z _res);
+
+/**
+ * Creates a new COption_f64Z which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_f64Z COption_f64Z_clone(const struct LDKCOption_f64Z *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
+
+/**
+ * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
+ */
+void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BestBlockDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_ok(struct LDKBestBlock o);
+
+/**
+ * Creates a new CResult_BestBlockDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BestBlockDecodeErrorZ_is_ok(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BestBlockDecodeErrorZ.
+ */
+void CResult_BestBlockDecodeErrorZ_free(struct LDKCResult_BestBlockDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BestBlockDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_clone(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
+ */
+struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
+
+/**
+ * Frees any resources used by the C2Tuple_usizeTransactionZ.
+ */
+void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ from the contained elements.
+ */
+struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_new(struct LDKThirtyTwoBytes a, uint32_t b, struct LDKCOption_ThirtyTwoBytesZ c);
+
+/**
+ * Frees any resources used by the C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.
+ */
+void C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_free(struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ_free(struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ _res);
+
+/**
+ * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the success state.
+ */
+struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o);
+
+/**
+ * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the error state.
+ */
+struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelMonitorUpdateStatusNoneZ.
+ */
+void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res);
+
+/**
+ * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ from the contained elements.
+ */
+struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKChannelId b, struct LDKCVec_MonitorEventZ c, struct LDKPublicKey d);
+
+/**
+ * Frees any resources used by the C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.
+ */
+void C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ _res);
+
+/**
+ * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
+ */
+struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
+
+/**
+ * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
+ */
+struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
+ */
+void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
+
+/**
+ * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
+ */
+void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
+ */
+struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
+
+/**
+ * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
+ */
+struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
+ */
+void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
+ */
+struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
+
+/**
+ * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
+ */
+struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
+ */
+void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
+ */
+struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
+
+/**
+ * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
+ */
+struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
+ */
+void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
+
+/**
+ * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
+ */
+void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
+
+/**
+ * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
+ */
+void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OfferIdDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_ok(struct LDKOfferId o);
+
+/**
+ * Creates a new CResult_OfferIdDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OfferIdDecodeErrorZ_is_ok(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OfferIdDecodeErrorZ.
+ */
+void CResult_OfferIdDecodeErrorZ_free(struct LDKCResult_OfferIdDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OfferIdDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_clone(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NoneBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_ok(void);
+
+/**
+ * Creates a new CResult_NoneBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NoneBolt12SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NoneBolt12SemanticErrorZ.
+ */
+void CResult_NoneBolt12SemanticErrorZ_free(struct LDKCResult_NoneBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_NoneBolt12SemanticErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_clone(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OfferBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_ok(struct LDKOffer o);
+
+/**
+ * Creates a new CResult_OfferBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OfferBolt12SemanticErrorZ_is_ok(const struct LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OfferBolt12SemanticErrorZ.
+ */
+void CResult_OfferBolt12SemanticErrorZ_free(struct LDKCResult_OfferBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_OfferBolt12SemanticErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_clone(const struct LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithDerivedPayerIdBuilder o);
+
+/**
+ * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.
+ */
+void CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithExplicitPayerIdBuilder o);
+
+/**
+ * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.
+ */
+void CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_OfferDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OfferDecodeErrorZ CResult_OfferDecodeErrorZ_ok(struct LDKOffer o);
+
+/**
+ * Creates a new CResult_OfferDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OfferDecodeErrorZ CResult_OfferDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OfferDecodeErrorZ_is_ok(const struct LDKCResult_OfferDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OfferDecodeErrorZ.
+ */
+void CResult_OfferDecodeErrorZ_free(struct LDKCResult_OfferDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OfferDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OfferDecodeErrorZ CResult_OfferDecodeErrorZ_clone(const struct LDKCResult_OfferDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
+ */
+struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
+
+/**
+ * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
+ */
+struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
+ */
+void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
+
+/**
+ * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
+ */
+struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
+
+/**
+ * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
+ */
+struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
+ */
+void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
+ */
+struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o);
+
+/**
+ * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
+ */
+struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PublicKeySecp256k1ErrorZ.
+ */
+void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res);
+
+/**
+ * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
+ */
+struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
+
+/**
+ * Constructs a new COption_NetworkUpdateZ containing nothing
+ */
+struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
+ */
+void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
+
+/**
+ * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
+
+/**
+ * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
+ */
+void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
+ */
+struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
+
+/**
+ * Constructs a new COption_UtxoLookupZ containing nothing
+ */
+struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
+ */
+void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
+
+/**
+ * Creates a new CResult_NoneLightningErrorZ in the success state.
+ */
+struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
+
+/**
+ * Creates a new CResult_NoneLightningErrorZ in the error state.
+ */
+struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NoneLightningErrorZ.
+ */
+void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
+
+/**
+ * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_boolLightningErrorZ in the success state.
+ */
+struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
+
+/**
+ * Creates a new CResult_boolLightningErrorZ in the error state.
+ */
+struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_boolLightningErrorZ.
+ */
+void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
+
+/**
+ * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
+ */
+struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
+
+/**
+ * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
+ */
+void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
+
+/**
+ * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
+ */
+struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
+
+/**
+ * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
+ */
+struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
+ */
+void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
+
+/**
+ * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
+
+/**
+ * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
+
+/**
+ * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
+ */
+void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
+
+/**
+ * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
+ */
+void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
+
+/**
+ * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
+ */
+void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_SocketAddressZ_free(struct LDKCVec_SocketAddressZ _res);
+
+/**
+ * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
+ */
+struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
+
+/**
+ * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
+ */
+struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
+ */
+void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
+ */
+struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
+
+/**
+ * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
+ */
+struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
+ */
+void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_NodeAnnouncementInfoZ containing a crate::lightning::routing::gossip::NodeAnnouncementInfo
+ */
+struct LDKCOption_NodeAnnouncementInfoZ COption_NodeAnnouncementInfoZ_some(struct LDKNodeAnnouncementInfo o);
+
+/**
+ * Constructs a new COption_NodeAnnouncementInfoZ containing nothing
+ */
+struct LDKCOption_NodeAnnouncementInfoZ COption_NodeAnnouncementInfoZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::routing::gossip::NodeAnnouncementInfo, if we are in the Some state
+ */
+void COption_NodeAnnouncementInfoZ_free(struct LDKCOption_NodeAnnouncementInfoZ _res);
+
+/**
+ * Creates a new COption_NodeAnnouncementInfoZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_NodeAnnouncementInfoZ COption_NodeAnnouncementInfoZ_clone(const struct LDKCOption_NodeAnnouncementInfoZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
+ */
+struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
+
+/**
+ * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
+ */
+struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
+ */
+void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
+ */
+struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
+
+/**
+ * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
+ */
+struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
+ */
+void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
+
+/**
+ * Constructs a new COption_CVec_SocketAddressZZ containing a crate::c_types::derived::CVec_SocketAddressZ
+ */
+struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_some(struct LDKCVec_SocketAddressZ o);
+
+/**
+ * Constructs a new COption_CVec_SocketAddressZZ containing nothing
+ */
+struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::derived::CVec_SocketAddressZ, if we are in the Some state
+ */
+void COption_CVec_SocketAddressZZ_free(struct LDKCOption_CVec_SocketAddressZZ _res);
+
+/**
+ * Creates a new COption_CVec_SocketAddressZZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_u64ShortChannelIdErrorZ in the success state.
+ */
+struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_ok(uint64_t o);
+
+/**
+ * Creates a new CResult_u64ShortChannelIdErrorZ in the error state.
+ */
+struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_err(enum LDKShortChannelIdError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_u64ShortChannelIdErrorZ_is_ok(const struct LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_u64ShortChannelIdErrorZ.
+ */
+void CResult_u64ShortChannelIdErrorZ_free(struct LDKCResult_u64ShortChannelIdErrorZ _res);
+
+/**
+ * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the success state.
+ */
+struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_ok(struct LDKPendingHTLCInfo o);
+
+/**
+ * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the error state.
+ */
+struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_err(struct LDKInboundHTLCErr e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PendingHTLCInfoInboundHTLCErrZ.
+ */
+void CResult_PendingHTLCInfoInboundHTLCErrZ_free(struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ _res);
+
+/**
+ * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_clone(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
+
+/**
+ * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
+ */
+struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
+
+/**
+ * Constructs a new COption_TxOutZ containing nothing
+ */
+struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
+ */
+void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
+
+/**
+ * Creates a new COption_TxOutZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_InputZ_free(struct LDKCVec_InputZ _res);
+
+/**
+ * Creates a new CResult_CoinSelectionNoneZ in the success state.
+ */
+struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
+
+/**
+ * Creates a new CResult_CoinSelectionNoneZ in the error state.
+ */
+struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CoinSelectionNoneZ.
+ */
+void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
+
+/**
+ * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
+ */
+struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
+
+/**
+ * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
+ */
+struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
+ */
+void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
+
+/**
+ * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_PaymentContextZ containing a crate::lightning::blinded_path::payment::PaymentContext
+ */
+struct LDKCOption_PaymentContextZ COption_PaymentContextZ_some(struct LDKPaymentContext o);
+
+/**
+ * Constructs a new COption_PaymentContextZ containing nothing
+ */
+struct LDKCOption_PaymentContextZ COption_PaymentContextZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::blinded_path::payment::PaymentContext, if we are in the Some state
+ */
+void COption_PaymentContextZ_free(struct LDKCOption_PaymentContextZ _res);
+
+/**
+ * Creates a new COption_PaymentContextZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_PaymentContextZ COption_PaymentContextZ_clone(const struct LDKCOption_PaymentContextZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_u64u16Z from the contained elements.
+ */
+struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_new(uint64_t a, uint16_t b);
+
+/**
+ * Frees any resources used by the C2Tuple_u64u16Z.
+ */
+void C2Tuple_u64u16Z_free(struct LDKC2Tuple_u64u16Z _res);
+
+/**
+ * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z
+ */
+struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_some(struct LDKC2Tuple_u64u16Z o);
+
+/**
+ * Constructs a new COption_C2Tuple_u64u16ZZ containing nothing
+ */
+struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u16Z, if we are in the Some state
+ */
+void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
+
+/**
+ * Creates a new COption_C2Tuple_u64u16ZZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelIdAPIErrorZ in the success state.
+ */
+struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_ok(struct LDKChannelId o);
+
+/**
+ * Creates a new CResult_ChannelIdAPIErrorZ in the error state.
+ */
+struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_err(struct LDKAPIError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelIdAPIErrorZ_is_ok(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelIdAPIErrorZ.
+ */
+void CResult_ChannelIdAPIErrorZ_free(struct LDKCResult_ChannelIdAPIErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelIdAPIErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_clone(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
+
+/**
+ * Creates a new CResult_NonePaymentSendFailureZ in the success state.
+ */
+struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
+
+/**
+ * Creates a new CResult_NonePaymentSendFailureZ in the error state.
+ */
+struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NonePaymentSendFailureZ.
+ */
+void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
+
+/**
+ * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
+ */
+struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
+
+/**
+ * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
+ */
+struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
+ */
+void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
+
+/**
+ * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the success state.
+ */
+struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
+
+/**
+ * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state.
+ */
+struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ThirtyTwoBytesPaymentSendFailureZ.
+ */
+void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res);
+
+/**
+ * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the success state.
+ */
+struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
+
+/**
+ * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the error state.
+ */
+struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ThirtyTwoBytesRetryableSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ThirtyTwoBytesRetryableSendFailureZ.
+ */
+void CResult_ThirtyTwoBytesRetryableSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ _res);
+
+/**
+ * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ from the contained elements.
+ */
+struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
+
+/**
+ * Frees any resources used by the C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ.
+ */
+void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.
+ */
+void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res);
+
+/**
+ * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state.
+ */
+struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
+
+/**
+ * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the error state.
+ */
+struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_err(struct LDKProbeSendFailure e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.
+ */
+void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ _res);
+
+/**
+ * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_clone(const struct LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_ChannelIdPublicKeyZ from the contained elements.
+ */
+struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_new(struct LDKChannelId a, struct LDKPublicKey b);
+
+/**
+ * Frees any resources used by the C2Tuple_ChannelIdPublicKeyZ.
+ */
+void C2Tuple_ChannelIdPublicKeyZ_free(struct LDKC2Tuple_ChannelIdPublicKeyZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_ChannelIdPublicKeyZZ_free(struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_ChannelIdZ_free(struct LDKCVec_ChannelIdZ _res);
+
+/**
+ * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKOfferWithDerivedMetadataBuilder o);
+
+/**
+ * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.
+ */
+void CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(const struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_StrZ containing a crate::c_types::Str
+ */
+struct LDKCOption_StrZ COption_StrZ_some(struct LDKStr o);
+
+/**
+ * Constructs a new COption_StrZ containing nothing
+ */
+struct LDKCOption_StrZ COption_StrZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::Str, if we are in the Some state
+ */
+void COption_StrZ_free(struct LDKCOption_StrZ _res);
+
+/**
+ * Creates a new COption_StrZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_StrZ COption_StrZ_clone(const struct LDKCOption_StrZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the error state.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.
+ */
+void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the success state.
+ */
+struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
+
+/**
+ * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the error state.
+ */
+struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ThirtyTwoBytesAPIErrorZ.
+ */
+void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res);
+
+/**
+ * Creates a new CResult_ThirtyTwoBytesAPIErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_OffersContextZ containing a crate::lightning::blinded_path::message::OffersContext
+ */
+struct LDKCOption_OffersContextZ COption_OffersContextZ_some(struct LDKOffersContext o);
+
+/**
+ * Constructs a new COption_OffersContextZ containing nothing
+ */
+struct LDKCOption_OffersContextZ COption_OffersContextZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::blinded_path::message::OffersContext, if we are in the Some state
+ */
+void COption_OffersContextZ_free(struct LDKCOption_OffersContextZ _res);
+
+/**
+ * Creates a new COption_OffersContextZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_OffersContextZ COption_OffersContextZ_clone(const struct LDKCOption_OffersContextZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_OffersMessageResponseInstructionZ C2Tuple_OffersMessageResponseInstructionZ_clone(const struct LDKC2Tuple_OffersMessageResponseInstructionZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_OffersMessageResponseInstructionZ from the contained elements.
+ */
+struct LDKC2Tuple_OffersMessageResponseInstructionZ C2Tuple_OffersMessageResponseInstructionZ_new(struct LDKOffersMessage a, struct LDKResponseInstruction b);
+
+/**
+ * Frees any resources used by the C2Tuple_OffersMessageResponseInstructionZ.
+ */
+void C2Tuple_OffersMessageResponseInstructionZ_free(struct LDKC2Tuple_OffersMessageResponseInstructionZ _res);
+
+/**
+ * Constructs a new COption_C2Tuple_OffersMessageResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_OffersMessageResponseInstructionZ
+ */
+struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ COption_C2Tuple_OffersMessageResponseInstructionZZ_some(struct LDKC2Tuple_OffersMessageResponseInstructionZ o);
+
+/**
+ * Constructs a new COption_C2Tuple_OffersMessageResponseInstructionZZ containing nothing
+ */
+struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ COption_C2Tuple_OffersMessageResponseInstructionZZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::derived::C2Tuple_OffersMessageResponseInstructionZ, if we are in the Some state
+ */
+void COption_C2Tuple_OffersMessageResponseInstructionZZ_free(struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ _res);
+
+/**
+ * Creates a new COption_C2Tuple_OffersMessageResponseInstructionZZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ COption_C2Tuple_OffersMessageResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_OffersMessageResponseInstructionZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ C2Tuple_OffersMessageMessageSendInstructionsZ_clone(const struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_OffersMessageMessageSendInstructionsZ from the contained elements.
+ */
+struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ C2Tuple_OffersMessageMessageSendInstructionsZ_new(struct LDKOffersMessage a, struct LDKMessageSendInstructions b);
+
+/**
+ * Frees any resources used by the C2Tuple_OffersMessageMessageSendInstructionsZ.
+ */
+void C2Tuple_OffersMessageMessageSendInstructionsZ_free(struct LDKC2Tuple_OffersMessageMessageSendInstructionsZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_OffersMessageMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_OffersMessageMessageSendInstructionsZZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ C2Tuple_ReleaseHeldHtlcResponseInstructionZ_clone(const struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_ReleaseHeldHtlcResponseInstructionZ from the contained elements.
+ */
+struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ C2Tuple_ReleaseHeldHtlcResponseInstructionZ_new(struct LDKReleaseHeldHtlc a, struct LDKResponseInstruction b);
+
+/**
+ * Frees any resources used by the C2Tuple_ReleaseHeldHtlcResponseInstructionZ.
+ */
+void C2Tuple_ReleaseHeldHtlcResponseInstructionZ_free(struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ _res);
+
+/**
+ * Constructs a new COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_ReleaseHeldHtlcResponseInstructionZ
+ */
+struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_some(struct LDKC2Tuple_ReleaseHeldHtlcResponseInstructionZ o);
+
+/**
+ * Constructs a new COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ containing nothing
+ */
+struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::derived::C2Tuple_ReleaseHeldHtlcResponseInstructionZ, if we are in the Some state
+ */
+void COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_free(struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ _res);
+
+/**
+ * Creates a new COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ COption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_ReleaseHeldHtlcResponseInstructionZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_clone(const struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ from the contained elements.
+ */
+struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_new(struct LDKAsyncPaymentsMessage a, struct LDKMessageSendInstructions b);
+
+/**
+ * Frees any resources used by the C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ.
+ */
+void C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ_free(struct LDKC2Tuple_AsyncPaymentsMessageMessageSendInstructionsZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_AsyncPaymentsMessageMessageSendInstructionsZZ _res);
+
+/**
+ * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
+ */
+struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
+
+/**
+ * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
+ */
+struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
+ */
+void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_BlindedForwardDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_ok(struct LDKBlindedForward o);
+
+/**
+ * Creates a new CResult_BlindedForwardDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BlindedForwardDecodeErrorZ_is_ok(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BlindedForwardDecodeErrorZ.
+ */
+void CResult_BlindedForwardDecodeErrorZ_free(struct LDKCResult_BlindedForwardDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BlindedForwardDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_clone(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the success state.
+ */
+struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_ok(struct LDKPendingHTLCRouting o);
+
+/**
+ * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the error state.
+ */
+struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PendingHTLCRoutingDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PendingHTLCRoutingDecodeErrorZ.
+ */
+void CResult_PendingHTLCRoutingDecodeErrorZ_free(struct LDKCResult_PendingHTLCRoutingDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the success state.
+ */
+struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_ok(struct LDKPendingHTLCInfo o);
+
+/**
+ * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the error state.
+ */
+struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PendingHTLCInfoDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PendingHTLCInfoDecodeErrorZ.
+ */
+void CResult_PendingHTLCInfoDecodeErrorZ_free(struct LDKCResult_PendingHTLCInfoDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_PendingHTLCInfoDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_BlindedFailureDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_ok(enum LDKBlindedFailure o);
+
+/**
+ * Creates a new CResult_BlindedFailureDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BlindedFailureDecodeErrorZ_is_ok(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BlindedFailureDecodeErrorZ.
+ */
+void CResult_BlindedFailureDecodeErrorZ_free(struct LDKCResult_BlindedFailureDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BlindedFailureDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_clone(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
+
+/**
+ * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements.
+ */
+struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
+
+/**
+ * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelManagerZ.
+ */
+void C2Tuple_ThirtyTwoBytesChannelManagerZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ o);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.
+ */
+void CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
+ */
+struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
+
+/**
+ * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
+ */
+struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
+ */
+void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
+
+/**
+ * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
+ */
+void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
+ */
+struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
+
+/**
+ * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
+ */
+struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
+ */
+void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
+
+/**
+ * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
+ */
+struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
+
+/**
+ * Constructs a new COption_APIErrorZ containing nothing
+ */
+struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
+ */
+void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
+
+/**
+ * Creates a new COption_APIErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
+
+/**
+ * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
+ */
+void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
+
+/**
+ * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
+ */
+void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
+ */
+struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
+
+/**
+ * Constructs a new COption_MonitorEventZ containing nothing
+ */
+struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
+ */
+void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
+
+/**
+ * Creates a new COption_MonitorEventZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
+
+/**
+ * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
+ */
+void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
+ */
+struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
+
+/**
+ * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
+ */
+struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
+ */
+void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u8ZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements.
+ */
+struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
+
+/**
+ * Frees any resources used by the C2Tuple_OutPointCVec_u8ZZ.
+ */
+void C2Tuple_OutPointCVec_u8ZZ_free(struct LDKC2Tuple_OutPointCVec_u8ZZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_clone(const struct LDKC2Tuple_u32CVec_u8ZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_u32CVec_u8ZZ from the contained elements.
+ */
+struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_new(uint32_t a, struct LDKCVec_u8Z b);
+
+/**
+ * Frees any resources used by the C2Tuple_u32CVec_u8ZZ.
+ */
+void C2Tuple_u32CVec_u8ZZ_free(struct LDKC2Tuple_u32CVec_u8ZZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_u32CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u32CVec_u8ZZZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements.
+ */
+struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b);
+
+/**
+ * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.
+ */
+void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
+
+/**
+ * Creates a new CResult_NoneReplayEventZ in the success state.
+ */
+struct LDKCResult_NoneReplayEventZ CResult_NoneReplayEventZ_ok(void);
+
+/**
+ * Creates a new CResult_NoneReplayEventZ in the error state.
+ */
+struct LDKCResult_NoneReplayEventZ CResult_NoneReplayEventZ_err(struct LDKReplayEvent e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NoneReplayEventZ_is_ok(const struct LDKCResult_NoneReplayEventZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NoneReplayEventZ.
+ */
+void CResult_NoneReplayEventZ_free(struct LDKCResult_NoneReplayEventZ _res);
+
+/**
+ * Creates a new CResult_NoneReplayEventZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NoneReplayEventZ CResult_NoneReplayEventZ_clone(const struct LDKCResult_NoneReplayEventZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_u32TxOutZ from the contained elements.
+ */
+struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
+
+/**
+ * Frees any resources used by the C2Tuple_u32TxOutZ.
+ */
+void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements.
+ */
+struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
+
+/**
+ * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.
+ */
+void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements.
+ */
+struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
+
+/**
+ * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelMonitorZ.
+ */
+void C2Tuple_ThirtyTwoBytesChannelMonitorZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.
+ */
+void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
+ */
+struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
+
+/**
+ * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
+ */
+void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ C2Tuple_OnionMessageContentsResponseInstructionZ_clone(const struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_OnionMessageContentsResponseInstructionZ from the contained elements.
+ */
+struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ C2Tuple_OnionMessageContentsResponseInstructionZ_new(struct LDKOnionMessageContents a, struct LDKResponseInstruction b);
+
+/**
+ * Frees any resources used by the C2Tuple_OnionMessageContentsResponseInstructionZ.
+ */
+void C2Tuple_OnionMessageContentsResponseInstructionZ_free(struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ _res);
+
+/**
+ * Constructs a new COption_C2Tuple_OnionMessageContentsResponseInstructionZZ containing a crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ
+ */
+struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_some(struct LDKC2Tuple_OnionMessageContentsResponseInstructionZ o);
+
+/**
+ * Constructs a new COption_C2Tuple_OnionMessageContentsResponseInstructionZZ containing nothing
+ */
+struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::derived::C2Tuple_OnionMessageContentsResponseInstructionZ, if we are in the Some state
+ */
+void COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_free(struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ _res);
+
+/**
+ * Creates a new COption_C2Tuple_OnionMessageContentsResponseInstructionZZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ COption_C2Tuple_OnionMessageContentsResponseInstructionZZ_clone(const struct LDKCOption_C2Tuple_OnionMessageContentsResponseInstructionZZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_OnionMessageContentsZ containing a crate::lightning::onion_message::packet::OnionMessageContents
+ */
+struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_some(struct LDKOnionMessageContents o);
+
+/**
+ * Constructs a new COption_OnionMessageContentsZ containing nothing
+ */
+struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::onion_message::packet::OnionMessageContents, if we are in the Some state
+ */
+void COption_OnionMessageContentsZ_free(struct LDKCOption_OnionMessageContentsZ _res);
+
+/**
+ * Creates a new COption_OnionMessageContentsZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_clone(const struct LDKCOption_OnionMessageContentsZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_OnionMessageContentsZ o);
+
+/**
+ * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_COption_OnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_COption_OnionMessageContentsZDecodeErrorZ.
+ */
+void CResult_COption_OnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ C2Tuple_OnionMessageContentsMessageSendInstructionsZ_clone(const struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_OnionMessageContentsMessageSendInstructionsZ from the contained elements.
+ */
+struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ C2Tuple_OnionMessageContentsMessageSendInstructionsZ_new(struct LDKOnionMessageContents a, struct LDKMessageSendInstructions b);
+
+/**
+ * Frees any resources used by the C2Tuple_OnionMessageContentsMessageSendInstructionsZ.
+ */
+void C2Tuple_OnionMessageContentsMessageSendInstructionsZ_free(struct LDKC2Tuple_OnionMessageContentsMessageSendInstructionsZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ_free(struct LDKCVec_C2Tuple_OnionMessageContentsMessageSendInstructionsZZ _res);
+
+/**
+ * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
+ */
+struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
+
+/**
+ * Constructs a new COption_TypeZ containing nothing
+ */
+struct LDKCOption_TypeZ COption_TypeZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
+ */
+void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
+
+/**
+ * Creates a new COption_TypeZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
+
+/**
+ * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
+ */
+void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_SocketAddressZ containing a crate::lightning::ln::msgs::SocketAddress
+ */
+struct LDKCOption_SocketAddressZ COption_SocketAddressZ_some(struct LDKSocketAddress o);
+
+/**
+ * Constructs a new COption_SocketAddressZ containing nothing
+ */
+struct LDKCOption_SocketAddressZ COption_SocketAddressZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::ln::msgs::SocketAddress, if we are in the Some state
+ */
+void COption_SocketAddressZ_free(struct LDKCOption_SocketAddressZ _res);
+
+/**
+ * Creates a new COption_SocketAddressZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_PeerDetailsZ_free(struct LDKCVec_PeerDetailsZ _res);
+
+/**
+ * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
+ */
+struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
+
+/**
+ * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
+ */
+struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
+ */
+void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
+
+/**
+ * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NonePeerHandleErrorZ in the success state.
+ */
+struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
+
+/**
+ * Creates a new CResult_NonePeerHandleErrorZ in the error state.
+ */
+struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NonePeerHandleErrorZ.
+ */
+void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
+
+/**
+ * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_boolPeerHandleErrorZ in the success state.
+ */
+struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
+
+/**
+ * Creates a new CResult_boolPeerHandleErrorZ in the error state.
+ */
+struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_boolPeerHandleErrorZ.
+ */
+void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
+
+/**
+ * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_u32GraphSyncErrorZ in the success state.
+ */
+struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
+
+/**
+ * Creates a new CResult_u32GraphSyncErrorZ in the error state.
+ */
+struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_u32GraphSyncErrorZ.
+ */
+void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
+
+/**
+ * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
+ */
+struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_ok(struct LDKCVec_u8Z o);
+
+/**
+ * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
+ */
+struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_err(enum LDKIOError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CVec_u8ZIOErrorZ_is_ok(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CVec_u8ZIOErrorZ.
+ */
+void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
+
+/**
+ * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
+ */
+struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o);
+
+/**
+ * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
+ */
+struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CVec_StrZIOErrorZ_is_ok(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CVec_StrZIOErrorZ.
+ */
+void CResult_CVec_StrZIOErrorZ_free(struct LDKCResult_CVec_StrZIOErrorZ _res);
+
+/**
+ * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res);
+
+/**
+ * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state.
+ */
+struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o);
+
+/**
+ * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the error state.
+ */
+struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_err(enum LDKIOError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.
+ */
+void CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ _res);
+
+/**
+ * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the error state.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_err(enum LDKIOError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.
+ */
+void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(struct LDKUnsignedInvoiceRequest o);
+
+/**
+ * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ.
+ */
+void CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_ok(struct LDKInvoiceRequest o);
+
+/**
+ * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InvoiceRequestBolt12SemanticErrorZ.
+ */
+void CResult_InvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithExplicitSigningPubkeyBuilder o);
+
+/**
+ * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.
+ */
+void CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state.
+ */
+struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o);
+
+/**
+ * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the error state.
+ */
+struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_VerifiedInvoiceRequestNoneZ_is_ok(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_VerifiedInvoiceRequestNoneZ.
+ */
+void CResult_VerifiedInvoiceRequestNoneZ_free(struct LDKCResult_VerifiedInvoiceRequestNoneZ _res);
+
+/**
+ * Creates a new CResult_VerifiedInvoiceRequestNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the success state.
+ */
+struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithDerivedSigningPubkeyBuilder o);
+
+/**
+ * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the error state.
+ */
+struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.
+ */
+void CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the success state.
+ */
+struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_ok(struct LDKInvoiceRequestFields o);
+
+/**
+ * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the error state.
+ */
+struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InvoiceRequestFieldsDecodeErrorZ.
+ */
+void CResult_InvoiceRequestFieldsDecodeErrorZ_free(struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_clone(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_NoneZ containing a
+ */
+enum LDKCOption_NoneZ COption_NoneZ_some(void);
+
+/**
+ * Constructs a new COption_NoneZ containing nothing
+ */
+enum LDKCOption_NoneZ COption_NoneZ_none(void);
+
+/**
+ * Frees any resources associated with the , if we are in the Some state
+ */
+void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
+
+/**
+ * Constructs a new COption_ECDSASignatureZ containing a crate::c_types::ECDSASignature
+ */
+struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_some(struct LDKECDSASignature o);
+
+/**
+ * Constructs a new COption_ECDSASignatureZ containing nothing
+ */
+struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::ECDSASignature, if we are in the Some state
+ */
+void COption_ECDSASignatureZ_free(struct LDKCOption_ECDSASignatureZ _res);
+
+/**
+ * Creates a new COption_ECDSASignatureZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_clone(const struct LDKCOption_ECDSASignatureZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_i64Z containing a i64
+ */
+struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
+
+/**
+ * Constructs a new COption_i64Z containing nothing
+ */
+struct LDKCOption_i64Z COption_i64Z_none(void);
+
+/**
+ * Frees any resources associated with the i64, if we are in the Some state
+ */
+void COption_i64Z_free(struct LDKCOption_i64Z _res);
+
+/**
+ * Creates a new COption_i64Z which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_SocketAddressDecodeErrorZ in the success state.
+ */
+struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_ok(struct LDKSocketAddress o);
+
+/**
+ * Creates a new CResult_SocketAddressDecodeErrorZ in the error state.
+ */
+struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_SocketAddressDecodeErrorZ_is_ok(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_SocketAddressDecodeErrorZ.
+ */
+void CResult_SocketAddressDecodeErrorZ_free(struct LDKCResult_SocketAddressDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_SocketAddressDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_clone(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the success state.
+ */
+struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_ok(struct LDKSocketAddress o);
+
+/**
+ * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the error state.
+ */
+struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_err(enum LDKSocketAddressParseError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_SocketAddressSocketAddressParseErrorZ_is_ok(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_SocketAddressSocketAddressParseErrorZ.
+ */
+void CResult_SocketAddressSocketAddressParseErrorZ_free(struct LDKCResult_SocketAddressSocketAddressParseErrorZ _res);
+
+/**
+ * Creates a new CResult_SocketAddressSocketAddressParseErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_clone(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
+
+/**
+ * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
+ */
+struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
+
+/**
+ * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
+ */
+struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
+ */
+void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
+ */
+struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
+
+/**
+ * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
+ */
+struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
+ */
+void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_StfuDecodeErrorZ in the success state.
+ */
+struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_ok(struct LDKStfu o);
+
+/**
+ * Creates a new CResult_StfuDecodeErrorZ in the error state.
+ */
+struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_StfuDecodeErrorZ_is_ok(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_StfuDecodeErrorZ.
+ */
+void CResult_StfuDecodeErrorZ_free(struct LDKCResult_StfuDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_StfuDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_clone(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_SpliceInitDecodeErrorZ in the success state.
+ */
+struct LDKCResult_SpliceInitDecodeErrorZ CResult_SpliceInitDecodeErrorZ_ok(struct LDKSpliceInit o);
+
+/**
+ * Creates a new CResult_SpliceInitDecodeErrorZ in the error state.
+ */
+struct LDKCResult_SpliceInitDecodeErrorZ CResult_SpliceInitDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_SpliceInitDecodeErrorZ_is_ok(const struct LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_SpliceInitDecodeErrorZ.
+ */
+void CResult_SpliceInitDecodeErrorZ_free(struct LDKCResult_SpliceInitDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_SpliceInitDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_SpliceInitDecodeErrorZ CResult_SpliceInitDecodeErrorZ_clone(const struct LDKCResult_SpliceInitDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_SpliceAckDecodeErrorZ in the success state.
+ */
+struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_ok(struct LDKSpliceAck o);
+
+/**
+ * Creates a new CResult_SpliceAckDecodeErrorZ in the error state.
+ */
+struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_SpliceAckDecodeErrorZ_is_ok(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_SpliceAckDecodeErrorZ.
+ */
+void CResult_SpliceAckDecodeErrorZ_free(struct LDKCResult_SpliceAckDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_SpliceAckDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_clone(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_SpliceLockedDecodeErrorZ in the success state.
+ */
+struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_ok(struct LDKSpliceLocked o);
+
+/**
+ * Creates a new CResult_SpliceLockedDecodeErrorZ in the error state.
+ */
+struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_SpliceLockedDecodeErrorZ_is_ok(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_SpliceLockedDecodeErrorZ.
+ */
+void CResult_SpliceLockedDecodeErrorZ_free(struct LDKCResult_SpliceLockedDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_SpliceLockedDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_clone(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
+ */
+struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
+
+/**
+ * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
+ */
+struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
+ */
+void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
+ */
+struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
+
+/**
+ * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
+ */
+struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
+ */
+void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
+ */
+struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
+
+/**
+ * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
+ */
+struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
+ */
+void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
+ */
+struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
+
+/**
+ * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
+ */
+struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
+ */
+void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
+ */
+struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
+
+/**
+ * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
+ */
+struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
+ */
+void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
+ */
+struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
+
+/**
+ * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
+ */
+struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
+ */
+void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
+ */
+struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
+
+/**
+ * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
+ */
+struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
+ */
+void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
+ */
+struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
+
+/**
+ * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
+ */
+struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
+ */
+void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
+ */
+struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
+
+/**
+ * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
+ */
+struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
+ */
+void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
+ */
+struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
+
+/**
+ * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
+ */
+struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
+ */
+void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
+
+/**
+ * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
+ */
+void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
+
+/**
+ * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
+ */
+void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
+
+/**
+ * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
+ */
+void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_CommitmentSignedBatchDecodeErrorZ in the success state.
+ */
+struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CResult_CommitmentSignedBatchDecodeErrorZ_ok(struct LDKCommitmentSignedBatch o);
+
+/**
+ * Creates a new CResult_CommitmentSignedBatchDecodeErrorZ in the error state.
+ */
+struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CResult_CommitmentSignedBatchDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CommitmentSignedBatchDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CommitmentSignedBatchDecodeErrorZ.
+ */
+void CResult_CommitmentSignedBatchDecodeErrorZ_free(struct LDKCResult_CommitmentSignedBatchDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_CommitmentSignedBatchDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CommitmentSignedBatchDecodeErrorZ CResult_CommitmentSignedBatchDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedBatchDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
+ */
+struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
+
+/**
+ * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
+ */
+struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
+ */
+void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
+ */
+struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
+
+/**
+ * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
+ */
+struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
+ */
+void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
+ */
+struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
+
+/**
+ * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
+ */
+struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
+ */
+void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
+
+/**
+ * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
+ */
+void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_InitDecodeErrorZ in the success state.
+ */
+struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
+
+/**
+ * Creates a new CResult_InitDecodeErrorZ in the error state.
+ */
+struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InitDecodeErrorZ.
+ */
+void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
+
+/**
+ * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
+ */
+void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
+ */
+struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
+
+/**
+ * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
+ */
+struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
+ */
+void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
+
+/**
+ * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
+ */
+void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
+
+/**
+ * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
+ */
+void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
+ */
+struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
+
+/**
+ * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
+ */
+struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
+ */
+void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
+ */
+struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
+
+/**
+ * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
+ */
+struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
+ */
+void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
+ */
+struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
+
+/**
+ * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
+ */
+struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
+ */
+void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
+ */
+struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
+
+/**
+ * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
+ */
+struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
+ */
+void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OnionPacketDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_ok(struct LDKOnionPacket o);
+
+/**
+ * Creates a new CResult_OnionPacketDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OnionPacketDecodeErrorZ_is_ok(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OnionPacketDecodeErrorZ.
+ */
+void CResult_OnionPacketDecodeErrorZ_free(struct LDKCResult_OnionPacketDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OnionPacketDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_clone(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
+ */
+struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
+
+/**
+ * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
+ */
+struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
+ */
+void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
+
+/**
+ * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
+ */
+void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the success state.
+ */
+struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_ok(struct LDKFinalOnionHopData o);
+
+/**
+ * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the error state.
+ */
+struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_FinalOnionHopDataDecodeErrorZ_is_ok(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_FinalOnionHopDataDecodeErrorZ.
+ */
+void CResult_FinalOnionHopDataDecodeErrorZ_free(struct LDKCResult_FinalOnionHopDataDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_FinalOnionHopDataDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_clone(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PingDecodeErrorZ in the success state.
+ */
+struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
+
+/**
+ * Creates a new CResult_PingDecodeErrorZ in the error state.
+ */
+struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PingDecodeErrorZ.
+ */
+void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PongDecodeErrorZ in the success state.
+ */
+struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
+
+/**
+ * Creates a new CResult_PongDecodeErrorZ in the error state.
+ */
+struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PongDecodeErrorZ.
+ */
+void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
+ */
+struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
+
+/**
+ * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
+ */
+struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
+ */
+void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
+
+/**
+ * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
+ */
+void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
+ */
+struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
+
+/**
+ * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
+ */
+struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
+ */
+void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
+
+/**
+ * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
+ */
+void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
+
+/**
+ * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
+ */
+void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
+ */
+struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
+
+/**
+ * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
+ */
+struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
+ */
+void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
+ */
+struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
+
+/**
+ * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
+ */
+struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
+ */
+void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
+ */
+struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
+
+/**
+ * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
+ */
+struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
+ */
+void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
+ */
+struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
+
+/**
+ * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
+ */
+struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
+ */
+void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
+
+/**
+ * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
+ */
+void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
+ */
+struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
+
+/**
+ * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
+ */
+struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
+ */
+void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
+
+/**
+ * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
+ */
+void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
+ */
+struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
+
+/**
+ * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
+ */
+struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
+ */
+void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_InboundHTLCStateDetailsZ containing a crate::lightning::ln::channel_state::InboundHTLCStateDetails
+ */
+struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_some(enum LDKInboundHTLCStateDetails o);
+
+/**
+ * Constructs a new COption_InboundHTLCStateDetailsZ containing nothing
+ */
+struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::ln::channel_state::InboundHTLCStateDetails, if we are in the Some state
+ */
+void COption_InboundHTLCStateDetailsZ_free(struct LDKCOption_InboundHTLCStateDetailsZ _res);
+
+/**
+ * Creates a new COption_InboundHTLCStateDetailsZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_InboundHTLCStateDetailsZ COption_InboundHTLCStateDetailsZ_clone(const struct LDKCOption_InboundHTLCStateDetailsZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(struct LDKCOption_InboundHTLCStateDetailsZ o);
+
+/**
+ * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ.
+ */
+void CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(const struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ in the success state.
+ */
+struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_ok(struct LDKInboundHTLCDetails o);
+
+/**
+ * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ in the error state.
+ */
+struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(const struct LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InboundHTLCDetailsDecodeErrorZ.
+ */
+void CResult_InboundHTLCDetailsDecodeErrorZ_free(struct LDKCResult_InboundHTLCDetailsDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_InboundHTLCDetailsDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_InboundHTLCDetailsDecodeErrorZ CResult_InboundHTLCDetailsDecodeErrorZ_clone(const struct LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_OutboundHTLCStateDetailsZ containing a crate::lightning::ln::channel_state::OutboundHTLCStateDetails
+ */
+struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_some(enum LDKOutboundHTLCStateDetails o);
+
+/**
+ * Constructs a new COption_OutboundHTLCStateDetailsZ containing nothing
+ */
+struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::ln::channel_state::OutboundHTLCStateDetails, if we are in the Some state
+ */
+void COption_OutboundHTLCStateDetailsZ_free(struct LDKCOption_OutboundHTLCStateDetailsZ _res);
+
+/**
+ * Creates a new COption_OutboundHTLCStateDetailsZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_OutboundHTLCStateDetailsZ COption_OutboundHTLCStateDetailsZ_clone(const struct LDKCOption_OutboundHTLCStateDetailsZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(struct LDKCOption_OutboundHTLCStateDetailsZ o);
+
+/**
+ * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ.
+ */
+void CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(const struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_ok(struct LDKOutboundHTLCDetails o);
+
+/**
+ * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(const struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OutboundHTLCDetailsDecodeErrorZ.
+ */
+void CResult_OutboundHTLCDetailsDecodeErrorZ_free(struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OutboundHTLCDetailsDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ CResult_OutboundHTLCDetailsDecodeErrorZ_clone(const struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
+ */
+struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
+
+/**
+ * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
+ */
+struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
+ */
+void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
+
+/**
+ * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
+ */
+void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channel_state::ChannelShutdownState
+ */
+struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
+
+/**
+ * Constructs a new COption_ChannelShutdownStateZ containing nothing
+ */
+struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::ln::channel_state::ChannelShutdownState, if we are in the Some state
+ */
+void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
+
+/**
+ * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_InboundHTLCDetailsZ_free(struct LDKCVec_InboundHTLCDetailsZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_OutboundHTLCDetailsZ_free(struct LDKCVec_OutboundHTLCDetailsZ _res);
+
+/**
+ * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
+
+/**
+ * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
+ */
+void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
+
+/**
+ * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
+ */
+void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
+
+/**
+ * Creates a new CResult_HeldHtlcAvailableDecodeErrorZ in the success state.
+ */
+struct LDKCResult_HeldHtlcAvailableDecodeErrorZ CResult_HeldHtlcAvailableDecodeErrorZ_ok(struct LDKHeldHtlcAvailable o);
+
+/**
+ * Creates a new CResult_HeldHtlcAvailableDecodeErrorZ in the error state.
+ */
+struct LDKCResult_HeldHtlcAvailableDecodeErrorZ CResult_HeldHtlcAvailableDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_HeldHtlcAvailableDecodeErrorZ_is_ok(const struct LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_HeldHtlcAvailableDecodeErrorZ.
+ */
+void CResult_HeldHtlcAvailableDecodeErrorZ_free(struct LDKCResult_HeldHtlcAvailableDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_HeldHtlcAvailableDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_HeldHtlcAvailableDecodeErrorZ CResult_HeldHtlcAvailableDecodeErrorZ_clone(const struct LDKCResult_HeldHtlcAvailableDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ReleaseHeldHtlcDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ CResult_ReleaseHeldHtlcDecodeErrorZ_ok(struct LDKReleaseHeldHtlc o);
+
+/**
+ * Creates a new CResult_ReleaseHeldHtlcDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ CResult_ReleaseHeldHtlcDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ReleaseHeldHtlcDecodeErrorZ_is_ok(const struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ReleaseHeldHtlcDecodeErrorZ.
+ */
+void CResult_ReleaseHeldHtlcDecodeErrorZ_free(struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ReleaseHeldHtlcDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ CResult_ReleaseHeldHtlcDecodeErrorZ_clone(const struct LDKCResult_ReleaseHeldHtlcDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_AsyncPaymentsMessageDecodeErrorZ in the success state.
+ */
+struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ CResult_AsyncPaymentsMessageDecodeErrorZ_ok(struct LDKAsyncPaymentsMessage o);
+
+/**
+ * Creates a new CResult_AsyncPaymentsMessageDecodeErrorZ in the error state.
+ */
+struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ CResult_AsyncPaymentsMessageDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_AsyncPaymentsMessageDecodeErrorZ_is_ok(const struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_AsyncPaymentsMessageDecodeErrorZ.
+ */
+void CResult_AsyncPaymentsMessageDecodeErrorZ_free(struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_AsyncPaymentsMessageDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ CResult_AsyncPaymentsMessageDecodeErrorZ_clone(const struct LDKCResult_AsyncPaymentsMessageDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
+
+/**
+ * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
+ */
+void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
+ */
+struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
+
+/**
+ * Constructs a new COption_HTLCClaimZ containing nothing
+ */
+struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
+ */
+void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
+
+/**
+ * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
+ */
+struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
+
+/**
+ * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
+ */
+struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
+ */
+void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
+ */
+struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
+
+/**
+ * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
+ */
+struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
+ */
+void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
+
+/**
+ * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
+ */
+void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
+ */
+struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
+
+/**
+ * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
+ */
+struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
+ */
+void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
+ */
+struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
+
+/**
+ * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
+ */
+struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
+ */
+void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
+
+/**
+ * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
+ */
+void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
+ */
+struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
+
+/**
+ * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
+ */
+struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
+ */
+void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
+
+/**
+ * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
+ */
+void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
+ */
+struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
+
+/**
+ * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
+ */
+struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
+ */
+void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
+
+/**
+ * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
+ */
+struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
+
+/**
+ * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
+ */
+struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
+ */
+void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
+ */
+struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
+
+/**
+ * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
+ */
+struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
+ */
+void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
+
+/**
+ * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
+ */
+struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
+
+/**
+ * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
+ */
+struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
+ */
+void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
+
+/**
+ * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_usizeZ containing a usize
+ */
+struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
+
+/**
+ * Constructs a new COption_usizeZ containing nothing
+ */
+struct LDKCOption_usizeZ COption_usizeZ_none(void);
+
+/**
+ * Frees any resources associated with the usize, if we are in the Some state
+ */
+void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
+
+/**
+ * Creates a new COption_usizeZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
+
+/**
+ * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
+ */
+void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
+ */
+struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
+
+/**
+ * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
+ */
+struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
+ */
+void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
+
+/**
+ * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
+
+/**
+ * Creates a new CResult_FundingInfoDecodeErrorZ in the success state.
+ */
+struct LDKCResult_FundingInfoDecodeErrorZ CResult_FundingInfoDecodeErrorZ_ok(struct LDKFundingInfo o);
+
+/**
+ * Creates a new CResult_FundingInfoDecodeErrorZ in the error state.
+ */
+struct LDKCResult_FundingInfoDecodeErrorZ CResult_FundingInfoDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_FundingInfoDecodeErrorZ_is_ok(const struct LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_FundingInfoDecodeErrorZ.
+ */
+void CResult_FundingInfoDecodeErrorZ_free(struct LDKCResult_FundingInfoDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_FundingInfoDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_FundingInfoDecodeErrorZ CResult_FundingInfoDecodeErrorZ_clone(const struct LDKCResult_FundingInfoDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
+ */
+struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
+
+/**
+ * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
+ */
+struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
+ */
+void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_ok(struct LDKClaimedHTLC o);
+
+/**
+ * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ClaimedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ClaimedHTLCDecodeErrorZ.
+ */
+void CResult_ClaimedHTLCDecodeErrorZ_free(struct LDKCResult_ClaimedHTLCDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ClaimedHTLCDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_clone(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
+ */
+struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
+
+/**
+ * Constructs a new COption_PathFailureZ containing nothing
+ */
+struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
+ */
+void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
+
+/**
+ * Creates a new COption_PathFailureZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
+
+/**
+ * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
+ */
+void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
+ */
+struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
+
+/**
+ * Constructs a new COption_ClosureReasonZ containing nothing
+ */
+struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
+ */
+void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
+
+/**
+ * Creates a new COption_ClosureReasonZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
+
+/**
+ * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
+ */
+void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
+ */
+struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
+
+/**
+ * Constructs a new COption_HTLCDestinationZ containing nothing
+ */
+struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
+ */
+void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
+
+/**
+ * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
+
+/**
+ * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
+ */
+void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
+ */
+struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
+
+/**
+ * Constructs a new COption_PaymentFailureReasonZ containing nothing
+ */
+struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
+ */
+void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
+
+/**
+ * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_COption_PaymentFailureReasonZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_ok(struct LDKCOption_PaymentFailureReasonZ o);
+
+/**
+ * Creates a new CResult_COption_PaymentFailureReasonZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_COption_PaymentFailureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_COption_PaymentFailureReasonZDecodeErrorZ.
+ */
+void CResult_COption_PaymentFailureReasonZDecodeErrorZ_free(struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_COption_PaymentFailureReasonZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ CResult_COption_PaymentFailureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_PaymentFailureReasonZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_U128Z containing a crate::c_types::U128
+ */
+struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
+
+/**
+ * Constructs a new COption_U128Z containing nothing
+ */
+struct LDKCOption_U128Z COption_U128Z_none(void);
+
+/**
+ * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
+ */
+void COption_U128Z_free(struct LDKCOption_U128Z _res);
+
+/**
+ * Creates a new COption_U128Z which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
+
+/**
+ * Constructs a new COption_EventZ containing a crate::lightning::events::Event
+ */
+struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
+
+/**
+ * Constructs a new COption_EventZ containing nothing
+ */
+struct LDKCOption_EventZ COption_EventZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
+ */
+void COption_EventZ_free(struct LDKCOption_EventZ _res);
+
+/**
+ * Creates a new COption_EventZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
+
+/**
+ * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
+ */
+void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NonceDecodeErrorZ in the success state.
+ */
+struct LDKCResult_NonceDecodeErrorZ CResult_NonceDecodeErrorZ_ok(struct LDKNonce o);
+
+/**
+ * Creates a new CResult_NonceDecodeErrorZ in the error state.
+ */
+struct LDKCResult_NonceDecodeErrorZ CResult_NonceDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NonceDecodeErrorZ_is_ok(const struct LDKCResult_NonceDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NonceDecodeErrorZ.
+ */
+void CResult_NonceDecodeErrorZ_free(struct LDKCResult_NonceDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_NonceDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NonceDecodeErrorZ CResult_NonceDecodeErrorZ_clone(const struct LDKCResult_NonceDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
+
+/**
+ * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
+ */
+struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
+
+/**
+ * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
+ */
+struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
+ */
+void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
+
+/**
+ * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
+ */
+struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
+
+/**
+ * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
+ */
+struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
+ */
+void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
+ */
+struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
+
+/**
+ * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
+ */
+struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
+ */
+void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
+
+/**
+ * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
+ */
+struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
+
+/**
+ * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
+ */
+void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
+
+/**
+ * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
+ */
+struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_ok(struct LDKPayeePubKey o);
+
+/**
+ * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
+ */
+struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PayeePubKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PayeePubKeySecp256k1ErrorZ.
+ */
+void CResult_PayeePubKeySecp256k1ErrorZ_free(struct LDKCResult_PayeePubKeySecp256k1ErrorZ _res);
+
+/**
+ * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_clone(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
+
+/**
+ * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
+ */
+struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
+
+/**
+ * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
+ */
+struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
+ */
+void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
+
+/**
+ * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
+ */
+struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
+
+/**
+ * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
+ */
+struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
+ */
+void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
+ */
+struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
+
+/**
+ * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
+ */
+struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
+ */
+void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
+
+/**
+ * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_DescriptionCreationErrorZ in the success state.
+ */
+struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
+
+/**
+ * Creates a new CResult_DescriptionCreationErrorZ in the error state.
+ */
+struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_DescriptionCreationErrorZ.
+ */
+void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
+
+/**
+ * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
+ */
+struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
+
+/**
+ * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
+ */
+struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
+ */
+void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
+
+/**
+ * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OutPointDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
+
+/**
+ * Creates a new CResult_OutPointDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OutPointDecodeErrorZ.
+ */
+void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
+
+/**
+ * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
+ */
+void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
+ */
+struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
+
+/**
+ * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
+ */
+struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
+ */
+void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_HostnameDecodeErrorZ in the success state.
+ */
+struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
+
+/**
+ * Creates a new CResult_HostnameDecodeErrorZ in the error state.
+ */
+struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_HostnameDecodeErrorZ.
+ */
+void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
+ */
+struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
+
+/**
+ * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
+ */
+struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
+ */
+void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
+
+/**
+ * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
+ */
+struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
+
+/**
+ * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
+ */
+struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
+ */
+void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelIdDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_ok(struct LDKChannelId o);
+
+/**
+ * Creates a new CResult_ChannelIdDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ChannelIdDecodeErrorZ_is_ok(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ChannelIdDecodeErrorZ.
+ */
+void CResult_ChannelIdDecodeErrorZ_free(struct LDKCResult_ChannelIdDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ChannelIdDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_clone(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_clone(const struct LDKC2Tuple__u832u16Z *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple__u832u16Z from the contained elements.
+ */
+struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_new(struct LDKThirtyTwoBytes a, uint16_t b);
+
+/**
+ * Frees any resources used by the C2Tuple__u832u16Z.
+ */
+void C2Tuple__u832u16Z_free(struct LDKC2Tuple__u832u16Z _res);
+
+/**
+ * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
+
+/**
+ * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
+ */
+void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_BlindedPaymentPathNoneZ in the success state.
+ */
+struct LDKCResult_BlindedPaymentPathNoneZ CResult_BlindedPaymentPathNoneZ_ok(struct LDKBlindedPaymentPath o);
+
+/**
+ * Creates a new CResult_BlindedPaymentPathNoneZ in the error state.
+ */
+struct LDKCResult_BlindedPaymentPathNoneZ CResult_BlindedPaymentPathNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BlindedPaymentPathNoneZ_is_ok(const struct LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BlindedPaymentPathNoneZ.
+ */
+void CResult_BlindedPaymentPathNoneZ_free(struct LDKCResult_BlindedPaymentPathNoneZ _res);
+
+/**
+ * Creates a new CResult_BlindedPaymentPathNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BlindedPaymentPathNoneZ CResult_BlindedPaymentPathNoneZ_clone(const struct LDKCResult_BlindedPaymentPathNoneZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_PaymentForwardNodeZ_free(struct LDKCVec_PaymentForwardNodeZ _res);
+
+/**
+ * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
+ */
+struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o);
+
+/**
+ * Creates a new CResult_PaymentRelayDecodeErrorZ in the error state.
+ */
+struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PaymentRelayDecodeErrorZ_is_ok(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PaymentRelayDecodeErrorZ.
+ */
+void CResult_PaymentRelayDecodeErrorZ_free(struct LDKCResult_PaymentRelayDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_PaymentRelayDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_clone(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state.
+ */
+struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_ok(struct LDKPaymentConstraints o);
+
+/**
+ * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the error state.
+ */
+struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PaymentConstraintsDecodeErrorZ_is_ok(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PaymentConstraintsDecodeErrorZ.
+ */
+void CResult_PaymentConstraintsDecodeErrorZ_free(struct LDKCResult_PaymentConstraintsDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_PaymentConstraintsDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PaymentContextDecodeErrorZ in the success state.
+ */
+struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_ok(struct LDKPaymentContext o);
+
+/**
+ * Creates a new CResult_PaymentContextDecodeErrorZ in the error state.
+ */
+struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PaymentContextDecodeErrorZ.
+ */
+void CResult_PaymentContextDecodeErrorZ_free(struct LDKCResult_PaymentContextDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_PaymentContextDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_clone(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the success state.
+ */
+struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_ok(struct LDKUnknownPaymentContext o);
+
+/**
+ * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the error state.
+ */
+struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_UnknownPaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_UnknownPaymentContextDecodeErrorZ.
+ */
+void CResult_UnknownPaymentContextDecodeErrorZ_free(struct LDKCResult_UnknownPaymentContextDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_UnknownPaymentContextDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_clone(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the success state.
+ */
+struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_ok(struct LDKBolt12OfferContext o);
+
+/**
+ * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the error state.
+ */
+struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_Bolt12OfferContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_Bolt12OfferContextDecodeErrorZ.
+ */
+void CResult_Bolt12OfferContextDecodeErrorZ_free(struct LDKCResult_Bolt12OfferContextDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_Bolt12OfferContextDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the success state.
+ */
+struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_ok(struct LDKBolt12RefundContext o);
+
+/**
+ * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the error state.
+ */
+struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_Bolt12RefundContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_Bolt12RefundContextDecodeErrorZ.
+ */
+void CResult_Bolt12RefundContextDecodeErrorZ_free(struct LDKCResult_Bolt12RefundContextDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_Bolt12RefundContextDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
+ */
+struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
+
+/**
+ * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
+ */
+struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
+ */
+void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
+
+/**
+ * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ResponderDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ResponderDecodeErrorZ CResult_ResponderDecodeErrorZ_ok(struct LDKResponder o);
+
+/**
+ * Creates a new CResult_ResponderDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ResponderDecodeErrorZ CResult_ResponderDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_ResponderDecodeErrorZ_is_ok(const struct LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_ResponderDecodeErrorZ.
+ */
+void CResult_ResponderDecodeErrorZ_free(struct LDKCResult_ResponderDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_ResponderDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_ResponderDecodeErrorZ CResult_ResponderDecodeErrorZ_clone(const struct LDKCResult_ResponderDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_MessageContextZ containing a crate::lightning::blinded_path::message::MessageContext
+ */
+struct LDKCOption_MessageContextZ COption_MessageContextZ_some(struct LDKMessageContext o);
+
+/**
+ * Constructs a new COption_MessageContextZ containing nothing
+ */
+struct LDKCOption_MessageContextZ COption_MessageContextZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::blinded_path::message::MessageContext, if we are in the Some state
+ */
+void COption_MessageContextZ_free(struct LDKCOption_MessageContextZ _res);
+
+/**
+ * Creates a new COption_MessageContextZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_MessageContextZ COption_MessageContextZ_clone(const struct LDKCOption_MessageContextZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(const struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ from the contained elements.
+ */
+struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(struct LDKPublicKey a, struct LDKOnionMessage b, struct LDKCOption_CVec_SocketAddressZZ c);
+
+/**
+ * Frees any resources used by the C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.
+ */
+void C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res);
+
+/**
+ * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the success state.
+ */
+struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o);
+
+/**
+ * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the error state.
+ */
+struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(struct LDKSendError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.
+ */
+void CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res);
+
+/**
+ * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PeeledOnionNoneZ in the success state.
+ */
+struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_ok(struct LDKPeeledOnion o);
+
+/**
+ * Creates a new CResult_PeeledOnionNoneZ in the error state.
+ */
+struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_PeeledOnionNoneZ_is_ok(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_PeeledOnionNoneZ.
+ */
+void CResult_PeeledOnionNoneZ_free(struct LDKCResult_PeeledOnionNoneZ _res);
+
+/**
+ * Creates a new CResult_PeeledOnionNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_clone(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_SendSuccessSendErrorZ in the success state.
+ */
+struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_ok(struct LDKSendSuccess o);
+
+/**
+ * Creates a new CResult_SendSuccessSendErrorZ in the error state.
+ */
+struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_err(struct LDKSendError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_SendSuccessSendErrorZ_is_ok(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_SendSuccessSendErrorZ.
+ */
+void CResult_SendSuccessSendErrorZ_free(struct LDKCResult_SendSuccessSendErrorZ _res);
+
+/**
+ * Creates a new CResult_SendSuccessSendErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_clone(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_NoneSendErrorZ in the success state.
+ */
+struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void);
+
+/**
+ * Creates a new CResult_NoneSendErrorZ in the error state.
+ */
+struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_NoneSendErrorZ.
+ */
+void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res);
+
+/**
+ * Creates a new CResult_NoneSendErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_clone(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
+
+/**
+ * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
+ */
+void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
+
+/**
+ * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
+ */
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
+
+/**
+ * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
+ */
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
+ */
+void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
+
+/**
+ * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
+ */
+struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
+
+/**
+ * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
+ */
+struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
+ */
+void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the success state.
+ */
+struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_ok(struct LDKTrackedSpendableOutput o);
+
+/**
+ * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the error state.
+ */
+struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_TrackedSpendableOutputDecodeErrorZ.
+ */
+void CResult_TrackedSpendableOutputDecodeErrorZ_free(struct LDKCResult_TrackedSpendableOutputDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_clone(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_ok(struct LDKOutputSpendStatus o);
+
+/**
+ * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OutputSpendStatusDecodeErrorZ_is_ok(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OutputSpendStatusDecodeErrorZ.
+ */
+void CResult_OutputSpendStatusDecodeErrorZ_free(struct LDKCResult_OutputSpendStatusDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OutputSpendStatusDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_clone(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
+ */
+struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
+
+/**
+ * Constructs a new COption_FilterZ containing nothing
+ */
+struct LDKCOption_FilterZ COption_FilterZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
+ */
+void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_TrackedSpendableOutputZ_free(struct LDKCVec_TrackedSpendableOutputZ _res);
+
+/**
+ * Creates a new CResult_OutputSweeperDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_ok(struct LDKOutputSweeper o);
+
+/**
+ * Creates a new CResult_OutputSweeperDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OutputSweeperDecodeErrorZ_is_ok(const struct LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OutputSweeperDecodeErrorZ.
+ */
+void CResult_OutputSweeperDecodeErrorZ_free(struct LDKCResult_OutputSweeperDecodeErrorZ _res);
+
+/**
+ * Creates a new C2Tuple_BestBlockOutputSweeperZ from the contained elements.
+ */
+struct LDKC2Tuple_BestBlockOutputSweeperZ C2Tuple_BestBlockOutputSweeperZ_new(struct LDKBestBlock a, struct LDKOutputSweeper b);
+
+/**
+ * Frees any resources used by the C2Tuple_BestBlockOutputSweeperZ.
+ */
+void C2Tuple_BestBlockOutputSweeperZ_free(struct LDKC2Tuple_BestBlockOutputSweeperZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the success state.
+ */
+struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(struct LDKC2Tuple_BestBlockOutputSweeperZ o);
+
+/**
+ * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the error state.
+ */
+struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.
+ */
+void CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the success state.
+ */
+struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_ok(struct LDKDelayedPaymentBasepoint o);
+
+/**
+ * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the error state.
+ */
+struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_DelayedPaymentBasepointDecodeErrorZ.
+ */
+void CResult_DelayedPaymentBasepointDecodeErrorZ_free(struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the success state.
+ */
+struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_ok(struct LDKDelayedPaymentKey o);
+
+/**
+ * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the error state.
+ */
+struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_DelayedPaymentKeyDecodeErrorZ.
+ */
+void CResult_DelayedPaymentKeyDecodeErrorZ_free(struct LDKCResult_DelayedPaymentKeyDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_HtlcBasepointDecodeErrorZ in the success state.
+ */
+struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_ok(struct LDKHtlcBasepoint o);
+
+/**
+ * Creates a new CResult_HtlcBasepointDecodeErrorZ in the error state.
+ */
+struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_HtlcBasepointDecodeErrorZ_is_ok(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_HtlcBasepointDecodeErrorZ.
+ */
+void CResult_HtlcBasepointDecodeErrorZ_free(struct LDKCResult_HtlcBasepointDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_HtlcBasepointDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_clone(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_HtlcKeyDecodeErrorZ in the success state.
+ */
+struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_ok(struct LDKHtlcKey o);
+
+/**
+ * Creates a new CResult_HtlcKeyDecodeErrorZ in the error state.
+ */
+struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_HtlcKeyDecodeErrorZ_is_ok(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_HtlcKeyDecodeErrorZ.
+ */
+void CResult_HtlcKeyDecodeErrorZ_free(struct LDKCResult_HtlcKeyDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_HtlcKeyDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_clone(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RevocationBasepointDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_ok(struct LDKRevocationBasepoint o);
+
+/**
+ * Creates a new CResult_RevocationBasepointDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RevocationBasepointDecodeErrorZ_is_ok(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RevocationBasepointDecodeErrorZ.
+ */
+void CResult_RevocationBasepointDecodeErrorZ_free(struct LDKCResult_RevocationBasepointDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RevocationBasepointDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_clone(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RevocationKeyDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_ok(struct LDKRevocationKey o);
+
+/**
+ * Creates a new CResult_RevocationKeyDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_RevocationKeyDecodeErrorZ_is_ok(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_RevocationKeyDecodeErrorZ.
+ */
+void CResult_RevocationKeyDecodeErrorZ_free(struct LDKCResult_RevocationKeyDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RevocationKeyDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_clone(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
+ */
+struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
+
+/**
+ * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
+ */
+struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
+ */
+void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_clone(const struct LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_OutPointChannelIdZ from the contained elements.
+ */
+struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_new(struct LDKOutPoint a, struct LDKChannelId b);
+
+/**
+ * Frees any resources used by the C2Tuple_OutPointChannelIdZ.
+ */
+void C2Tuple_OutPointChannelIdZ_free(struct LDKC2Tuple_OutPointChannelIdZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_OutPointChannelIdZZ_free(struct LDKCVec_C2Tuple_OutPointChannelIdZZ _res);
+
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_OutPointCVec_u64ZZ C2Tuple_OutPointCVec_u64ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u64ZZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_OutPointCVec_u64ZZ from the contained elements.
+ */
+struct LDKC2Tuple_OutPointCVec_u64ZZ C2Tuple_OutPointCVec_u64ZZ_new(struct LDKOutPoint a, struct LDKCVec_u64Z b);
+
+/**
+ * Frees any resources used by the C2Tuple_OutPointCVec_u64ZZ.
+ */
+void C2Tuple_OutPointCVec_u64ZZ_free(struct LDKC2Tuple_OutPointCVec_u64ZZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_C2Tuple_OutPointCVec_u64ZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_u64ZZZ _res);
+
+/**
+ * Creates a new CResult_BlindedMessagePathDecodeErrorZ in the success state.
+ */
+struct LDKCResult_BlindedMessagePathDecodeErrorZ CResult_BlindedMessagePathDecodeErrorZ_ok(struct LDKBlindedMessagePath o);
+
+/**
+ * Creates a new CResult_BlindedMessagePathDecodeErrorZ in the error state.
+ */
+struct LDKCResult_BlindedMessagePathDecodeErrorZ CResult_BlindedMessagePathDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BlindedMessagePathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BlindedMessagePathDecodeErrorZ.
+ */
+void CResult_BlindedMessagePathDecodeErrorZ_free(struct LDKCResult_BlindedMessagePathDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_BlindedMessagePathDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BlindedMessagePathDecodeErrorZ CResult_BlindedMessagePathDecodeErrorZ_clone(const struct LDKCResult_BlindedMessagePathDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_BlindedMessagePathNoneZ in the success state.
+ */
+struct LDKCResult_BlindedMessagePathNoneZ CResult_BlindedMessagePathNoneZ_ok(struct LDKBlindedMessagePath o);
+
+/**
+ * Creates a new CResult_BlindedMessagePathNoneZ in the error state.
+ */
+struct LDKCResult_BlindedMessagePathNoneZ CResult_BlindedMessagePathNoneZ_err(void);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_BlindedMessagePathNoneZ_is_ok(const struct LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_BlindedMessagePathNoneZ.
+ */
+void CResult_BlindedMessagePathNoneZ_free(struct LDKCResult_BlindedMessagePathNoneZ _res);
+
+/**
+ * Creates a new CResult_BlindedMessagePathNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_BlindedMessagePathNoneZ CResult_BlindedMessagePathNoneZ_clone(const struct LDKCResult_BlindedMessagePathNoneZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_MessageContextDecodeErrorZ in the success state.
+ */
+struct LDKCResult_MessageContextDecodeErrorZ CResult_MessageContextDecodeErrorZ_ok(struct LDKMessageContext o);
+
+/**
+ * Creates a new CResult_MessageContextDecodeErrorZ in the error state.
+ */
+struct LDKCResult_MessageContextDecodeErrorZ CResult_MessageContextDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_MessageContextDecodeErrorZ_is_ok(const struct LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_MessageContextDecodeErrorZ.
+ */
+void CResult_MessageContextDecodeErrorZ_free(struct LDKCResult_MessageContextDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_MessageContextDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_MessageContextDecodeErrorZ CResult_MessageContextDecodeErrorZ_clone(const struct LDKCResult_MessageContextDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_OffersContextDecodeErrorZ in the success state.
+ */
+struct LDKCResult_OffersContextDecodeErrorZ CResult_OffersContextDecodeErrorZ_ok(struct LDKOffersContext o);
+
+/**
+ * Creates a new CResult_OffersContextDecodeErrorZ in the error state.
+ */
+struct LDKCResult_OffersContextDecodeErrorZ CResult_OffersContextDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Checks if the given object is currently in the success state
+ */
+bool CResult_OffersContextDecodeErrorZ_is_ok(const struct LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the CResult_OffersContextDecodeErrorZ.
+ */
+void CResult_OffersContextDecodeErrorZ_free(struct LDKCResult_OffersContextDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_OffersContextDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_OffersContextDecodeErrorZ CResult_OffersContextDecodeErrorZ_clone(const struct LDKCResult_OffersContextDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees any resources used by the APIError
+ */
+void APIError_free(struct LDKAPIError this_ptr);
+
+/**
+ * Creates a copy of the APIError
+ */
+struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new APIMisuseError-variant APIError
+ */
+struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
+
+/**
+ * Utility method to constructs a new FeeRateTooHigh-variant APIError
+ */
+struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
+
+/**
+ * Utility method to constructs a new InvalidRoute-variant APIError
+ */
+struct LDKAPIError APIError_invalid_route(struct LDKStr err);
+
+/**
+ * Utility method to constructs a new ChannelUnavailable-variant APIError
+ */
+struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
+
+/**
+ * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
+ */
+struct LDKAPIError APIError_monitor_update_in_progress(void);
+
+/**
+ * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
+ */
+struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
+
+/**
+ * Checks if two APIErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
+
+/**
+ * Serialize the APIError object into a byte array which can be read by APIError_read
+ */
+struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
+
+/**
+ * Read a APIError from a byte array, created by APIError_write
+ */
+struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
+ */
+void BigSize_free(struct LDKBigSize this_obj);
+
+uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
+
+void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Constructs a new BigSize given each field
+ */
+MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
+
+/**
+ * Creates a copy of the BigSize
+ */
+struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the BigSize.
+ */
+uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
+
+/**
+ * Checks if two BigSizes contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
+
+/**
+ * Serialize the BigSize object into a byte array which can be read by BigSize_read
+ */
+struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
+
+/**
+ * Read a BigSize from a byte array, created by BigSize_write
+ */
+struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
+
+/**
+ * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
+ */
+struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
+
+/**
+ * Read a UntrustedString from a byte array, created by UntrustedString_write
+ */
+struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
+ */
+void Hostname_free(struct LDKHostname this_obj);
+
+/**
+ * Creates a copy of the Hostname
+ */
+struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the Hostname.
+ */
+uint64_t Hostname_hash(const struct LDKHostname *NONNULL_PTR o);
+
+/**
+ * Checks if two Hostnames contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
+
+/**
+ * Returns the length of the hostname.
+ */
+MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
+
+/**
+ * Get the string representation of a Hostname object
+ */
+struct LDKStr Hostname_to_str(const struct LDKHostname *NONNULL_PTR o);
+
+/**
+ * Serialize the Hostname object into a byte array which can be read by Hostname_read
+ */
+struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
+
+/**
+ * Read a Hostname from a byte array, created by Hostname_write
+ */
+struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
+ */
+void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
+
+/**
+ * Creates a copy of the TransactionU16LenLimited
+ */
+struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the TransactionU16LenLimited.
+ */
+uint64_t TransactionU16LenLimited_hash(const struct LDKTransactionU16LenLimited *NONNULL_PTR o);
+
+/**
+ * Checks if two TransactionU16LenLimiteds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
+
+/**
+ * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
+ * serialized length is <= u16::MAX.
+ */
+MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
+
+/**
+ * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
+ */
+MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
+
+/**
+ * Returns a reference to the contained `Transaction`
+ */
+MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_as_transaction(const struct LDKTransactionU16LenLimited *NONNULL_PTR this_arg);
+
+/**
+ * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
+ */
+struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
+
+/**
+ * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
+ */
+struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
+
+/**
+ * Creates a digital signature of a message given a SecretKey, like the node's secret.
+ * 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.
+ * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
+ */
+struct LDKStr sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
+
+/**
+ * Recovers the PublicKey of the signer of the message given the message and the signature.
+ */
+struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
+
+/**
+ * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
+ * and the PublicKey.
+ */
+bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
+
+/**
+ * Calls the free function if one is set
+ */
+void KVStore_free(struct LDKKVStore this_ptr);
+
+/**
+ * Calls the free function if one is set
+ */
+void Persister_free(struct LDKPersister this_ptr);
+
+/**
+ * Read previously persisted [`ChannelMonitor`]s from the store.
+ */
+struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
+
+/**
+ * Frees any resources used by the MonitorUpdatingPersister, if is_owned is set and inner is non-NULL.
+ */
+void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
+
+/**
+ * Constructs a new [`MonitorUpdatingPersister`].
+ *
+ * The `maximum_pending_updates` parameter controls how many updates may be stored before a
+ * [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
+ * consolidation will frequently occur with fewer updates than what you set here; this number
+ * is merely the maximum that may be stored. When setting this value, consider that for higher
+ * values of `maximum_pending_updates`:
+ *
+ * - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
+ * [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
+ * `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
+ * - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
+ * \"waves\" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
+ * less frequent \"waves.\"
+ * - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
+ * [`MonitorUpdatingPersister::cleanup_stale_updates`].
+ */
+MUST_USE_RES struct LDKMonitorUpdatingPersister MonitorUpdatingPersister_new(struct LDKKVStore kv_store, struct LDKLogger logger, uint64_t maximum_pending_updates, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator);
+
+/**
+ * Reads all stored channel monitors, along with any stored updates for them.
+ *
+ * It is extremely important that your [`KVStore::read`] implementation uses the
+ * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
+ * documentation for [`MonitorUpdatingPersister`].
+ */
+MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ MonitorUpdatingPersister_read_all_channel_monitors_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
+
+/**
+ * Read a single channel monitor, along with any stored updates for it.
+ *
+ * It is extremely important that your [`KVStore::read`] implementation uses the
+ * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
+ * documentation for [`MonitorUpdatingPersister`].
+ *
+ * For `monitor_key`, channel storage keys be the channel's transaction ID and index, or
+ * [`OutPoint`], with an underscore `_` between them. For example, given:
+ *
+ * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
+ * - Index: `1`
+ *
+ * The correct `monitor_key` would be:
+ * `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
+ *
+ * Loading a large number of monitors will be faster if done in parallel. You can use this
+ * function to accomplish this. Take care to limit the number of parallel readers.
+ */
+MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ MonitorUpdatingPersister_read_channel_monitor_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, struct LDKStr monitor_key);
+
+/**
+ * Cleans up stale updates for all monitors.
+ *
+ * This function works by first listing all monitors, and then for each of them, listing all
+ * updates. The updates that have an `update_id` less than or equal to than the stored monitor
+ * are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
+ * be passed to [`KVStore::remove`].
+ */
+MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy);
+
+/**
+ * Constructs a new Persist which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
+ */
+struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
+
+/**
+ * Creates a copy of the ShortChannelIdError
+ */
+enum LDKShortChannelIdError ShortChannelIdError_clone(const enum LDKShortChannelIdError *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new BlockOverflow-variant ShortChannelIdError
+ */
+enum LDKShortChannelIdError ShortChannelIdError_block_overflow(void);
+
+/**
+ * Utility method to constructs a new TxIndexOverflow-variant ShortChannelIdError
+ */
+enum LDKShortChannelIdError ShortChannelIdError_tx_index_overflow(void);
+
+/**
+ * Utility method to constructs a new VoutIndexOverflow-variant ShortChannelIdError
+ */
+enum LDKShortChannelIdError ShortChannelIdError_vout_index_overflow(void);
+
+/**
+ * Checks if two ShortChannelIdErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool ShortChannelIdError_eq(const enum LDKShortChannelIdError *NONNULL_PTR a, const enum LDKShortChannelIdError *NONNULL_PTR b);
+
+/**
+ * Extracts the block height (most significant 3-bytes) from the `short_channel_id`
+ */
+uint32_t block_from_scid(uint64_t short_channel_id);
+
+/**
+ * Extracts the tx index (bytes [2..4]) from the `short_channel_id`
+ */
+uint32_t tx_index_from_scid(uint64_t short_channel_id);
+
+/**
+ * Extracts the vout (bytes [0..2]) from the `short_channel_id`
+ */
+uint16_t vout_from_scid(uint64_t short_channel_id);
+
+/**
+ * Constructs a `short_channel_id` using the components pieces. Results in an error
+ * if the block height, tx index, or vout index overflow the maximum sizes.
+ */
+struct LDKCResult_u64ShortChannelIdErrorZ scid_from_parts(uint64_t block, uint64_t tx_index, uint64_t vout_index);
+
+/**
+ * Frees any resources used by the TrackedSpendableOutput, if is_owned is set and inner is non-NULL.
+ */
+void TrackedSpendableOutput_free(struct LDKTrackedSpendableOutput this_obj);
+
+/**
+ * The tracked output descriptor.
+ */
+struct LDKSpendableOutputDescriptor TrackedSpendableOutput_get_descriptor(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
+
+/**
+ * The tracked output descriptor.
+ */
+void TrackedSpendableOutput_set_descriptor(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKSpendableOutputDescriptor val);
+
+/**
+ * The channel this output belongs to.
+ *
+ * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`]
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKChannelId TrackedSpendableOutput_get_channel_id(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
+
+/**
+ * The channel this output belongs to.
+ *
+ * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`]
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void TrackedSpendableOutput_set_channel_id(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The current status of the output spend.
+ */
+struct LDKOutputSpendStatus TrackedSpendableOutput_get_status(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr);
+
+/**
+ * The current status of the output spend.
+ */
+void TrackedSpendableOutput_set_status(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKOutputSpendStatus val);
+
+/**
+ * Constructs a new TrackedSpendableOutput given each field
+ *
+ * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKTrackedSpendableOutput TrackedSpendableOutput_new(struct LDKSpendableOutputDescriptor descriptor_arg, struct LDKChannelId channel_id_arg, struct LDKOutputSpendStatus status_arg);
+
+/**
+ * Creates a copy of the TrackedSpendableOutput
+ */
+struct LDKTrackedSpendableOutput TrackedSpendableOutput_clone(const struct LDKTrackedSpendableOutput *NONNULL_PTR orig);
+
+/**
+ * Checks if two TrackedSpendableOutputs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool TrackedSpendableOutput_eq(const struct LDKTrackedSpendableOutput *NONNULL_PTR a, const struct LDKTrackedSpendableOutput *NONNULL_PTR b);
+
+/**
+ * Returns whether the output is spent in the given transaction.
+ */
+MUST_USE_RES bool TrackedSpendableOutput_is_spent_in(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_arg, struct LDKTransaction tx);
+
+/**
+ * Serialize the TrackedSpendableOutput object into a byte array which can be read by TrackedSpendableOutput_read
+ */
+struct LDKCVec_u8Z TrackedSpendableOutput_write(const struct LDKTrackedSpendableOutput *NONNULL_PTR obj);
+
+/**
+ * Read a TrackedSpendableOutput from a byte array, created by TrackedSpendableOutput_write
+ */
+struct LDKCResult_TrackedSpendableOutputDecodeErrorZ TrackedSpendableOutput_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the OutputSpendStatus
+ */
+void OutputSpendStatus_free(struct LDKOutputSpendStatus this_ptr);
+
+/**
+ * Creates a copy of the OutputSpendStatus
+ */
+struct LDKOutputSpendStatus OutputSpendStatus_clone(const struct LDKOutputSpendStatus *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new PendingInitialBroadcast-variant OutputSpendStatus
+ */
+struct LDKOutputSpendStatus OutputSpendStatus_pending_initial_broadcast(struct LDKCOption_u32Z delayed_until_height);
+
+/**
+ * Utility method to constructs a new PendingFirstConfirmation-variant OutputSpendStatus
+ */
+struct LDKOutputSpendStatus OutputSpendStatus_pending_first_confirmation(struct LDKThirtyTwoBytes first_broadcast_hash, uint32_t latest_broadcast_height, struct LDKTransaction latest_spending_tx);
+
+/**
+ * Utility method to constructs a new PendingThresholdConfirmations-variant OutputSpendStatus
+ */
+struct LDKOutputSpendStatus OutputSpendStatus_pending_threshold_confirmations(struct LDKThirtyTwoBytes first_broadcast_hash, uint32_t latest_broadcast_height, struct LDKTransaction latest_spending_tx, uint32_t confirmation_height, struct LDKThirtyTwoBytes confirmation_hash);
+
+/**
+ * Checks if two OutputSpendStatuss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool OutputSpendStatus_eq(const struct LDKOutputSpendStatus *NONNULL_PTR a, const struct LDKOutputSpendStatus *NONNULL_PTR b);
+
+/**
+ * Serialize the OutputSpendStatus object into a byte array which can be read by OutputSpendStatus_read
+ */
+struct LDKCVec_u8Z OutputSpendStatus_write(const struct LDKOutputSpendStatus *NONNULL_PTR obj);
+
+/**
+ * Read a OutputSpendStatus from a byte array, created by OutputSpendStatus_write
+ */
+struct LDKCResult_OutputSpendStatusDecodeErrorZ OutputSpendStatus_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the OutputSweeper, if is_owned is set and inner is non-NULL.
+ */
+void OutputSweeper_free(struct LDKOutputSweeper this_obj);
+
+/**
+ * Constructs a new [`OutputSweeper`].
+ *
+ * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users also
+ * need to register their [`Filter`] implementation via the given `chain_data_source`.
+ */
+MUST_USE_RES struct LDKOutputSweeper OutputSweeper_new(struct LDKBestBlock best_block, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKCOption_FilterZ chain_data_source, struct LDKOutputSpender output_spender, struct LDKChangeDestinationSource change_destination_source, struct LDKKVStore kv_store, struct LDKLogger logger);
+
+/**
+ * Tells the sweeper to track the given outputs descriptors.
+ *
+ * Usually, this should be called based on the values emitted by the
+ * [`Event::SpendableOutputs`].
+ *
+ * The given `exclude_static_outputs` flag controls whether the sweeper will filter out
+ * [`SpendableOutputDescriptor::StaticOutput`]s, which may be handled directly by the on-chain
+ * wallet implementation.
+ *
+ * If `delay_until_height` is set, we will delay the spending until the respective block
+ * height is reached. This can be used to batch spends, e.g., to reduce on-chain fees.
+ *
+ * Returns `Err` on persistence failure, in which case the call may be safely retried.
+ *
+ * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs
+ *
+ * Note that channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKCResult_NoneNoneZ OutputSweeper_track_spendable_outputs(const struct LDKOutputSweeper *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ output_descriptors, struct LDKChannelId channel_id, bool exclude_static_outputs, struct LDKCOption_u32Z delay_until_height);
+
+/**
+ * Returns a list of the currently tracked spendable outputs.
+ */
+MUST_USE_RES struct LDKCVec_TrackedSpendableOutputZ OutputSweeper_tracked_spendable_outputs(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
+
+/**
+ * Gets the latest best block which was connected either via the [`Listen`] or
+ * [`Confirm`] interfaces.
+ */
+MUST_USE_RES struct LDKBestBlock OutputSweeper_current_best_block(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new Listen which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
+ */
+struct LDKListen OutputSweeper_as_Listen(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new Confirm which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
+ */
+struct LDKConfirm OutputSweeper_as_Confirm(const struct LDKOutputSweeper *NONNULL_PTR this_arg);
+
+/**
+ * Frees any resources used by the SpendingDelay
+ */
+void SpendingDelay_free(struct LDKSpendingDelay this_ptr);
+
+/**
+ * Creates a copy of the SpendingDelay
+ */
+struct LDKSpendingDelay SpendingDelay_clone(const struct LDKSpendingDelay *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new Relative-variant SpendingDelay
+ */
+struct LDKSpendingDelay SpendingDelay_relative(uint32_t num_blocks);
+
+/**
+ * Utility method to constructs a new Absolute-variant SpendingDelay
+ */
+struct LDKSpendingDelay SpendingDelay_absolute(uint32_t height);
+
+/**
+ * Read a OutputSweeper from a byte array, created by OutputSweeper_write
+ */
+struct LDKCResult_OutputSweeperDecodeErrorZ OutputSweeper_read(struct LDKu8slice ser, struct LDKBroadcasterInterface arg_a, struct LDKFeeEstimator arg_b, struct LDKCOption_FilterZ arg_c, struct LDKOutputSpender arg_d, struct LDKChangeDestinationSource arg_e, struct LDKKVStore arg_f, struct LDKLogger arg_g);
+
+/**
+ * Read a C2Tuple_BestBlockOutputSweeperZ from a byte array, created by C2Tuple_BestBlockOutputSweeperZ_write
+ */
+struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ C2Tuple_BestBlockOutputSweeperZ_read(struct LDKu8slice ser, struct LDKBroadcasterInterface arg_a, struct LDKFeeEstimator arg_b, struct LDKCOption_FilterZ arg_c, struct LDKOutputSpender arg_d, struct LDKChangeDestinationSource arg_e, struct LDKKVStore arg_f, struct LDKLogger arg_g);
+
+/**
+ * Calls the free function if one is set
+ */
+void FutureCallback_free(struct LDKFutureCallback this_ptr);
+
+/**
+ * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
+ */
+void Future_free(struct LDKFuture this_obj);
+
+/**
+ * Registers a callback to be called upon completion of this future. If the future has already
+ * completed, the callback will be called immediately.
+ */
+void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
+
+/**
+ * Waits until this [`Future`] completes.
+ */
+void Future_wait(const struct LDKFuture *NONNULL_PTR this_arg);
+
+/**
+ * Waits until this [`Future`] completes or the given amount of time has elapsed.
+ *
+ * Returns true if the [`Future`] completed, false if the time elapsed.
+ */
+MUST_USE_RES bool Future_wait_timeout(const struct LDKFuture *NONNULL_PTR this_arg, uint64_t max_wait);
+
+/**
+ * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
+ */
+void Sleeper_free(struct LDKSleeper this_obj);
+
+/**
+ * Constructs a new sleeper from one future, allowing blocking on it.
+ */
+MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(const struct LDKFuture *NONNULL_PTR future);
+
+/**
+ * Constructs a new sleeper from two futures, allowing blocking on both at once.
+ */
+MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b);
+
+/**
+ * Constructs a new sleeper from three futures, allowing blocking on all three at once.
+ *
+ */
+MUST_USE_RES struct LDKSleeper Sleeper_from_three_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b, const struct LDKFuture *NONNULL_PTR fut_c);
+
+/**
+ * Constructs a new sleeper on many futures, allowing blocking on all at once.
+ */
+MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
+
+/**
+ * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
+ */
+void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
+
+/**
+ * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
+ * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
+ * elapsed.
+ */
+MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
+
+/**
+ * Creates a copy of the Level
+ */
+enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new Gossip-variant Level
+ */
+enum LDKLevel Level_gossip(void);
+
+/**
+ * Utility method to constructs a new Trace-variant Level
+ */
+enum LDKLevel Level_trace(void);
+
+/**
+ * Utility method to constructs a new Debug-variant Level
+ */
+enum LDKLevel Level_debug(void);
+
+/**
+ * Utility method to constructs a new Info-variant Level
+ */
+enum LDKLevel Level_info(void);
+
+/**
+ * Utility method to constructs a new Warn-variant Level
+ */
+enum LDKLevel Level_warn(void);
+
+/**
+ * Utility method to constructs a new Error-variant Level
+ */
+enum LDKLevel Level_error(void);
+
+/**
+ * Checks if two Levels contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the Level.
+ */
+uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
+
+/**
+ * Get the string representation of a Level object
+ */
+struct LDKStr Level_to_str(const enum LDKLevel *NONNULL_PTR o);
+
+/**
+ * Returns the most verbose logging level.
+ */
+MUST_USE_RES enum LDKLevel Level_max(void);
+
+/**
+ * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
+ */
+void Record_free(struct LDKRecord this_obj);
+
+/**
+ * The verbosity level of the message.
+ */
+enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
+
+/**
+ * The verbosity level of the message.
+ */
+void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
+
+/**
+ * The node id of the peer pertaining to the logged record.
+ *
+ * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
+ * `None`, depending on if the peer information is readily available in LDK when the log is
+ * generated.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKPublicKey Record_get_peer_id(const struct LDKRecord *NONNULL_PTR this_ptr);
+
+/**
+ * The node id of the peer pertaining to the logged record.
+ *
+ * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
+ * `None`, depending on if the peer information is readily available in LDK when the log is
+ * generated.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void Record_set_peer_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The channel id of the channel pertaining to the logged record. May be a temporary id before
+ * the channel has been funded.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKChannelId Record_get_channel_id(const struct LDKRecord *NONNULL_PTR this_ptr);
+
+/**
+ * The channel id of the channel pertaining to the logged record. May be a temporary id before
+ * the channel has been funded.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void Record_set_channel_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The message body.
+ */
+struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
+
+/**
+ * The message body.
+ */
+void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
+
+/**
+ * The module path of the message.
+ */
+struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
+
+/**
+ * The module path of the message.
+ */
+void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
+
+/**
+ * The source file containing the message.
+ */
+struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
+
+/**
+ * The source file containing the message.
+ */
+void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
+
+/**
+ * The line containing the message.
+ */
+uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
+
+/**
+ * The line containing the message.
+ */
+void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The payment hash.
+ *
+ * Note that this is only filled in for logs pertaining to a specific payment, and will be
+ * `None` for logs which are not directly related to a payment.
+ */
+struct LDKCOption_ThirtyTwoBytesZ Record_get_payment_hash(const struct LDKRecord *NONNULL_PTR this_ptr);
+
+/**
+ * The payment hash.
+ *
+ * Note that this is only filled in for logs pertaining to a specific payment, and will be
+ * `None` for logs which are not directly related to a payment.
+ */
+void Record_set_payment_hash(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
+
+/**
+ * Constructs a new Record given each field
+ *
+ * Note that peer_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKRecord Record_new(enum LDKLevel level_arg, struct LDKPublicKey peer_id_arg, struct LDKChannelId channel_id_arg, struct LDKStr args_arg, struct LDKStr module_path_arg, struct LDKStr file_arg, uint32_t line_arg, struct LDKCOption_ThirtyTwoBytesZ payment_hash_arg);
+
+/**
+ * Creates a copy of the Record
+ */
+struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
+
+/**
+ * Calls the free function if one is set
+ */
+void Logger_free(struct LDKLogger this_ptr);
+
+/**
+ * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
+ */
+void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
+
+/**
+ * Confirmations we will wait for before considering the channel locked in.
+ * Applied only for inbound channels (see [`ChannelHandshakeLimits::max_minimum_depth`] for the
+ * equivalent limit applied to outbound channels).
+ *
+ * A lower-bound of `1` is applied, requiring all channels to have a confirmed commitment
+ * transaction before operation. If you wish to accept channels with zero confirmations, see
+ * [`UserConfig::manually_accept_inbound_channels`] and
+ * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
+ *
+ * Default value: `6`
+ *
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
+ */
+uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Confirmations we will wait for before considering the channel locked in.
+ * Applied only for inbound channels (see [`ChannelHandshakeLimits::max_minimum_depth`] for the
+ * equivalent limit applied to outbound channels).
+ *
+ * A lower-bound of `1` is applied, requiring all channels to have a confirmed commitment
+ * transaction before operation. If you wish to accept channels with zero confirmations, see
+ * [`UserConfig::manually_accept_inbound_channels`] and
+ * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
+ *
+ * Default value: `6`
+ *
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
+ */
+void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * Set to the number of blocks we require our counterparty to wait to claim their money (ie
+ * the number of blocks we have to punish our counterparty if they broadcast a revoked
+ * transaction).
+ *
+ * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
+ * be online to check for revoked transactions on-chain at least once every our_to_self_delay
+ * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
+ * possibly with time in between to RBF the spending transaction).
+ *
+ * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
+ * case of an honest unilateral channel close, which implicitly decrease the economic value of
+ * our channel.
+ *
+ * Default value: [`BREAKDOWN_TIMEOUT`] (We enforce it as a minimum at channel opening so you
+ * can tweak config to ask for more security, not less.)
+ */
+uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Set to the number of blocks we require our counterparty to wait to claim their money (ie
+ * the number of blocks we have to punish our counterparty if they broadcast a revoked
+ * transaction).
+ *
+ * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
+ * be online to check for revoked transactions on-chain at least once every our_to_self_delay
+ * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
+ * possibly with time in between to RBF the spending transaction).
+ *
+ * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
+ * case of an honest unilateral channel close, which implicitly decrease the economic value of
+ * our channel.
+ *
+ * Default value: [`BREAKDOWN_TIMEOUT`] (We enforce it as a minimum at channel opening so you
+ * can tweak config to ask for more security, not less.)
+ */
+void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Set to the smallest value HTLC we will accept to process.
+ *
+ * This value is sent to our counterparty on channel-open and we close the channel any time
+ * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
+ *
+ * Default value: `1` (If the value is less than `1`, it is ignored and set to `1`, as is
+ * required by the protocol.
+ */
+uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Set to the smallest value HTLC we will accept to process.
+ *
+ * This value is sent to our counterparty on channel-open and we close the channel any time
+ * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
+ *
+ * Default value: `1` (If the value is less than `1`, it is ignored and set to `1`, as is
+ * required by the protocol.
+ */
+void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Sets the percentage of the channel value we will cap the total value of outstanding inbound
+ * HTLCs to.
+ *
+ * This can be set to a value between 1-100, where the value corresponds to the percent of the
+ * channel value in whole percentages.
+ *
+ * Note that:
+ * * If configured to another value than the default value `10`, any new channels created with
+ * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
+ * `ChannelManager`.
+ *
+ * * This caps the total value for inbound HTLCs in-flight only, and there's currently
+ * no way to configure the cap for the total value of outbound HTLCs in-flight.
+ *
+ * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
+ * are different from the non-HTLC-encumbered funds. This makes this an important knob to
+ * restrict exposure to loss due to being offline for too long.
+ * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
+ * for more information.
+ *
+ * Default value: `10`
+ *
+ * Minimum value: `1` (Any values less will be treated as `1` instead.)
+ *
+ * Maximum value: `100` (Any values larger will be treated as `100` instead.)
+ */
+uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Sets the percentage of the channel value we will cap the total value of outstanding inbound
+ * HTLCs to.
+ *
+ * This can be set to a value between 1-100, where the value corresponds to the percent of the
+ * channel value in whole percentages.
+ *
+ * Note that:
+ * * If configured to another value than the default value `10`, any new channels created with
+ * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
+ * `ChannelManager`.
+ *
+ * * This caps the total value for inbound HTLCs in-flight only, and there's currently
+ * no way to configure the cap for the total value of outbound HTLCs in-flight.
+ *
+ * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
+ * are different from the non-HTLC-encumbered funds. This makes this an important knob to
+ * restrict exposure to loss due to being offline for too long.
+ * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
+ * for more information.
+ *
+ * Default value: `10`
+ *
+ * Minimum value: `1` (Any values less will be treated as `1` instead.)
+ *
+ * Maximum value: `100` (Any values larger will be treated as `100` instead.)
+ */
+void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
+
+/**
+ * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
+ * BOLTs) option for outbound private channels. This provides better privacy by not including
+ * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
+ * relay HTLCs to us using the channel's SCID alias.
+ *
+ * If this option is set, channels may be created that will not be readable by LDK versions
+ * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
+ * [`DecodeError::InvalidValue`].
+ *
+ * Note that setting this to true does *not* prevent us from opening channels with
+ * counterparties that do not support the `scid_alias` option; we will simply fall back to a
+ * private channel without that option.
+ *
+ * Ignored if the channel is negotiated to be announced, see
+ * [`ChannelHandshakeConfig::announce_for_forwarding`] and
+ * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
+ *
+ * Default value: `false` (This value is likely to change to `true` in the future.)
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
+ */
+bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
+ * BOLTs) option for outbound private channels. This provides better privacy by not including
+ * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
+ * relay HTLCs to us using the channel's SCID alias.
+ *
+ * If this option is set, channels may be created that will not be readable by LDK versions
+ * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
+ * [`DecodeError::InvalidValue`].
+ *
+ * Note that setting this to true does *not* prevent us from opening channels with
+ * counterparties that do not support the `scid_alias` option; we will simply fall back to a
+ * private channel without that option.
+ *
+ * Ignored if the channel is negotiated to be announced, see
+ * [`ChannelHandshakeConfig::announce_for_forwarding`] and
+ * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
+ *
+ * Default value: `false` (This value is likely to change to `true` in the future.)
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
+ */
+void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * Set to announce the channel publicly and notify all nodes that they can route via this
+ * channel.
+ *
+ * This should only be set to true for nodes which expect to be online reliably.
+ *
+ * As the node which funds a channel picks this value this will only apply for new outbound
+ * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
+ *
+ * Default value: `false`
+ */
+bool ChannelHandshakeConfig_get_announce_for_forwarding(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Set to announce the channel publicly and notify all nodes that they can route via this
+ * channel.
+ *
+ * This should only be set to true for nodes which expect to be online reliably.
+ *
+ * As the node which funds a channel picks this value this will only apply for new outbound
+ * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
+ *
+ * Default value: `false`
+ */
+void ChannelHandshakeConfig_set_announce_for_forwarding(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
+ * supports it, they will then enforce the mutual-close output to us matches what we provided
+ * at intialization, preventing us from closing to an alternate pubkey.
+ *
+ * This is set to true by default to provide a slight increase in security, though ultimately
+ * any attacker who is able to take control of a channel can just as easily send the funds via
+ * lightning payments, so we never require that our counterparties support this option.
+ *
+ * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
+ *
+ * Default value: `true`
+ *
+ * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
+ */
+bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+
+/**
+ * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
+ * supports it, they will then enforce the mutual-close output to us matches what we provided
+ * at intialization, preventing us from closing to an alternate pubkey.
+ *
+ * This is set to true by default to provide a slight increase in security, though ultimately
+ * any attacker who is able to take control of a channel can just as easily send the funds via
+ * lightning payments, so we never require that our counterparties support this option.
+ *
+ * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
+ *
+ * Default value: `true`
+ *
+ * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
+ */
+void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * The Proportion of the channel value to configure as counterparty's channel reserve,
+ * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
+ *
+ * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
+ * on their side, at all times.
+ * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
+ * claiming at least this value on chain.
+ *
+ * Channel reserve values greater than 30% could be considered highly unreasonable, since that
+ * amount can never be used for payments.
+ * Also, if our selected channel reserve for counterparty and counterparty's selected
+ * channel reserve for us sum up to equal or greater than channel value, channel negotiations
+ * will fail.
+ *
+ * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
+ * other than the default value.
+ *
+ * Default value: `10_000` millionths (i.e., 1% of channel value)
+ *
+ * Minimum value: If the calculated proportional value is less than `1000` sats, it will be
+ * treated as `1000` sats instead, which is a safe implementation-specific lower
+ * bound.
+ *
+ * Maximum value: `1_000_000` (i.e., 100% of channel value. Any values larger than one million
+ * will be treated as one million instead, although channel negotiations will
+ * fail in that case.)
+ */
+uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+
+/**
+ * The Proportion of the channel value to configure as counterparty's channel reserve,
+ * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
+ *
+ * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
+ * on their side, at all times.
+ * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
+ * claiming at least this value on chain.
+ *
+ * Channel reserve values greater than 30% could be considered highly unreasonable, since that
+ * amount can never be used for payments.
+ * Also, if our selected channel reserve for counterparty and counterparty's selected
+ * channel reserve for us sum up to equal or greater than channel value, channel negotiations
+ * will fail.
+ *
+ * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
+ * other than the default value.
+ *
+ * Default value: `10_000` millionths (i.e., 1% of channel value)
+ *
+ * Minimum value: If the calculated proportional value is less than `1000` sats, it will be
+ * treated as `1000` sats instead, which is a safe implementation-specific lower
+ * bound.
+ *
+ * Maximum value: `1_000_000` (i.e., 100% of channel value. Any values larger than one million
+ * will be treated as one million instead, although channel negotiations will
+ * fail in that case.)
+ */
+void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
+ * channels. This feature requires having a reserve of onchain funds readily available to bump
+ * transactions in the event of a channel force close to avoid the possibility of losing funds.
+ *
+ * Note that if you wish accept inbound channels with anchor outputs, you must enable
+ * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
+ * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
+ * whether your reserve of onchain funds is enough to cover the fees for all existing and new
+ * channels featuring anchor outputs in the event of a force close.
+ *
+ * If this option is set, channels may be created that will not be readable by LDK versions
+ * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
+ * [`DecodeError::InvalidValue`].
+ *
+ * Note that setting this to true does *not* prevent us from opening channels with
+ * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
+ * fall back to a `static_remote_key` channel.
+ *
+ * LDK will not support the legacy `option_anchors` commitment version due to a discovered
+ * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
+ * Considered Harmful`] mailing list post.
+ *
+ * Default value: `false` (This value is likely to change to `true` in the future.)
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
+ * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
+ */
+bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
+ * channels. This feature requires having a reserve of onchain funds readily available to bump
+ * transactions in the event of a channel force close to avoid the possibility of losing funds.
+ *
+ * Note that if you wish accept inbound channels with anchor outputs, you must enable
+ * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
+ * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
+ * whether your reserve of onchain funds is enough to cover the fees for all existing and new
+ * channels featuring anchor outputs in the event of a force close.
+ *
+ * If this option is set, channels may be created that will not be readable by LDK versions
+ * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
+ * [`DecodeError::InvalidValue`].
+ *
+ * Note that setting this to true does *not* prevent us from opening channels with
+ * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
+ * fall back to a `static_remote_key` channel.
+ *
+ * LDK will not support the legacy `option_anchors` commitment version due to a discovered
+ * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
+ * Considered Harmful`] mailing list post.
+ *
+ * Default value: `false` (This value is likely to change to `true` in the future.)
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
+ * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
+ */
+void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
+ *
+ * Increasing the value can help improve liquidity and stability in
+ * routing at the cost of higher long term disk / DB usage.
+ *
+ * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
+ * other than the default value.
+ *
+ * Default value: `50`
+ *
+ * Maximum value: `483` (Any values larger will be treated as `483`. This is the BOLT #2 spec
+ * limit on `max_accepted_htlcs`.)
+ */
+uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
+ *
+ * Increasing the value can help improve liquidity and stability in
+ * routing at the cost of higher long term disk / DB usage.
+ *
+ * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
+ * other than the default value.
+ *
+ * Default value: `50`
+ *
+ * Maximum value: `483` (Any values larger will be treated as `483`. This is the BOLT #2 spec
+ * limit on `max_accepted_htlcs`.)
+ */
+void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Constructs a new ChannelHandshakeConfig given each field
+ */
+MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg, uint8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announce_for_forwarding_arg, bool commit_upfront_shutdown_pubkey_arg, uint32_t their_channel_reserve_proportional_millionths_arg, bool negotiate_anchors_zero_fee_htlc_tx_arg, uint16_t our_max_accepted_htlcs_arg);
+
+/**
+ * Creates a copy of the ChannelHandshakeConfig
+ */
+struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
+
+/**
+ * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
+ */
+MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
+
+/**
+ * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
+ */
+void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
+
+/**
+ * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
+ * only applies to inbound channels.
+ *
+ * Default value: `1000`
+ * (Minimum of [`ChannelHandshakeConfig::their_channel_reserve_proportional_millionths`])
+ */
+uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
+
+/**
+ * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
+ * only applies to inbound channels.
+ *
+ * Default value: `1000`
+ * (Minimum of [`ChannelHandshakeConfig::their_channel_reserve_proportional_millionths`])
+ */
+void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
+ * only applies to inbound channels.
+ *
+ * Default value: `2^24 - 1`
+ */
+uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
+
+/**
+ * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
+ * only applies to inbound channels.
+ *
+ * Default value: `2^24 - 1`
+ */
+void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
+ * you to limit the maximum minimum-size they can require.
+ *
+ * Default value: `u64::max_value`
+ */
+uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
+
+/**
+ * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
+ * you to limit the maximum minimum-size they can require.
+ *
+ * Default value: `u64::max_value`
+ */
+void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
+ * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
+ *
+ * Default value: `0`
+ */
+uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
+
+/**
+ * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
+ * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
+ *
+ * Default value: `0`
+ */
+void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The remote node will require we keep a certain amount in direct payment to ourselves at all
+ * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
+ * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
+ *
+ * Default value: `u64::max_value`.
+ */
+uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
+
+/**
+ * The remote node will require we keep a certain amount in direct payment to ourselves at all
+ * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
+ * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
+ *
+ * Default value: `u64::max_value`.
+ */
+void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
+ * time. This allows you to set a minimum such value.
+ *
+ * Default value: `0`
+ */
+uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
+
+/**
+ * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
+ * time. This allows you to set a minimum such value.
+ *
+ * Default value: `0`
+ */
+void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Before a channel is usable the funding transaction will need to be confirmed by at least a
+ * certain number of blocks, specified by the node which is not the funder (as the funder can
+ * assume they aren't going to double-spend themselves).
+ * This config allows you to set a limit on the maximum amount of time to wait.
+ *
+ * Default value: `144`, or roughly one day and only applies to outbound channels
+ */
+uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
+
+/**
+ * Before a channel is usable the funding transaction will need to be confirmed by at least a
+ * certain number of blocks, specified by the node which is not the funder (as the funder can
+ * assume they aren't going to double-spend themselves).
+ * This config allows you to set a limit on the maximum amount of time to wait.
+ *
+ * Default value: `144`, or roughly one day and only applies to outbound channels
+ */
+void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * Whether we implicitly trust funding transactions generated by us for our own outbound
+ * channels to not be double-spent.
+ *
+ * If this is set, we assume that our own funding transactions are *never* double-spent, and
+ * thus we can trust them without any confirmations. This is generally a reasonable
+ * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
+ * control of the signing keys).
+ *
+ * You may wish to un-set this if you allow the user to (or do in an automated fashion)
+ * double-spend the funding transaction to RBF with an alternative channel open.
+ *
+ * This only applies if our counterparty set their confirmations-required value to `0`, and we
+ * always trust our own funding transaction at `1` confirmation irrespective of this value.
+ * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
+ * `true` (`0`) and `false` (`1`).
+ *
+ * Default value: `true`
+ */
+bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
+
+/**
+ * Whether we implicitly trust funding transactions generated by us for our own outbound
+ * channels to not be double-spent.
+ *
+ * If this is set, we assume that our own funding transactions are *never* double-spent, and
+ * thus we can trust them without any confirmations. This is generally a reasonable
+ * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
+ * control of the signing keys).
+ *
+ * You may wish to un-set this if you allow the user to (or do in an automated fashion)
+ * double-spend the funding transaction to RBF with an alternative channel open.
+ *
+ * This only applies if our counterparty set their confirmations-required value to `0`, and we
+ * always trust our own funding transaction at `1` confirmation irrespective of this value.
+ * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
+ * `true` (`0`) and `false` (`1`).
+ *
+ * Default value: `true`
+ */
+void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * Set to force an incoming channel to match our announced channel preference in
+ * [`ChannelHandshakeConfig::announce_for_forwarding`].
+ *
+ * For a node which is not online reliably, this should be set to true and
+ * [`ChannelHandshakeConfig::announce_for_forwarding`] set to false, ensuring that no announced (aka public)
+ * channels will ever be opened.
+ *
+ * Default value: `true`
+ */
+bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
+
+/**
+ * Set to force an incoming channel to match our announced channel preference in
+ * [`ChannelHandshakeConfig::announce_for_forwarding`].
+ *
+ * For a node which is not online reliably, this should be set to true and
+ * [`ChannelHandshakeConfig::announce_for_forwarding`] set to false, ensuring that no announced (aka public)
+ * channels will ever be opened.
+ *
+ * Default value: `true`
+ */
+void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * Set to the amount of time we're willing to wait to claim money back to us.
+ *
+ * Not checking this value would be a security issue, as our peer would be able to set it to
+ * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
+ *
+ * Default value: `2016`, which we also enforce as a maximum value so you can tweak config to
+ * reduce the loss of having useless locked funds (if your peer accepts)
+ */
+uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
+
+/**
+ * Set to the amount of time we're willing to wait to claim money back to us.
+ *
+ * Not checking this value would be a security issue, as our peer would be able to set it to
+ * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
+ *
+ * Default value: `2016`, which we also enforce as a maximum value so you can tweak config to
+ * reduce the loss of having useless locked funds (if your peer accepts)
+ */
+void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Constructs a new ChannelHandshakeLimits given each field
+ */
+MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint32_t max_minimum_depth_arg, bool trust_own_funding_0conf_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg);
+
+/**
+ * Creates a copy of the ChannelHandshakeLimits
+ */
+struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
+
+/**
+ * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
+ */
+MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
+
+/**
+ * Frees any resources used by the MaxDustHTLCExposure
+ */
+void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
+
+/**
+ * Creates a copy of the MaxDustHTLCExposure
+ */
+struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
+ */
+struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
+
+/**
+ * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
+ */
+struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
+
+/**
+ * Checks if two MaxDustHTLCExposures contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
+
+/**
+ * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
+ */
+struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
+
+/**
+ * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
+ */
+struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
+ */
+void ChannelConfig_free(struct LDKChannelConfig this_obj);
+
+/**
+ * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
+ * over the channel.
+ * This may be allowed to change at runtime in a later update, however doing so must result in
+ * update messages sent to notify all nodes of our updated relay fee.
+ *
+ * Default value: `0`
+ */
+uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
+ * over the channel.
+ * This may be allowed to change at runtime in a later update, however doing so must result in
+ * update messages sent to notify all nodes of our updated relay fee.
+ *
+ * Default value: `0`
+ */
+void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
+ * excess of [`forwarding_fee_proportional_millionths`].
+ * This may be allowed to change at runtime in a later update, however doing so must result in
+ * update messages sent to notify all nodes of our updated relay fee.
+ *
+ * The default value of a single satoshi roughly matches the market rate on many routing nodes
+ * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
+ * this node.
+ *
+ * Default value: `1000`
+ *
+ * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
+ */
+uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
+ * excess of [`forwarding_fee_proportional_millionths`].
+ * This may be allowed to change at runtime in a later update, however doing so must result in
+ * update messages sent to notify all nodes of our updated relay fee.
+ *
+ * The default value of a single satoshi roughly matches the market rate on many routing nodes
+ * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
+ * this node.
+ *
+ * Default value: `1000`
+ *
+ * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
+ */
+void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
+ * the channel this config applies to.
+ *
+ * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
+ * HTLC balance when a channel appears on-chain whereas
+ * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
+ * (non-HTLC-encumbered) balance.
+ *
+ * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
+ * we (or one of our watchtowers) MUST be online to check for broadcast of the current
+ * commitment transaction at least once per this many blocks (minus some margin to allow us
+ * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
+ * the spending transaction).
+ *
+ * Default value: `72` (12 hours at an average of 6 blocks/hour)
+ *
+ * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`] (Any values less than this will be treated as
+ * [`MIN_CLTV_EXPIRY_DELTA`] instead.)
+ *
+ * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
+ */
+uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
+
+/**
+ * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
+ * the channel this config applies to.
+ *
+ * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
+ * HTLC balance when a channel appears on-chain whereas
+ * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
+ * (non-HTLC-encumbered) balance.
+ *
+ * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
+ * we (or one of our watchtowers) MUST be online to check for broadcast of the current
+ * commitment transaction at least once per this many blocks (minus some margin to allow us
+ * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
+ * the spending transaction).
+ *
+ * Default value: `72` (12 hours at an average of 6 blocks/hour)
+ *
+ * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`] (Any values less than this will be treated as
+ * [`MIN_CLTV_EXPIRY_DELTA`] instead.)
+ *
+ * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
+ */
+void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Limit our total exposure to potential loss to on-chain fees on close, including in-flight
+ * HTLCs which are burned to fees as they are too small to claim on-chain and fees on
+ * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate.
+ *
+ * # HTLC-based Dust Exposure
+ *
+ * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
+ * not be claimable on-chain, instead being turned into additional miner fees if either
+ * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
+ * to such payments may be substantial if there are many dust HTLCs present when the
+ * channel is force-closed.
+ *
+ * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
+ * channel negotiated throughout the channel open process, along with the fees required to have
+ * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
+ * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
+ * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
+ * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
+ * variant is primarily intended for use with pre-anchor channels.
+ *
+ * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
+ * exposure across all three types per-channel.
+ *
+ * # Transaction Fee Dust Exposure
+ *
+ * Further, counterparties broadcasting a commitment transaction in a force-close may result
+ * in other balance being burned to fees, and thus all fees on commitment and HTLC
+ * transactions in excess of our local fee estimates are included in the dust calculation.
+ *
+ * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750
+ * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per
+ * non-dust HTLC we're allowed to have with our peers before risking a force-closure for
+ * inbound channels.
+ *
+ * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500
+ * sat/KW), we risk force-closure if we disagree with our peer by:
+ * * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in
+ * both directions (the maximum),
+ * * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both
+ * directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
+ * * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs
+ * in both directions (the maximum),
+ * * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs
+ * in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
+ *
+ * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
+ * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
+ * for anchor channels we expect our counterparty to use a relatively low feerate estimate
+ * while we use [`ConfirmationTarget::MaximumFeeEstimate`] (which should be relatively high)
+ * and feerate disagreement force-closures should only occur when theirs is higher than ours.
+ *
+ * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of `10_000`
+ *
+ * [`ConfirmationTarget::MaximumFeeEstimate`]: crate::chain::chaininterface::ConfirmationTarget::MaximumFeeEstimate
+ */
+struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Limit our total exposure to potential loss to on-chain fees on close, including in-flight
+ * HTLCs which are burned to fees as they are too small to claim on-chain and fees on
+ * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate.
+ *
+ * # HTLC-based Dust Exposure
+ *
+ * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
+ * not be claimable on-chain, instead being turned into additional miner fees if either
+ * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
+ * to such payments may be substantial if there are many dust HTLCs present when the
+ * channel is force-closed.
+ *
+ * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
+ * channel negotiated throughout the channel open process, along with the fees required to have
+ * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
+ * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
+ * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
+ * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
+ * variant is primarily intended for use with pre-anchor channels.
+ *
+ * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
+ * exposure across all three types per-channel.
+ *
+ * # Transaction Fee Dust Exposure
+ *
+ * Further, counterparties broadcasting a commitment transaction in a force-close may result
+ * in other balance being burned to fees, and thus all fees on commitment and HTLC
+ * transactions in excess of our local fee estimates are included in the dust calculation.
+ *
+ * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750
+ * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per
+ * non-dust HTLC we're allowed to have with our peers before risking a force-closure for
+ * inbound channels.
+ *
+ * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500
+ * sat/KW), we risk force-closure if we disagree with our peer by:
+ * * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in
+ * both directions (the maximum),
+ * * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both
+ * directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
+ * * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs
+ * in both directions (the maximum),
+ * * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs
+ * in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`])
+ *
+ * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement
+ * will scale linearly with increases (or decreases) in the our feerate estimates. Further,
+ * for anchor channels we expect our counterparty to use a relatively low feerate estimate
+ * while we use [`ConfirmationTarget::MaximumFeeEstimate`] (which should be relatively high)
+ * and feerate disagreement force-closures should only occur when theirs is higher than ours.
+ *
+ * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of `10_000`
+ *
+ * [`ConfirmationTarget::MaximumFeeEstimate`]: crate::chain::chaininterface::ConfirmationTarget::MaximumFeeEstimate
+ */
+void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
+
+/**
+ * The additional fee we're willing to pay to avoid waiting for the counterparty's
+ * `to_self_delay` to reclaim funds.
+ *
+ * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
+ * closing transaction which both sides find acceptable, ultimately paid by the channel
+ * funder/initiator.
+ *
+ * When we are the funder, because we have to pay the channel closing fee, we bound the
+ * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
+ * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
+ * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
+ * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
+ * funds.
+ *
+ * When we are not the funder, we require the closing transaction fee pay at least our
+ * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
+ * Thus, this value is ignored when we are not the funder.
+ *
+ * Default value: `1000`
+ *
+ * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
+ * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
+ */
+uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
+
+/**
+ * The additional fee we're willing to pay to avoid waiting for the counterparty's
+ * `to_self_delay` to reclaim funds.
+ *
+ * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
+ * closing transaction which both sides find acceptable, ultimately paid by the channel
+ * funder/initiator.
+ *
+ * When we are the funder, because we have to pay the channel closing fee, we bound the
+ * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
+ * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
+ * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
+ * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
+ * funds.
+ *
+ * When we are not the funder, we require the closing transaction fee pay at least our
+ * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
+ * Thus, this value is ignored when we are not the funder.
+ *
+ * Default value: `1000`
+ *
+ * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
+ * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
+ */
+void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
+ * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
+ *
+ * Usage:
+ * - The payee will set this option and set its invoice route hints to use [intercept scids]
+ * generated by this channel's counterparty.
+ * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
+ * [`forward_intercepted_htlc`] with less than the amount provided in
+ * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
+ * actual forward amounts is their fee. See
+ * <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
+ * for how this feature may be used in the LSP use case.
+ *
+ * # Note
+ * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
+ * as-expected if this feature is activated, otherwise they may lose money!
+ * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
+ * counterparty.
+ *
+ * # Note
+ * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
+ * Unsetting this flag between restarts may lead to payment receive failures.
+ *
+ * Default value: `false`
+ *
+ * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
+ * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
+ * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
+ * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
+ * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
+ * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
+ */
+bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
+ * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
+ *
+ * Usage:
+ * - The payee will set this option and set its invoice route hints to use [intercept scids]
+ * generated by this channel's counterparty.
+ * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
+ * [`forward_intercepted_htlc`] with less than the amount provided in
+ * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
+ * actual forward amounts is their fee. See
+ * <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
+ * for how this feature may be used in the LSP use case.
+ *
+ * # Note
+ * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
+ * as-expected if this feature is activated, otherwise they may lose money!
+ * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
+ * counterparty.
+ *
+ * # Note
+ * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
+ * Unsetting this flag between restarts may lead to payment receive failures.
+ *
+ * Default value: `false`
+ *
+ * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
+ * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
+ * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
+ * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
+ * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
+ * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
+ */
+void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * Constructs a new ChannelConfig given each field
+ */
+MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, struct LDKMaxDustHTLCExposure max_dust_htlc_exposure_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg, bool accept_underpaying_htlcs_arg);
+
+/**
+ * Creates a copy of the ChannelConfig
+ */
+struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
+
+/**
+ * Checks if two ChannelConfigs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
+
+/**
+ * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
+ */
+void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
+
+/**
+ * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
+ */
+MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
+
+/**
+ * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
+ */
+struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
+
+/**
+ * Read a ChannelConfig from a byte array, created by ChannelConfig_write
+ */
+struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
+ */
+void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
+
+struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
+
+void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+
+struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
+
+void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+
+struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
+
+void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
+
+/**
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
+
+void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
+
+struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
+
+void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * Constructs a new ChannelConfigUpdate given each field
+ */
+MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_new(struct LDKCOption_u32Z forwarding_fee_proportional_millionths_arg, struct LDKCOption_u32Z forwarding_fee_base_msat_arg, struct LDKCOption_u16Z cltv_expiry_delta_arg, struct LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg, struct LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg);
+
+/**
+ * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
+ */
+void UserConfig_free(struct LDKUserConfig this_obj);
+
+/**
+ * Channel handshake config that we propose to our counterparty.
+ */
+struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Channel handshake config that we propose to our counterparty.
+ */
+void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
+
+/**
+ * Limits applied to our counterparty's proposed channel handshake config settings.
+ */
+struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Limits applied to our counterparty's proposed channel handshake config settings.
+ */
+void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
+
+/**
+ * Channel config which affects behavior during channel lifetime.
+ */
+struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Channel config which affects behavior during channel lifetime.
+ */
+void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
+
+/**
+ * If this is set to `false`, we will reject any HTLCs which were to be forwarded over private
+ * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
+ * node which is not online reliably.
+ *
+ * For nodes which are not online reliably, you should set all channels to *not* be announced
+ * (using [`ChannelHandshakeConfig::announce_for_forwarding`] and
+ * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to `false` to
+ * ensure you are not exposed to any forwarding risk.
+ *
+ * Note that because you cannot change a channel's announced state after creation, there is no
+ * way to disable forwarding on public channels retroactively. Thus, in order to change a node
+ * from a publicly-announced forwarding node to a private non-forwarding node you must close
+ * all your channels and open new ones. For privacy, you should also change your node_id
+ * (swapping all private and public key material for new ones) at that time.
+ *
+ * Default value: `false`
+ */
+bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If this is set to `false`, we will reject any HTLCs which were to be forwarded over private
+ * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
+ * node which is not online reliably.
+ *
+ * For nodes which are not online reliably, you should set all channels to *not* be announced
+ * (using [`ChannelHandshakeConfig::announce_for_forwarding`] and
+ * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to `false` to
+ * ensure you are not exposed to any forwarding risk.
+ *
+ * Note that because you cannot change a channel's announced state after creation, there is no
+ * way to disable forwarding on public channels retroactively. Thus, in order to change a node
+ * from a publicly-announced forwarding node to a private non-forwarding node you must close
+ * all your channels and open new ones. For privacy, you should also change your node_id
+ * (swapping all private and public key material for new ones) at that time.
+ *
+ * Default value: `false`
+ */
+void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * If this is set to `false`, we do not accept inbound requests to open a new channel.
+ *
+ * Default value: `true`
+ */
+bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If this is set to `false`, we do not accept inbound requests to open a new channel.
+ *
+ * Default value: `true`
+ */
+void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * If this is set to `true`, the user needs to manually accept inbound requests to open a new
+ * channel.
+ *
+ * When set to `true`, [`Event::OpenChannelRequest`] will be triggered once a request to open a
+ * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
+ * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
+ * user explicitly chooses to accept the request.
+ *
+ * Default value: `false`
+ *
+ * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
+ * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
+ * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
+ */
+bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If this is set to `true`, the user needs to manually accept inbound requests to open a new
+ * channel.
+ *
+ * When set to `true`, [`Event::OpenChannelRequest`] will be triggered once a request to open a
+ * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
+ * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
+ * user explicitly chooses to accept the request.
+ *
+ * Default value: `false`
+ *
+ * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
+ * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
+ * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
+ */
+void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * If this is set to `true`, LDK will intercept HTLCs that are attempting to be forwarded over
+ * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
+ * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
+ *
+ * Setting this to `true` may break backwards compatibility with LDK versions < 0.0.113.
+ *
+ * Default value: `false`
+ *
+ * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
+ * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
+ */
+bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If this is set to `true`, LDK will intercept HTLCs that are attempting to be forwarded over
+ * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
+ * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
+ *
+ * Setting this to `true` may break backwards compatibility with LDK versions < 0.0.113.
+ *
+ * Default value: `false`
+ *
+ * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
+ * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
+ */
+void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * If this is set to `false`, when receiving a keysend payment we'll fail it if it has multiple
+ * parts. If this is set to `true`, we'll accept the payment.
+ *
+ * Setting this to `true` will break backwards compatibility upon downgrading to an LDK
+ * version prior to 0.0.116 while receiving an MPP keysend. If we have already received an MPP
+ * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
+ *
+ * Default value: `false`
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ */
+bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If this is set to `false`, when receiving a keysend payment we'll fail it if it has multiple
+ * parts. If this is set to `true`, we'll accept the payment.
+ *
+ * Setting this to `true` will break backwards compatibility upon downgrading to an LDK
+ * version prior to 0.0.116 while receiving an MPP keysend. If we have already received an MPP
+ * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
+ *
+ * Default value: `false`
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ */
+void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * If this is set to `true`, the user needs to manually pay [`Bolt12Invoice`]s when received.
+ *
+ * When set to `true`, [`Event::InvoiceReceived`] will be generated for each received
+ * [`Bolt12Invoice`] instead of being automatically paid after verification. Use
+ * [`ChannelManager::send_payment_for_bolt12_invoice`] to pay the invoice or
+ * [`ChannelManager::abandon_payment`] to abandon the associated payment.
+ *
+ * Default value: `false`
+ *
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * [`Event::InvoiceReceived`]: crate::events::Event::InvoiceReceived
+ * [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ */
+bool UserConfig_get_manually_handle_bolt12_invoices(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If this is set to `true`, the user needs to manually pay [`Bolt12Invoice`]s when received.
+ *
+ * When set to `true`, [`Event::InvoiceReceived`] will be generated for each received
+ * [`Bolt12Invoice`] instead of being automatically paid after verification. Use
+ * [`ChannelManager::send_payment_for_bolt12_invoice`] to pay the invoice or
+ * [`ChannelManager::abandon_payment`] to abandon the associated payment.
+ *
+ * Default value: `false`
+ *
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * [`Event::InvoiceReceived`]: crate::events::Event::InvoiceReceived
+ * [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice
+ * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ */
+void UserConfig_set_manually_handle_bolt12_invoices(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * Constructs a new UserConfig given each field
+ */
+MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg, bool accept_intercept_htlcs_arg, bool accept_mpp_keysend_arg, bool manually_handle_bolt12_invoices_arg);
+
+/**
+ * Creates a copy of the UserConfig
+ */
+struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
+
+/**
+ * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
+ */
+MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
+
+/**
+ * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
+ */
+void BestBlock_free(struct LDKBestBlock this_obj);
+
+/**
+ * The block's hash
+ */
+const uint8_t (*BestBlock_get_block_hash(const struct LDKBestBlock *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The block's hash
+ */
+void BestBlock_set_block_hash(struct LDKBestBlock *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The height at which the block was confirmed.
+ */
+uint32_t BestBlock_get_height(const struct LDKBestBlock *NONNULL_PTR this_ptr);
+
+/**
+ * The height at which the block was confirmed.
+ */
+void BestBlock_set_height(struct LDKBestBlock *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * Constructs a new BestBlock given each field
+ */
+MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash_arg, uint32_t height_arg);
+
+/**
+ * Creates a copy of the BestBlock
+ */
+struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the BestBlock.
+ */
+uint64_t BestBlock_hash(const struct LDKBestBlock *NONNULL_PTR o);
+
+/**
+ * Checks if two BestBlocks contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
+
+/**
+ * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
+ * network.
+ */
+MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
+
+/**
+ * Serialize the BestBlock object into a byte array which can be read by BestBlock_read
+ */
+struct LDKCVec_u8Z BestBlock_write(const struct LDKBestBlock *NONNULL_PTR obj);
+
+/**
+ * Read a BestBlock from a byte array, created by BestBlock_write
+ */
+struct LDKCResult_BestBlockDecodeErrorZ BestBlock_read(struct LDKu8slice ser);
+
+/**
+ * Calls the free function if one is set
+ */
+void Listen_free(struct LDKListen this_ptr);
+
+/**
+ * Calls the free function if one is set
+ */
+void Confirm_free(struct LDKConfirm this_ptr);
+
+/**
+ * Creates a copy of the ChannelMonitorUpdateStatus
+ */
+enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
+ */
+enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
+
+/**
+ * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
+ */
+enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
+
+/**
+ * Utility method to constructs a new UnrecoverableError-variant ChannelMonitorUpdateStatus
+ */
+enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_unrecoverable_error(void);
+
+/**
+ * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
+
+/**
+ * Calls the free function if one is set
+ */
+void Watch_free(struct LDKWatch this_ptr);
+
+/**
+ * Calls the free function if one is set
+ */
+void Filter_free(struct LDKFilter this_ptr);
+
+/**
+ * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
+ */
+void WatchedOutput_free(struct LDKWatchedOutput this_obj);
+
+/**
+ * First block where the transaction output may have been spent.
+ */
+struct LDKCOption_ThirtyTwoBytesZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
+
+/**
+ * First block where the transaction output may have been spent.
+ */
+void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
+
+/**
+ * Outpoint identifying the transaction output.
+ */
+struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
+
+/**
+ * Outpoint identifying the transaction output.
+ */
+void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+
+/**
+ * Spending condition of the transaction output.
+ */
+struct LDKCVec_u8Z WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
+
+/**
+ * Spending condition of the transaction output.
+ */
+void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+
+/**
+ * Constructs a new WatchedOutput given each field
+ */
+MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_ThirtyTwoBytesZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
+
+/**
+ * Creates a copy of the WatchedOutput
+ */
+struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
+
+/**
+ * Checks if two WatchedOutputs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
+ */
+uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
+
+/**
+ * Calls the free function if one is set
+ */
+void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
+
+/**
+ * Creates a copy of the ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new MaximumFeeEstimate-variant ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_maximum_fee_estimate(void);
+
+/**
+ * Utility method to constructs a new UrgentOnChainSweep-variant ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_urgent_on_chain_sweep(void);
+
+/**
+ * Utility method to constructs a new MinAllowedAnchorChannelRemoteFee-variant ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(void);
+
+/**
+ * Utility method to constructs a new MinAllowedNonAnchorChannelRemoteFee-variant ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee(void);
+
+/**
+ * Utility method to constructs a new AnchorChannelFee-variant ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_anchor_channel_fee(void);
+
+/**
+ * Utility method to constructs a new NonAnchorChannelFee-variant ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_non_anchor_channel_fee(void);
+
+/**
+ * Utility method to constructs a new ChannelCloseMinimum-variant ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_channel_close_minimum(void);
+
+/**
+ * Utility method to constructs a new OutputSpendingFee-variant ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_output_spending_fee(void);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
+ */
+uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
+
+/**
+ * Checks if two ConfirmationTargets contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
+
+/**
+ * Calls the free function if one is set
+ */
+void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
+
+/**
+ * Calls the free function if one is set
+ */
+void Persist_free(struct LDKPersist this_ptr);
+
+/**
+ * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
+ */
+void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
+
+/**
+ * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
+ */
+void ChainMonitor_free(struct LDKChainMonitor this_obj);
+
+/**
+ * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
+ *
+ * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
+ * will call back to it indicating transactions and outputs of interest. This allows clients to
+ * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
+ * always need to fetch full blocks absent another means for determining which blocks contain
+ * transactions relevant to the watched channels.
+ */
+MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
+
+/**
+ * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
+ * claims which are awaiting confirmation.
+ *
+ * Includes the balances from each [`ChannelMonitor`] *except* those included in
+ * `ignored_channels`.
+ *
+ * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
+ * inclusion in the return value.
+ */
+MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
+
+/**
+ * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
+ * such [`ChannelMonitor`] is currently being monitored for.
+ *
+ * Note that the result holds a mutex over our monitor set, and should not be held
+ * indefinitely.
+ */
+MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
+
+/**
+ * Lists the funding outpoint and channel ID of each [`ChannelMonitor`] being monitored.
+ *
+ * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
+ * monitoring for on-chain state resolutions.
+ */
+MUST_USE_RES struct LDKCVec_C2Tuple_OutPointChannelIdZZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
+ * Each `Vec<u64>` contains `update_id`s from [`ChannelMonitor::get_latest_update_id`] for updates
+ * that have not yet been fully persisted. Note that if a full monitor is persisted all the pending
+ * monitor updates must be individually marked completed by calling [`ChainMonitor::channel_monitor_updated`].
+ */
+MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_u64ZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Indicates the persistence of a [`ChannelMonitor`] has completed after
+ * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
+ *
+ * Thus, the anticipated use is, at a high level:
+ * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
+ * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
+ * returning [`ChannelMonitorUpdateStatus::InProgress`],
+ * 2) once all remote copies are updated, you call this function with [`ChannelMonitor::get_latest_update_id`]
+ * or [`ChannelMonitorUpdate::update_id`] as the `completed_update_id`, and once all pending
+ * updates have completed the channel will be re-enabled.
+ *
+ * It is only necessary to call [`ChainMonitor::channel_monitor_updated`] when you return [`ChannelMonitorUpdateStatus::InProgress`]
+ * from [`Persist`] and either:
+ * 1. A new [`ChannelMonitor`] was added in [`Persist::persist_new_channel`], or
+ * 2. A [`ChannelMonitorUpdate`] was provided as part of [`Persist::update_persisted_channel`].
+ * Note that we don't care about calls to [`Persist::update_persisted_channel`] where no
+ * [`ChannelMonitorUpdate`] was provided.
+ *
+ * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
+ * registered [`ChannelMonitor`]s.
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, uint64_t completed_update_id);
+
+/**
+ * Gets a [`Future`] that completes when an event is available either via
+ * [`chain::Watch::release_pending_monitor_events`] or
+ * [`EventsProvider::process_pending_events`].
+ *
+ * Note that callbacks registered on the [`Future`] MUST NOT call back into this
+ * [`ChainMonitor`] and should instead register actions to be taken later.
+ *
+ * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
+ */
+MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
+ * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
+ * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
+ * invoking this every 30 seconds, or lower if running in an environment with spotty
+ * connections, like on mobile.
+ */
+void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Triggers rebroadcasts of pending claims from force-closed channels after a transaction
+ * signature generation failure.
+ *
+ * `monitor_opt` can be used as a filter to only trigger them for a specific channel monitor.
+ *
+ * Note that monitor_opt (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void ChainMonitor_signer_unblocked(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint monitor_opt);
+
+/**
+ * Archives fully resolved channel monitors by calling [`Persist::archive_persisted_channel`].
+ *
+ * This is useful for pruning fully resolved monitors from the monitor set and primary
+ * storage so they are not kept in memory and reloaded on restart.
+ *
+ * Should be called occasionally (once every handful of blocks or on startup).
+ *
+ * Depending on the implementation of [`Persist::archive_persisted_channel`] the monitor
+ * data could be moved to an archive location or removed entirely.
+ */
+void ChainMonitor_archive_fully_resolved_channel_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new Listen which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
+ */
+struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new Confirm which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
+ */
+struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new Watch which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
+ */
+struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new EventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
+ */
+struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
+ */
+void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
+
+/**
+ * The sequence number of this update. Updates *must* be replayed in-order according to this
+ * sequence number (and updates may panic if they are not). The update_id values are strictly
+ * increasing and increase by one for each new update, with two exceptions specified below.
+ *
+ * This sequence number is also used to track up to which points updates which returned
+ * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
+ * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
+ *
+ * The only instances we allow where update_id values are not strictly increasing have a
+ * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
+ * will force close the channel by broadcasting the latest commitment transaction or
+ * special post-force-close updates, like providing preimages necessary to claim outputs on the
+ * broadcast commitment transaction. See its docs for more details.
+ *
+ * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
+ */
+uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * The sequence number of this update. Updates *must* be replayed in-order according to this
+ * sequence number (and updates may panic if they are not). The update_id values are strictly
+ * increasing and increase by one for each new update, with two exceptions specified below.
+ *
+ * This sequence number is also used to track up to which points updates which returned
+ * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
+ * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
+ *
+ * The only instances we allow where update_id values are not strictly increasing have a
+ * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
+ * will force close the channel by broadcasting the latest commitment transaction or
+ * special post-force-close updates, like providing preimages necessary to claim outputs on the
+ * broadcast commitment transaction. See its docs for more details.
+ *
+ * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
+ */
+void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The channel ID associated with these updates.
+ *
+ * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and
+ * always `Some` otherwise.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKChannelId ChannelMonitorUpdate_get_channel_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID associated with these updates.
+ *
+ * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and
+ * always `Some` otherwise.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void ChannelMonitorUpdate_set_channel_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * Creates a copy of the ChannelMonitorUpdate
+ */
+struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
+
+/**
+ * Checks if two ChannelMonitorUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
+
+/**
+ * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
+ */
+struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
+
+/**
+ * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
+ */
+struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the MonitorEvent
+ */
+void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
+
+/**
+ * Creates a copy of the MonitorEvent
+ */
+struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new HTLCEvent-variant MonitorEvent
+ */
+struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
+
+/**
+ * Utility method to constructs a new HolderForceClosedWithInfo-variant MonitorEvent
+ */
+struct LDKMonitorEvent MonitorEvent_holder_force_closed_with_info(struct LDKClosureReason reason, struct LDKOutPoint outpoint, struct LDKChannelId channel_id);
+
+/**
+ * Utility method to constructs a new HolderForceClosed-variant MonitorEvent
+ */
+struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a);
+
+/**
+ * Utility method to constructs a new Completed-variant MonitorEvent
+ */
+struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, struct LDKChannelId channel_id, uint64_t monitor_update_id);
+
+/**
+ * Checks if two MonitorEvents contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
+
+/**
+ * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
+ */
+struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
+
+/**
+ * Read a MonitorEvent from a byte array, created by MonitorEvent_write
+ */
+struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
+ */
+void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
+
+/**
+ * Creates a copy of the HTLCUpdate
+ */
+struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
+
+/**
+ * Checks if two HTLCUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
+
+/**
+ * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
+ */
+struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
+
+/**
+ * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
+ */
+struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
+
+/**
+ * Creates a copy of the BalanceSource
+ */
+enum LDKBalanceSource BalanceSource_clone(const enum LDKBalanceSource *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new HolderForceClosed-variant BalanceSource
+ */
+enum LDKBalanceSource BalanceSource_holder_force_closed(void);
+
+/**
+ * Utility method to constructs a new CounterpartyForceClosed-variant BalanceSource
+ */
+enum LDKBalanceSource BalanceSource_counterparty_force_closed(void);
+
+/**
+ * Utility method to constructs a new CoopClose-variant BalanceSource
+ */
+enum LDKBalanceSource BalanceSource_coop_close(void);
+
+/**
+ * Utility method to constructs a new Htlc-variant BalanceSource
+ */
+enum LDKBalanceSource BalanceSource_htlc(void);
+
+/**
+ * Checks if two BalanceSources contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool BalanceSource_eq(const enum LDKBalanceSource *NONNULL_PTR a, const enum LDKBalanceSource *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the Balance
+ */
+void Balance_free(struct LDKBalance this_ptr);
+
+/**
+ * Creates a copy of the Balance
+ */
+struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
+ */
+struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis, uint64_t transaction_fee_satoshis, uint64_t outbound_payment_htlc_rounded_msat, uint64_t outbound_forwarded_htlc_rounded_msat, uint64_t inbound_claiming_htlc_rounded_msat, uint64_t inbound_htlc_rounded_msat);
+
+/**
+ * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
+ */
+struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height, enum LDKBalanceSource source);
+
+/**
+ * Utility method to constructs a new ContentiousClaimable-variant Balance
+ */
+struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
+
+/**
+ * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
+ */
+struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash, bool outbound_payment);
+
+/**
+ * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
+ */
+struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
+
+/**
+ * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
+ */
+struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis);
+
+/**
+ * Checks if two Balances contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
+
+/**
+ * The amount claimable, in satoshis.
+ *
+ * For outbound payments, this excludes the balance from the possible HTLC timeout.
+ *
+ * For forwarded payments, this includes the balance from the possible HTLC timeout as
+ * (to be conservative) that balance does not include routing fees we'd earn if we'd claim
+ * the balance from a preimage in a successful forward.
+ *
+ * For more information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
+ * [`Balance::MaybePreimageClaimableHTLC`].
+ *
+ * On-chain fees required to claim the balance are not included in this amount.
+ */
+MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
+
+/**
+ * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
+ */
+void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
+
+/**
+ * Creates a copy of the ChannelMonitor
+ */
+struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
+
+/**
+ * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
+ */
+struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
+
+/**
+ * Updates a ChannelMonitor on the basis of some new information provided by the Channel
+ * itself.
+ *
+ * panics if the given update is not the next update by update_id.
+ */
+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);
+
+/**
+ * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
+ * ChannelMonitor.
+ */
+MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
+ */
+MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Gets the channel_id of the channel this ChannelMonitor is monitoring for.
+ */
+MUST_USE_RES struct LDKChannelId ChannelMonitor_channel_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Gets a list of txids, with their output scripts (in the order they appear in the
+ * transaction), which we must learn about spends of via block_connected().
+ */
+MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
+ * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
+ * have been registered.
+ */
+void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter, const struct LDKLogger *NONNULL_PTR logger);
+
+/**
+ * Get the list of HTLCs who's status has been updated on chain. This should be called by
+ * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
+ */
+MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
+ *
+ * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
+ * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
+ * within each channel. As the confirmation of a commitment transaction may be critical to the
+ * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
+ * environment with spotty connections, like on mobile.
+ *
+ * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
+ * order to handle these events.
+ *
+ * Will return a [`ReplayEvent`] error if event handling failed and should eventually be retried.
+ *
+ * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
+ * [`BumpTransaction`]: crate::events::Event::BumpTransaction
+ */
+MUST_USE_RES struct LDKCResult_NoneReplayEventZ ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
+
+/**
+ * Gets the counterparty's initial commitment transaction. The returned commitment
+ * transaction is unsigned. This is intended to be called during the initial persistence of
+ * the monitor (inside an implementation of [`Persist::persist_new_channel`]), to allow for
+ * watchtowers in the persistence pipeline to have enough data to form justice transactions.
+ *
+ * This is similar to [`Self::counterparty_commitment_txs_from_update`], except
+ * that for the initial commitment transaction, we don't have a corresponding update.
+ *
+ * This will only return `Some` for channel monitors that have been created after upgrading
+ * to LDK 0.0.117+.
+ *
+ * [`Persist::persist_new_channel`]: crate::chain::chainmonitor::Persist::persist_new_channel
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Gets all of the counterparty commitment transactions provided by the given update. This
+ * may be empty if the update doesn't include any new counterparty commitments. Returned
+ * commitment transactions are unsigned.
+ *
+ * This is provided so that watchtower clients in the persistence pipeline are able to build
+ * justice transactions for each counterparty commitment upon each update. It's intended to be
+ * used within an implementation of [`Persist::update_persisted_channel`], which is provided
+ * with a monitor and an update. Once revoked, signing a justice transaction can be done using
+ * [`Self::sign_to_local_justice_tx`].
+ *
+ * It is expected that a watchtower client may use this method to retrieve the latest counterparty
+ * commitment transaction(s), and then hold the necessary data until a later update in which
+ * the monitor has been updated with the corresponding revocation data, at which point the
+ * monitor can sign the justice transaction.
+ *
+ * This will only return a non-empty list for monitor updates that have been created after
+ * upgrading to LDK 0.0.117+. Note that no restriction lies on the monitors themselves, which
+ * may have been created prior to upgrading.
+ *
+ * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel
+ */
+MUST_USE_RES struct LDKCVec_CommitmentTransactionZ ChannelMonitor_counterparty_commitment_txs_from_update(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
+
+/**
+ * Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
+ * signing the justice transaction easier for implementors of
+ * [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
+ * signing the input at `input_idx`. This method will only produce a valid signature for
+ * a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
+ * be used for revoked HTLC outputs.
+ *
+ * `Value` is the value of the output being spent by the input at `input_idx`, committed
+ * in the BIP 143 signature.
+ *
+ * This method will only succeed if this monitor has received the revocation secret for the
+ * provided `commitment_number`. If a commitment number is provided that does not correspond
+ * to the commitment transaction being revoked, this will return a signed transaction, but
+ * the signature will not be valid.
+ *
+ * [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_justice_revoked_output
+ * [`Persist`]: crate::chain::chainmonitor::Persist
+ */
+MUST_USE_RES struct LDKCResult_TransactionNoneZ ChannelMonitor_sign_to_local_justice_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction justice_tx, uintptr_t input_idx, uint64_t value, uint64_t commitment_number);
+
+/**
+ * Gets the `node_id` of the counterparty for this channel.
+ *
+ * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
+ * otherwise.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
+/**
+ * You may use this to broadcast the latest local commitment transaction, either because
+ * a monitor update failed or because we've fallen behind (i.e. we've received proof that our
+ * counterparty side knows a revocation secret we gave them that they shouldn't know).
+ *
+ * Broadcasting these transactions in this manner is UNSAFE, as they allow counterparty
+ * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
+ * close channel with their commitment transaction after a substantial amount of time. Best
+ * may be to contact the other node operator out-of-band to coordinate other options available
+ * to you.
+ */
+void ChannelMonitor_broadcast_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
+
+/**
+ * Processes transactions in a newly connected block, which may result in any of the following:
+ * - update the monitor's state against resolved HTLCs
+ * - punish the counterparty in the case of seeing a revoked commitment transaction
+ * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
+ * - detect settled outputs for later spending
+ * - schedule and bump any in-flight claims
+ *
+ * Returns any new outputs to watch from `txdata`; after called, these are also included in
+ * [`get_outputs_to_watch`].
+ *
+ * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
+ */
+MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_block_connected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
+
+/**
+ * Determines if the disconnected block contained any transactions of interest and updates
+ * appropriately.
+ */
+void ChannelMonitor_block_disconnected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
+
+/**
+ * Processes transactions confirmed in a block with the given header and height, returning new
+ * outputs to watch. See [`block_connected`] for details.
+ *
+ * Used instead of [`block_connected`] by clients that are notified of transactions rather than
+ * blocks. See [`chain::Confirm`] for calling expectations.
+ *
+ * [`block_connected`]: Self::block_connected
+ */
+MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_transactions_confirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
+
+/**
+ * Processes a transaction that was reorganized out of the chain.
+ *
+ * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
+ * than blocks. See [`chain::Confirm`] for calling expectations.
+ *
+ * [`block_disconnected`]: Self::block_disconnected
+ */
+void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
+
+/**
+ * Updates the monitor with the current best chain tip, returning new outputs to watch. See
+ * [`block_connected`] for details.
+ *
+ * Used instead of [`block_connected`] by clients that are notified of transactions rather than
+ * blocks. See [`chain::Confirm`] for calling expectations.
+ *
+ * [`block_connected`]: Self::block_connected
+ */
+MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_best_block_updated(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
+
+/**
+ * Returns the set of txids that should be monitored for re-organization out of the chain.
+ */
+MUST_USE_RES struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Gets the latest best block which was connected either via the [`chain::Listen`] or
+ * [`chain::Confirm`] interfaces.
+ */
+MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
+ * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
+ * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
+ * invoking this every 30 seconds, or lower if running in an environment with spotty
+ * connections, like on mobile.
+ */
+void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
+
+/**
+ * Returns true if the monitor has pending claim requests that are not fully confirmed yet.
+ */
+MUST_USE_RES bool ChannelMonitor_has_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Triggers rebroadcasts of pending claims from a force-closed channel after a transaction
+ * signature generation failure.
+ */
+void ChannelMonitor_signer_unblocked(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
+
+/**
+ * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the
+ * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`]
+ * confirmations. For [`SpendableOutputDescriptor::DelayedPaymentOutput`] descriptors to be
+ * returned, the transaction must have at least `max(ANTI_REORG_DELAY, to_self_delay)`
+ * confirmations.
+ *
+ * Descriptors returned by this method are primarily exposed via [`Event::SpendableOutputs`]
+ * once they are no longer under reorg risk. This method serves as a way to retrieve these
+ * descriptors at a later time, either for historical purposes, or to replay any
+ * missed/unhandled descriptors. For the purpose of gathering historical records, if the
+ * channel close has fully resolved (i.e., [`ChannelMonitor::get_claimable_balances`] returns
+ * an empty set), you can retrieve all spendable outputs by providing all descendant spending
+ * transactions starting from the channel's funding transaction and going down three levels.
+ *
+ * `tx` is a transaction we'll scan the outputs of. Any transaction can be provided. If any
+ * outputs which can be spent by us are found, at least one descriptor is returned.
+ *
+ * `confirmation_height` must be the height of the block in which `tx` was included in.
+ */
+MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height);
+
+/**
+ * Checks if the monitor is fully resolved. Resolved monitor is one that has claimed all of
+ * its outputs and balances (i.e. [`Self::get_claimable_balances`] returns an empty set).
+ *
+ * This function returns true only if [`Self::get_claimable_balances`] has been empty for at least
+ * 4032 blocks as an additional protection against any bugs resulting in spuriously empty balance sets.
+ */
+MUST_USE_RES bool ChannelMonitor_is_fully_resolved(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger);
+
+/**
+ * Gets the balances in this channel which are either claimable by us if we were to
+ * force-close the channel now or which are claimable on-chain (possibly awaiting
+ * confirmation).
+ *
+ * Any balances in the channel which are available on-chain (excluding on-chain fees) are
+ * included here until an [`Event::SpendableOutputs`] event has been generated for the
+ * balance, or until our counterparty has claimed the balance and accrued several
+ * confirmations on the claim transaction.
+ *
+ * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
+ * LDK prior to 0.0.111, not all or excess balances may be included.
+ *
+ * See [`Balance`] for additional details on the types of claimable balances which
+ * may be returned here and their meanings.
+ */
+MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Read a C2Tuple_ThirtyTwoBytesChannelMonitorZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelMonitorZ_write
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
+
+/**
+ * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
+ */
+void OutPoint_free(struct LDKOutPoint this_obj);
+
+/**
+ * The referenced transaction's txid.
+ */
+const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The referenced transaction's txid.
+ */
+void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The index of the referenced output in its transaction's vout.
+ */
+uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
+
+/**
+ * The index of the referenced output in its transaction's vout.
+ */
+void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Constructs a new OutPoint given each field
+ */
+MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
+
+/**
+ * Creates a copy of the OutPoint
+ */
+struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
+
+/**
+ * Checks if two OutPoints contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the OutPoint.
+ */
+uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
+
+/**
+ * Get the string representation of a OutPoint object
+ */
+struct LDKStr OutPoint_to_str(const struct LDKOutPoint *NONNULL_PTR o);
+
+/**
+ * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
+ */
+struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
+
+/**
+ * Read a OutPoint from a byte array, created by OutPoint_write
+ */
+struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the InboundHTLCErr, if is_owned is set and inner is non-NULL.
+ */
+void InboundHTLCErr_free(struct LDKInboundHTLCErr this_obj);
+
+/**
+ * BOLT 4 error code.
+ */
+uint16_t InboundHTLCErr_get_err_code(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
+
+/**
+ * BOLT 4 error code.
+ */
+void InboundHTLCErr_set_err_code(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Data attached to this error.
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCVec_u8Z InboundHTLCErr_get_err_data(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
+
+/**
+ * Data attached to this error.
+ */
+void InboundHTLCErr_set_err_data(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+
+/**
+ * Error message text.
+ */
+struct LDKStr InboundHTLCErr_get_msg(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
+
+/**
+ * Error message text.
+ */
+void InboundHTLCErr_set_msg(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKStr val);
+
+/**
+ * Constructs a new InboundHTLCErr given each field
+ */
+MUST_USE_RES struct LDKInboundHTLCErr InboundHTLCErr_new(uint16_t err_code_arg, struct LDKCVec_u8Z err_data_arg, struct LDKStr msg_arg);
+
+/**
+ * Creates a copy of the InboundHTLCErr
+ */
+struct LDKInboundHTLCErr InboundHTLCErr_clone(const struct LDKInboundHTLCErr *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the InboundHTLCErr.
+ */
+uint64_t InboundHTLCErr_hash(const struct LDKInboundHTLCErr *NONNULL_PTR o);
+
+/**
+ * Checks if two InboundHTLCErrs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool InboundHTLCErr_eq(const struct LDKInboundHTLCErr *NONNULL_PTR a, const struct LDKInboundHTLCErr *NONNULL_PTR b);
+
+/**
+ * Peel one layer off an incoming onion, returning a [`PendingHTLCInfo`] that contains information
+ * about the intended next-hop for the HTLC.
+ *
+ * This does all the relevant context-free checks that LDK requires for payment relay or
+ * acceptance. If the payment is to be received, and the amount matches the expected amount for
+ * a given invoice, this indicates the [`msgs::UpdateAddHTLC`], once fully committed in the
+ * channel, will generate an [`Event::PaymentClaimable`].
+ *
+ * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
+ */
+struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(const struct LDKUpdateAddHTLC *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, uint32_t cur_height, bool accept_mpp_keysend, bool allow_skimmed_fees);
+
+/**
+ * Frees any resources used by the PendingHTLCRouting
+ */
+void PendingHTLCRouting_free(struct LDKPendingHTLCRouting this_ptr);
+
+/**
+ * Creates a copy of the PendingHTLCRouting
+ */
+struct LDKPendingHTLCRouting PendingHTLCRouting_clone(const struct LDKPendingHTLCRouting *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new Forward-variant PendingHTLCRouting
+ */
+struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded);
+
+/**
+ * Utility method to constructs a new Receive-variant PendingHTLCRouting
+ */
+struct LDKPendingHTLCRouting PendingHTLCRouting_receive(struct LDKFinalOnionHopData payment_data, struct LDKCOption_CVec_u8ZZ payment_metadata, struct LDKCOption_PaymentContextZ payment_context, uint32_t incoming_cltv_expiry, struct LDKThirtyTwoBytes phantom_shared_secret, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error);
+
+/**
+ * Utility method to constructs a new ReceiveKeysend-variant PendingHTLCRouting
+ */
+struct LDKPendingHTLCRouting PendingHTLCRouting_receive_keysend(struct LDKFinalOnionHopData payment_data, struct LDKThirtyTwoBytes payment_preimage, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error);
+
+/**
+ * Frees any resources used by the BlindedForward, if is_owned is set and inner is non-NULL.
+ */
+void BlindedForward_free(struct LDKBlindedForward this_obj);
+
+/**
+ * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
+ * onion payload if we're the introduction node. Useful for calculating the next hop's
+ * [`msgs::UpdateAddHTLC::blinding_point`].
+ */
+struct LDKPublicKey BlindedForward_get_inbound_blinding_point(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
+
+/**
+ * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
+ * onion payload if we're the introduction node. Useful for calculating the next hop's
+ * [`msgs::UpdateAddHTLC::blinding_point`].
+ */
+void BlindedForward_set_inbound_blinding_point(struct LDKBlindedForward *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * If needed, this determines how this HTLC should be failed backwards, based on whether we are
+ * the introduction node.
+ */
+enum LDKBlindedFailure BlindedForward_get_failure(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
+
+/**
+ * If needed, this determines how this HTLC should be failed backwards, based on whether we are
+ * the introduction node.
+ */
+void BlindedForward_set_failure(struct LDKBlindedForward *NONNULL_PTR this_ptr, enum LDKBlindedFailure val);
+
+/**
+ * Overrides the next hop's [`msgs::UpdateAddHTLC::blinding_point`]. Set if this HTLC is being
+ * forwarded within a [`BlindedPaymentPath`] that was concatenated to another blinded path that
+ * starts at the next hop.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKPublicKey BlindedForward_get_next_blinding_override(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
+
+/**
+ * Overrides the next hop's [`msgs::UpdateAddHTLC::blinding_point`]. Set if this HTLC is being
+ * forwarded within a [`BlindedPaymentPath`] that was concatenated to another blinded path that
+ * starts at the next hop.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void BlindedForward_set_next_blinding_override(struct LDKBlindedForward *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new BlindedForward given each field
+ *
+ * Note that next_blinding_override_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg, struct LDKPublicKey next_blinding_override_arg);
+
+/**
+ * Creates a copy of the BlindedForward
+ */
+struct LDKBlindedForward BlindedForward_clone(const struct LDKBlindedForward *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the BlindedForward.
+ */
+uint64_t BlindedForward_hash(const struct LDKBlindedForward *NONNULL_PTR o);
+
+/**
+ * Checks if two BlindedForwards contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool BlindedForward_eq(const struct LDKBlindedForward *NONNULL_PTR a, const struct LDKBlindedForward *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the PendingHTLCInfo, if is_owned is set and inner is non-NULL.
+ */
+void PendingHTLCInfo_free(struct LDKPendingHTLCInfo this_obj);
+
+/**
+ * Further routing details based on whether the HTLC is being forwarded or received.
+ */
+struct LDKPendingHTLCRouting PendingHTLCInfo_get_routing(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
+
+/**
+ * Further routing details based on whether the HTLC is being forwarded or received.
+ */
+void PendingHTLCInfo_set_routing(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKPendingHTLCRouting val);
+
+/**
+ * The onion shared secret we build with the sender used to decrypt the onion.
+ *
+ * This is later used to encrypt failure packets in the event that the HTLC is failed.
+ */
+const uint8_t (*PendingHTLCInfo_get_incoming_shared_secret(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The onion shared secret we build with the sender used to decrypt the onion.
+ *
+ * This is later used to encrypt failure packets in the event that the HTLC is failed.
+ */
+void PendingHTLCInfo_set_incoming_shared_secret(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
+ */
+const uint8_t (*PendingHTLCInfo_get_payment_hash(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
+
+/**
+ * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
+ */
+void PendingHTLCInfo_set_payment_hash(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * Amount received in the incoming HTLC.
+ *
+ * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
+ * versions.
+ */
+struct LDKCOption_u64Z PendingHTLCInfo_get_incoming_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
+
+/**
+ * Amount received in the incoming HTLC.
+ *
+ * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
+ * versions.
+ */
+void PendingHTLCInfo_set_incoming_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The amount the sender indicated should be forwarded on to the next hop or amount the sender
+ * intended for us to receive for received payments.
+ *
+ * If the received amount is less than this for received payments, an intermediary hop has
+ * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
+ * it along another path).
+ *
+ * Because nodes can take less than their required fees, and because senders may wish to
+ * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
+ * received payments. In such cases, recipients must handle this HTLC as if it had received
+ * [`Self::outgoing_amt_msat`].
+ */
+uint64_t PendingHTLCInfo_get_outgoing_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
+
+/**
+ * The amount the sender indicated should be forwarded on to the next hop or amount the sender
+ * intended for us to receive for received payments.
+ *
+ * If the received amount is less than this for received payments, an intermediary hop has
+ * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
+ * it along another path).
+ *
+ * Because nodes can take less than their required fees, and because senders may wish to
+ * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
+ * received payments. In such cases, recipients must handle this HTLC as if it had received
+ * [`Self::outgoing_amt_msat`].
+ */
+void PendingHTLCInfo_set_outgoing_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
+ * should have been set on the received HTLC for received payments).
+ */
+uint32_t PendingHTLCInfo_get_outgoing_cltv_value(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
+
+/**
+ * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
+ * should have been set on the received HTLC for received payments).
+ */
+void PendingHTLCInfo_set_outgoing_cltv_value(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
+ *
+ * If this is a payment for forwarding, this is the fee we are taking before forwarding the
+ * HTLC.
+ *
+ * If this is a received payment, this is the fee that our counterparty took.
+ *
+ * This is used to allow LSPs to take fees as a part of payments, without the sender having to
+ * shoulder them.
+ */
+struct LDKCOption_u64Z PendingHTLCInfo_get_skimmed_fee_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
+
+/**
+ * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
+ *
+ * If this is a payment for forwarding, this is the fee we are taking before forwarding the
+ * HTLC.
+ *
+ * If this is a received payment, this is the fee that our counterparty took.
+ *
+ * This is used to allow LSPs to take fees as a part of payments, without the sender having to
+ * shoulder them.
+ */
+void PendingHTLCInfo_set_skimmed_fee_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * Constructs a new PendingHTLCInfo given each field
+ */
+MUST_USE_RES struct LDKPendingHTLCInfo PendingHTLCInfo_new(struct LDKPendingHTLCRouting routing_arg, struct LDKThirtyTwoBytes incoming_shared_secret_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u64Z incoming_amt_msat_arg, uint64_t outgoing_amt_msat_arg, uint32_t outgoing_cltv_value_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg);
+
+/**
+ * Creates a copy of the PendingHTLCInfo
+ */
+struct LDKPendingHTLCInfo PendingHTLCInfo_clone(const struct LDKPendingHTLCInfo *NONNULL_PTR orig);
+
+/**
+ * Creates a copy of the BlindedFailure
+ */
+enum LDKBlindedFailure BlindedFailure_clone(const enum LDKBlindedFailure *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new FromIntroductionNode-variant BlindedFailure
+ */
+enum LDKBlindedFailure BlindedFailure_from_introduction_node(void);
+
+/**
+ * Utility method to constructs a new FromBlindedNode-variant BlindedFailure
+ */
+enum LDKBlindedFailure BlindedFailure_from_blinded_node(void);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the BlindedFailure.
+ */
+uint64_t BlindedFailure_hash(const enum LDKBlindedFailure *NONNULL_PTR o);
+
+/**
+ * Checks if two BlindedFailures contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool BlindedFailure_eq(const enum LDKBlindedFailure *NONNULL_PTR a, const enum LDKBlindedFailure *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the FailureCode
+ */
+void FailureCode_free(struct LDKFailureCode this_ptr);
+
+/**
+ * Creates a copy of the FailureCode
+ */
+struct LDKFailureCode FailureCode_clone(const struct LDKFailureCode *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
+ */
+struct LDKFailureCode FailureCode_temporary_node_failure(void);
+
+/**
+ * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
+ */
+struct LDKFailureCode FailureCode_required_node_feature_missing(void);
+
+/**
+ * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
+ */
+struct LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
+
+/**
+ * Utility method to constructs a new InvalidOnionPayload-variant FailureCode
+ */
+struct LDKFailureCode FailureCode_invalid_onion_payload(struct LDKCOption_C2Tuple_u64u16ZZ a);
+
+/**
+ * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
+ */
+void ChannelManager_free(struct LDKChannelManager this_obj);
+
+/**
+ * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
+ */
+void ChainParameters_free(struct LDKChainParameters this_obj);
+
+/**
+ * The network for determining the `chain_hash` in Lightning messages.
+ */
+enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The network for determining the `chain_hash` in Lightning messages.
+ */
+void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
+
+/**
+ * The hash and height of the latest block successfully connected.
+ *
+ * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
+ */
+struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The hash and height of the latest block successfully connected.
+ *
+ * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
+ */
+void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
+
+/**
+ * Constructs a new ChainParameters given each field
+ */
+MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
+
+/**
+ * Creates a copy of the ChainParameters
+ */
+struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
+
+/**
+ * Frees any resources used by the RecentPaymentDetails
+ */
+void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
+
+/**
+ * Creates a copy of the RecentPaymentDetails
+ */
+struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
+ */
+struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
+
+/**
+ * Utility method to constructs a new Pending-variant RecentPaymentDetails
+ */
+struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
+
+/**
+ * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
+ */
+struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
+
+/**
+ * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
+ */
+struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
+
+/**
+ * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
+ */
+void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
+
+/**
+ * The list of channels to be included in the invoice route hints.
+ */
+struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
+
+/**
+ * The list of channels to be included in the invoice route hints.
+ */
+void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
+
+/**
+ * A fake scid used for representing the phantom node's fake channel in generating the invoice
+ * route hints.
+ */
+uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
+
+/**
+ * A fake scid used for representing the phantom node's fake channel in generating the invoice
+ * route hints.
+ */
+void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The pubkey of the real backing node that would ultimately receive the payment.
+ */
+struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
+
+/**
+ * The pubkey of the real backing node that would ultimately receive the payment.
+ */
+void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new PhantomRouteHints given each field
+ */
+MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
+
+/**
+ * Creates a copy of the PhantomRouteHints
+ */
+struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
+
+/**
+ * Constructs a new `ChannelManager` to hold several channels and route between them.
+ *
+ * The current time or latest block header time can be provided as the `current_timestamp`.
+ *
+ * This is the main \"logic hub\" for all channel-related actions, and implements
+ * [`ChannelMessageHandler`].
+ *
+ * Non-proportional fees are fixed according to our risk using the provided fee estimator.
+ *
+ * Users need to notify the new `ChannelManager` when a new block is connected or
+ * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
+ * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
+ * more details.
+ *
+ * [`block_connected`]: chain::Listen::block_connected
+ * [`block_disconnected`]: chain::Listen::block_disconnected
+ * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
+ */
+MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKUserConfig config, struct LDKChainParameters params, uint32_t current_timestamp);
+
+/**
+ * Gets the current configuration applied to all new channels.
+ */
+MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Creates a new outbound channel to the given remote node and with the given value.
+ *
+ * `user_channel_id` will be provided back as in
+ * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
+ * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
+ * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
+ * is simply copied to events and otherwise ignored.
+ *
+ * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
+ * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
+ *
+ * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
+ * generate a shutdown scriptpubkey or destination script set by
+ * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
+ *
+ * Note that we do not check if you are currently connected to the given peer. If no
+ * connection is available, the outbound `open_channel` message may fail to send, resulting in
+ * the channel eventually being silently forgotten (dropped on reload).
+ *
+ * If `temporary_channel_id` is specified, it will be used as the temporary channel ID of the
+ * channel. Otherwise, a random one will be generated for you.
+ *
+ * Returns the new Channel's temporary `channel_id`. This ID will appear as
+ * [`Event::FundingGenerationReady::temporary_channel_id`] and in
+ * [`ChannelDetails::channel_id`] until after
+ * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
+ * one derived from the funding transaction's TXID. If the counterparty rejects the channel
+ * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
+ *
+ * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
+ * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
+ * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
+ *
+ * Note that temporary_channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKCResult_ChannelIdAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, struct LDKU128 user_channel_id, struct LDKChannelId temporary_channel_id, struct LDKUserConfig override_config);
+
+/**
+ * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
+ * more information.
+ */
+MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Gets the list of usable channels, in random order. Useful as an argument to
+ * [`Router::find_route`] to ensure non-announced channels are used.
+ *
+ * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
+ * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
+ * are.
+ */
+MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Gets the list of channels we have with a given counterparty, in random order.
+ */
+MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
+
+/**
+ * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
+ * successful path, or have unresolved HTLCs.
+ *
+ * This can be useful for payments that may have been prepared, but ultimately not sent, as a
+ * result of a crash. If such a payment exists, is not listed here, and an
+ * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
+ *
+ * [`Event::PaymentSent`]: events::Event::PaymentSent
+ */
+MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
+ * will be accepted on the given channel, and after additional timeout/the closing of all
+ * pending HTLCs, the channel will be closed on chain.
+ *
+ * * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
+ * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
+ * fee estimate.
+ * * If our counterparty is the channel initiator, we will require a channel closing
+ * transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
+ * would appear on a force-closure transaction, whichever is lower. We will allow our
+ * counterparty to pay as much fee as they'd like, however.
+ *
+ * May generate a [`SendShutdown`] message event on success, which should be relayed.
+ *
+ * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
+ * generate a shutdown scriptpubkey or destination script set by
+ * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
+ * channel.
+ *
+ * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
+ * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
+ * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
+ * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id);
+
+/**
+ * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
+ * will be accepted on the given channel, and after additional timeout/the closing of all
+ * pending HTLCs, the channel will be closed on chain.
+ *
+ * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
+ * the channel being closed or not:
+ * * If we are the channel initiator, we will pay at least this feerate on the closing
+ * transaction. The upper-bound is set by
+ * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
+ * fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
+ * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
+ * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
+ * will appear on a force-closure transaction, whichever is lower).
+ *
+ * The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction.
+ * Will fail if a shutdown script has already been set for this channel by
+ * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
+ * also be compatible with our and the counterparty's features.
+ *
+ * May generate a [`SendShutdown`] message event on success, which should be relayed.
+ *
+ * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
+ * generate a shutdown scriptpubkey or destination script set by
+ * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
+ * channel.
+ *
+ * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
+ * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
+ * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
+ *
+ * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script);
+
+/**
+ * Force closes a channel, immediately broadcasting the latest local transaction(s),
+ * rejecting new HTLCs.
+ *
+ * The provided `error_message` is sent to connected peers for closing
+ * channels and should be a human-readable description of what went wrong.
+ *
+ * Fails if `channel_id` is unknown to the manager, or if the `counterparty_node_id`
+ * isn't the counterparty of the corresponding channel.
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id, struct LDKStr error_message);
+
+/**
+ * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
+ * the latest local transaction(s).
+ *
+ * The provided `error_message` is sent to connected peers for closing channels and should
+ * be a human-readable description of what went wrong.
+ *
+ * Fails if `channel_id` is unknown to the manager, or if the
+ * `counterparty_node_id` isn't the counterparty of the corresponding channel.
+ * You can always broadcast the latest local transaction(s) via
+ * [`ChannelMonitor::broadcast_latest_holder_commitment_txn`].
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id, struct LDKStr error_message);
+
+/**
+ * Force close all channels, immediately broadcasting the latest local commitment transaction
+ * for each to the chain and rejecting new HTLCs on each.
+ *
+ * The provided `error_message` is sent to connected peers for closing channels and should
+ * be a human-readable description of what went wrong.
+ */
+void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKStr error_message);
+
+/**
+ * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
+ * local transaction(s).
+ *
+ * The provided `error_message` is sent to connected peers for closing channels and
+ * should be a human-readable description of what went wrong.
+ */
+void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKStr error_message);
+
+/**
+ * Sends a payment along a given route.
+ *
+ * This method is *DEPRECATED*, use [`Self::send_payment`] instead. If you wish to fix the
+ * route for a payment, do so by matching the [`PaymentId`] passed to
+ * [`Router::find_route_with_id`].
+ *
+ * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
+ * fields for more info.
+ *
+ * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
+ * [`PeerManager::process_events`]).
+ *
+ * # Avoiding Duplicate Payments
+ *
+ * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
+ * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
+ * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
+ * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
+ * second payment with the same [`PaymentId`].
+ *
+ * Thus, in order to ensure duplicate payments are not sent, you should implement your own
+ * tracking of payments, including state to indicate once a payment has completed. Because you
+ * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
+ * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
+ * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
+ *
+ * Additionally, in the scenario where we begin the process of sending a payment, but crash
+ * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
+ * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
+ * [`ChannelManager::list_recent_payments`] for more information.
+ *
+ * # Possible Error States on [`PaymentSendFailure`]
+ *
+ * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
+ * each entry matching the corresponding-index entry in the route paths, see
+ * [`PaymentSendFailure`] for more info.
+ *
+ * In general, a path may raise:
+ * * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
+ * node public key) is specified.
+ * * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
+ * closed, doesn't exist, or the peer is currently disconnected.
+ * * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
+ * relevant updates.
+ *
+ * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
+ * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
+ * different route unless you intend to pay twice!
+ *
+ * [`RouteHop`]: crate::routing::router::RouteHop
+ * [`Event::PaymentSent`]: events::Event::PaymentSent
+ * [`Event::PaymentFailed`]: events::Event::PaymentFailed
+ * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
+ * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
+ * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
+ */
+MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment_with_route(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKRoute route, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
+
+/**
+ * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
+ * `route_params` and retry failed payment paths based on `retry_strategy`.
+ */
+MUST_USE_RES struct LDKCResult_NoneRetryableSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
+
+/**
+ * Signals that no further attempts for the given payment should occur. Useful if you have a
+ * pending outbound payment with retries remaining, but wish to stop retrying the payment before
+ * retries are exhausted.
+ *
+ * # Event Generation
+ *
+ * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
+ * as there are no remaining pending HTLCs for this payment.
+ *
+ * Note that calling this method does *not* prevent a payment from succeeding. You must still
+ * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
+ * determine the ultimate status of a payment.
+ *
+ * # Requested Invoices
+ *
+ * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
+ * the payment prior to receiving the invoice will result in an [`Event::PaymentFailed`] and
+ * prevent any attempts at paying it once received.
+ *
+ * # Restart Behavior
+ *
+ * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
+ * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated.
+ *
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ */
+void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
+
+/**
+ * Send a spontaneous payment, which is a payment that does not require the recipient to have
+ * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
+ * the preimage, it must be a cryptographically secure random value that no intermediate node
+ * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
+ * never reach the recipient.
+ *
+ * See [`send_payment`] documentation for more details on the return value of this function
+ * and idempotency guarantees provided by the [`PaymentId`] key.
+ *
+ * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
+ * [`send_payment`] for more information about the risks of duplicate preimage usage.
+ *
+ * [`send_payment`]: Self::send_payment
+ */
+MUST_USE_RES struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
+
+/**
+ * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
+ * based on `route_params` and retry failed payment paths based on `retry_strategy`.
+ *
+ * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
+ * payments.
+ *
+ * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
+ */
+MUST_USE_RES struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ ChannelManager_send_spontaneous_payment_with_retry(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
+
+/**
+ * Send a payment that is probing the given route for liquidity. We calculate the
+ * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
+ * us to easily discern them from real payments.
+ */
+MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
+
+/**
+ * Sends payment probes over all paths of a route that would be used to pay the given
+ * amount to the given `node_id`.
+ *
+ * See [`ChannelManager::send_preflight_probes`] for more information.
+ */
+MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_spontaneous_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, uint64_t amount_msat, uint32_t final_cltv_expiry_delta, struct LDKCOption_u64Z liquidity_limit_multiplier);
+
+/**
+ * Sends payment probes over all paths of a route that would be used to pay a route found
+ * according to the given [`RouteParameters`].
+ *
+ * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
+ * the actual payment. Note this is only useful if there likely is sufficient time for the
+ * probe to settle before sending out the actual payment, e.g., when waiting for user
+ * confirmation in a wallet UI.
+ *
+ * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
+ * actual payment. Users should therefore be cautious and might avoid sending probes if
+ * liquidity is scarce and/or they don't expect the probe to return before they send the
+ * payment. To mitigate this issue, channels with available liquidity less than the required
+ * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
+ * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
+ */
+MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKRouteParameters route_params, struct LDKCOption_u64Z liquidity_limit_multiplier);
+
+/**
+ * Call this upon creation of a funding transaction for the given channel.
+ *
+ * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
+ * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
+ *
+ * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
+ * across the p2p network.
+ *
+ * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
+ * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
+ *
+ * May panic if the output found in the funding transaction is duplicative with some other
+ * channel (note that this should be trivially prevented by using unique funding transaction
+ * keys per-channel).
+ *
+ * Do NOT broadcast the funding transaction yourself. When we have safely received our
+ * counterparty's signature the funding transaction will automatically be broadcast via the
+ * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
+ *
+ * Note that this includes RBF or similar transaction replacement strategies - lightning does
+ * not currently support replacing a funding transaction on an existing channel. Instead,
+ * create a new channel with a conflicting funding transaction.
+ *
+ * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
+ * the wallet software generating the funding transaction to apply anti-fee sniping as
+ * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
+ * for more details.
+ *
+ * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
+ * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction);
+
+/**
+ * **Unsafe**: This method does not validate the spent output. It is the caller's
+ * responsibility to ensure the spent outputs are SegWit, as well as making sure the funding
+ * transaction has a final absolute locktime, i.e., its locktime is lower than the next block height.
+ *
+ * For a safer method, please refer to [`ChannelManager::funding_transaction_generated`].
+ *
+ * Call this in response to a [`Event::FundingGenerationReady`] event.
+ *
+ * Note that if this method is called successfully, the funding transaction won't be
+ * broadcasted and you are expected to broadcast it manually when receiving the
+ * [`Event::FundingTxBroadcastSafe`] event.
+ *
+ * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
+ * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
+ *
+ * May panic if the funding output is duplicative with some other channel (note that this
+ * should be trivially prevented by using unique funding transaction keys per-channel).
+ *
+ * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
+ * the wallet software generating the funding transaction to apply anti-fee sniping as
+ * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/> for
+ * more details.
+ *
+ * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
+ * [`Event::FundingTxBroadcastSafe`]: crate::events::Event::FundingTxBroadcastSafe
+ * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
+ * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_unsafe_manual_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding);
+
+/**
+ * Call this upon creation of a batch funding transaction for the given channels.
+ *
+ * Return values are identical to [`Self::funding_transaction_generated`], respective to
+ * each individual channel and transaction output.
+ *
+ * Do NOT broadcast the funding transaction yourself. This batch funding transaction
+ * will only be broadcast when we have safely received and persisted the counterparty's
+ * signature for each channel.
+ *
+ * If there is an error, all channels in the batch are to be considered closed.
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_batch_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ temporary_channels, struct LDKTransaction funding_transaction);
+
+/**
+ * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
+ *
+ * Once the updates are applied, each eligible channel (advertised with a known short channel
+ * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
+ * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
+ * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
+ *
+ * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
+ * `counterparty_node_id` is provided.
+ *
+ * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
+ * below [`MIN_CLTV_EXPIRY_DELTA`].
+ *
+ * If an error is returned, none of the updates should be considered applied.
+ *
+ * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
+ * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
+ * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
+ * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
+ * [`ChannelUpdate`]: msgs::ChannelUpdate
+ * [`ChannelUnavailable`]: APIError::ChannelUnavailable
+ * [`APIMisuseError`]: APIError::APIMisuseError
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_partial_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ChannelIdZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update);
+
+/**
+ * Atomically updates the [`ChannelConfig`] for the given channels.
+ *
+ * Once the updates are applied, each eligible channel (advertised with a known short channel
+ * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
+ * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
+ * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
+ *
+ * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
+ * `counterparty_node_id` is provided.
+ *
+ * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
+ * below [`MIN_CLTV_EXPIRY_DELTA`].
+ *
+ * If an error is returned, none of the updates should be considered applied.
+ *
+ * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
+ * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
+ * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
+ * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
+ * [`ChannelUpdate`]: msgs::ChannelUpdate
+ * [`ChannelUnavailable`]: APIError::ChannelUnavailable
+ * [`APIMisuseError`]: APIError::APIMisuseError
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ChannelIdZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config);
+
+/**
+ * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
+ * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
+ *
+ * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
+ * channel to a receiving node if the node lacks sufficient inbound liquidity.
+ *
+ * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
+ * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
+ * receiver's invoice route hints. These route hints will signal to LDK to generate an
+ * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
+ * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
+ *
+ * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
+ * you from forwarding more than you received. See
+ * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
+ * than expected.
+ *
+ * Errors if the event was not handled in time, in which case the HTLC was automatically failed
+ * backwards.
+ *
+ * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
+ * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
+ * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const struct LDKChannelId *NONNULL_PTR next_hop_channel_id, struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat);
+
+/**
+ * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
+ * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
+ *
+ * Errors if the event was not handled in time, in which case the HTLC was automatically failed
+ * backwards.
+ *
+ * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
+
+/**
+ * Processes HTLCs which are pending waiting on random forward delay.
+ *
+ * Should only really ever be called in response to a PendingHTLCsForwardable event.
+ * Will likely generate further events.
+ */
+void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Performs actions which should happen on startup and roughly once per minute thereafter.
+ *
+ * This currently includes:
+ * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
+ * * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
+ * than a minute, informing the network that they should no longer attempt to route over
+ * the channel.
+ * * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
+ * with the current [`ChannelConfig`].
+ * * Removing peers which have disconnected but and no longer have any channels.
+ * * Force-closing and removing channels which have not completed establishment in a timely manner.
+ * * Forgetting about stale outbound payments, either those that have already been fulfilled
+ * or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
+ * The latter is determined using the system clock in `std` and the highest seen block time
+ * minus two hours in `no-std`.
+ *
+ * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
+ * estimate fetches.
+ *
+ * [`ChannelUpdate`]: msgs::ChannelUpdate
+ * [`ChannelConfig`]: crate::util::config::ChannelConfig
+ */
+void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
+ * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
+ * along the path (including in our own channel on which we received it).
+ *
+ * Note that in some cases around unclean shutdown, it is possible the payment may have
+ * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
+ * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
+ * may have already been failed automatically by LDK if it was nearing its expiration time.
+ *
+ * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
+ * [`ChannelManager::claim_funds`]), you should still monitor for
+ * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
+ * startup during which time claims that were in-progress at shutdown may be replayed.
+ */
+void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
+
+/**
+ * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
+ * reason for the failure.
+ *
+ * See [`FailureCode`] for valid failure codes.
+ */
+void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
+
+/**
+ * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
+ * [`MessageSendEvent`]s needed to claim the payment.
+ *
+ * This method is guaranteed to ensure the payment has been claimed but only if the current
+ * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
+ * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
+ * successful. It will generally be available in the next [`process_pending_events`] call.
+ *
+ * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
+ * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
+ * event matches your expectation. If you fail to do so and call this method, you may provide
+ * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
+ *
+ * This function will fail the payment if it has custom TLVs with even type numbers, as we
+ * will assume they are unknown. If you intend to accept even custom TLVs, you should use
+ * [`claim_funds_with_known_custom_tlvs`].
+ *
+ * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
+ * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
+ * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
+ * [`process_pending_events`]: EventsProvider::process_pending_events
+ * [`create_inbound_payment`]: Self::create_inbound_payment
+ * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
+ * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
+ */
+void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
+
+/**
+ * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
+ * even type numbers.
+ *
+ * # Note
+ *
+ * You MUST check you've understood all even TLVs before using this to
+ * claim, otherwise you may unintentionally agree to some protocol you do not understand.
+ *
+ * [`claim_funds`]: Self::claim_funds
+ */
+void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
+
+/**
+ * Gets the node_id held by this ChannelManager
+ */
+MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
+ *
+ * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
+ * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
+ * the channel.
+ *
+ * The `user_channel_id` parameter will be provided back in
+ * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
+ * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
+ *
+ * Note that this method will return an error and reject the channel, if it requires support
+ * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
+ * used to accept such channels.
+ *
+ * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
+ * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
+
+/**
+ * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
+ * it as confirmed immediately.
+ *
+ * The `user_channel_id` parameter will be provided back in
+ * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
+ * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
+ *
+ * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
+ * and (if the counterparty agrees), enables forwarding of payments immediately.
+ *
+ * This fully trusts that the counterparty has honestly and correctly constructed the funding
+ * transaction and blindly assumes that it will eventually confirm.
+ *
+ * If it does not confirm before we decide to close the channel, or if the funding transaction
+ * does not pay to the correct script the correct amount, *you will lose funds*.
+ *
+ * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
+ * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id);
+
+/**
+ * Creates an [`OfferBuilder`] such that the [`Offer`] it builds is recognized by the
+ * [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer's
+ * expiration will be `absolute_expiry` if `Some`, otherwise it will not expire.
+ *
+ * # Privacy
+ *
+ * Uses [`MessageRouter`] to construct a [`BlindedMessagePath`] for the offer based on the given
+ * `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for
+ * privacy implications as well as those of the parameterized [`Router`], which implements
+ * [`MessageRouter`].
+ *
+ * Also, uses a derived signing pubkey in the offer for recipient privacy.
+ *
+ * # Limitations
+ *
+ * Requires a direct connection to the introduction node in the responding [`InvoiceRequest`]'s
+ * reply path.
+ *
+ * # Errors
+ *
+ * Errors if the parameterized [`Router`] is unable to create a blinded path for the offer.
+ *
+ * [`Offer`]: crate::offers::offer::Offer
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ */
+MUST_USE_RES struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_offer_builder(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z absolute_expiry);
+
+/**
+ * Creates a [`RefundBuilder`] such that the [`Refund`] it builds is recognized by the
+ * [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the refund.
+ *
+ * # Payment
+ *
+ * The provided `payment_id` is used to ensure that only one invoice is paid for the refund.
+ * See [Avoiding Duplicate Payments] for other requirements once the payment has been sent.
+ *
+ * The builder will have the provided expiration set. Any changes to the expiration on the
+ * returned builder will not be honored by [`ChannelManager`]. For `no-std`, the highest seen
+ * block time minus two hours is used for the current time when determining if the refund has
+ * expired.
+ *
+ * To revoke the refund, use [`ChannelManager::abandon_payment`] prior to receiving the
+ * invoice. If abandoned, or an invoice isn't received before expiration, the payment will fail
+ * with an [`Event::PaymentFailed`].
+ *
+ * If `max_total_routing_fee_msat` is not specified, The default from
+ * [`RouteParameters::from_payment_params_and_value`] is applied.
+ *
+ * # Privacy
+ *
+ * Uses [`MessageRouter`] to construct a [`BlindedMessagePath`] for the refund based on the given
+ * `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for
+ * privacy implications as well as those of the parameterized [`Router`], which implements
+ * [`MessageRouter`].
+ *
+ * Also, uses a derived payer id in the refund for payer privacy.
+ *
+ * # Limitations
+ *
+ * Requires a direct connection to an introduction node in the responding
+ * [`Bolt12Invoice::payment_paths`].
+ *
+ * # Errors
+ *
+ * Errors if:
+ * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
+ * - `amount_msats` is invalid, or
+ * - the parameterized [`Router`] is unable to create a blinded path for the refund.
+ *
+ * [`Refund`]: crate::offers::refund::Refund
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
+ * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
+ */
+MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_refund_builder(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t amount_msats, uint64_t absolute_expiry, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat);
+
+/**
+ * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
+ * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
+ * [`Bolt12Invoice`] once it is received.
+ *
+ * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
+ * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
+ * The optional parameters are used in the builder, if `Some`:
+ * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
+ * [`Offer::expects_quantity`] is `true`.
+ * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
+ * - `payer_note` for [`InvoiceRequest::payer_note`].
+ *
+ * If `max_total_routing_fee_msat` is not specified, The default from
+ * [`RouteParameters::from_payment_params_and_value`] is applied.
+ *
+ * # Payment
+ *
+ * The provided `payment_id` is used to ensure that only one invoice is paid for the request
+ * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
+ * been sent.
+ *
+ * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
+ * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
+ * payment will fail with an [`Event::PaymentFailed`].
+ *
+ * # Privacy
+ *
+ * For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`]
+ * to construct a [`BlindedMessagePath`] for the reply path. For further privacy implications, see the
+ * docs of the parameterized [`Router`], which implements [`MessageRouter`].
+ *
+ * # Limitations
+ *
+ * Requires a direct connection to an introduction node in [`Offer::paths`] or to
+ * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
+ * [`Bolt12Invoice::payment_paths`].
+ *
+ * # Errors
+ *
+ * Errors if:
+ * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
+ * - the provided parameters are invalid for the offer,
+ * - the offer is for an unsupported chain, or
+ * - the parameterized [`Router`] is unable to create a blinded reply path for the invoice
+ * request.
+ *
+ * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
+ * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
+ * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
+ * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
+ */
+MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ ChannelManager_pay_for_offer(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOffer *NONNULL_PTR offer, struct LDKCOption_u64Z quantity, struct LDKCOption_u64Z amount_msats, struct LDKCOption_StrZ payer_note, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat);
+
+/**
+ * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
+ * message.
+ *
+ * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
+ * [`BlindedPaymentPath`] containing the [`PaymentSecret`] needed to reconstruct the
+ * corresponding [`PaymentPreimage`]. It is returned purely for informational purposes.
+ *
+ * # Limitations
+ *
+ * Requires a direct connection to an introduction node in [`Refund::paths`] or to
+ * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
+ * node meeting the aforementioned criteria, but there's no guarantee that they will be
+ * received and no retries will be made.
+ *
+ * # Errors
+ *
+ * Errors if:
+ * - the refund is for an unsupported chain, or
+ * - the parameterized [`Router`] is unable to create a blinded payment path or reply path for
+ * the invoice.
+ *
+ * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+ */
+MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund);
+
+/**
+ * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
+ * to pay us.
+ *
+ * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
+ * [`PaymentHash`] and [`PaymentPreimage`] for you.
+ *
+ * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`] event, which
+ * will have the [`PaymentClaimable::purpose`] return `Some` for [`PaymentPurpose::preimage`]. That
+ * should then be passed directly to [`claim_funds`].
+ *
+ * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
+ *
+ * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
+ * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
+ *
+ * # Note
+ *
+ * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
+ * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
+ *
+ * Errors if `min_value_msat` is greater than total bitcoin supply.
+ *
+ * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
+ * on versions of LDK prior to 0.0.114.
+ *
+ * [`claim_funds`]: Self::claim_funds
+ * [`PaymentClaimable`]: events::Event::PaymentClaimable
+ * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
+ * [`PaymentPurpose::preimage`]: events::PaymentPurpose::preimage
+ * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
+ */
+MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
+
+/**
+ * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
+ * stored external to LDK.
+ *
+ * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
+ * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
+ * the `min_value_msat` provided here, if one is provided.
+ *
+ * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
+ * note that LDK will not stop you from registering duplicate payment hashes for inbound
+ * payments.
+ *
+ * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
+ * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
+ * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
+ * sender \"proof-of-payment\" unless they have paid the required amount.
+ *
+ * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
+ * in excess of the current time. This should roughly match the expiry time set in the invoice.
+ * After this many seconds, we will remove the inbound payment, resulting in any attempts to
+ * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
+ * invoices when no timeout is set.
+ *
+ * Note that we use block header time to time-out pending inbound payments (with some margin
+ * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
+ * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
+ * If you need exact expiry semantics, you should enforce them upon receipt of
+ * [`PaymentClaimable`].
+ *
+ * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
+ * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
+ *
+ * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
+ * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
+ *
+ * # Note
+ *
+ * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
+ * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
+ *
+ * Errors if `min_value_msat` is greater than total bitcoin supply.
+ *
+ * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
+ * on versions of LDK prior to 0.0.114.
+ *
+ * [`create_inbound_payment`]: Self::create_inbound_payment
+ * [`PaymentClaimable`]: events::Event::PaymentClaimable
+ */
+MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry);
+
+/**
+ * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
+ * previously returned from [`create_inbound_payment`].
+ *
+ * [`create_inbound_payment`]: Self::create_inbound_payment
+ */
+MUST_USE_RES struct LDKCResult_ThirtyTwoBytesAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
+
+/**
+ * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
+ * are used when constructing the phantom invoice's route hints.
+ *
+ * [phantom node payments]: crate::sign::PhantomKeysManager
+ */
+MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Gets route hints for use in receiving [phantom node payments].
+ *
+ * [phantom node payments]: crate::sign::PhantomKeysManager
+ */
+MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
+ * used when constructing the route hints for HTLCs intended to be intercepted. See
+ * [`ChannelManager::forward_intercepted_htlc`].
+ *
+ * Note that this method is not guaranteed to return unique values, you may need to call it a few
+ * times to get a unique scid.
+ */
+MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Gets inflight HTLC information by processing pending outbound payments that are in
+ * our channels. May be used during pathfinding to account for in-use channel liquidity.
+ */
+MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
+ */
+struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new EventsProvider which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
+ */
+struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new Listen which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
+ */
+struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new Confirm which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
+ */
+struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
+ * may have events that need processing.
+ *
+ * In order to check if this [`ChannelManager`] needs persisting, call
+ * [`Self::get_and_clear_needs_persistence`].
+ *
+ * Note that callbacks registered on the [`Future`] MUST NOT call back into this
+ * [`ChannelManager`] and should instead register actions to be taken later.
+ */
+MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Returns true if this [`ChannelManager`] needs to be persisted.
+ *
+ * See [`Self::get_event_or_persistence_needed_future`] for retrieving a [`Future`] that
+ * indicates this should be checked.
+ */
+MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Gets the latest best block which was connected either via the [`chain::Listen`] or
+ * [`chain::Confirm`] interfaces.
+ */
+MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
+ * [`ChannelManager`].
+ */
+MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
+ * [`ChannelManager`].
+ */
+MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
+ * [`ChannelManager`].
+ */
+MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Fetches the set of [`InitFeatures`] flags that are provided by or required by
+ * [`ChannelManager`].
+ */
+MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
+ */
+struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
+ */
+struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new AsyncPaymentsMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned AsyncPaymentsMessageHandler must be freed before this_arg is
+ */
+struct LDKAsyncPaymentsMessageHandler ChannelManager_as_AsyncPaymentsMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is
+ */
+struct LDKNodeIdLookUp ChannelManager_as_NodeIdLookUp(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
+/**
+ * Fetches the set of [`InitFeatures`] flags that are provided by or required by
+ * [`ChannelManager`].
+ */
+struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
+
+/**
+ * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
+ */
+struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
+
+/**
+ * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
+ */
+struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
+
+/**
+ * Serialize the BlindedForward object into a byte array which can be read by BlindedForward_read
+ */
+struct LDKCVec_u8Z BlindedForward_write(const struct LDKBlindedForward *NONNULL_PTR obj);
+
+/**
+ * Read a BlindedForward from a byte array, created by BlindedForward_write
+ */
+struct LDKCResult_BlindedForwardDecodeErrorZ BlindedForward_read(struct LDKu8slice ser);
+
+/**
+ * Serialize the PendingHTLCRouting object into a byte array which can be read by PendingHTLCRouting_read
+ */
+struct LDKCVec_u8Z PendingHTLCRouting_write(const struct LDKPendingHTLCRouting *NONNULL_PTR obj);
+
+/**
+ * Read a PendingHTLCRouting from a byte array, created by PendingHTLCRouting_write
+ */
+struct LDKCResult_PendingHTLCRoutingDecodeErrorZ PendingHTLCRouting_read(struct LDKu8slice ser);
+
+/**
+ * Serialize the PendingHTLCInfo object into a byte array which can be read by PendingHTLCInfo_read
+ */
+struct LDKCVec_u8Z PendingHTLCInfo_write(const struct LDKPendingHTLCInfo *NONNULL_PTR obj);
+
+/**
+ * Read a PendingHTLCInfo from a byte array, created by PendingHTLCInfo_write
+ */
+struct LDKCResult_PendingHTLCInfoDecodeErrorZ PendingHTLCInfo_read(struct LDKu8slice ser);
+
+/**
+ * Serialize the BlindedFailure object into a byte array which can be read by BlindedFailure_read
+ */
+struct LDKCVec_u8Z BlindedFailure_write(const enum LDKBlindedFailure *NONNULL_PTR obj);
+
+/**
+ * Read a BlindedFailure from a byte array, created by BlindedFailure_write
+ */
+struct LDKCResult_BlindedFailureDecodeErrorZ BlindedFailure_read(struct LDKu8slice ser);
+
+/**
+ * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
+ */
+struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
+
+/**
+ * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
+ */
+void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
+
+/**
+ * A cryptographically secure source of entropy.
+ */
+const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+
+/**
+ * A cryptographically secure source of entropy.
+ */
+void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
+
+/**
+ * A signer that is able to perform node-scoped cryptographic operations.
+ */
+const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+
+/**
+ * A signer that is able to perform node-scoped cryptographic operations.
+ */
+void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
+
+/**
+ * The keys provider which will give us relevant keys. Some keys will be loaded during
+ * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
+ * signing data.
+ */
+const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+
+/**
+ * The keys provider which will give us relevant keys. Some keys will be loaded during
+ * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
+ * signing data.
+ */
+void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
+
+/**
+ * The fee_estimator for use in the ChannelManager in the future.
+ *
+ * No calls to the FeeEstimator will be made during deserialization.
+ */
+const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+
+/**
+ * The fee_estimator for use in the ChannelManager in the future.
+ *
+ * No calls to the FeeEstimator will be made during deserialization.
+ */
+void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
+
+/**
+ * The chain::Watch for use in the ChannelManager in the future.
+ *
+ * No calls to the chain::Watch will be made during deserialization. It is assumed that
+ * you have deserialized ChannelMonitors separately and will add them to your
+ * chain::Watch after deserializing this ChannelManager.
+ */
+const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+
+/**
+ * The chain::Watch for use in the ChannelManager in the future.
+ *
+ * No calls to the chain::Watch will be made during deserialization. It is assumed that
+ * you have deserialized ChannelMonitors separately and will add them to your
+ * chain::Watch after deserializing this ChannelManager.
+ */
+void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
+
+/**
+ * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
+ * used to broadcast the latest local commitment transactions of channels which must be
+ * force-closed during deserialization.
+ */
+const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+
+/**
+ * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
+ * used to broadcast the latest local commitment transactions of channels which must be
+ * force-closed during deserialization.
+ */
+void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
+
+/**
+ * The router which will be used in the ChannelManager in the future for finding routes
+ * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
+ *
+ * No calls to the router will be made during deserialization.
+ */
+const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+
+/**
+ * The router which will be used in the ChannelManager in the future for finding routes
+ * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
+ *
+ * No calls to the router will be made during deserialization.
+ */
+void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
+
+/**
+ * The Logger for use in the ChannelManager and which may be used to log information during
+ * deserialization.
+ */
+const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+
+/**
+ * The Logger for use in the ChannelManager and which may be used to log information during
+ * deserialization.
+ */
+void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
+
+/**
+ * Default settings used for new channels. Any existing channels will continue to use the
+ * runtime settings which were stored when the ChannelManager was serialized.
+ */
+struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
+
+/**
+ * Default settings used for new channels. Any existing channels will continue to use the
+ * runtime settings which were stored when the ChannelManager was serialized.
+ */
+void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
+
+/**
+ * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
+ * HashMap for you. This is primarily useful for C bindings where it is not practical to
+ * populate a HashMap directly from C.
+ */
+MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors);
+
+/**
+ * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
+
+/**
+ * Frees any resources used by the DelayedPaymentBasepoint, if is_owned is set and inner is non-NULL.
+ */
+void DelayedPaymentBasepoint_free(struct LDKDelayedPaymentBasepoint this_obj);
+
+struct LDKPublicKey DelayedPaymentBasepoint_get_a(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr);
+
+void DelayedPaymentBasepoint_set_a(struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new DelayedPaymentBasepoint given each field
+ */
+MUST_USE_RES struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_new(struct LDKPublicKey a_arg);
+
+/**
+ * Checks if two DelayedPaymentBasepoints contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool DelayedPaymentBasepoint_eq(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR a, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the DelayedPaymentBasepoint
+ */
+struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_clone(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the DelayedPaymentBasepoint.
+ */
+uint64_t DelayedPaymentBasepoint_hash(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR o);
+
+/**
+ * Get inner Public Key
+ */
+MUST_USE_RES struct LDKPublicKey DelayedPaymentBasepoint_to_public_key(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg);
+
+/**
+ *Derives the \"tweak\" used in calculate [`DelayedPaymentKey::from_basepoint`].\n\n[`DelayedPaymentKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
+ */
+MUST_USE_RES struct LDKThirtyTwoBytes DelayedPaymentBasepoint_derive_add_tweak(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
+
+/**
+ * Serialize the DelayedPaymentBasepoint object into a byte array which can be read by DelayedPaymentBasepoint_read
+ */
+struct LDKCVec_u8Z DelayedPaymentBasepoint_write(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR obj);
+
+/**
+ * Read a DelayedPaymentBasepoint from a byte array, created by DelayedPaymentBasepoint_write
+ */
+struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ DelayedPaymentBasepoint_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the DelayedPaymentKey, if is_owned is set and inner is non-NULL.
+ */
+void DelayedPaymentKey_free(struct LDKDelayedPaymentKey this_obj);
+
+struct LDKPublicKey DelayedPaymentKey_get_a(const struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr);
+
+void DelayedPaymentKey_set_a(struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new DelayedPaymentKey given each field
+ */
+MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_new(struct LDKPublicKey a_arg);
+
+/**
+ * Checks if two DelayedPaymentKeys contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool DelayedPaymentKey_eq(const struct LDKDelayedPaymentKey *NONNULL_PTR a, const struct LDKDelayedPaymentKey *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the DelayedPaymentKey
+ */
+struct LDKDelayedPaymentKey DelayedPaymentKey_clone(const struct LDKDelayedPaymentKey *NONNULL_PTR orig);
+
+/**
+ *Derive a public delayedpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
+ */
+MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_basepoint(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
+
+/**
+ *Build a delayedpubkey directly from an already-derived private key
+ */
+MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_secret_key(const uint8_t (*sk)[32]);
+
+/**
+ * Get inner Public Key
+ */
+MUST_USE_RES struct LDKPublicKey DelayedPaymentKey_to_public_key(const struct LDKDelayedPaymentKey *NONNULL_PTR this_arg);
+
+/**
+ * Serialize the DelayedPaymentKey object into a byte array which can be read by DelayedPaymentKey_read
+ */
+struct LDKCVec_u8Z DelayedPaymentKey_write(const struct LDKDelayedPaymentKey *NONNULL_PTR obj);
+
+/**
+ * Read a DelayedPaymentKey from a byte array, created by DelayedPaymentKey_write
+ */
+struct LDKCResult_DelayedPaymentKeyDecodeErrorZ DelayedPaymentKey_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the HtlcBasepoint, if is_owned is set and inner is non-NULL.
+ */
+void HtlcBasepoint_free(struct LDKHtlcBasepoint this_obj);
+
+struct LDKPublicKey HtlcBasepoint_get_a(const struct LDKHtlcBasepoint *NONNULL_PTR this_ptr);
+
+void HtlcBasepoint_set_a(struct LDKHtlcBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new HtlcBasepoint given each field
+ */
+MUST_USE_RES struct LDKHtlcBasepoint HtlcBasepoint_new(struct LDKPublicKey a_arg);
+
+/**
+ * Checks if two HtlcBasepoints contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool HtlcBasepoint_eq(const struct LDKHtlcBasepoint *NONNULL_PTR a, const struct LDKHtlcBasepoint *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the HtlcBasepoint
+ */
+struct LDKHtlcBasepoint HtlcBasepoint_clone(const struct LDKHtlcBasepoint *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the HtlcBasepoint.
+ */
+uint64_t HtlcBasepoint_hash(const struct LDKHtlcBasepoint *NONNULL_PTR o);
+
+/**
+ * Get inner Public Key
+ */
+MUST_USE_RES struct LDKPublicKey HtlcBasepoint_to_public_key(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg);
+
+/**
+ *Derives the \"tweak\" used in calculate [`HtlcKey::from_basepoint`].\n\n[`HtlcKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party.
+ */
+MUST_USE_RES struct LDKThirtyTwoBytes HtlcBasepoint_derive_add_tweak(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point);
+
+/**
+ * Serialize the HtlcBasepoint object into a byte array which can be read by HtlcBasepoint_read
+ */
+struct LDKCVec_u8Z HtlcBasepoint_write(const struct LDKHtlcBasepoint *NONNULL_PTR obj);
+
+/**
+ * Read a HtlcBasepoint from a byte array, created by HtlcBasepoint_write
+ */
+struct LDKCResult_HtlcBasepointDecodeErrorZ HtlcBasepoint_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the HtlcKey, if is_owned is set and inner is non-NULL.
+ */
+void HtlcKey_free(struct LDKHtlcKey this_obj);
+
+struct LDKPublicKey HtlcKey_get_a(const struct LDKHtlcKey *NONNULL_PTR this_ptr);
+
+void HtlcKey_set_a(struct LDKHtlcKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new HtlcKey given each field
+ */
+MUST_USE_RES struct LDKHtlcKey HtlcKey_new(struct LDKPublicKey a_arg);
+
+/**
+ * Checks if two HtlcKeys contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool HtlcKey_eq(const struct LDKHtlcKey *NONNULL_PTR a, const struct LDKHtlcKey *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the HtlcKey
+ */
+struct LDKHtlcKey HtlcKey_clone(const struct LDKHtlcKey *NONNULL_PTR orig);
+
+/**
+ *Derive a public htlcpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
+ */
+MUST_USE_RES struct LDKHtlcKey HtlcKey_from_basepoint(const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
+
+/**
+ *Build a htlcpubkey directly from an already-derived private key
+ */
+MUST_USE_RES struct LDKHtlcKey HtlcKey_from_secret_key(const uint8_t (*sk)[32]);
+
+/**
+ * Get inner Public Key
+ */
+MUST_USE_RES struct LDKPublicKey HtlcKey_to_public_key(const struct LDKHtlcKey *NONNULL_PTR this_arg);
+
+/**
+ * Serialize the HtlcKey object into a byte array which can be read by HtlcKey_read
+ */
+struct LDKCVec_u8Z HtlcKey_write(const struct LDKHtlcKey *NONNULL_PTR obj);
+
+/**
+ * Read a HtlcKey from a byte array, created by HtlcKey_write
+ */
+struct LDKCResult_HtlcKeyDecodeErrorZ HtlcKey_read(struct LDKu8slice ser);
+
+/**
+ * Adds a tweak to a public key to derive a new public key.
+ *
+ * May panic if `tweak` is not the output of a SHA-256 hash.
+ */
+struct LDKPublicKey add_public_key_tweak(struct LDKPublicKey base_point, const uint8_t (*tweak)[32]);
+
+/**
+ * Frees any resources used by the RevocationBasepoint, if is_owned is set and inner is non-NULL.
+ */
+void RevocationBasepoint_free(struct LDKRevocationBasepoint this_obj);
+
+struct LDKPublicKey RevocationBasepoint_get_a(const struct LDKRevocationBasepoint *NONNULL_PTR this_ptr);
+
+void RevocationBasepoint_set_a(struct LDKRevocationBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new RevocationBasepoint given each field
+ */
+MUST_USE_RES struct LDKRevocationBasepoint RevocationBasepoint_new(struct LDKPublicKey a_arg);
+
+/**
+ * Checks if two RevocationBasepoints contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool RevocationBasepoint_eq(const struct LDKRevocationBasepoint *NONNULL_PTR a, const struct LDKRevocationBasepoint *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the RevocationBasepoint
+ */
+struct LDKRevocationBasepoint RevocationBasepoint_clone(const struct LDKRevocationBasepoint *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the RevocationBasepoint.
+ */
+uint64_t RevocationBasepoint_hash(const struct LDKRevocationBasepoint *NONNULL_PTR o);
+
+/**
+ * Get inner Public Key
+ */
+MUST_USE_RES struct LDKPublicKey RevocationBasepoint_to_public_key(const struct LDKRevocationBasepoint *NONNULL_PTR this_arg);
+
+/**
+ * Serialize the RevocationBasepoint object into a byte array which can be read by RevocationBasepoint_read
+ */
+struct LDKCVec_u8Z RevocationBasepoint_write(const struct LDKRevocationBasepoint *NONNULL_PTR obj);
+
+/**
+ * Read a RevocationBasepoint from a byte array, created by RevocationBasepoint_write
+ */
+struct LDKCResult_RevocationBasepointDecodeErrorZ RevocationBasepoint_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the RevocationKey, if is_owned is set and inner is non-NULL.
+ */
+void RevocationKey_free(struct LDKRevocationKey this_obj);
+
+struct LDKPublicKey RevocationKey_get_a(const struct LDKRevocationKey *NONNULL_PTR this_ptr);
+
+void RevocationKey_set_a(struct LDKRevocationKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new RevocationKey given each field
+ */
+MUST_USE_RES struct LDKRevocationKey RevocationKey_new(struct LDKPublicKey a_arg);
+
+/**
+ * Checks if two RevocationKeys contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool RevocationKey_eq(const struct LDKRevocationKey *NONNULL_PTR a, const struct LDKRevocationKey *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the RevocationKey
+ */
+struct LDKRevocationKey RevocationKey_clone(const struct LDKRevocationKey *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the RevocationKey.
+ */
+uint64_t RevocationKey_hash(const struct LDKRevocationKey *NONNULL_PTR o);
+
+/**
+ * Derives a per-commitment-transaction revocation public key from one party's per-commitment
+ * point and the other party's [`RevocationBasepoint`]. This is the public equivalent of
+ * [`chan_utils::derive_private_revocation_key`] - using only public keys to derive a public
+ * key instead of private keys.
+ *
+ * Note that this is infallible iff we trust that at least one of the two input keys are randomly
+ * generated (ie our own).
+ *
+ * [`chan_utils::derive_private_revocation_key`]: crate::ln::chan_utils::derive_private_revocation_key
+ */
+MUST_USE_RES struct LDKRevocationKey RevocationKey_from_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
+
+/**
+ * Get inner Public Key
+ */
+MUST_USE_RES struct LDKPublicKey RevocationKey_to_public_key(const struct LDKRevocationKey *NONNULL_PTR this_arg);
+
+/**
+ * Serialize the RevocationKey object into a byte array which can be read by RevocationKey_read
+ */
+struct LDKCVec_u8Z RevocationKey_write(const struct LDKRevocationKey *NONNULL_PTR obj);
+
+/**
+ * Read a RevocationKey from a byte array, created by RevocationKey_write
+ */
+struct LDKCResult_RevocationKeyDecodeErrorZ RevocationKey_read(struct LDKu8slice ser);
+
+/**
+ * Creates a copy of the InboundHTLCStateDetails
+ */
+enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_clone(const enum LDKInboundHTLCStateDetails *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new AwaitingRemoteRevokeToAdd-variant InboundHTLCStateDetails
+ */
+enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_add(void);
+
+/**
+ * Utility method to constructs a new Committed-variant InboundHTLCStateDetails
+ */
+enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_committed(void);
+
+/**
+ * Utility method to constructs a new AwaitingRemoteRevokeToRemoveFulfill-variant InboundHTLCStateDetails
+ */
+enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill(void);
+
+/**
+ * Utility method to constructs a new AwaitingRemoteRevokeToRemoveFail-variant InboundHTLCStateDetails
+ */
+enum LDKInboundHTLCStateDetails InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail(void);
+
+/**
+ * Serialize the InboundHTLCStateDetails object into a byte array which can be read by InboundHTLCStateDetails_read
+ */
+struct LDKCVec_u8Z InboundHTLCStateDetails_write(const enum LDKInboundHTLCStateDetails *NONNULL_PTR obj);
+
+/**
+ * Read a InboundHTLCStateDetails from a byte array, created by InboundHTLCStateDetails_write
+ */
+struct LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ InboundHTLCStateDetails_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the InboundHTLCDetails, if is_owned is set and inner is non-NULL.
+ */
+void InboundHTLCDetails_free(struct LDKInboundHTLCDetails this_obj);
+
+/**
+ * The HTLC ID.
+ * The IDs are incremented by 1 starting from 0 for each offered HTLC.
+ * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
+ * and not part of any commitment transaction.
+ */
+uint64_t InboundHTLCDetails_get_htlc_id(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The HTLC ID.
+ * The IDs are incremented by 1 starting from 0 for each offered HTLC.
+ * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
+ * and not part of any commitment transaction.
+ */
+void InboundHTLCDetails_set_htlc_id(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The amount in msat.
+ */
+uint64_t InboundHTLCDetails_get_amount_msat(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The amount in msat.
+ */
+void InboundHTLCDetails_set_amount_msat(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The block height at which this HTLC expires.
+ */
+uint32_t InboundHTLCDetails_get_cltv_expiry(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The block height at which this HTLC expires.
+ */
+void InboundHTLCDetails_set_cltv_expiry(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The payment hash.
+ */
+const uint8_t (*InboundHTLCDetails_get_payment_hash(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The payment hash.
+ */
+void InboundHTLCDetails_set_payment_hash(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The state of the HTLC in the state machine.
+ *
+ * Determines on which commitment transactions the HTLC is included and what message the HTLC is
+ * waiting for to advance to the next state.
+ *
+ * See [`InboundHTLCStateDetails`] for information on the specific states.
+ *
+ * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
+ * states may result in `None` here.
+ */
+struct LDKCOption_InboundHTLCStateDetailsZ InboundHTLCDetails_get_state(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The state of the HTLC in the state machine.
+ *
+ * Determines on which commitment transactions the HTLC is included and what message the HTLC is
+ * waiting for to advance to the next state.
+ *
+ * See [`InboundHTLCStateDetails`] for information on the specific states.
+ *
+ * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
+ * states may result in `None` here.
+ */
+void InboundHTLCDetails_set_state(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_InboundHTLCStateDetailsZ val);
+
+/**
+ * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
+ * from the local commitment transaction and added to the commitment transaction fee.
+ * For non-anchor channels, this takes into account the cost of the second-stage HTLC
+ * transactions as well.
+ *
+ * When the local commitment transaction is broadcasted as part of a unilateral closure,
+ * the value of this HTLC will therefore not be claimable but instead burned as a transaction
+ * fee.
+ *
+ * Note that dust limits are specific to each party. An HTLC can be dust for the local
+ * commitment transaction but not for the counterparty's commitment transaction and vice versa.
+ */
+bool InboundHTLCDetails_get_is_dust(const struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
+ * from the local commitment transaction and added to the commitment transaction fee.
+ * For non-anchor channels, this takes into account the cost of the second-stage HTLC
+ * transactions as well.
+ *
+ * When the local commitment transaction is broadcasted as part of a unilateral closure,
+ * the value of this HTLC will therefore not be claimable but instead burned as a transaction
+ * fee.
+ *
+ * Note that dust limits are specific to each party. An HTLC can be dust for the local
+ * commitment transaction but not for the counterparty's commitment transaction and vice versa.
+ */
+void InboundHTLCDetails_set_is_dust(struct LDKInboundHTLCDetails *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * Constructs a new InboundHTLCDetails given each field
+ */
+MUST_USE_RES struct LDKInboundHTLCDetails InboundHTLCDetails_new(uint64_t htlc_id_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_InboundHTLCStateDetailsZ state_arg, bool is_dust_arg);
+
+/**
+ * Creates a copy of the InboundHTLCDetails
+ */
+struct LDKInboundHTLCDetails InboundHTLCDetails_clone(const struct LDKInboundHTLCDetails *NONNULL_PTR orig);
+
+/**
+ * Serialize the InboundHTLCDetails object into a byte array which can be read by InboundHTLCDetails_read
+ */
+struct LDKCVec_u8Z InboundHTLCDetails_write(const struct LDKInboundHTLCDetails *NONNULL_PTR obj);
+
+/**
+ * Read a InboundHTLCDetails from a byte array, created by InboundHTLCDetails_write
+ */
+struct LDKCResult_InboundHTLCDetailsDecodeErrorZ InboundHTLCDetails_read(struct LDKu8slice ser);
+
+/**
+ * Creates a copy of the OutboundHTLCStateDetails
+ */
+enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_clone(const enum LDKOutboundHTLCStateDetails *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new AwaitingRemoteRevokeToAdd-variant OutboundHTLCStateDetails
+ */
+enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_add(void);
+
+/**
+ * Utility method to constructs a new Committed-variant OutboundHTLCStateDetails
+ */
+enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_committed(void);
+
+/**
+ * Utility method to constructs a new AwaitingRemoteRevokeToRemoveSuccess-variant OutboundHTLCStateDetails
+ */
+enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success(void);
+
+/**
+ * Utility method to constructs a new AwaitingRemoteRevokeToRemoveFailure-variant OutboundHTLCStateDetails
+ */
+enum LDKOutboundHTLCStateDetails OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure(void);
+
+/**
+ * Serialize the OutboundHTLCStateDetails object into a byte array which can be read by OutboundHTLCStateDetails_read
+ */
+struct LDKCVec_u8Z OutboundHTLCStateDetails_write(const enum LDKOutboundHTLCStateDetails *NONNULL_PTR obj);
+
+/**
+ * Read a OutboundHTLCStateDetails from a byte array, created by OutboundHTLCStateDetails_write
+ */
+struct LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ OutboundHTLCStateDetails_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the OutboundHTLCDetails, if is_owned is set and inner is non-NULL.
+ */
+void OutboundHTLCDetails_free(struct LDKOutboundHTLCDetails this_obj);
+
+/**
+ * The HTLC ID.
+ * The IDs are incremented by 1 starting from 0 for each offered HTLC.
+ * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
+ * and not part of any commitment transaction.
+ *
+ * Not present when we are awaiting a remote revocation and the HTLC is not added yet.
+ */
+struct LDKCOption_u64Z OutboundHTLCDetails_get_htlc_id(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The HTLC ID.
+ * The IDs are incremented by 1 starting from 0 for each offered HTLC.
+ * They are unique per channel and inbound/outbound direction, unless an HTLC was only announced
+ * and not part of any commitment transaction.
+ *
+ * Not present when we are awaiting a remote revocation and the HTLC is not added yet.
+ */
+void OutboundHTLCDetails_set_htlc_id(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The amount in msat.
+ */
+uint64_t OutboundHTLCDetails_get_amount_msat(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The amount in msat.
+ */
+void OutboundHTLCDetails_set_amount_msat(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The block height at which this HTLC expires.
+ */
+uint32_t OutboundHTLCDetails_get_cltv_expiry(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The block height at which this HTLC expires.
+ */
+void OutboundHTLCDetails_set_cltv_expiry(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The payment hash.
+ */
+const uint8_t (*OutboundHTLCDetails_get_payment_hash(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The payment hash.
+ */
+void OutboundHTLCDetails_set_payment_hash(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The state of the HTLC in the state machine.
+ *
+ * Determines on which commitment transactions the HTLC is included and what message the HTLC is
+ * waiting for to advance to the next state.
+ *
+ * See [`OutboundHTLCStateDetails`] for information on the specific states.
+ *
+ * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
+ * states may result in `None` here.
+ */
+struct LDKCOption_OutboundHTLCStateDetailsZ OutboundHTLCDetails_get_state(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The state of the HTLC in the state machine.
+ *
+ * Determines on which commitment transactions the HTLC is included and what message the HTLC is
+ * waiting for to advance to the next state.
+ *
+ * See [`OutboundHTLCStateDetails`] for information on the specific states.
+ *
+ * LDK will always fill this field in, but when downgrading to prior versions of LDK, new
+ * states may result in `None` here.
+ */
+void OutboundHTLCDetails_set_state(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_OutboundHTLCStateDetailsZ val);
+
+/**
+ * The extra fee being skimmed off the top of this HTLC.
+ */
+struct LDKCOption_u64Z OutboundHTLCDetails_get_skimmed_fee_msat(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The extra fee being skimmed off the top of this HTLC.
+ */
+void OutboundHTLCDetails_set_skimmed_fee_msat(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
+ * from the local commitment transaction and added to the commitment transaction fee.
+ * For non-anchor channels, this takes into account the cost of the second-stage HTLC
+ * transactions as well.
+ *
+ * When the local commitment transaction is broadcasted as part of a unilateral closure,
+ * the value of this HTLC will therefore not be claimable but instead burned as a transaction
+ * fee.
+ *
+ * Note that dust limits are specific to each party. An HTLC can be dust for the local
+ * commitment transaction but not for the counterparty's commitment transaction and vice versa.
+ */
+bool OutboundHTLCDetails_get_is_dust(const struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Whether the HTLC has an output below the local dust limit. If so, the output will be trimmed
+ * from the local commitment transaction and added to the commitment transaction fee.
+ * For non-anchor channels, this takes into account the cost of the second-stage HTLC
+ * transactions as well.
+ *
+ * When the local commitment transaction is broadcasted as part of a unilateral closure,
+ * the value of this HTLC will therefore not be claimable but instead burned as a transaction
+ * fee.
+ *
+ * Note that dust limits are specific to each party. An HTLC can be dust for the local
+ * commitment transaction but not for the counterparty's commitment transaction and vice versa.
+ */
+void OutboundHTLCDetails_set_is_dust(struct LDKOutboundHTLCDetails *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * Constructs a new OutboundHTLCDetails given each field
+ */
+MUST_USE_RES struct LDKOutboundHTLCDetails OutboundHTLCDetails_new(struct LDKCOption_u64Z htlc_id_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_OutboundHTLCStateDetailsZ state_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, bool is_dust_arg);
+
+/**
+ * Creates a copy of the OutboundHTLCDetails
+ */
+struct LDKOutboundHTLCDetails OutboundHTLCDetails_clone(const struct LDKOutboundHTLCDetails *NONNULL_PTR orig);
+
+/**
+ * Serialize the OutboundHTLCDetails object into a byte array which can be read by OutboundHTLCDetails_read
+ */
+struct LDKCVec_u8Z OutboundHTLCDetails_write(const struct LDKOutboundHTLCDetails *NONNULL_PTR obj);
+
+/**
+ * Read a OutboundHTLCDetails from a byte array, created by OutboundHTLCDetails_write
+ */
+struct LDKCResult_OutboundHTLCDetailsDecodeErrorZ OutboundHTLCDetails_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
+ */
+void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
+
+/**
+ * Base routing fee in millisatoshis.
+ */
+uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
+
+/**
+ * Base routing fee in millisatoshis.
+ */
+void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
+ */
+uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
+
+/**
+ * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
+ */
+void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
+ * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
+ * `cltv_expiry_delta` for more details.
+ */
+uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
+ * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
+ * `cltv_expiry_delta` for more details.
+ */
+void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Constructs a new CounterpartyForwardingInfo given each field
+ */
+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);
+
+/**
+ * Creates a copy of the CounterpartyForwardingInfo
+ */
+struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
+
+/**
+ * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
+ */
+struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
+
+/**
+ * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
+ */
+struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
+ */
+void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
+
+/**
+ * The node_id of our counterparty
+ */
+struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * The node_id of our counterparty
+ */
+void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The Features the channel counterparty provided upon last connection.
+ * Useful for routing as it is the most up-to-date copy of the counterparty's features and
+ * many routing-relevant features are present in the init context.
+ */
+struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * The Features the channel counterparty provided upon last connection.
+ * Useful for routing as it is the most up-to-date copy of the counterparty's features and
+ * many routing-relevant features are present in the init context.
+ */
+void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
+
+/**
+ * The value, in satoshis, that must always be held in the channel for our counterparty. This
+ * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
+ * claiming at least this value on chain.
+ *
+ * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
+ *
+ * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
+ */
+uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * The value, in satoshis, that must always be held in the channel for our counterparty. This
+ * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
+ * claiming at least this value on chain.
+ *
+ * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
+ *
+ * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
+ */
+void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Information on the fees and requirements that the counterparty requires when forwarding
+ * payments to us through this channel.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * Information on the fees and requirements that the counterparty requires when forwarding
+ * payments to us through this channel.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
+
+/**
+ * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
+ * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
+ * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
+ */
+struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
+ * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
+ * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
+ */
+void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
+ */
+struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
+ */
+void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * Constructs a new ChannelCounterparty given each field
+ *
+ * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg, struct LDKCOption_u64Z outbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z outbound_htlc_maximum_msat_arg);
+
+/**
+ * Creates a copy of the ChannelCounterparty
+ */
+struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
+
+/**
+ * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
+ */
+struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
+
+/**
+ * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
+ */
+struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
+ */
+void ChannelDetails_free(struct LDKChannelDetails this_obj);
+
+/**
+ * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
+ * thereafter this is the txid of the funding transaction xor the funding transaction output).
+ * Note that this means this value is *not* persistent - it can change once during the
+ * lifetime of the channel.
+ */
+struct LDKChannelId ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
+ * thereafter this is the txid of the funding transaction xor the funding transaction output).
+ * Note that this means this value is *not* persistent - it can change once during the
+ * lifetime of the channel.
+ */
+void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * Parameters which apply to our counterparty. See individual fields for more information.
+ */
+struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Parameters which apply to our counterparty. See individual fields for more information.
+ */
+void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
+
+/**
+ * The Channel's funding transaction output, if we've negotiated the funding transaction with
+ * our counterparty already.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The Channel's funding transaction output, if we've negotiated the funding transaction with
+ * our counterparty already.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+
+/**
+ * The features which this channel operates with. See individual features for more info.
+ *
+ * `None` until negotiation completes and the channel type is finalized.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The features which this channel operates with. See individual features for more info.
+ *
+ * `None` until negotiation completes and the channel type is finalized.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
+
+/**
+ * The position of the funding transaction in the chain. None if the funding transaction has
+ * not yet been confirmed and the channel fully opened.
+ *
+ * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
+ * payments instead of this. See [`get_inbound_payment_scid`].
+ *
+ * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
+ * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
+ *
+ * [`inbound_scid_alias`]: Self::inbound_scid_alias
+ * [`outbound_scid_alias`]: Self::outbound_scid_alias
+ * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
+ * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
+ * [`confirmations_required`]: Self::confirmations_required
+ */
+struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The position of the funding transaction in the chain. None if the funding transaction has
+ * not yet been confirmed and the channel fully opened.
+ *
+ * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
+ * payments instead of this. See [`get_inbound_payment_scid`].
+ *
+ * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
+ * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
+ *
+ * [`inbound_scid_alias`]: Self::inbound_scid_alias
+ * [`outbound_scid_alias`]: Self::outbound_scid_alias
+ * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
+ * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
+ * [`confirmations_required`]: Self::confirmations_required
+ */
+void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
+ * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
+ * the channel has not yet been confirmed (as long as [`confirmations_required`] is
+ * `Some(0)`).
+ *
+ * This will be `None` as long as the channel is not available for routing outbound payments.
+ *
+ * [`short_channel_id`]: Self::short_channel_id
+ * [`confirmations_required`]: Self::confirmations_required
+ */
+struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
+ * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
+ * the channel has not yet been confirmed (as long as [`confirmations_required`] is
+ * `Some(0)`).
+ *
+ * This will be `None` as long as the channel is not available for routing outbound payments.
+ *
+ * [`short_channel_id`]: Self::short_channel_id
+ * [`confirmations_required`]: Self::confirmations_required
+ */
+void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * An optional [`short_channel_id`] alias for this channel, randomly generated by our
+ * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
+ * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
+ * when they see a payment to be routed to us.
+ *
+ * Our counterparty may choose to rotate this value at any time, though will always recognize
+ * previous values for inbound payment forwarding.
+ *
+ * [`short_channel_id`]: Self::short_channel_id
+ */
+struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * An optional [`short_channel_id`] alias for this channel, randomly generated by our
+ * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
+ * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
+ * when they see a payment to be routed to us.
+ *
+ * Our counterparty may choose to rotate this value at any time, though will always recognize
+ * previous values for inbound payment forwarding.
+ *
+ * [`short_channel_id`]: Self::short_channel_id
+ */
+void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The value, in satoshis, of this channel as appears in the funding output
+ */
+uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The value, in satoshis, of this channel as appears in the funding output
+ */
+void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The value, in satoshis, that must always be held in the channel for us. This value ensures
+ * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
+ * this value on chain.
+ *
+ * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ *
+ * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
+ */
+struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The value, in satoshis, that must always be held in the channel for us. This value ensures
+ * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
+ * this value on chain.
+ *
+ * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ *
+ * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
+ */
+void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
+ * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+ * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
+ * serialized with LDK versions prior to 0.0.113.
+ *
+ * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ */
+struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
+ * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
+ * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
+ * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
+ * serialized with LDK versions prior to 0.0.113.
+ *
+ * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+ * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
+ * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
+ */
+void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
+
+/**
+ * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
+ * which is applied to commitment and HTLC transactions.
+ *
+ * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
+ */
+struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
+ * which is applied to commitment and HTLC transactions.
+ *
+ * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
+ */
+void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+
+/**
+ * Our total balance. This is the amount we would get if we close the channel.
+ * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
+ * amount is not likely to be recoverable on close.
+ *
+ * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
+ * balance is not available for inclusion in new outbound HTLCs). This further does not include
+ * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
+ * This does not consider any on-chain fees.
+ *
+ * See also [`ChannelDetails::outbound_capacity_msat`]
+ */
+uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Our total balance. This is the amount we would get if we close the channel.
+ * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
+ * amount is not likely to be recoverable on close.
+ *
+ * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
+ * balance is not available for inclusion in new outbound HTLCs). This further does not include
+ * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
+ * This does not consider any on-chain fees.
+ *
+ * See also [`ChannelDetails::outbound_capacity_msat`]
+ */
+void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The available outbound capacity for sending HTLCs to the remote peer. This does not include
+ * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
+ * available for inclusion in new outbound HTLCs). This further does not include any pending
+ * outgoing HTLCs which are awaiting some other resolution to be sent.
+ *
+ * See also [`ChannelDetails::balance_msat`]
+ *
+ * This value is not exact. Due to various in-flight changes, feerate changes, and our
+ * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
+ * should be able to spend nearly this amount.
+ */
+uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The available outbound capacity for sending HTLCs to the remote peer. This does not include
+ * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
+ * available for inclusion in new outbound HTLCs). This further does not include any pending
+ * outgoing HTLCs which are awaiting some other resolution to be sent.
+ *
+ * See also [`ChannelDetails::balance_msat`]
+ *
+ * This value is not exact. Due to various in-flight changes, feerate changes, and our
+ * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
+ * should be able to spend nearly this amount.
+ */
+void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The available outbound capacity for sending a single HTLC to the remote peer. This is
+ * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
+ * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
+ * to use a limit as close as possible to the HTLC limit we can currently send.
+ *
+ * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
+ * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
+ */
+uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The available outbound capacity for sending a single HTLC to the remote peer. This is
+ * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
+ * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
+ * to use a limit as close as possible to the HTLC limit we can currently send.
+ *
+ * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
+ * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
+ */
+void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
+ * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
+ * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
+ * route which is valid.
+ */
+uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
+ * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
+ * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
+ * route which is valid.
+ */
+void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The available inbound capacity for the remote peer to send HTLCs to us. This does not
+ * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
+ * available for inclusion in new inbound HTLCs).
+ * Note that there are some corner cases not fully handled here, so the actual available
+ * inbound capacity may be slightly higher than this.
+ *
+ * This value is not exact. Due to various in-flight changes, feerate changes, and our
+ * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
+ * However, our counterparty should be able to spend nearly this amount.
+ */
+uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The available inbound capacity for the remote peer to send HTLCs to us. This does not
+ * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
+ * available for inclusion in new inbound HTLCs).
+ * Note that there are some corner cases not fully handled here, so the actual available
+ * inbound capacity may be slightly higher than this.
+ *
+ * This value is not exact. Due to various in-flight changes, feerate changes, and our
+ * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
+ * However, our counterparty should be able to spend nearly this amount.
+ */
+void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The number of required confirmations on the funding transaction before the funding will be
+ * considered \"locked\". This number is selected by the channel fundee (i.e. us if
+ * [`is_outbound`] is *not* set), and can be selected for inbound channels with
+ * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
+ * [`ChannelHandshakeLimits::max_minimum_depth`].
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ *
+ * [`is_outbound`]: ChannelDetails::is_outbound
+ * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
+ * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
+ */
+struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The number of required confirmations on the funding transaction before the funding will be
+ * considered \"locked\". This number is selected by the channel fundee (i.e. us if
+ * [`is_outbound`] is *not* set), and can be selected for inbound channels with
+ * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
+ * [`ChannelHandshakeLimits::max_minimum_depth`].
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ *
+ * [`is_outbound`]: ChannelDetails::is_outbound
+ * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
+ * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
+ */
+void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+
+/**
+ * The current number of confirmations on the funding transaction.
+ *
+ * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
+ */
+struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The current number of confirmations on the funding transaction.
+ *
+ * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
+ */
+void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+
+/**
+ * The number of blocks (after our commitment transaction confirms) that we will need to wait
+ * until we can claim our funds after we force-close the channel. During this time our
+ * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
+ * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
+ * time to claim our non-HTLC-encumbered funds.
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ */
+struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The number of blocks (after our commitment transaction confirms) that we will need to wait
+ * until we can claim our funds after we force-close the channel. During this time our
+ * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
+ * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
+ * time to claim our non-HTLC-encumbered funds.
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ */
+void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
+
+/**
+ * True if the channel was initiated (and thus funded) by us.
+ */
+bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * True if the channel was initiated (and thus funded) by us.
+ */
+void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * True if the channel is confirmed, channel_ready messages have been exchanged, and the
+ * channel is not currently being shut down. `channel_ready` message exchange implies the
+ * required confirmation count has been reached (and we were connected to the peer at some
+ * point after the funding transaction received enough confirmations). The required
+ * confirmation count is provided in [`confirmations_required`].
+ *
+ * [`confirmations_required`]: ChannelDetails::confirmations_required
+ */
+bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * True if the channel is confirmed, channel_ready messages have been exchanged, and the
+ * channel is not currently being shut down. `channel_ready` message exchange implies the
+ * required confirmation count has been reached (and we were connected to the peer at some
+ * point after the funding transaction received enough confirmations). The required
+ * confirmation count is provided in [`confirmations_required`].
+ *
+ * [`confirmations_required`]: ChannelDetails::confirmations_required
+ */
+void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * The stage of the channel's shutdown.
+ * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The stage of the channel's shutdown.
+ * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
+ */
+void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
+
+/**
+ * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
+ * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
+ *
+ * This is a strict superset of `is_channel_ready`.
+ */
+bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
+ * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
+ *
+ * This is a strict superset of `is_channel_ready`.
+ */
+void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * True if this channel is (or will be) publicly-announced.
+ */
+bool ChannelDetails_get_is_announced(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * True if this channel is (or will be) publicly-announced.
+ */
+void ChannelDetails_set_is_announced(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * The smallest value HTLC (in msat) we will accept, for this channel. This field
+ * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
+ */
+struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The smallest value HTLC (in msat) we will accept, for this channel. This field
+ * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
+ */
+void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The largest value HTLC (in msat) we currently will accept, for this channel.
+ */
+struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The largest value HTLC (in msat) we currently will accept, for this channel.
+ */
+void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * Set of configurable parameters that affect channel operation.
+ *
+ * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Set of configurable parameters that affect channel operation.
+ *
+ * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
+
+/**
+ * Pending inbound HTLCs.
+ *
+ * This field is empty for objects serialized with LDK versions prior to 0.0.122.
+ */
+struct LDKCVec_InboundHTLCDetailsZ ChannelDetails_get_pending_inbound_htlcs(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Pending inbound HTLCs.
+ *
+ * This field is empty for objects serialized with LDK versions prior to 0.0.122.
+ */
+void ChannelDetails_set_pending_inbound_htlcs(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCVec_InboundHTLCDetailsZ val);
+
+/**
+ * Pending outbound HTLCs.
+ *
+ * This field is empty for objects serialized with LDK versions prior to 0.0.122.
+ */
+struct LDKCVec_OutboundHTLCDetailsZ ChannelDetails_get_pending_outbound_htlcs(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Pending outbound HTLCs.
+ *
+ * This field is empty for objects serialized with LDK versions prior to 0.0.122.
+ */
+void ChannelDetails_set_pending_outbound_htlcs(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCVec_OutboundHTLCDetailsZ val);
+
+/**
+ * Constructs a new ChannelDetails given each field
+ *
+ * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKChannelId channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, struct LDKU128 user_channel_id_arg, struct LDKCOption_u32Z feerate_sat_per_1000_weight_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t next_outbound_htlc_minimum_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u32Z confirmations_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, struct LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg, bool is_usable_arg, bool is_announced_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg, struct LDKChannelConfig config_arg, struct LDKCVec_InboundHTLCDetailsZ pending_inbound_htlcs_arg, struct LDKCVec_OutboundHTLCDetailsZ pending_outbound_htlcs_arg);
+
+/**
+ * Creates a copy of the ChannelDetails
+ */
+struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
+
+/**
+ * Gets the current SCID which should be used to identify this channel for inbound payments.
+ * This should be used for providing invoice hints or in any other context where our
+ * counterparty will forward a payment to us.
+ *
+ * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
+ * [`ChannelDetails::short_channel_id`]. See those for more information.
+ */
+MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
+
+/**
+ * Gets the current SCID which should be used to identify this channel for outbound payments.
+ * This should be used in [`Route`]s to describe the first hop or in other contexts where
+ * we're sending or forwarding a payment outbound over this channel.
+ *
+ * This is either the [`ChannelDetails::short_channel_id`], if set, or the
+ * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
+ *
+ * [`Route`]: crate::routing::router::Route
+ */
+MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
+
+/**
+ * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
+ */
+struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
+
+/**
+ * Read a ChannelDetails from a byte array, created by ChannelDetails_write
+ */
+struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
+
+/**
+ * Creates a copy of the ChannelShutdownState
+ */
+enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
+ */
+enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
+
+/**
+ * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
+ */
+enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
+
+/**
+ * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
+ */
+enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
+
+/**
+ * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
+ */
+enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
+
+/**
+ * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
+ */
+enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
+
+/**
+ * Checks if two ChannelShutdownStates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
+
+/**
+ * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
+ */
+struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
+
+/**
+ * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
+ */
+struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
+ */
+void ExpandedKey_free(struct LDKExpandedKey this_obj);
+
+/**
+ * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
+ *
+ * It is recommended to cache this value and not regenerate it for each new inbound payment.
+ */
+MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
+
+/**
+ * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
+ * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
+ * a `ChannelManager`.
+ *
+ * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
+ * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
+ * regenerate it for each new inbound payment.
+ *
+ * `current_time` is a Unix timestamp representing the current time.
+ *
+ * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
+ * on versions of LDK prior to 0.0.114.
+ *
+ * [phantom node payments]: crate::sign::PhantomKeysManager
+ * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
+ */
+struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ create(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, const struct LDKEntropySource *NONNULL_PTR entropy_source, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
+
+/**
+ * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
+ * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
+ * without a `ChannelManager`.
+ *
+ * See [`create`] for information on the `keys` and `current_time` parameters.
+ *
+ * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
+ * on versions of LDK prior to 0.0.114.
+ *
+ * [phantom node payments]: crate::sign::PhantomKeysManager
+ */
+struct LDKCResult_ThirtyTwoBytesNoneZ create_from_hash(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
+
+/**
+ * Frees any resources used by the DecodeError
+ */
+void DecodeError_free(struct LDKDecodeError this_ptr);
+
+/**
+ * Creates a copy of the DecodeError
+ */
+struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new UnknownVersion-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_unknown_version(void);
+
+/**
+ * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_unknown_required_feature(void);
+
+/**
+ * Utility method to constructs a new InvalidValue-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_invalid_value(void);
+
+/**
+ * Utility method to constructs a new ShortRead-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_short_read(void);
+
+/**
+ * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_bad_length_descriptor(void);
+
+/**
+ * Utility method to constructs a new Io-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_io(enum LDKIOError a);
+
+/**
+ * Utility method to constructs a new UnsupportedCompression-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_unsupported_compression(void);
+
+/**
+ * Utility method to constructs a new DangerousValue-variant DecodeError
+ */
+struct LDKDecodeError DecodeError_dangerous_value(void);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the DecodeError.
+ */
+uint64_t DecodeError_hash(const struct LDKDecodeError *NONNULL_PTR o);
+
+/**
+ * Checks if two DecodeErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
+ */
+void Init_free(struct LDKInit this_obj);
+
+/**
+ * The relevant features which the sender supports.
+ */
+struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
+
+/**
+ * The relevant features which the sender supports.
+ */
+void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
+
+/**
+ * Indicates chains the sender is interested in.
+ *
+ * If there are no common chains, the connection will be closed.
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
+
+/**
+ * Indicates chains the sender is interested in.
+ *
+ * If there are no common chains, the connection will be closed.
+ */
+void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
+
+/**
+ * The receipient's network address.
+ *
+ * This adds the option to report a remote IP address back to a connecting peer using the init
+ * message. A node can decide to use that information to discover a potential update to its
+ * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
+ * the new address.
+ */
+struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
+
+/**
+ * The receipient's network address.
+ *
+ * This adds the option to report a remote IP address back to a connecting peer using the init
+ * message. A node can decide to use that information to discover a potential update to its
+ * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
+ * the new address.
+ */
+void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
+
+/**
+ * Constructs a new Init given each field
+ */
+MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
+
+/**
+ * Creates a copy of the Init
+ */
+struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the Init.
+ */
+uint64_t Init_hash(const struct LDKInit *NONNULL_PTR o);
+
+/**
+ * Checks if two Inits contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
+ */
+void ErrorMessage_free(struct LDKErrorMessage this_obj);
+
+/**
+ * The channel ID involved in the error.
+ *
+ * All-0s indicates a general error unrelated to a specific channel, after which all channels
+ * with the sending peer should be closed.
+ */
+struct LDKChannelId ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID involved in the error.
+ *
+ * All-0s indicates a general error unrelated to a specific channel, after which all channels
+ * with the sending peer should be closed.
+ */
+void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * A possibly human-readable error description.
+ *
+ * The string should be sanitized before it is used (e.g., emitted to logs or printed to
+ * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
+ * the terminal emulator or the logging subsystem.
+ */
+struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
+
+/**
+ * A possibly human-readable error description.
+ *
+ * The string should be sanitized before it is used (e.g., emitted to logs or printed to
+ * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
+ * the terminal emulator or the logging subsystem.
+ */
+void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
+
+/**
+ * Constructs a new ErrorMessage given each field
+ */
+MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
+
+/**
+ * Creates a copy of the ErrorMessage
+ */
+struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ErrorMessage.
+ */
+uint64_t ErrorMessage_hash(const struct LDKErrorMessage *NONNULL_PTR o);
+
+/**
+ * Checks if two ErrorMessages contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
+ */
+void WarningMessage_free(struct LDKWarningMessage this_obj);
+
+/**
+ * The channel ID involved in the warning.
+ *
+ * All-0s indicates a warning unrelated to a specific channel.
+ */
+struct LDKChannelId WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID involved in the warning.
+ *
+ * All-0s indicates a warning unrelated to a specific channel.
+ */
+void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * A possibly human-readable warning description.
+ *
+ * The string should be sanitized before it is used (e.g. emitted to logs or printed to
+ * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
+ * the terminal emulator or the logging subsystem.
+ */
+struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
+
+/**
+ * A possibly human-readable warning description.
+ *
+ * The string should be sanitized before it is used (e.g. emitted to logs or printed to
+ * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
+ * the terminal emulator or the logging subsystem.
+ */
+void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
+
+/**
+ * Constructs a new WarningMessage given each field
+ */
+MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg);
+
+/**
+ * Creates a copy of the WarningMessage
+ */
+struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the WarningMessage.
+ */
+uint64_t WarningMessage_hash(const struct LDKWarningMessage *NONNULL_PTR o);
+
+/**
+ * Checks if two WarningMessages contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
+ */
+void Ping_free(struct LDKPing this_obj);
+
+/**
+ * The desired response length.
+ */
+uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
+
+/**
+ * The desired response length.
+ */
+void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The ping packet size.
+ *
+ * This field is not sent on the wire. byteslen zeros are sent.
+ */
+uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
+
+/**
+ * The ping packet size.
+ *
+ * This field is not sent on the wire. byteslen zeros are sent.
+ */
+void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Constructs a new Ping given each field
+ */
+MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
+
+/**
+ * Creates a copy of the Ping
+ */
+struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the Ping.
+ */
+uint64_t Ping_hash(const struct LDKPing *NONNULL_PTR o);
+
+/**
+ * Checks if two Pings contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
+ */
+void Pong_free(struct LDKPong this_obj);
+
+/**
+ * The pong packet size.
+ *
+ * This field is not sent on the wire. byteslen zeros are sent.
+ */
+uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
+
+/**
+ * The pong packet size.
+ *
+ * This field is not sent on the wire. byteslen zeros are sent.
+ */
+void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Constructs a new Pong given each field
+ */
+MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
+
+/**
+ * Creates a copy of the Pong
+ */
+struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the Pong.
+ */
+uint64_t Pong_hash(const struct LDKPong *NONNULL_PTR o);
+
+/**
+ * Checks if two Pongs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the CommonOpenChannelFields, if is_owned is set and inner is non-NULL.
+ */
+void CommonOpenChannelFields_free(struct LDKCommonOpenChannelFields this_obj);
+
+/**
+ * The genesis hash of the blockchain where the channel is to be opened
+ */
+const uint8_t (*CommonOpenChannelFields_get_chain_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The genesis hash of the blockchain where the channel is to be opened
+ */
+void CommonOpenChannelFields_set_chain_hash(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * A temporary channel ID
+ * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
+ * For V1 channels: a temporary channel ID, until the funding outpoint is announced
+ */
+struct LDKChannelId CommonOpenChannelFields_get_temporary_channel_id(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * A temporary channel ID
+ * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
+ * For V1 channels: a temporary channel ID, until the funding outpoint is announced
+ */
+void CommonOpenChannelFields_set_temporary_channel_id(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * For V1 channels: The channel value
+ * For V2 channels: Part of the channel value contributed by the channel initiator
+ */
+uint64_t CommonOpenChannelFields_get_funding_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * For V1 channels: The channel value
+ * For V2 channels: Part of the channel value contributed by the channel initiator
+ */
+void CommonOpenChannelFields_set_funding_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The threshold below which outputs on transactions broadcast by the channel initiator will be
+ * omitted
+ */
+uint64_t CommonOpenChannelFields_get_dust_limit_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The threshold below which outputs on transactions broadcast by the channel initiator will be
+ * omitted
+ */
+void CommonOpenChannelFields_set_dust_limit_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
+ */
+uint64_t CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
+ */
+void CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The minimum HTLC size incoming to channel initiator, in milli-satoshi
+ */
+uint64_t CommonOpenChannelFields_get_htlc_minimum_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum HTLC size incoming to channel initiator, in milli-satoshi
+ */
+void CommonOpenChannelFields_set_htlc_minimum_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The feerate for the commitment transaction set by the channel initiator until updated by
+ * [`UpdateFee`]
+ */
+uint32_t CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The feerate for the commitment transaction set by the channel initiator until updated by
+ * [`UpdateFee`]
+ */
+void CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
+ * broadcast a commitment transaction
+ */
+uint16_t CommonOpenChannelFields_get_to_self_delay(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
+ * broadcast a commitment transaction
+ */
+void CommonOpenChannelFields_set_to_self_delay(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The maximum number of inbound HTLCs towards channel initiator
+ */
+uint16_t CommonOpenChannelFields_get_max_accepted_htlcs(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum number of inbound HTLCs towards channel initiator
+ */
+void CommonOpenChannelFields_set_max_accepted_htlcs(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The channel initiator's key controlling the funding transaction
+ */
+struct LDKPublicKey CommonOpenChannelFields_get_funding_pubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The channel initiator's key controlling the funding transaction
+ */
+void CommonOpenChannelFields_set_funding_pubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Used to derive a revocation key for transactions broadcast by counterparty
+ */
+struct LDKPublicKey CommonOpenChannelFields_get_revocation_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Used to derive a revocation key for transactions broadcast by counterparty
+ */
+void CommonOpenChannelFields_set_revocation_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * A payment key to channel initiator for transactions broadcast by counterparty
+ */
+struct LDKPublicKey CommonOpenChannelFields_get_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * A payment key to channel initiator for transactions broadcast by counterparty
+ */
+void CommonOpenChannelFields_set_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Used to derive a payment key to channel initiator for transactions broadcast by channel
+ * initiator
+ */
+struct LDKPublicKey CommonOpenChannelFields_get_delayed_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Used to derive a payment key to channel initiator for transactions broadcast by channel
+ * initiator
+ */
+void CommonOpenChannelFields_set_delayed_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Used to derive an HTLC payment key to channel initiator
+ */
+struct LDKPublicKey CommonOpenChannelFields_get_htlc_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Used to derive an HTLC payment key to channel initiator
+ */
+void CommonOpenChannelFields_set_htlc_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
+ */
+struct LDKPublicKey CommonOpenChannelFields_get_first_per_commitment_point(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
+ */
+void CommonOpenChannelFields_set_first_per_commitment_point(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The channel flags to be used
+ */
+uint8_t CommonOpenChannelFields_get_channel_flags(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The channel flags to be used
+ */
+void CommonOpenChannelFields_set_channel_flags(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint8_t val);
+
+/**
+ * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
+ * collaboratively close
+ */
+struct LDKCOption_CVec_u8ZZ CommonOpenChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
+ * collaboratively close
+ */
+void CommonOpenChannelFields_set_shutdown_scriptpubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
+
+/**
+ * The channel type that this channel will represent
+ *
+ * If this is `None`, we derive the channel type from the intersection of our
+ * feature bits with our counterparty's feature bits from the [`Init`] message.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKChannelTypeFeatures CommonOpenChannelFields_get_channel_type(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The channel type that this channel will represent
+ *
+ * If this is `None`, we derive the channel type from the intersection of our
+ * feature bits with our counterparty's feature bits from the [`Init`] message.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void CommonOpenChannelFields_set_channel_type(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
+
+/**
+ * Constructs a new CommonOpenChannelFields given each field
+ *
+ * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKCommonOpenChannelFields CommonOpenChannelFields_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKChannelId temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
+
+/**
+ * Creates a copy of the CommonOpenChannelFields
+ */
+struct LDKCommonOpenChannelFields CommonOpenChannelFields_clone(const struct LDKCommonOpenChannelFields *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the CommonOpenChannelFields.
+ */
+uint64_t CommonOpenChannelFields_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR o);
+
+/**
+ * Checks if two CommonOpenChannelFieldss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool CommonOpenChannelFields_eq(const struct LDKCommonOpenChannelFields *NONNULL_PTR a, const struct LDKCommonOpenChannelFields *NONNULL_PTR b);
+
+/**
+ * The [`ChannelParameters`] for this channel.
+ */
+MUST_USE_RES struct LDKChannelParameters CommonOpenChannelFields_channel_parameters(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_arg);
+
+/**
+ * Frees any resources used by the ChannelParameters, if is_owned is set and inner is non-NULL.
+ */
+void ChannelParameters_free(struct LDKChannelParameters this_obj);
+
+/**
+ * The threshold below which outputs on transactions broadcast by the channel initiator will be
+ * omitted.
+ */
+uint64_t ChannelParameters_get_dust_limit_satoshis(const struct LDKChannelParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The threshold below which outputs on transactions broadcast by the channel initiator will be
+ * omitted.
+ */
+void ChannelParameters_set_dust_limit_satoshis(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
+ */
+uint64_t ChannelParameters_get_max_htlc_value_in_flight_msat(const struct LDKChannelParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
+ */
+void ChannelParameters_set_max_htlc_value_in_flight_msat(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The minimum HTLC size for HTLCs towards the channel initiator, in milli-satoshi
+ */
+uint64_t ChannelParameters_get_htlc_minimum_msat(const struct LDKChannelParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum HTLC size for HTLCs towards the channel initiator, in milli-satoshi
+ */
+void ChannelParameters_set_htlc_minimum_msat(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The feerate for the commitment transaction set by the channel initiator until updated by
+ * [`UpdateFee`]
+ */
+uint32_t ChannelParameters_get_commitment_feerate_sat_per_1000_weight(const struct LDKChannelParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The feerate for the commitment transaction set by the channel initiator until updated by
+ * [`UpdateFee`]
+ */
+void ChannelParameters_set_commitment_feerate_sat_per_1000_weight(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The number of blocks which the non-channel-initator will have to wait to claim on-chain
+ * funds if they broadcast a commitment transaction.
+ */
+uint16_t ChannelParameters_get_to_self_delay(const struct LDKChannelParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The number of blocks which the non-channel-initator will have to wait to claim on-chain
+ * funds if they broadcast a commitment transaction.
+ */
+void ChannelParameters_set_to_self_delay(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The maximum number of pending HTLCs towards the channel initiator.
+ */
+uint16_t ChannelParameters_get_max_accepted_htlcs(const struct LDKChannelParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum number of pending HTLCs towards the channel initiator.
+ */
+void ChannelParameters_set_max_accepted_htlcs(struct LDKChannelParameters *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Constructs a new ChannelParameters given each field
+ */
+MUST_USE_RES struct LDKChannelParameters ChannelParameters_new(uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg);
+
+/**
+ * Creates a copy of the ChannelParameters
+ */
+struct LDKChannelParameters ChannelParameters_clone(const struct LDKChannelParameters *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ChannelParameters.
+ */
+uint64_t ChannelParameters_hash(const struct LDKChannelParameters *NONNULL_PTR o);
+
+/**
+ * Checks if two ChannelParameterss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ChannelParameters_eq(const struct LDKChannelParameters *NONNULL_PTR a, const struct LDKChannelParameters *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
+ */
+void OpenChannel_free(struct LDKOpenChannel this_obj);
+
+/**
+ * Common fields of `open_channel(2)`-like messages
+ */
+struct LDKCommonOpenChannelFields OpenChannel_get_common_fields(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
+
+/**
+ * Common fields of `open_channel(2)`-like messages
+ */
+void OpenChannel_set_common_fields(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
+
+/**
+ * The amount to push to the counterparty as part of the open, in milli-satoshi
+ */
+uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
+
+/**
+ * The amount to push to the counterparty as part of the open, in milli-satoshi
+ */
+void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
+ */
+uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
+ */
+void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Constructs a new OpenChannel given each field
+ */
+MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKCommonOpenChannelFields common_fields_arg, uint64_t push_msat_arg, uint64_t channel_reserve_satoshis_arg);
+
+/**
+ * Creates a copy of the OpenChannel
+ */
+struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the OpenChannel.
+ */
+uint64_t OpenChannel_hash(const struct LDKOpenChannel *NONNULL_PTR o);
+
+/**
+ * Checks if two OpenChannels contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
+ */
+void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
+
+/**
+ * Common fields of `open_channel(2)`-like messages
+ */
+struct LDKCommonOpenChannelFields OpenChannelV2_get_common_fields(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * Common fields of `open_channel(2)`-like messages
+ */
+void OpenChannelV2_set_common_fields(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val);
+
+/**
+ * The feerate for the funding transaction set by the channel initiator
+ */
+uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * The feerate for the funding transaction set by the channel initiator
+ */
+void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The locktime for the funding transaction
+ */
+uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * The locktime for the funding transaction
+ */
+void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
+ */
+struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
+ */
+void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Optionally, a requirement that only confirmed inputs can be added
+ */
+enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * Optionally, a requirement that only confirmed inputs can be added
+ */
+void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
+
+/**
+ * Constructs a new OpenChannelV2 given each field
+ */
+MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKCommonOpenChannelFields common_fields_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t locktime_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
+
+/**
+ * Creates a copy of the OpenChannelV2
+ */
+struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the OpenChannelV2.
+ */
+uint64_t OpenChannelV2_hash(const struct LDKOpenChannelV2 *NONNULL_PTR o);
+
+/**
+ * Checks if two OpenChannelV2s contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the CommonAcceptChannelFields, if is_owned is set and inner is non-NULL.
+ */
+void CommonAcceptChannelFields_free(struct LDKCommonAcceptChannelFields this_obj);
+
+/**
+ * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
+ */
+struct LDKChannelId CommonAcceptChannelFields_get_temporary_channel_id(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message.
+ */
+void CommonAcceptChannelFields_set_temporary_channel_id(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The threshold below which outputs on transactions broadcast by the channel acceptor will be
+ * omitted
+ */
+uint64_t CommonAcceptChannelFields_get_dust_limit_satoshis(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The threshold below which outputs on transactions broadcast by the channel acceptor will be
+ * omitted
+ */
+void CommonAcceptChannelFields_set_dust_limit_satoshis(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
+ */
+uint64_t CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
+ */
+void CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
+ */
+uint64_t CommonAcceptChannelFields_get_htlc_minimum_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
+ */
+void CommonAcceptChannelFields_set_htlc_minimum_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Minimum depth of the funding transaction before the channel is considered open
+ */
+uint32_t CommonAcceptChannelFields_get_minimum_depth(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Minimum depth of the funding transaction before the channel is considered open
+ */
+void CommonAcceptChannelFields_set_minimum_depth(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
+ * broadcast a commitment transaction
+ */
+uint16_t CommonAcceptChannelFields_get_to_self_delay(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
+ * broadcast a commitment transaction
+ */
+void CommonAcceptChannelFields_set_to_self_delay(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The maximum number of inbound HTLCs towards channel acceptor
+ */
+uint16_t CommonAcceptChannelFields_get_max_accepted_htlcs(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum number of inbound HTLCs towards channel acceptor
+ */
+void CommonAcceptChannelFields_set_max_accepted_htlcs(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The channel acceptor's key controlling the funding transaction
+ */
+struct LDKPublicKey CommonAcceptChannelFields_get_funding_pubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The channel acceptor's key controlling the funding transaction
+ */
+void CommonAcceptChannelFields_set_funding_pubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Used to derive a revocation key for transactions broadcast by counterparty
+ */
+struct LDKPublicKey CommonAcceptChannelFields_get_revocation_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Used to derive a revocation key for transactions broadcast by counterparty
+ */
+void CommonAcceptChannelFields_set_revocation_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * A payment key to channel acceptor for transactions broadcast by counterparty
+ */
+struct LDKPublicKey CommonAcceptChannelFields_get_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * A payment key to channel acceptor for transactions broadcast by counterparty
+ */
+void CommonAcceptChannelFields_set_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Used to derive a payment key to channel acceptor for transactions broadcast by channel
+ * acceptor
+ */
+struct LDKPublicKey CommonAcceptChannelFields_get_delayed_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Used to derive a payment key to channel acceptor for transactions broadcast by channel
+ * acceptor
+ */
+void CommonAcceptChannelFields_set_delayed_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
+ */
+struct LDKPublicKey CommonAcceptChannelFields_get_htlc_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
+ */
+void CommonAcceptChannelFields_set_htlc_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
+ */
+struct LDKPublicKey CommonAcceptChannelFields_get_first_per_commitment_point(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
+ */
+void CommonAcceptChannelFields_set_first_per_commitment_point(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
+ * collaboratively close
+ */
+struct LDKCOption_CVec_u8ZZ CommonAcceptChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
+ * collaboratively close
+ */
+void CommonAcceptChannelFields_set_shutdown_scriptpubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
+
+/**
+ * The channel type that this channel will represent. If none is set, we derive the channel
+ * type from the intersection of our feature bits with our counterparty's feature bits from
+ * the Init message.
+ *
+ * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
+ * [`CommonOpenChannelFields::channel_type`].
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKChannelTypeFeatures CommonAcceptChannelFields_get_channel_type(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr);
+
+/**
+ * The channel type that this channel will represent. If none is set, we derive the channel
+ * type from the intersection of our feature bits with our counterparty's feature bits from
+ * the Init message.
+ *
+ * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s
+ * [`CommonOpenChannelFields::channel_type`].
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void CommonAcceptChannelFields_set_channel_type(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
+
+/**
+ * Constructs a new CommonAcceptChannelFields given each field
+ *
+ * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_new(struct LDKChannelId temporary_channel_id_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
+
+/**
+ * Creates a copy of the CommonAcceptChannelFields
+ */
+struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_clone(const struct LDKCommonAcceptChannelFields *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the CommonAcceptChannelFields.
+ */
+uint64_t CommonAcceptChannelFields_hash(const struct LDKCommonAcceptChannelFields *NONNULL_PTR o);
+
+/**
+ * Checks if two CommonAcceptChannelFieldss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool CommonAcceptChannelFields_eq(const struct LDKCommonAcceptChannelFields *NONNULL_PTR a, const struct LDKCommonAcceptChannelFields *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
+ */
+void AcceptChannel_free(struct LDKAcceptChannel this_obj);
+
+/**
+ * Common fields of `accept_channel(2)`-like messages
+ */
+struct LDKCommonAcceptChannelFields AcceptChannel_get_common_fields(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
+
+/**
+ * Common fields of `accept_channel(2)`-like messages
+ */
+void AcceptChannel_set_common_fields(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
+
+/**
+ * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
+ */
+uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
+ */
+void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Constructs a new AcceptChannel given each field
+ */
+MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t channel_reserve_satoshis_arg);
+
+/**
+ * Creates a copy of the AcceptChannel
+ */
+struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the AcceptChannel.
+ */
+uint64_t AcceptChannel_hash(const struct LDKAcceptChannel *NONNULL_PTR o);
+
+/**
+ * Checks if two AcceptChannels contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
+ */
+void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
+
+/**
+ * Common fields of `accept_channel(2)`-like messages
+ */
+struct LDKCommonAcceptChannelFields AcceptChannelV2_get_common_fields(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * Common fields of `accept_channel(2)`-like messages
+ */
+void AcceptChannelV2_set_common_fields(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val);
+
+/**
+ * Part of the channel value contributed by the channel acceptor
+ */
+uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * Part of the channel value contributed by the channel acceptor
+ */
+void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
+ */
+struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
+ */
+void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Optionally, a requirement that only confirmed inputs can be added
+ */
+enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
+
+/**
+ * Optionally, a requirement that only confirmed inputs can be added
+ */
+void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
+
+/**
+ * Constructs a new AcceptChannelV2 given each field
+ */
+MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t funding_satoshis_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
+
+/**
+ * Creates a copy of the AcceptChannelV2
+ */
+struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the AcceptChannelV2.
+ */
+uint64_t AcceptChannelV2_hash(const struct LDKAcceptChannelV2 *NONNULL_PTR o);
+
+/**
+ * Checks if two AcceptChannelV2s contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
+ */
+void FundingCreated_free(struct LDKFundingCreated this_obj);
+
+/**
+ * A temporary channel ID, until the funding is established
+ */
+struct LDKChannelId FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
+
+/**
+ * A temporary channel ID, until the funding is established
+ */
+void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The funding transaction ID
+ */
+const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The funding transaction ID
+ */
+void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The specific output index funding this channel
+ */
+uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
+
+/**
+ * The specific output index funding this channel
+ */
+void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The signature of the channel initiator (funder) on the initial commitment transaction
+ */
+struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
+
+/**
+ * The signature of the channel initiator (funder) on the initial commitment transaction
+ */
+void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+
+/**
+ * Constructs a new FundingCreated given each field
+ */
+MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKChannelId temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKECDSASignature signature_arg);
+
+/**
+ * Creates a copy of the FundingCreated
+ */
+struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the FundingCreated.
+ */
+uint64_t FundingCreated_hash(const struct LDKFundingCreated *NONNULL_PTR o);
+
+/**
+ * Checks if two FundingCreateds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
+ */
+void FundingSigned_free(struct LDKFundingSigned this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The signature of the channel acceptor (fundee) on the initial commitment transaction
+ */
+struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
+
+/**
+ * The signature of the channel acceptor (fundee) on the initial commitment transaction
+ */
+void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+
+/**
+ * Constructs a new FundingSigned given each field
+ */
+MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg);
+
+/**
+ * Creates a copy of the FundingSigned
+ */
+struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the FundingSigned.
+ */
+uint64_t FundingSigned_hash(const struct LDKFundingSigned *NONNULL_PTR o);
+
+/**
+ * Checks if two FundingSigneds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
+ */
+void ChannelReady_free(struct LDKChannelReady this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The per-commitment point of the second commitment transaction
+ */
+struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
+
+/**
+ * The per-commitment point of the second commitment transaction
+ */
+void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * If set, provides a `short_channel_id` alias for this channel.
+ *
+ * The sender will accept payments to be forwarded over this SCID and forward them to this
+ * messages' recipient.
+ */
+struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
+
+/**
+ * If set, provides a `short_channel_id` alias for this channel.
+ *
+ * The sender will accept payments to be forwarded over this SCID and forward them to this
+ * messages' recipient.
+ */
+void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * Constructs a new ChannelReady given each field
+ */
+MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKChannelId channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg);
+
+/**
+ * Creates a copy of the ChannelReady
+ */
+struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ChannelReady.
+ */
+uint64_t ChannelReady_hash(const struct LDKChannelReady *NONNULL_PTR o);
+
+/**
+ * Checks if two ChannelReadys contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the Stfu, if is_owned is set and inner is non-NULL.
+ */
+void Stfu_free(struct LDKStfu this_obj);
+
+/**
+ * The channel ID where quiescence is intended
+ */
+struct LDKChannelId Stfu_get_channel_id(const struct LDKStfu *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID where quiescence is intended
+ */
+void Stfu_set_channel_id(struct LDKStfu *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * Initiator flag, 1 if initiating, 0 if replying to an stfu.
+ */
+uint8_t Stfu_get_initiator(const struct LDKStfu *NONNULL_PTR this_ptr);
+
+/**
+ * Initiator flag, 1 if initiating, 0 if replying to an stfu.
+ */
+void Stfu_set_initiator(struct LDKStfu *NONNULL_PTR this_ptr, uint8_t val);
+
+/**
+ * Constructs a new Stfu given each field
+ */
+MUST_USE_RES struct LDKStfu Stfu_new(struct LDKChannelId channel_id_arg, uint8_t initiator_arg);
+
+/**
+ * Creates a copy of the Stfu
+ */
+struct LDKStfu Stfu_clone(const struct LDKStfu *NONNULL_PTR orig);
+
+/**
+ * Checks if two Stfus contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool Stfu_eq(const struct LDKStfu *NONNULL_PTR a, const struct LDKStfu *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the SpliceInit, if is_owned is set and inner is non-NULL.
+ */
+void SpliceInit_free(struct LDKSpliceInit this_obj);
+
+/**
+ * The channel ID where splicing is intended
+ */
+struct LDKChannelId SpliceInit_get_channel_id(const struct LDKSpliceInit *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID where splicing is intended
+ */
+void SpliceInit_set_channel_id(struct LDKSpliceInit *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The amount the splice initiator is intending to add to its channel balance (splice-in)
+ * or remove from its channel balance (splice-out).
+ */
+int64_t SpliceInit_get_funding_contribution_satoshis(const struct LDKSpliceInit *NONNULL_PTR this_ptr);
+
+/**
+ * The amount the splice initiator is intending to add to its channel balance (splice-in)
+ * or remove from its channel balance (splice-out).
+ */
+void SpliceInit_set_funding_contribution_satoshis(struct LDKSpliceInit *NONNULL_PTR this_ptr, int64_t val);
+
+/**
+ * The feerate for the new funding transaction, set by the splice initiator
+ */
+uint32_t SpliceInit_get_funding_feerate_perkw(const struct LDKSpliceInit *NONNULL_PTR this_ptr);
+
+/**
+ * The feerate for the new funding transaction, set by the splice initiator
+ */
+void SpliceInit_set_funding_feerate_perkw(struct LDKSpliceInit *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The locktime for the new funding transaction
+ */
+uint32_t SpliceInit_get_locktime(const struct LDKSpliceInit *NONNULL_PTR this_ptr);
+
+/**
+ * The locktime for the new funding transaction
+ */
+void SpliceInit_set_locktime(struct LDKSpliceInit *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The key of the sender (splice initiator) controlling the new funding transaction
+ */
+struct LDKPublicKey SpliceInit_get_funding_pubkey(const struct LDKSpliceInit *NONNULL_PTR this_ptr);
+
+/**
+ * The key of the sender (splice initiator) controlling the new funding transaction
+ */
+void SpliceInit_set_funding_pubkey(struct LDKSpliceInit *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * If set, only confirmed inputs added (by the splice acceptor) will be accepted
+ */
+enum LDKCOption_NoneZ SpliceInit_get_require_confirmed_inputs(const struct LDKSpliceInit *NONNULL_PTR this_ptr);
+
+/**
+ * If set, only confirmed inputs added (by the splice acceptor) will be accepted
+ */
+void SpliceInit_set_require_confirmed_inputs(struct LDKSpliceInit *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
+
+/**
+ * Constructs a new SpliceInit given each field
+ */
+MUST_USE_RES struct LDKSpliceInit SpliceInit_new(struct LDKChannelId channel_id_arg, int64_t funding_contribution_satoshis_arg, uint32_t funding_feerate_perkw_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
+
+/**
+ * Creates a copy of the SpliceInit
+ */
+struct LDKSpliceInit SpliceInit_clone(const struct LDKSpliceInit *NONNULL_PTR orig);
+
+/**
+ * Checks if two SpliceInits contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool SpliceInit_eq(const struct LDKSpliceInit *NONNULL_PTR a, const struct LDKSpliceInit *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the SpliceAck, if is_owned is set and inner is non-NULL.
+ */
+void SpliceAck_free(struct LDKSpliceAck this_obj);
+
+/**
+ * The channel ID where splicing is intended
+ */
+struct LDKChannelId SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID where splicing is intended
+ */
+void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The amount the splice acceptor is intending to add to its channel balance (splice-in)
+ * or remove from its channel balance (splice-out).
+ */
+int64_t SpliceAck_get_funding_contribution_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
+
+/**
+ * The amount the splice acceptor is intending to add to its channel balance (splice-in)
+ * or remove from its channel balance (splice-out).
+ */
+void SpliceAck_set_funding_contribution_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val);
+
+/**
+ * The key of the sender (splice acceptor) controlling the new funding transaction
+ */
+struct LDKPublicKey SpliceAck_get_funding_pubkey(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
+
+/**
+ * The key of the sender (splice acceptor) controlling the new funding transaction
+ */
+void SpliceAck_set_funding_pubkey(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * If set, only confirmed inputs added (by the splice initiator) will be accepted
+ */
+enum LDKCOption_NoneZ SpliceAck_get_require_confirmed_inputs(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
+
+/**
+ * If set, only confirmed inputs added (by the splice initiator) will be accepted
+ */
+void SpliceAck_set_require_confirmed_inputs(struct LDKSpliceAck *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
+
+/**
+ * Constructs a new SpliceAck given each field
+ */
+MUST_USE_RES struct LDKSpliceAck SpliceAck_new(struct LDKChannelId channel_id_arg, int64_t funding_contribution_satoshis_arg, struct LDKPublicKey funding_pubkey_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
+
+/**
+ * Creates a copy of the SpliceAck
+ */
+struct LDKSpliceAck SpliceAck_clone(const struct LDKSpliceAck *NONNULL_PTR orig);
+
+/**
+ * Checks if two SpliceAcks contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool SpliceAck_eq(const struct LDKSpliceAck *NONNULL_PTR a, const struct LDKSpliceAck *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the SpliceLocked, if is_owned is set and inner is non-NULL.
+ */
+void SpliceLocked_free(struct LDKSpliceLocked this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId SpliceLocked_get_channel_id(const struct LDKSpliceLocked *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The ID of the new funding transaction that has been locked
+ */
+const uint8_t (*SpliceLocked_get_splice_txid(const struct LDKSpliceLocked *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The ID of the new funding transaction that has been locked
+ */
+void SpliceLocked_set_splice_txid(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * Constructs a new SpliceLocked given each field
+ */
+MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes splice_txid_arg);
+
+/**
+ * Creates a copy of the SpliceLocked
+ */
+struct LDKSpliceLocked SpliceLocked_clone(const struct LDKSpliceLocked *NONNULL_PTR orig);
+
+/**
+ * Checks if two SpliceLockeds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool SpliceLocked_eq(const struct LDKSpliceLocked *NONNULL_PTR a, const struct LDKSpliceLocked *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
+ */
+void TxAddInput_free(struct LDKTxAddInput this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * A randomly chosen unique identifier for this input, which is even for initiators and odd for
+ * non-initiators.
+ */
+uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
+
+/**
+ * A randomly chosen unique identifier for this input, which is even for initiators and odd for
+ * non-initiators.
+ */
+void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Serialized transaction that contains the output this input spends to verify that it is non
+ * malleable.
+ */
+struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
+
+/**
+ * Serialized transaction that contains the output this input spends to verify that it is non
+ * malleable.
+ */
+void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
+
+/**
+ * The index of the output being spent
+ */
+uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
+
+/**
+ * The index of the output being spent
+ */
+void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The sequence number of this input
+ */
+uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
+
+/**
+ * The sequence number of this input
+ */
+void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The ID of the previous funding transaction, when it is being added as an input during splicing
+ */
+struct LDKCOption_ThirtyTwoBytesZ TxAddInput_get_shared_input_txid(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
+
+/**
+ * The ID of the previous funding transaction, when it is being added as an input during splicing
+ */
+void TxAddInput_set_shared_input_txid(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
+
+/**
+ * Constructs a new TxAddInput given each field
+ */
+MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg, struct LDKCOption_ThirtyTwoBytesZ shared_input_txid_arg);
+
+/**
+ * Creates a copy of the TxAddInput
+ */
+struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the TxAddInput.
+ */
+uint64_t TxAddInput_hash(const struct LDKTxAddInput *NONNULL_PTR o);
+
+/**
+ * Checks if two TxAddInputs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
+ */
+void TxAddOutput_free(struct LDKTxAddOutput this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * A randomly chosen unique identifier for this output, which is even for initiators and odd for
+ * non-initiators.
+ */
+uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
+
+/**
+ * A randomly chosen unique identifier for this output, which is even for initiators and odd for
+ * non-initiators.
+ */
+void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The satoshi value of the output
+ */
+uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
+
+/**
+ * The satoshi value of the output
+ */
+void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The scriptPubKey for the output
+ */
+struct LDKCVec_u8Z TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
+
+/**
+ * The scriptPubKey for the output
+ */
+void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+
+/**
+ * Constructs a new TxAddOutput given each field
+ */
+MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg);
+
+/**
+ * Creates a copy of the TxAddOutput
+ */
+struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the TxAddOutput.
+ */
+uint64_t TxAddOutput_hash(const struct LDKTxAddOutput *NONNULL_PTR o);
+
+/**
+ * Checks if two TxAddOutputs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
+ */
+void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The serial ID of the input to be removed
+ */
+uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
+
+/**
+ * The serial ID of the input to be removed
+ */
+void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Constructs a new TxRemoveInput given each field
+ */
+MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
+
+/**
+ * Creates a copy of the TxRemoveInput
+ */
+struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
+ */
+uint64_t TxRemoveInput_hash(const struct LDKTxRemoveInput *NONNULL_PTR o);
+
+/**
+ * Checks if two TxRemoveInputs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
+ */
+void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The serial ID of the output to be removed
+ */
+uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
+
+/**
+ * The serial ID of the output to be removed
+ */
+void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Constructs a new TxRemoveOutput given each field
+ */
+MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg);
+
+/**
+ * Creates a copy of the TxRemoveOutput
+ */
+struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the TxRemoveOutput.
+ */
+uint64_t TxRemoveOutput_hash(const struct LDKTxRemoveOutput *NONNULL_PTR o);
+
+/**
+ * Checks if two TxRemoveOutputs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
+ */
+void TxComplete_free(struct LDKTxComplete this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * Constructs a new TxComplete given each field
+ */
+MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKChannelId channel_id_arg);
+
+/**
+ * Creates a copy of the TxComplete
+ */
+struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the TxComplete.
+ */
+uint64_t TxComplete_hash(const struct LDKTxComplete *NONNULL_PTR o);
+
+/**
+ * Checks if two TxCompletes contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
+ */
+void TxSignatures_free(struct LDKTxSignatures this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The TXID
+ */
+const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The TXID
+ */
+void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The list of witnesses
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
+
+/**
+ * The list of witnesses
+ */
+void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
+
+/**
+ * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
+ */
+struct LDKCOption_ECDSASignatureZ TxSignatures_get_shared_input_signature(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
+
+/**
+ * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers
+ */
+void TxSignatures_set_shared_input_signature(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCOption_ECDSASignatureZ val);
+
+/**
+ * Constructs a new TxSignatures given each field
+ */
+MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg, struct LDKCOption_ECDSASignatureZ shared_input_signature_arg);
+
+/**
+ * Creates a copy of the TxSignatures
+ */
+struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the TxSignatures.
+ */
+uint64_t TxSignatures_hash(const struct LDKTxSignatures *NONNULL_PTR o);
+
+/**
+ * Checks if two TxSignaturess contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
+ */
+void TxInitRbf_free(struct LDKTxInitRbf this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The locktime of the transaction
+ */
+uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
+
+/**
+ * The locktime of the transaction
+ */
+void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The feerate of the transaction
+ */
+uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
+
+/**
+ * The feerate of the transaction
+ */
+void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The number of satoshis the sender will contribute to or, if negative, remove from
+ * (e.g. splice-out) the funding output of the transaction
+ */
+struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
+
+/**
+ * The number of satoshis the sender will contribute to or, if negative, remove from
+ * (e.g. splice-out) the funding output of the transaction
+ */
+void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
+
+/**
+ * Constructs a new TxInitRbf given each field
+ */
+MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKChannelId channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
+
+/**
+ * Creates a copy of the TxInitRbf
+ */
+struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the TxInitRbf.
+ */
+uint64_t TxInitRbf_hash(const struct LDKTxInitRbf *NONNULL_PTR o);
+
+/**
+ * Checks if two TxInitRbfs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
+ */
+void TxAckRbf_free(struct LDKTxAckRbf this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The number of satoshis the sender will contribute to or, if negative, remove from
+ * (e.g. splice-out) the funding output of the transaction
+ */
+struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
+
+/**
+ * The number of satoshis the sender will contribute to or, if negative, remove from
+ * (e.g. splice-out) the funding output of the transaction
+ */
+void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
+
+/**
+ * Constructs a new TxAckRbf given each field
+ */
+MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKChannelId channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
+
+/**
+ * Creates a copy of the TxAckRbf
+ */
+struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the TxAckRbf.
+ */
+uint64_t TxAckRbf_hash(const struct LDKTxAckRbf *NONNULL_PTR o);
+
+/**
+ * Checks if two TxAckRbfs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
+ */
+void TxAbort_free(struct LDKTxAbort this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * Message data
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
+
+/**
+ * Message data
+ */
+void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+
+/**
+ * Constructs a new TxAbort given each field
+ */
+MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z data_arg);
+
+/**
+ * Creates a copy of the TxAbort
+ */
+struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the TxAbort.
+ */
+uint64_t TxAbort_hash(const struct LDKTxAbort *NONNULL_PTR o);
+
+/**
+ * Checks if two TxAborts contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
+ */
+void Shutdown_free(struct LDKShutdown this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The destination of this peer's funds on closing.
+ *
+ * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
+ */
+struct LDKCVec_u8Z Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
+
+/**
+ * The destination of this peer's funds on closing.
+ *
+ * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
+ */
+void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+
+/**
+ * Constructs a new Shutdown given each field
+ */
+MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
+
+/**
+ * Creates a copy of the Shutdown
+ */
+struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the Shutdown.
+ */
+uint64_t Shutdown_hash(const struct LDKShutdown *NONNULL_PTR o);
+
+/**
+ * Checks if two Shutdowns contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
+ */
+void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
+
+/**
+ * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
+ * transaction.
+ */
+uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
+ * transaction.
+ */
+void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
+ * transaction.
+ */
+uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
+ * transaction.
+ */
+void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Constructs a new ClosingSignedFeeRange given each field
+ */
+MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
+
+/**
+ * Creates a copy of the ClosingSignedFeeRange
+ */
+struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ClosingSignedFeeRange.
+ */
+uint64_t ClosingSignedFeeRange_hash(const struct LDKClosingSignedFeeRange *NONNULL_PTR o);
+
+/**
+ * Checks if two ClosingSignedFeeRanges contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
+ */
+void ClosingSigned_free(struct LDKClosingSigned this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The proposed total fee for the closing transaction
+ */
+uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
+
+/**
+ * The proposed total fee for the closing transaction
+ */
+void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * A signature on the closing transaction
+ */
+struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
+
+/**
+ * A signature on the closing transaction
+ */
+void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+
+/**
+ * The minimum and maximum fees which the sender is willing to accept, provided only by new
+ * nodes.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum and maximum fees which the sender is willing to accept, provided only by new
+ * nodes.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
+
+/**
+ * Constructs a new ClosingSigned given each field
+ *
+ * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKChannelId channel_id_arg, uint64_t fee_satoshis_arg, struct LDKECDSASignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
+
+/**
+ * Creates a copy of the ClosingSigned
+ */
+struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ClosingSigned.
+ */
+uint64_t ClosingSigned_hash(const struct LDKClosingSigned *NONNULL_PTR o);
+
+/**
+ * Checks if two ClosingSigneds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
+ */
+void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The HTLC ID
+ */
+uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The HTLC ID
+ */
+void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The HTLC value in milli-satoshi
+ */
+uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The HTLC value in milli-satoshi
+ */
+void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The payment hash, the pre-image of which controls HTLC redemption
+ */
+const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The payment hash, the pre-image of which controls HTLC redemption
+ */
+void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The expiry height of the HTLC
+ */
+uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The expiry height of the HTLC
+ */
+void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The extra fee skimmed by the sender of this message. See
+ * [`ChannelConfig::accept_underpaying_htlcs`].
+ *
+ * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
+ */
+struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The extra fee skimmed by the sender of this message. See
+ * [`ChannelConfig::accept_underpaying_htlcs`].
+ *
+ * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
+ */
+void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The onion routing packet with encrypted data for the next hop.
+ */
+struct LDKOnionPacket UpdateAddHTLC_get_onion_routing_packet(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The onion routing packet with encrypted data for the next hop.
+ */
+void UpdateAddHTLC_set_onion_routing_packet(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKOnionPacket val);
+
+/**
+ * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
+ * routing packet and the recipient-provided encrypted payload within.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKPublicKey UpdateAddHTLC_get_blinding_point(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
+ * routing packet and the recipient-provided encrypted payload within.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void UpdateAddHTLC_set_blinding_point(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new UpdateAddHTLC given each field
+ *
+ * Note that blinding_point_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKUpdateAddHTLC UpdateAddHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, uint64_t amount_msat_arg, struct LDKThirtyTwoBytes payment_hash_arg, uint32_t cltv_expiry_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, struct LDKOnionPacket onion_routing_packet_arg, struct LDKPublicKey blinding_point_arg);
+
+/**
+ * Creates a copy of the UpdateAddHTLC
+ */
+struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the UpdateAddHTLC.
+ */
+uint64_t UpdateAddHTLC_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR o);
+
+/**
+ * Checks if two UpdateAddHTLCs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
+ */
+void OnionMessage_free(struct LDKOnionMessage this_obj);
+
+/**
+ * Used in decrypting the onion packet's payload.
+ */
+struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
+
+/**
+ * Used in decrypting the onion packet's payload.
+ */
+void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The full onion packet including hop data, pubkey, and hmac
+ */
+struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
+
+/**
+ * The full onion packet including hop data, pubkey, and hmac
+ */
+void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
+
+/**
+ * Constructs a new OnionMessage given each field
+ */
+MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
+
+/**
+ * Creates a copy of the OnionMessage
+ */
+struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the OnionMessage.
+ */
+uint64_t OnionMessage_hash(const struct LDKOnionMessage *NONNULL_PTR o);
+
+/**
+ * Checks if two OnionMessages contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
+ */
+void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The HTLC ID
+ */
+uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The HTLC ID
+ */
+void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The pre-image of the payment hash, allowing HTLC redemption
+ */
+const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The pre-image of the payment hash, allowing HTLC redemption
+ */
+void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * Constructs a new UpdateFulfillHTLC given each field
+ */
+MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
+
+/**
+ * Creates a copy of the UpdateFulfillHTLC
+ */
+struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the UpdateFulfillHTLC.
+ */
+uint64_t UpdateFulfillHTLC_hash(const struct LDKUpdateFulfillHTLC *NONNULL_PTR o);
+
+/**
+ * Checks if two UpdateFulfillHTLCs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
+ */
+void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The HTLC ID
+ */
+uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The HTLC ID
+ */
+void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Creates a copy of the UpdateFailHTLC
+ */
+struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the UpdateFailHTLC.
+ */
+uint64_t UpdateFailHTLC_hash(const struct LDKUpdateFailHTLC *NONNULL_PTR o);
+
+/**
+ * Checks if two UpdateFailHTLCs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
+ */
+void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The HTLC ID
+ */
+uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The HTLC ID
+ */
+void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The failure code
+ */
+uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
+
+/**
+ * The failure code
+ */
+void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * Creates a copy of the UpdateFailMalformedHTLC
+ */
+struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the UpdateFailMalformedHTLC.
+ */
+uint64_t UpdateFailMalformedHTLC_hash(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR o);
+
+/**
+ * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the CommitmentSignedBatch, if is_owned is set and inner is non-NULL.
+ */
+void CommitmentSignedBatch_free(struct LDKCommitmentSignedBatch this_obj);
+
+/**
+ * Batch size N: all N `commitment_signed` messages must be received before being processed
+ */
+uint16_t CommitmentSignedBatch_get_batch_size(const struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr);
+
+/**
+ * Batch size N: all N `commitment_signed` messages must be received before being processed
+ */
+void CommitmentSignedBatch_set_batch_size(struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The funding transaction, to discriminate among multiple pending funding transactions (e.g. in case of splicing)
+ */
+const uint8_t (*CommitmentSignedBatch_get_funding_txid(const struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The funding transaction, to discriminate among multiple pending funding transactions (e.g. in case of splicing)
+ */
+void CommitmentSignedBatch_set_funding_txid(struct LDKCommitmentSignedBatch *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * Constructs a new CommitmentSignedBatch given each field
+ */
+MUST_USE_RES struct LDKCommitmentSignedBatch CommitmentSignedBatch_new(uint16_t batch_size_arg, struct LDKThirtyTwoBytes funding_txid_arg);
+
+/**
+ * Creates a copy of the CommitmentSignedBatch
+ */
+struct LDKCommitmentSignedBatch CommitmentSignedBatch_clone(const struct LDKCommitmentSignedBatch *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the CommitmentSignedBatch.
+ */
+uint64_t CommitmentSignedBatch_hash(const struct LDKCommitmentSignedBatch *NONNULL_PTR o);
+
+/**
+ * Checks if two CommitmentSignedBatchs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool CommitmentSignedBatch_eq(const struct LDKCommitmentSignedBatch *NONNULL_PTR a, const struct LDKCommitmentSignedBatch *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
+ */
+void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * A signature on the commitment transaction
+ */
+struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
+
+/**
+ * A signature on the commitment transaction
+ */
+void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+
+/**
+ * Signatures on the HTLC transactions
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
+
+/**
+ * Signatures on the HTLC transactions
+ */
+void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
+
+/**
+ * Optional batch size and other parameters
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKCommitmentSignedBatch CommitmentSigned_get_batch(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
+
+/**
+ * Optional batch size and other parameters
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void CommitmentSigned_set_batch(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCommitmentSignedBatch val);
+
+/**
+ * Constructs a new CommitmentSigned given each field
+ *
+ * Note that batch_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg, struct LDKCommitmentSignedBatch batch_arg);
+
+/**
+ * Creates a copy of the CommitmentSigned
+ */
+struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the CommitmentSigned.
+ */
+uint64_t CommitmentSigned_hash(const struct LDKCommitmentSigned *NONNULL_PTR o);
+
+/**
+ * Checks if two CommitmentSigneds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
+ */
+void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The secret corresponding to the per-commitment point
+ */
+const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The secret corresponding to the per-commitment point
+ */
+void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The next sender-broadcast commitment transaction's per-commitment point
+ */
+struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
+
+/**
+ * The next sender-broadcast commitment transaction's per-commitment point
+ */
+void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new RevokeAndACK given each field
+ */
+MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg);
+
+/**
+ * Creates a copy of the RevokeAndACK
+ */
+struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the RevokeAndACK.
+ */
+uint64_t RevokeAndACK_hash(const struct LDKRevokeAndACK *NONNULL_PTR o);
+
+/**
+ * Checks if two RevokeAndACKs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
+ */
+void UpdateFee_free(struct LDKUpdateFee this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * Fee rate per 1000-weight of the transaction
+ */
+uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
+
+/**
+ * Fee rate per 1000-weight of the transaction
+ */
+void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * Constructs a new UpdateFee given each field
+ */
+MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKChannelId channel_id_arg, uint32_t feerate_per_kw_arg);
+
+/**
+ * Creates a copy of the UpdateFee
+ */
+struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the UpdateFee.
+ */
+uint64_t UpdateFee_hash(const struct LDKUpdateFee *NONNULL_PTR o);
+
+/**
+ * Checks if two UpdateFees contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
+ */
+void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The next commitment number for the sender
+ */
+uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
+
+/**
+ * The next commitment number for the sender
+ */
+void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The next commitment number for the recipient
+ */
+uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
+
+/**
+ * The next commitment number for the recipient
+ */
+void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Proof that the sender knows the per-commitment secret of a specific commitment transaction
+ * belonging to the recipient
+ */
+const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
+
+/**
+ * Proof that the sender knows the per-commitment secret of a specific commitment transaction
+ * belonging to the recipient
+ */
+void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The sender's per-commitment point for their current commitment transaction
+ */
+struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
+
+/**
+ * The sender's per-commitment point for their current commitment transaction
+ */
+void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The next funding transaction ID
+ */
+struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
+
+/**
+ * The next funding transaction ID
+ */
+void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
+
+/**
+ * Constructs a new ChannelReestablish given each field
+ */
+MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKChannelId channel_id_arg, uint64_t next_local_commitment_number_arg, uint64_t next_remote_commitment_number_arg, struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg, struct LDKCOption_ThirtyTwoBytesZ next_funding_txid_arg);
+
+/**
+ * Creates a copy of the ChannelReestablish
+ */
+struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ChannelReestablish.
+ */
+uint64_t ChannelReestablish_hash(const struct LDKChannelReestablish *NONNULL_PTR o);
+
+/**
+ * Checks if two ChannelReestablishs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
+ */
+void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
+
+/**
+ * The channel ID
+ */
+struct LDKChannelId AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
+
+/**
+ * The channel ID
+ */
+void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val);
+
+/**
+ * The short channel ID
+ */
+uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
+
+/**
+ * The short channel ID
+ */
+void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * A signature by the node key
+ */
+struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
+
+/**
+ * A signature by the node key
+ */
+void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+
+/**
+ * A signature by the funding key
+ */
+struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
+
+/**
+ * A signature by the funding key
+ */
+void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+
+/**
+ * Constructs a new AnnouncementSignatures given each field
+ */
+MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKChannelId channel_id_arg, uint64_t short_channel_id_arg, struct LDKECDSASignature node_signature_arg, struct LDKECDSASignature bitcoin_signature_arg);
+
+/**
+ * Creates a copy of the AnnouncementSignatures
+ */
+struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the AnnouncementSignatures.
+ */
+uint64_t AnnouncementSignatures_hash(const struct LDKAnnouncementSignatures *NONNULL_PTR o);
+
+/**
+ * Checks if two AnnouncementSignaturess contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the SocketAddress
+ */
+void SocketAddress_free(struct LDKSocketAddress this_ptr);
+
+/**
+ * Creates a copy of the SocketAddress
+ */
+struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new TcpIpV4-variant SocketAddress
+ */
+struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
+
+/**
+ * Utility method to constructs a new TcpIpV6-variant SocketAddress
+ */
+struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
+
+/**
+ * Utility method to constructs a new OnionV2-variant SocketAddress
+ */
+struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
+
+/**
+ * Utility method to constructs a new OnionV3-variant SocketAddress
+ */
+struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
+
+/**
+ * Utility method to constructs a new Hostname-variant SocketAddress
+ */
+struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the SocketAddress.
+ */
+uint64_t SocketAddress_hash(const struct LDKSocketAddress *NONNULL_PTR o);
+
+/**
+ * Checks if two SocketAddresss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
+
+/**
+ * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
+ */
+struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
+
+/**
+ * Read a SocketAddress from a byte array, created by SocketAddress_write
+ */
+struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
+
+/**
+ * Creates a copy of the SocketAddressParseError
+ */
+enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
+ */
+enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
+
+/**
+ * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
+ */
+enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
+
+/**
+ * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
+ */
+enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
+
+/**
+ * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
+ */
+enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the SocketAddressParseError.
+ */
+uint64_t SocketAddressParseError_hash(const enum LDKSocketAddressParseError *NONNULL_PTR o);
+
+/**
+ * Checks if two SocketAddressParseErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
+
+/**
+ * Get the string representation of a SocketAddressParseError object
+ */
+struct LDKStr SocketAddressParseError_to_str(const enum LDKSocketAddressParseError *NONNULL_PTR o);
+
+/**
+ * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
+ *
+ * The host part must end with \".onion\".
+ */
+struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
+
+/**
+ * Get the string representation of a SocketAddress object
+ */
+struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o);
+
+/**
+ * Read a SocketAddress object from a string
+ */
+struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
+
+/**
+ * Frees any resources used by the UnsignedGossipMessage
+ */
+void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
+
+/**
+ * Creates a copy of the UnsignedGossipMessage
+ */
+struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
+ */
+struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
+
+/**
+ * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
+ */
+struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
+
+/**
+ * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
+ */
+struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
+
+/**
+ * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
+ */
+struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
+
+/**
+ * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
+ */
+void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
+
+/**
+ * The advertised features
+ */
+struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * The advertised features
+ */
+void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
+
+/**
+ * A strictly monotonic announcement counter, with gaps allowed
+ */
+uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * A strictly monotonic announcement counter, with gaps allowed
+ */
+void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
+ * to this node).
+ */
+struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
+ * to this node).
+ */
+void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
+
+/**
+ * An RGB color for UI purposes
+ */
+const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
+
+/**
+ * An RGB color for UI purposes
+ */
+void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
+
+/**
+ * An alias, for UI purposes.
+ *
+ * This should be sanitized before use. There is no guarantee of uniqueness.
+ */
+struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * An alias, for UI purposes.
+ *
+ * This should be sanitized before use. There is no guarantee of uniqueness.
+ */
+void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
+
+/**
+ * List of addresses on which this node is reachable
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * List of addresses on which this node is reachable
+ */
+void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
+
+/**
+ * Excess address data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_address_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * Excess address data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol.
+ */
+void UnsignedNodeAnnouncement_set_excess_address_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+
+/**
+ * Excess data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * Excess data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
+ */
+void UnsignedNodeAnnouncement_set_excess_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+
+/**
+ * Constructs a new UnsignedNodeAnnouncement given each field
+ */
+MUST_USE_RES struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_new(struct LDKNodeFeatures features_arg, uint32_t timestamp_arg, struct LDKNodeId node_id_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_SocketAddressZ addresses_arg, struct LDKCVec_u8Z excess_address_data_arg, struct LDKCVec_u8Z excess_data_arg);
+
+/**
+ * Creates a copy of the UnsignedNodeAnnouncement
+ */
+struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the UnsignedNodeAnnouncement.
+ */
+uint64_t UnsignedNodeAnnouncement_hash(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR o);
+
+/**
+ * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
+ */
+void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
+
+/**
+ * The signature by the node key
+ */
+struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * The signature by the node key
+ */
+void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+
+/**
+ * The actual content of the announcement
+ */
+struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * The actual content of the announcement
+ */
+void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
+
+/**
+ * Constructs a new NodeAnnouncement given each field
+ */
+MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
+
+/**
+ * Creates a copy of the NodeAnnouncement
+ */
+struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the NodeAnnouncement.
+ */
+uint64_t NodeAnnouncement_hash(const struct LDKNodeAnnouncement *NONNULL_PTR o);
+
+/**
+ * Checks if two NodeAnnouncements contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
+ */
+void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
+
+/**
+ * The advertised channel features
+ */
+struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * The advertised channel features
+ */
+void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
+
+/**
+ * The genesis hash of the blockchain where the channel is to be opened
+ */
+const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The genesis hash of the blockchain where the channel is to be opened
+ */
+void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The short channel ID
+ */
+uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * The short channel ID
+ */
+void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * One of the two `node_id`s which are endpoints of this channel
+ */
+struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * One of the two `node_id`s which are endpoints of this channel
+ */
+void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
+
+/**
+ * The other of the two `node_id`s which are endpoints of this channel
+ */
+struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * The other of the two `node_id`s which are endpoints of this channel
+ */
+void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
+
+/**
+ * The funding key for the first node
+ */
+struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * The funding key for the first node
+ */
+void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
+
+/**
+ * The funding key for the second node
+ */
+struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * The funding key for the second node
+ */
+void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
+
+/**
+ * Excess data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * Excess data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
+ */
+void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+
+/**
+ * Constructs a new UnsignedChannelAnnouncement given each field
+ */
+MUST_USE_RES struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_new(struct LDKChannelFeatures features_arg, struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, struct LDKNodeId node_id_1_arg, struct LDKNodeId node_id_2_arg, struct LDKNodeId bitcoin_key_1_arg, struct LDKNodeId bitcoin_key_2_arg, struct LDKCVec_u8Z excess_data_arg);
+
+/**
+ * Creates a copy of the UnsignedChannelAnnouncement
+ */
+struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the UnsignedChannelAnnouncement.
+ */
+uint64_t UnsignedChannelAnnouncement_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR o);
+
+/**
+ * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
+ */
+void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
+
+/**
+ * Authentication of the announcement by the first public node
+ */
+struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * Authentication of the announcement by the first public node
+ */
+void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+
+/**
+ * Authentication of the announcement by the second public node
+ */
+struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * Authentication of the announcement by the second public node
+ */
+void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+
+/**
+ * Proof of funding UTXO ownership by the first public node
+ */
+struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * Proof of funding UTXO ownership by the first public node
+ */
+void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+
+/**
+ * Proof of funding UTXO ownership by the second public node
+ */
+struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * Proof of funding UTXO ownership by the second public node
+ */
+void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+
+/**
+ * The actual announcement
+ */
+struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
+
+/**
+ * The actual announcement
+ */
+void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
+
+/**
+ * Constructs a new ChannelAnnouncement given each field
+ */
+MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKECDSASignature node_signature_1_arg, struct LDKECDSASignature node_signature_2_arg, struct LDKECDSASignature bitcoin_signature_1_arg, struct LDKECDSASignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg);
+
+/**
+ * Creates a copy of the ChannelAnnouncement
+ */
+struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ChannelAnnouncement.
+ */
+uint64_t ChannelAnnouncement_hash(const struct LDKChannelAnnouncement *NONNULL_PTR o);
+
+/**
+ * Checks if two ChannelAnnouncements contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
+ */
+void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
+
+/**
+ * The genesis hash of the blockchain where the channel is to be opened
+ */
+const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The genesis hash of the blockchain where the channel is to be opened
+ */
+void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The short channel ID
+ */
+uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * The short channel ID
+ */
+void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
+ */
+uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
+ */
+void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * Flags pertaining to this message.
+ */
+uint8_t UnsignedChannelUpdate_get_message_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * Flags pertaining to this message.
+ */
+void UnsignedChannelUpdate_set_message_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
+
+/**
+ * Flags pertaining to the channel, including to which direction in the channel this update
+ * applies and whether the direction is currently able to forward HTLCs.
+ */
+uint8_t UnsignedChannelUpdate_get_channel_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * Flags pertaining to the channel, including to which direction in the channel this update
+ * applies and whether the direction is currently able to forward HTLCs.
+ */
+void UnsignedChannelUpdate_set_channel_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
+
+/**
+ * The number of blocks such that if:
+ * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
+ * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
+ * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
+ * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
+ * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
+ * forwarding. Note that the HTLC sender is the one who originally sets this value when
+ * constructing the route.
+ */
+uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * The number of blocks such that if:
+ * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
+ * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
+ * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
+ * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
+ * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
+ * forwarding. Note that the HTLC sender is the one who originally sets this value when
+ * constructing the route.
+ */
+void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The minimum HTLC size incoming to sender, in milli-satoshi
+ */
+uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum HTLC size incoming to sender, in milli-satoshi
+ */
+void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The maximum HTLC value incoming to sender, in milli-satoshi.
+ *
+ * This used to be optional.
+ */
+uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum HTLC value incoming to sender, in milli-satoshi.
+ *
+ * This used to be optional.
+ */
+void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The base HTLC fee charged by sender, in milli-satoshi
+ */
+uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * The base HTLC fee charged by sender, in milli-satoshi
+ */
+void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The amount to fee multiplier, in micro-satoshi
+ */
+uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * The amount to fee multiplier, in micro-satoshi
+ */
+void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * Excess data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * Excess data which was signed as a part of the message which we do not (yet) understand how
+ * to decode.
+ *
+ * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
+ */
+void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+
+/**
+ * Constructs a new UnsignedChannelUpdate given each field
+ */
+MUST_USE_RES struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_new(struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, uint32_t timestamp_arg, uint8_t message_flags_arg, uint8_t channel_flags_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, struct LDKCVec_u8Z excess_data_arg);
+
+/**
+ * Creates a copy of the UnsignedChannelUpdate
+ */
+struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the UnsignedChannelUpdate.
+ */
+uint64_t UnsignedChannelUpdate_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR o);
+
+/**
+ * Checks if two UnsignedChannelUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
+ */
+void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
+
+/**
+ * A signature of the channel update
+ */
+struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * A signature of the channel update
+ */
+void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
+
+/**
+ * The actual channel update
+ */
+struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * The actual channel update
+ */
+void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
+
+/**
+ * Constructs a new ChannelUpdate given each field
+ */
+MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
+
+/**
+ * Creates a copy of the ChannelUpdate
+ */
+struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ChannelUpdate.
+ */
+uint64_t ChannelUpdate_hash(const struct LDKChannelUpdate *NONNULL_PTR o);
+
+/**
+ * Checks if two ChannelUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
+ */
+void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
+
+/**
+ * The genesis hash of the blockchain being queried
+ */
+const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The genesis hash of the blockchain being queried
+ */
+void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The height of the first block for the channel UTXOs being queried
+ */
+uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
+
+/**
+ * The height of the first block for the channel UTXOs being queried
+ */
+void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The number of blocks to include in the query results
+ */
+uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
+
+/**
+ * The number of blocks to include in the query results
+ */
+void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * Constructs a new QueryChannelRange given each field
+ */
+MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
+
+/**
+ * Creates a copy of the QueryChannelRange
+ */
+struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the QueryChannelRange.
+ */
+uint64_t QueryChannelRange_hash(const struct LDKQueryChannelRange *NONNULL_PTR o);
+
+/**
+ * Checks if two QueryChannelRanges contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
+ */
+void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
+
+/**
+ * The genesis hash of the blockchain being queried
+ */
+const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The genesis hash of the blockchain being queried
+ */
+void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The height of the first block in the range of the reply
+ */
+uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
+
+/**
+ * The height of the first block in the range of the reply
+ */
+void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The number of blocks included in the range of the reply
+ */
+uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
+
+/**
+ * The number of blocks included in the range of the reply
+ */
+void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * True when this is the final reply for a query
+ */
+bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
+
+/**
+ * True when this is the final reply for a query
+ */
+void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * The `short_channel_id`s in the channel range
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
+
+/**
+ * The `short_channel_id`s in the channel range
+ */
+void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
+
+/**
+ * Constructs a new ReplyChannelRange given each field
+ */
+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);
+
+/**
+ * Creates a copy of the ReplyChannelRange
+ */
+struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ReplyChannelRange.
+ */
+uint64_t ReplyChannelRange_hash(const struct LDKReplyChannelRange *NONNULL_PTR o);
+
+/**
+ * Checks if two ReplyChannelRanges contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
+ */
+void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
+
+/**
+ * The genesis hash of the blockchain being queried
+ */
+const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The genesis hash of the blockchain being queried
+ */
+void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The short_channel_ids that are being queried
+ *
+ * Returns a copy of the field.
+ */
+struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
+
+/**
+ * The short_channel_ids that are being queried
+ */
+void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
+
+/**
+ * Constructs a new QueryShortChannelIds given each field
+ */
+MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
+
+/**
+ * Creates a copy of the QueryShortChannelIds
+ */
+struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the QueryShortChannelIds.
+ */
+uint64_t QueryShortChannelIds_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR o);
+
+/**
+ * Checks if two QueryShortChannelIdss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
+ */
+void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
+
+/**
+ * The genesis hash of the blockchain that was queried
+ */
+const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The genesis hash of the blockchain that was queried
+ */
+void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * Indicates if the query recipient maintains up-to-date channel
+ * information for the `chain_hash`
+ */
+bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
+
+/**
+ * Indicates if the query recipient maintains up-to-date channel
+ * information for the `chain_hash`
+ */
+void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
+
+/**
+ * Constructs a new ReplyShortChannelIdsEnd given each field
+ */
+MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
+
+/**
+ * Creates a copy of the ReplyShortChannelIdsEnd
+ */
+struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
+ */
+uint64_t ReplyShortChannelIdsEnd_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR o);
+
+/**
+ * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
+ */
+void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
+
+/**
+ * The genesis hash of the blockchain for channel and node information
+ */
+const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The genesis hash of the blockchain for channel and node information
+ */
+void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The starting unix timestamp
+ */
+uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
+
+/**
+ * The starting unix timestamp
+ */
+void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The range of information in seconds
+ */
+uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
+
+/**
+ * The range of information in seconds
+ */
+void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * Constructs a new GossipTimestampFilter given each field
+ */
+MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
+
+/**
+ * Creates a copy of the GossipTimestampFilter
+ */
+struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the GossipTimestampFilter.
+ */
+uint64_t GossipTimestampFilter_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR o);
+
+/**
+ * Checks if two GossipTimestampFilters contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the ErrorAction
+ */
+void ErrorAction_free(struct LDKErrorAction this_ptr);
+
+/**
+ * Creates a copy of the ErrorAction
+ */
+struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new DisconnectPeer-variant ErrorAction
+ */
+struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
+
+/**
+ * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
+ */
+struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
+
+/**
+ * Utility method to constructs a new IgnoreError-variant ErrorAction
+ */
+struct LDKErrorAction ErrorAction_ignore_error(void);
+
+/**
+ * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
+ */
+struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
+
+/**
+ * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
+ */
+struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
+
+/**
+ * Utility method to constructs a new SendErrorMessage-variant ErrorAction
+ */
+struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
+
+/**
+ * Utility method to constructs a new SendWarningMessage-variant ErrorAction
+ */
+struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the ErrorAction.
+ */
+uint64_t ErrorAction_hash(const struct LDKErrorAction *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
+ */
+void LightningError_free(struct LDKLightningError this_obj);
+
+/**
+ * A human-readable message describing the error
+ */
+struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
+
+/**
+ * A human-readable message describing the error
+ */
+void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
+
+/**
+ * The action which should be taken against the offending peer.
+ */
+struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
+
+/**
+ * The action which should be taken against the offending peer.
+ */
+void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
+
+/**
+ * Constructs a new LightningError given each field
+ */
+MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
+
+/**
+ * Creates a copy of the LightningError
+ */
+struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
+
+/**
+ * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
+ */
+void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
+
+/**
+ * `update_add_htlc` messages which should be sent
+ */
+struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * `update_add_htlc` messages which should be sent
+ */
+void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
+
+/**
+ * `update_fulfill_htlc` messages which should be sent
+ */
+struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * `update_fulfill_htlc` messages which should be sent
+ */
+void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
+
+/**
+ * `update_fail_htlc` messages which should be sent
+ */
+struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * `update_fail_htlc` messages which should be sent
+ */
+void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
+
+/**
+ * `update_fail_malformed_htlc` messages which should be sent
+ */
+struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * `update_fail_malformed_htlc` messages which should be sent
+ */
+void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
+
+/**
+ * An `update_fee` message which should be sent
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * An `update_fee` message which should be sent
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
+
+/**
+ * A `commitment_signed` message which should be sent
+ */
+struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
+
+/**
+ * A `commitment_signed` message which should be sent
+ */
+void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
+
+/**
+ * Constructs a new CommitmentUpdate given each field
+ *
+ * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+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);
+
+/**
+ * Creates a copy of the CommitmentUpdate
+ */
+struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
+
+/**
+ * Generates a non-cryptographic 64-bit hash of the CommitmentUpdate.
+ */
+uint64_t CommitmentUpdate_hash(const struct LDKCommitmentUpdate *NONNULL_PTR o);
+
+/**
+ * Checks if two CommitmentUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
+
+/**
+ * Calls the free function if one is set
+ */
+void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
+
+/**
+ * Calls the free function if one is set
+ */
+void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
+
+/**
+ * Calls the free function if one is set
+ */
+void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
+
+/**
+ * Frees any resources used by the FinalOnionHopData, if is_owned is set and inner is non-NULL.
+ */
+void FinalOnionHopData_free(struct LDKFinalOnionHopData this_obj);
+
+/**
+ * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
+ * Because it is generated by the recipient and included in the invoice, it also provides
+ * proof to the recipient that the payment was sent by someone with the generated invoice.
+ */
+const uint8_t (*FinalOnionHopData_get_payment_secret(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr))[32];
+
+/**
+ * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
+ * Because it is generated by the recipient and included in the invoice, it also provides
+ * proof to the recipient that the payment was sent by someone with the generated invoice.
+ */
+void FinalOnionHopData_set_payment_secret(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * The intended total amount that this payment is for.
+ *
+ * Message serialization may panic if this value is more than 21 million Bitcoin.
+ */
+uint64_t FinalOnionHopData_get_total_msat(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr);
+
+/**
+ * The intended total amount that this payment is for.
+ *
+ * Message serialization may panic if this value is more than 21 million Bitcoin.
+ */
+void FinalOnionHopData_set_total_msat(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Constructs a new FinalOnionHopData given each field
+ */
+MUST_USE_RES struct LDKFinalOnionHopData FinalOnionHopData_new(struct LDKThirtyTwoBytes payment_secret_arg, uint64_t total_msat_arg);
+
+/**
+ * Creates a copy of the FinalOnionHopData
+ */
+struct LDKFinalOnionHopData FinalOnionHopData_clone(const struct LDKFinalOnionHopData *NONNULL_PTR orig);
+
+/**
+ * Frees any resources used by the OnionPacket, if is_owned is set and inner is non-NULL.
+ */
+void OnionPacket_free(struct LDKOnionPacket this_obj);
+
+/**
+ * BOLT 4 version number.
+ */
+uint8_t OnionPacket_get_version(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
+
+/**
+ * BOLT 4 version number.
+ */
+void OnionPacket_set_version(struct LDKOnionPacket *NONNULL_PTR this_ptr, uint8_t val);