Update auto-generated bindings to latest upstream
[ldk-c-bindings] / lightning-c-bindings / include / lightning.h
index 55957788957f941d51f015cc93ab7242eb3a6d83..dad0072d6b9fdca33e85da686e981dea81ec7e8b 100644 (file)
@@ -8,7 +8,7 @@
 #include <stdarg.h>
 #include <stdbool.h>
 #include <stdint.h>
-#include <ldk_rust_types.h>
+#include "ldk_rust_types.h"
 
 /**
  * An error when accessing the chain via [`Access`].
@@ -328,6 +328,11 @@ typedef enum LDKSemanticError {
     * The invoice contains multiple descriptions and/or description hashes which isn't allowed
     */
    LDKSemanticError_MultipleDescriptions,
+   /**
+    * The invoice is missing the mandatory payment secret, which all modern lightning nodes
+    * should provide.
+    */
+   LDKSemanticError_NoPaymentSecret,
    /**
     * The invoice contains multiple payment secrets
     */
@@ -344,6 +349,10 @@ typedef enum LDKSemanticError {
     * The invoice's signature is invalid
     */
    LDKSemanticError_InvalidSignature,
+   /**
+    * The invoice's amount was not a whole number of millisatoshis
+    */
+   LDKSemanticError_ImpreciseAmount,
    /**
     * Must be last for serialization purposes
     */
@@ -1040,7 +1049,64 @@ typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
 
 
 /**
- * This class tracks the per-transaction information needed to build a commitment transaction and to
+ * 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;
+
+
+
+/**
+ * This class tracks the per-transaction information needed to build a commitment transaction and will
  * actually build it and sign.  It is used for holder transactions that we sign only when needed
  * and for transactions we sign for the counterparty.
  *
@@ -1184,6 +1250,114 @@ typedef struct LDKCResult_CVec_SignatureZNoneZ {
    bool result_ok;
 } LDKCResult_CVec_SignatureZNoneZ;
 
+
+
+/**
+ * A script pubkey for shutting down a channel as defined by [BOLT #2].
+ *
+ * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
+ */
+typedef struct MUST_USE_STRUCT LDKShutdownScript {
+   /**
+    * 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.
+    */
+   LDKnativeShutdownScript *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;
+} LDKShutdownScript;
+
+/**
+ * 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 [`Script`] 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;
+
 /**
  * The contents of CResult_NoneErrorZ
  */
@@ -1683,9 +1857,9 @@ typedef enum LDKMonitorEvent_Tag {
     */
    LDKMonitorEvent_HTLCEvent,
    /**
-    * A monitor event that the Channel's commitment transaction was broadcasted.
+    * A monitor event that the Channel's commitment transaction was confirmed.
     */
-   LDKMonitorEvent_CommitmentTxBroadcasted,
+   LDKMonitorEvent_CommitmentTxConfirmed,
    /**
     * Must be last for serialization purposes
     */
@@ -1699,7 +1873,7 @@ typedef struct MUST_USE_STRUCT LDKMonitorEvent {
          struct LDKHTLCUpdate htlc_event;
       };
       struct {
-         struct LDKOutPoint commitment_tx_broadcasted;
+         struct LDKOutPoint commitment_tx_confirmed;
       };
    };
 } LDKMonitorEvent;
@@ -1749,6 +1923,121 @@ typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
 
 
 
+/**
+ * A channel_update message to be sent or received from a peer
+ */
+typedef struct MUST_USE_STRUCT LDKChannelUpdate {
+   /**
+    * 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.
+    */
+   LDKnativeChannelUpdate *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;
+} LDKChannelUpdate;
+
+/**
+ * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
+ * return packet by a node along the route. See [BOLT #4] for details.
+ *
+ * [BOLT #4]: https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md
+ */
+typedef enum LDKNetworkUpdate_Tag {
+   /**
+    * An error indicating a `channel_update` messages should be applied via
+    * [`NetworkGraph::update_channel`].
+    */
+   LDKNetworkUpdate_ChannelUpdateMessage,
+   /**
+    * An error indicating only that a channel has been closed, which should be applied via
+    * [`NetworkGraph::close_channel_from_update`].
+    */
+   LDKNetworkUpdate_ChannelClosed,
+   /**
+    * An error indicating only that a node has failed, which should be applied via
+    * [`NetworkGraph::fail_node`].
+    */
+   LDKNetworkUpdate_NodeFailure,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKNetworkUpdate_Sentinel,
+} LDKNetworkUpdate_Tag;
+
+typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
+   /**
+    * The update to apply via [`NetworkGraph::update_channel`].
+    */
+   struct LDKChannelUpdate msg;
+} LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
+
+typedef struct LDKNetworkUpdate_LDKChannelClosed_Body {
+   /**
+    * The short channel id of the closed channel.
+    */
+   uint64_t short_channel_id;
+   /**
+    * Whether the channel should be permanently removed or temporarily disabled until a new
+    * `channel_update` message is received.
+    */
+   bool is_permanent;
+} LDKNetworkUpdate_LDKChannelClosed_Body;
+
+typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
+   /**
+    * The node id of the failed node.
+    */
+   struct LDKPublicKey node_id;
+   /**
+    * Whether the node should be permanently removed from consideration or can be restored
+    * when a new `channel_update` message is received.
+    */
+   bool is_permanent;
+} LDKNetworkUpdate_LDKNodeFailure_Body;
+
+typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
+   LDKNetworkUpdate_Tag tag;
+   union {
+      LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
+      LDKNetworkUpdate_LDKChannelClosed_Body channel_closed;
+      LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
+   };
+} LDKNetworkUpdate;
+
+/**
+ * An enum which can either contain a crate::lightning::routing::network_graph::NetworkUpdate or not
+ */
+typedef enum LDKCOption_NetworkUpdateZ_Tag {
+   /**
+    * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::network_graph::NetworkUpdate
+    */
+   LDKCOption_NetworkUpdateZ_Some,
+   /**
+    * When we're in this state, this COption_NetworkUpdateZ contains nothing
+    */
+   LDKCOption_NetworkUpdateZ_None,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKCOption_NetworkUpdateZ_Sentinel,
+} LDKCOption_NetworkUpdateZ_Tag;
+
+typedef struct LDKCOption_NetworkUpdateZ {
+   LDKCOption_NetworkUpdateZ_Tag tag;
+   union {
+      struct {
+         struct LDKNetworkUpdate some;
+      };
+   };
+} LDKCOption_NetworkUpdateZ;
+
+
+
 /**
  * Information about a spendable output to a P2WSH script. See
  * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
@@ -1799,8 +2088,8 @@ typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
 typedef enum LDKSpendableOutputDescriptor_Tag {
    /**
     * An output to a script which was provided via KeysInterface directly, either from
-    * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
-    * spend it. No secret keys are provided as rust-lightning was never given any key.
+    * `get_destination_script()` or `get_shutdown_scriptpubkey()`, thus you should already know
+    * how to spend it. No secret keys are provided as rust-lightning was never given any key.
     * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
     * on-chain using the payment preimage or after it has timed out.
     */
@@ -2135,26 +2424,6 @@ typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
 
 
 
-/**
- * A channel_update message to be sent or received from a peer
- */
-typedef struct MUST_USE_STRUCT LDKChannelUpdate {
-   /**
-    * 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.
-    */
-   LDKnativeChannelUpdate *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;
-} LDKChannelUpdate;
-
-
-
 /**
  * A node_announcement message to be sent or received from a peer
  */
@@ -2223,6 +2492,8 @@ typedef enum LDKErrorAction_Tag {
 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
    /**
     * An error message which we should make an effort to send before we disconnect.
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
    struct LDKErrorMessage msg;
 } LDKErrorAction_LDKDisconnectPeer_Body;
@@ -2245,71 +2516,6 @@ typedef struct MUST_USE_STRUCT LDKErrorAction {
    };
 } LDKErrorAction;
 
-/**
- * The information we received from a peer along the route of a payment we originated. This is
- * returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
- * RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
- */
-typedef enum LDKHTLCFailChannelUpdate_Tag {
-   /**
-    * We received an error which included a full ChannelUpdate message.
-    */
-   LDKHTLCFailChannelUpdate_ChannelUpdateMessage,
-   /**
-    * We received an error which indicated only that a channel has been closed
-    */
-   LDKHTLCFailChannelUpdate_ChannelClosed,
-   /**
-    * We received an error which indicated only that a node has failed
-    */
-   LDKHTLCFailChannelUpdate_NodeFailure,
-   /**
-    * Must be last for serialization purposes
-    */
-   LDKHTLCFailChannelUpdate_Sentinel,
-} LDKHTLCFailChannelUpdate_Tag;
-
-typedef struct LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body {
-   /**
-    * The unwrapped message we received
-    */
-   struct LDKChannelUpdate msg;
-} LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body;
-
-typedef struct LDKHTLCFailChannelUpdate_LDKChannelClosed_Body {
-   /**
-    * The short_channel_id which has now closed.
-    */
-   uint64_t short_channel_id;
-   /**
-    * when this true, this channel should be permanently removed from the
-    * consideration. Otherwise, this channel can be restored as new channel_update is received
-    */
-   bool is_permanent;
-} LDKHTLCFailChannelUpdate_LDKChannelClosed_Body;
-
-typedef struct LDKHTLCFailChannelUpdate_LDKNodeFailure_Body {
-   /**
-    * The node_id that has failed.
-    */
-   struct LDKPublicKey node_id;
-   /**
-    * when this true, node should be permanently removed from the
-    * consideration. Otherwise, the channels connected to this node can be
-    * restored as new channel_update is received
-    */
-   bool is_permanent;
-} LDKHTLCFailChannelUpdate_LDKNodeFailure_Body;
-
-typedef struct MUST_USE_STRUCT LDKHTLCFailChannelUpdate {
-   LDKHTLCFailChannelUpdate_Tag tag;
-   union {
-      LDKHTLCFailChannelUpdate_LDKChannelUpdateMessage_Body channel_update_message;
-      LDKHTLCFailChannelUpdate_LDKChannelClosed_Body channel_closed;
-      LDKHTLCFailChannelUpdate_LDKNodeFailure_Body node_failure;
-   };
-} LDKHTLCFailChannelUpdate;
-
 
 
 /**
@@ -2468,11 +2674,6 @@ typedef enum LDKMessageSendEvent_Tag {
     * Broadcast an error downstream to be handled
     */
    LDKMessageSendEvent_HandleError,
-   /**
-    * When a payment fails we may receive updates back from the hop where it failed. In such
-    * cases this event is generated so that we can inform the network graph of this information.
-    */
-   LDKMessageSendEvent_PaymentFailureNetworkUpdate,
    /**
     * Query a peer for channels with funding transaction UTXOs in a block range.
     */
@@ -2661,13 +2862,6 @@ typedef struct LDKMessageSendEvent_LDKHandleError_Body {
    struct LDKErrorAction action;
 } LDKMessageSendEvent_LDKHandleError_Body;
 
-typedef struct LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body {
-   /**
-    * The channel/node update which should be sent to NetGraphMsgHandler
-    */
-   struct LDKHTLCFailChannelUpdate update;
-} LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body;
-
 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
    /**
     * The node_id of this message recipient
@@ -2720,7 +2914,6 @@ typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
       LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
       LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
       LDKMessageSendEvent_LDKHandleError_Body handle_error;
-      LDKMessageSendEvent_LDKPaymentFailureNetworkUpdate_Body payment_failure_network_update;
       LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
       LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
       LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
@@ -3055,15 +3248,46 @@ typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
 
 /**
- * A tuple of 2 elements. See the individual fields for the types contained.
+ * The contents of CResult_NoneNoneZ
  */
-typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
+typedef union LDKCResult_NoneNoneZPtr {
    /**
-    * The element at position 0
+    * Note that this value is always NULL, as there are no contents in the OK variant
     */
-   struct LDKSignature a;
+   void *result;
    /**
-    * The element at position 1
+    * Note that this value is always NULL, as there are no contents in the Err variant
+    */
+   void *err;
+} LDKCResult_NoneNoneZPtr;
+
+/**
+ * A CResult_NoneNoneZ represents the result of a fallible operation,
+ * containing a () on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_NoneNoneZ {
+   /**
+    * The contents of this CResult_NoneNoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_NoneNoneZPtr contents;
+   /**
+    * Whether this CResult_NoneNoneZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_NoneNoneZ;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
+   /**
+    * The element at position 0
+    */
+   struct LDKSignature a;
+   /**
+    * The element at position 1
     */
    struct LDKCVec_SignatureZ b;
 } LDKC2Tuple_SignatureCVec_SignatureZZ;
@@ -3134,6 +3358,30 @@ typedef struct LDKCResult_SignatureNoneZ {
 
 
 
+/**
+ * This class tracks the per-transaction information needed to build a closing transaction and will
+ * actually build it and sign.
+ *
+ * This class can be used inside a signer implementation to generate a signature given the relevant
+ * secret key.
+ */
+typedef struct MUST_USE_STRUCT LDKClosingTransaction {
+   /**
+    * 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.
+    */
+   LDKnativeClosingTransaction *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;
+} LDKClosingTransaction;
+
+
+
 /**
  * The unsigned part of a channel_announcement
  */
@@ -3194,6 +3442,15 @@ typedef struct LDKBaseSign {
     * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
     */
    struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
+   /**
+    * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
+    *
+    * This is required in order for the signer to make sure that releasing a commitment
+    * secret won't leave us without a broadcastable holder transaction.
+    * Policy checks should be implemented in this function, including checking the amount
+    * sent to us and checking the HTLCs.
+    */
+   struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx);
    /**
     * Gets the holder's channel public keys and basepoints
     */
@@ -3214,8 +3471,18 @@ typedef struct LDKBaseSign {
     * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
     *
     * Note that if signing fails or is rejected, the channel will be force-closed.
+    *
+    * Policy checks should be implemented in this function, including checking the amount
+    * sent to us and checking the HTLCs.
     */
    struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx);
+   /**
+    * Validate the counterparty's revocation.
+    *
+    * This is required in order for the signer to make sure that the state has moved
+    * forward and it is safe to sign the next counterparty commitment.
+    */
+   struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
    /**
     * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
     * This will only ever be called with a non-revoked commitment_tx.  This will be called with the
@@ -3293,7 +3560,7 @@ typedef struct LDKBaseSign {
     * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
     * chosen to forgo their output as dust.
     */
-   struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, struct LDKTransaction closing_tx);
+   struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
    /**
     * Signs a channel announcement message with our funding key, proving it comes from one
     * of the channel participants.
@@ -3340,21 +3607,16 @@ typedef struct LDKSign {
     * Implementation of BaseSign for this object.
     */
    struct LDKBaseSign BaseSign;
-   /**
-    * Creates a copy of the BaseSign, for a copy of this Sign.
-    * Because BaseSign doesn't natively support copying itself, you have to provide a full copy implementation here.
-    */
-   struct LDKBaseSign (*BaseSign_clone)(const struct LDKBaseSign *NONNULL_PTR orig_BaseSign);
    /**
     * Serialize the object into a byte array
     */
    struct LDKCVec_u8Z (*write)(const void *this_arg);
    /**
-    * Creates a copy of the object pointed to by this_arg, for a copy of this Sign.
-    * Note that the ultimate copy of the Sign will have all function pointers the same as the original.
-    * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new Sign.
+    * Called, if set, after this Sign has been cloned into a duplicate object.
+    * The new Sign 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 *(*clone)(const void *this_arg);
+   void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
    /**
     * 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.
@@ -3748,6 +4010,17 @@ typedef enum LDKAPIError_Tag {
     * attempted action to fail.
     */
    LDKAPIError_MonitorUpdateFailed,
+   /**
+    * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
+    * with the channel counterparty as negotiated in [`InitFeatures`].
+    *
+    * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
+    * a channel or cooperatively close one with this peer (and will have to force-close instead).
+    *
+    * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
+    * [`InitFeatures`]: crate::ln::features::InitFeatures
+    */
+   LDKAPIError_IncompatibleShutdownScript,
    /**
     * Must be last for serialization purposes
     */
@@ -3786,6 +4059,13 @@ typedef struct LDKAPIError_LDKChannelUnavailable_Body {
    struct LDKStr err;
 } LDKAPIError_LDKChannelUnavailable_Body;
 
+typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
+   /**
+    * The incompatible shutdown script.
+    */
+   struct LDKShutdownScript script;
+} LDKAPIError_LDKIncompatibleShutdownScript_Body;
+
 typedef struct MUST_USE_STRUCT LDKAPIError {
    LDKAPIError_Tag tag;
    union {
@@ -3793,6 +4073,7 @@ typedef struct MUST_USE_STRUCT LDKAPIError {
       LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
       LDKAPIError_LDKRouteError_Body route_error;
       LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
+      LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
    };
 } LDKAPIError;
 
@@ -3959,6 +4240,39 @@ typedef struct LDKCResult_NonePaymentSendFailureZ {
    bool result_ok;
 } LDKCResult_NonePaymentSendFailureZ;
 
+/**
+ * The contents of CResult_PaymentHashPaymentSendFailureZ
+ */
+typedef union LDKCResult_PaymentHashPaymentSendFailureZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKThirtyTwoBytes *result;
+   /**
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
+    */
+   struct LDKPaymentSendFailure *err;
+} LDKCResult_PaymentHashPaymentSendFailureZPtr;
+
+/**
+ * A CResult_PaymentHashPaymentSendFailureZ represents the result of a fallible operation,
+ * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PaymentHashPaymentSendFailureZ {
+   /**
+    * The contents of this CResult_PaymentHashPaymentSendFailureZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_PaymentHashPaymentSendFailureZPtr contents;
+   /**
+    * Whether this CResult_PaymentHashPaymentSendFailureZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_PaymentHashPaymentSendFailureZ;
+
 /**
  * A 4-byte byte array.
  */
@@ -4300,13 +4614,12 @@ typedef struct LDKKeysInterface {
     */
    struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
    /**
-    * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
-    * a channel.
+    * Get a script pubkey which we will send funds to when closing a channel.
     *
     * This method should return a different value each time it is called, to avoid linking
     * on-chain funds across channels as controlled to the same user.
     */
-   struct LDKPublicKey (*get_shutdown_pubkey)(const void *this_arg);
+   struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
    /**
     * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
     * restarted with some stale data!
@@ -4585,6 +4898,96 @@ typedef struct LDKCResult_OutPointDecodeErrorZ {
    bool result_ok;
 } LDKCResult_OutPointDecodeErrorZ;
 
+/**
+ * Defines a type identifier for sending messages over the wire.
+ *
+ * Messages implementing this trait specify a type and must be [`Writeable`].
+ */
+typedef struct LDKType {
+   /**
+    * 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 type identifying the message payload.
+    */
+   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);
+   /**
+    * 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;
+
+/**
+ * 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;
+
 /**
  * The contents of CResult_SiPrefixNoneZ
  */
@@ -5385,6 +5788,151 @@ typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
    uintptr_t datalen;
 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
 
+/**
+ * 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 {
+   /**
+    * Information for receiving a payment that we generated an invoice for.
+    */
+   LDKPaymentPurpose_InvoicePayment,
+   /**
+    * 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_LDKInvoicePayment_Body {
+   /**
+    * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
+    * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
+    * [`ChannelManager::claim_funds`].
+    *
+    * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
+    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKThirtyTwoBytes 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;
+   /**
+    * This is the `user_payment_id` which was provided to
+    * [`ChannelManager::create_inbound_payment_for_hash`] or
+    * [`ChannelManager::create_inbound_payment`]. It has no meaning inside of LDK and is
+    * simply copied here. It may be used to correlate PaymentReceived events with invoice
+    * metadata stored elsewhere.
+    *
+    * [`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
+    */
+   uint64_t user_payment_id;
+} LDKPaymentPurpose_LDKInvoicePayment_Body;
+
+typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
+   LDKPaymentPurpose_Tag tag;
+   union {
+      LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
+      struct {
+         struct LDKThirtyTwoBytes spontaneous_payment;
+      };
+   };
+} LDKPaymentPurpose;
+
+/**
+ * The reason the channel was closed. See individual variants more details.
+ */
+typedef enum LDKClosureReason_Tag {
+   /**
+    * Closure generated from receiving a peer error message.
+    *
+    * Our counterparty may have broadcasted their latest commitment state, and we have
+    * as well.
+    */
+   LDKClosureReason_CounterpartyForceClosed,
+   /**
+    * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
+    *
+    * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
+    */
+   LDKClosureReason_HolderForceClosed,
+   /**
+    * The channel was closed after negotiating a cooperative close and we've now broadcasted
+    * the cooperative close transaction. Note the shutdown may have been initiated by us.
+    */
+   LDKClosureReason_CooperativeClosure,
+   /**
+    * A commitment transaction was confirmed on chain, closing the channel. Most likely this
+    * commitment transaction came from our counterparty, but it may also have come from
+    * a copy of our own `ChannelMonitor`.
+    */
+   LDKClosureReason_CommitmentTxConfirmed,
+   /**
+    * Closure generated from processing an event, likely a HTLC forward/relay/reception.
+    */
+   LDKClosureReason_ProcessingError,
+   /**
+    * The `PeerManager` informed us that we've disconnected from the peer. We close channels
+    * if the `PeerManager` informed us that it is unlikely we'll be able to connect to the
+    * peer again in the future or if the peer disconnected before we finished negotiating
+    * the channel open. The first case may be caused by incompatible features which our
+    * counterparty, or we, require.
+    */
+   LDKClosureReason_DisconnectedPeer,
+   /**
+    * Closure generated from `ChannelManager::read` if the ChannelMonitor is newer than
+    * the ChannelManager deserialized.
+    */
+   LDKClosureReason_OutdatedChannelManager,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKClosureReason_Sentinel,
+} LDKClosureReason_Tag;
+
+typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
+   /**
+    * The error which the peer sent us.
+    *
+    * 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 exploit
+    * a security vulnerability in the terminal emulator or the logging subsystem.
+    */
+   struct LDKStr peer_msg;
+} LDKClosureReason_LDKCounterpartyForceClosed_Body;
+
+typedef struct LDKClosureReason_LDKProcessingError_Body {
+   /**
+    * A developer-readable error message which we generated.
+    */
+   struct LDKStr err;
+} LDKClosureReason_LDKProcessingError_Body;
+
+typedef struct MUST_USE_STRUCT LDKClosureReason {
+   LDKClosureReason_Tag tag;
+   union {
+      LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
+      LDKClosureReason_LDKProcessingError_Body processing_error;
+   };
+} LDKClosureReason;
+
 /**
  * An Event which you should probably take some action in response to.
  *
@@ -5415,15 +5963,18 @@ typedef enum LDKEvent_Tag {
     */
    LDKEvent_PaymentReceived,
    /**
-    * Indicates an outbound payment we made succeeded (ie it made it all the way to its target
+    * 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.
     */
    LDKEvent_PaymentSent,
    /**
     * Indicates an outbound payment we made failed. Probably some intermediary node dropped
     * something. You may wish to retry with a different route.
     */
-   LDKEvent_PaymentFailed,
+   LDKEvent_PaymentPathFailed,
    /**
     * Used to indicate that ChannelManager::process_pending_htlc_forwards should be called at a
     * time in the future.
@@ -5437,6 +5988,15 @@ typedef enum LDKEvent_Tag {
     * somewhere and spend them when you create on-chain transactions.
     */
    LDKEvent_SpendableOutputs,
+   /**
+    * This event is generated when a payment has been successfully forwarded through us and a
+    * forwarding fee earned.
+    */
+   LDKEvent_PaymentForwarded,
+   /**
+    * Used to indicate that a channel with the given `channel_id` is in the process of closure.
+    */
+   LDKEvent_ChannelClosed,
    /**
     * Must be last for serialization purposes
     */
@@ -5468,28 +6028,6 @@ typedef struct LDKEvent_LDKPaymentReceived_Body {
     * The hash for which the preimage should be handed to the ChannelManager.
     */
    struct LDKThirtyTwoBytes payment_hash;
-   /**
-    * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
-    * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
-    * [`ChannelManager::claim_funds`].
-    *
-    * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
-    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
-    */
-   struct LDKThirtyTwoBytes 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;
    /**
     * The value, in thousandths of a satoshi, that this payment is for. Note that you must
     * compare this to the expected value before accepting the payment (as otherwise you are
@@ -5497,16 +6035,10 @@ typedef struct LDKEvent_LDKPaymentReceived_Body {
     */
    uint64_t amt;
    /**
-    * This is the `user_payment_id` which was provided to
-    * [`ChannelManager::create_inbound_payment_for_hash`] or
-    * [`ChannelManager::create_inbound_payment`]. It has no meaning inside of LDK and is
-    * simply copied here. It may be used to correlate PaymentReceived events with invoice
-    * metadata stored elsewhere.
-    *
-    * [`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
+    * 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.
     */
-   uint64_t user_payment_id;
+   struct LDKPaymentPurpose purpose;
 } LDKEvent_LDKPaymentReceived_Body;
 
 typedef struct LDKEvent_LDKPaymentSent_Body {
@@ -5518,7 +6050,7 @@ typedef struct LDKEvent_LDKPaymentSent_Body {
    struct LDKThirtyTwoBytes payment_preimage;
 } LDKEvent_LDKPaymentSent_Body;
 
-typedef struct LDKEvent_LDKPaymentFailed_Body {
+typedef struct LDKEvent_LDKPaymentPathFailed_Body {
    /**
     * The hash which was given to ChannelManager::send_payment.
     */
@@ -5529,7 +6061,28 @@ typedef struct LDKEvent_LDKPaymentFailed_Body {
     * retry the payment via a different route.
     */
    bool rejected_by_dest;
-} LDKEvent_LDKPaymentFailed_Body;
+   /**
+    * Any failure information conveyed via the Onion return packet by a node along the failed
+    * payment route.
+    *
+    * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
+    * account the update. [`NetGraphMsgHandler`] is capable of doing this.
+    *
+    * [`NetworkGraph`]: crate::routing::network_graph::NetworkGraph
+    * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
+    */
+   struct LDKCOption_NetworkUpdateZ network_update;
+   /**
+    * For both single-path and multi-path payments, this is set if all paths of the payment have
+    * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
+    * larger MPP payment were still in flight when this event was generated.
+    */
+   bool all_paths_failed;
+   /**
+    * The payment path that failed.
+    */
+   struct LDKCVec_RouteHopZ path;
+} LDKEvent_LDKPaymentPathFailed_Body;
 
 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
    /**
@@ -5548,15 +6101,53 @@ typedef struct LDKEvent_LDKSpendableOutputs_Body {
    struct LDKCVec_SpendableOutputDescriptorZ outputs;
 } LDKEvent_LDKSpendableOutputs_Body;
 
+typedef struct LDKEvent_LDKPaymentForwarded_Body {
+   /**
+    * The 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 `fee_earned_msat` is
+    * `None`.
+    */
+   struct LDKCOption_u64Z fee_earned_msat;
+   /**
+    * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
+    * transaction.
+    */
+   bool claim_from_onchain_tx;
+} LDKEvent_LDKPaymentForwarded_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 LDKThirtyTwoBytes channel_id;
+   /**
+    * The reason the channel was closed.
+    */
+   struct LDKClosureReason reason;
+} LDKEvent_LDKChannelClosed_Body;
+
 typedef struct MUST_USE_STRUCT LDKEvent {
    LDKEvent_Tag tag;
    union {
       LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
       LDKEvent_LDKPaymentReceived_Body payment_received;
       LDKEvent_LDKPaymentSent_Body payment_sent;
-      LDKEvent_LDKPaymentFailed_Body payment_failed;
+      LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
       LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
       LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
+      LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
+      LDKEvent_LDKChannelClosed_Body channel_closed;
    };
 } LDKEvent;
 
@@ -5652,6 +6243,119 @@ typedef struct LDKCVec_TransactionOutputsZ {
    uintptr_t datalen;
 } LDKCVec_TransactionOutputsZ;
 
+/**
+ * Details about the balance(s) available for spending once the channel appears on chain.
+ *
+ * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
+ * be provided.
+ */
+typedef enum LDKBalance_Tag {
+   /**
+    * The channel is not yet closed (or the commitment or closing transaction has not yet
+    * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
+    * force-closed now.
+    */
+   LDKBalance_ClaimableOnChannelClose,
+   /**
+    * The channel has been closed, and the given balance is ours but awaiting confirmations until
+    * we consider it spendable.
+    */
+   LDKBalance_ClaimableAwaitingConfirmations,
+   /**
+    * The channel has been closed, and the given balance should be ours but awaiting spending
+    * transaction confirmation. If the spending transaction does not confirm in time, it is
+    * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
+    *
+    * Once the spending transaction confirms, before it has reached enough confirmations to be
+    * considered safe from chain reorganizations, the balance will instead be provided via
+    * [`Balance::ClaimableAwaitingConfirmations`].
+    */
+   LDKBalance_ContentiousClaimable,
+   /**
+    * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
+    * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
+    * likely to be claimed by our counterparty before we do.
+    */
+   LDKBalance_MaybeClaimableHTLCAwaitingTimeout,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKBalance_Sentinel,
+} LDKBalance_Tag;
+
+typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
+   /**
+    * The amount available to claim, in satoshis, excluding the on-chain fees which will be
+    * required to do so.
+    */
+   uint64_t claimable_amount_satoshis;
+} LDKBalance_LDKClaimableOnChannelClose_Body;
+
+typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
+   /**
+    * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
+    * were spent in broadcasting the transaction.
+    */
+   uint64_t claimable_amount_satoshis;
+   /**
+    * The height at which an [`Event::SpendableOutputs`] event will be generated for this
+    * amount.
+    */
+   uint32_t confirmation_height;
+} LDKBalance_LDKClaimableAwaitingConfirmations_Body;
+
+typedef struct LDKBalance_LDKContentiousClaimable_Body {
+   /**
+    * The amount available to claim, in satoshis, excluding the on-chain fees which will be
+    * required to do so.
+    */
+   uint64_t claimable_amount_satoshis;
+   /**
+    * The height at which the counterparty may be able to claim the balance if we have not
+    * done so.
+    */
+   uint32_t timeout_height;
+} LDKBalance_LDKContentiousClaimable_Body;
+
+typedef struct LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body {
+   /**
+    * The amount available to claim, in satoshis, excluding the on-chain fees which will be
+    * required to do so.
+    */
+   uint64_t claimable_amount_satoshis;
+   /**
+    * The height at which we will be able to claim the balance if our counterparty has not
+    * done so.
+    */
+   uint32_t claimable_height;
+} LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body;
+
+typedef struct MUST_USE_STRUCT LDKBalance {
+   LDKBalance_Tag tag;
+   union {
+      LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
+      LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
+      LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
+      LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body maybe_claimable_htlc_awaiting_timeout;
+   };
+} LDKBalance;
+
+/**
+ * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_BalanceZ {
+   /**
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    */
+   struct LDKBalance *data;
+   /**
+    * The number of elements pointed to by `data`.
+    */
+   uintptr_t datalen;
+} LDKCVec_BalanceZ;
+
 /**
  * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
  */
@@ -5685,6 +6389,68 @@ typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
    bool result_ok;
 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
 
+/**
+ * The contents of CResult_NoneLightningErrorZ
+ */
+typedef union LDKCResult_NoneLightningErrorZPtr {
+   /**
+    * 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 LDKLightningError *err;
+} LDKCResult_NoneLightningErrorZPtr;
+
+/**
+ * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
+ * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_NoneLightningErrorZ {
+   /**
+    * The contents of this CResult_NoneLightningErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_NoneLightningErrorZPtr contents;
+   /**
+    * Whether this CResult_NoneLightningErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_NoneLightningErrorZ;
+
+/**
+ * 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 CResult_boolLightningErrorZ
  */
@@ -5768,38 +6534,6 @@ typedef struct LDKCVec_NodeAnnouncementZ {
    uintptr_t datalen;
 } LDKCVec_NodeAnnouncementZ;
 
-/**
- * The contents of CResult_NoneLightningErrorZ
- */
-typedef union LDKCResult_NoneLightningErrorZPtr {
-   /**
-    * 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 LDKLightningError *err;
-} LDKCResult_NoneLightningErrorZPtr;
-
-/**
- * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
- * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_NoneLightningErrorZ {
-   /**
-    * The contents of this CResult_NoneLightningErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
-    */
-   union LDKCResult_NoneLightningErrorZPtr contents;
-   /**
-    * Whether this CResult_NoneLightningErrorZ represents a success state.
-    */
-   bool result_ok;
-} LDKCResult_NoneLightningErrorZ;
-
 /**
  * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
  * This corresponds to std::vector in C++
@@ -5936,6 +6670,58 @@ typedef struct LDKCResult_boolPeerHandleErrorZ {
    bool result_ok;
 } LDKCResult_boolPeerHandleErrorZ;
 
+/**
+ * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
+ * UTXOs.
+ */
+typedef struct LDKAccess {
+   /**
+    * 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 transaction output of a funding transaction encoded by [`short_channel_id`].
+    * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
+    * is unknown.
+    *
+    * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
+    */
+   struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], 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);
+} LDKAccess;
+
+/**
+ * An enum which can either contain a crate::lightning::chain::Access or not
+ */
+typedef enum LDKCOption_AccessZ_Tag {
+   /**
+    * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access
+    */
+   LDKCOption_AccessZ_Some,
+   /**
+    * When we're in this state, this COption_AccessZ contains nothing
+    */
+   LDKCOption_AccessZ_None,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKCOption_AccessZ_Sentinel,
+} LDKCOption_AccessZ_Tag;
+
+typedef struct LDKCOption_AccessZ {
+   LDKCOption_AccessZ_Tag tag;
+   union {
+      struct {
+         struct LDKAccess some;
+      };
+   };
+} LDKCOption_AccessZ;
+
 
 
 /**
@@ -6649,6 +7435,61 @@ typedef struct 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;
+
+
+
 /**
  * A commitment_signed message to be sent or received from a peer
  */
@@ -7784,14 +8625,123 @@ typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
    bool result_ok;
 } LDKCResult_InvoiceSignOrCreationErrorZ;
 
+
+
 /**
- * A trait indicating an object may generate message send events
+ * 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
+ * the return value of [`Filter::register_output`].
+ *
+ * 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.
+ *
+ * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
+ * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
  */
-typedef struct LDKMessageSendEventsProvider {
+typedef struct MUST_USE_STRUCT LDKWatchedOutput {
    /**
-    * 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.
-    */
+    * 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 [`TemporaryFailure`].
+ *
+ * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
+ * [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.
+    */
+   void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
+   /**
+    * Registers interest in spends of a transaction output.
+    *
+    * Optionally, when `output.block_hash` is set, should return any transaction spending the
+    * output that is found in the corresponding block along with its index.
+    *
+    * This return value is useful for Electrum clients in order to supply in-block descendant
+    * transactions which otherwise were not included. This is not necessary for other clients if
+    * such descendant transactions were already included (e.g., when a BIP 157 client provides the
+    * full block).
+    */
+   struct LDKCOption_C2Tuple_usizeTransactionZZ (*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 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
@@ -7819,7 +8769,7 @@ typedef struct LDKEventHandler {
     *
     * See [`EventsProvider`] for details that must be considered when implementing this method.
     */
-   void (*handle_event)(const void *this_arg, struct LDKEvent event);
+   void (*handle_event)(const void *this_arg, const struct LDKEvent *NONNULL_PTR 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.
@@ -7969,31 +8919,6 @@ typedef struct MUST_USE_STRUCT LDKBestBlock {
    bool is_owned;
 } LDKBestBlock;
 
-/**
- * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
- * UTXOs.
- */
-typedef struct LDKAccess {
-   /**
-    * 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 transaction output of a funding transaction encoded by [`short_channel_id`].
-    * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
-    * is unknown.
-    *
-    * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
-    */
-   struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], 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);
-} LDKAccess;
-
 /**
  * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
  * chain.
@@ -8121,88 +9046,6 @@ typedef struct LDKConfirm {
    void (*free)(void *this_arg);
 } LDKConfirm;
 
-
-
-/**
- * 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
- * the return value of [`Filter::register_output`].
- *
- * 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.
- *
- * [`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 [`TemporaryFailure`].
- *
- * [`TemporaryFailure`]: channelmonitor::ChannelMonitorUpdateErr::TemporaryFailure
- * [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.
-    */
-   void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
-   /**
-    * Registers interest in spends of a transaction output.
-    *
-    * Optionally, when `output.block_hash` is set, should return any transaction spending the
-    * output that is found in the corresponding block along with its index.
-    *
-    * This return value is useful for Electrum clients in order to supply in-block descendant
-    * transactions which otherwise were not included. This is not necessary for other clients if
-    * such descendant transactions were already included (e.g., when a BIP 157 client provides the
-    * full block).
-    */
-   struct LDKCOption_C2Tuple_usizeTransactionZZ (*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;
-
 /**
  * `Persist` defines behavior for persisting channel monitors: this could mean
  * writing once to disk, and/or uploading to one or more backup services.
@@ -8345,6 +9188,26 @@ typedef struct MUST_USE_STRUCT LDKChainParameters {
 
 
 
+/**
+ * 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;
+
+
+
 /**
  * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
  * to better separate parameters.
@@ -8577,10 +9440,6 @@ typedef struct LDKRoutingMessageHandler {
     * false or returning an Err otherwise.
     */
    struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
-   /**
-    * Handle some updates to the route graph that we learned due to an outbound failed payment.
-    */
-   void (*handle_htlc_fail_channel_update)(const void *this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update);
    /**
     * Gets a subset of the 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
@@ -8592,6 +9451,8 @@ typedef struct LDKRoutingMessageHandler {
     * starting at the node *after* the provided publickey and including batch_amount entries
     * 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
     */
    struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
    /**
@@ -8634,6 +9495,62 @@ typedef struct LDKRoutingMessageHandler {
    void (*free)(void *this_arg);
 } LDKRoutingMessageHandler;
 
+/**
+ * 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;
+
+/**
+ * Handler for BOLT1-compliant messages.
+ */
+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;
+   /**
+    * Called with the message type that was received and the buffer to be read.
+    * Can return a `MessageHandlingError` if the message could not be handled.
+    */
+   struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
+   /**
+    * Gets the list of pending messages which were generated by the custom message
+    * handler, clearing the list in the process. The first tuple element must
+    * correspond to the intended recipients node ids. If no connection to one of the
+    * specified node does not exist, the message is simply not sent to it.
+    */
+   struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
+   /**
+    * 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;
+
 
 
 /**
@@ -8753,11 +9670,11 @@ typedef struct LDKSocketDescriptor {
     */
    uint64_t (*hash)(const void *this_arg);
    /**
-    * Creates a copy of the object pointed to by this_arg, for a copy of this SocketDescriptor.
-    * Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
-    * May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
+    * 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 *(*clone)(const void *this_arg);
+   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.
@@ -8850,24 +9767,22 @@ typedef struct MUST_USE_STRUCT LDKRouteHintHop {
 
 
 /**
- * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
- * This exists only to make accessing a RwLock<NetworkGraph> possible from
- * the C bindings, as it can be done directly in Rust code.
+ * A read-only view of [`NetworkGraph`].
  */
-typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
+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.
     */
-   LDKnativeLockedNetworkGraph *inner;
+   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;
-} LDKLockedNetworkGraph;
+} LDKReadOnlyNetworkGraph;
 
 
 
@@ -8877,6 +9792,9 @@ typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
  * This network graph is then used for routing payments.
  * Provides interface to help with initial routing sync by
  * serving historical announcements.
+ *
+ * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
+ * [`NetworkGraph`].
  */
 typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
    /**
@@ -8927,20 +9845,29 @@ typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
 
 
 /**
- * BackgroundProcessor takes care of tasks that (1) need to happen periodically to keep
+ * `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:
- * * Monitoring whether the ChannelManager needs to be re-persisted to disk, and if so,
+ * * 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()` and
- *   `PeerManager::timer_tick_occurred()` every minute (can be done in the
- *   background).
+ *   [`ChannelManager`] persistence should be done in the background.
+ * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
+ *   at the appropriate intervals.
+ *
+ * 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.
  *
- * Note that 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.
+ * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
+ * [`Event`]: lightning::util::events::Event
+ *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
  */
 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
    /**
@@ -9139,6 +10066,11 @@ struct LDKStr _ldk_c_bindings_get_compiled_version(void);
  */
 void Transaction_free(struct LDKTransaction _res);
 
+/**
+ * Convenience function for constructing a new TxOut
+ */
+struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
+
 /**
  * Frees the data pointed to by script_pubkey.
  */
@@ -9385,7 +10317,22 @@ void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_Built
 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
+ * 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);
+
+/**
+ * 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);
 
@@ -9441,6 +10388,42 @@ void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _r
  */
 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *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);
+
+/**
+ * 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);
+
+/**
+ * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
+ */
+void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
+
 /**
  * Creates a new CResult_NoneErrorZ in the success state.
  */
@@ -9660,6 +10643,27 @@ void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTran
  */
 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
 
+/**
+ * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::network_graph::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::network_graph::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);
+
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
@@ -9793,6 +10797,27 @@ void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_Spenda
  */
 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *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);
+
+/**
+ * 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);
+
 /**
  * Creates a new tuple which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
@@ -10074,6 +11099,27 @@ void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailu
  */
 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
 
+/**
+ * Creates a new CResult_PaymentHashPaymentSendFailureZ in the success state.
+ */
+struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
+
+/**
+ * Creates a new CResult_PaymentHashPaymentSendFailureZ in the error state.
+ */
+struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
+
+/**
+ * Frees any resources used by the CResult_PaymentHashPaymentSendFailureZ.
+ */
+void CResult_PaymentHashPaymentSendFailureZ_free(struct LDKCResult_PaymentHashPaymentSendFailureZ _res);
+
+/**
+ * Creates a new CResult_PaymentHashPaymentSendFailureZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_clone(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR orig);
+
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
@@ -10188,6 +11234,36 @@ void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _r
  */
 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
 
+/**
+ * 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 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);
+
+/**
+ * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
+ */
+void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
+
 /**
  * Creates a new CResult_SiPrefixNoneZ in the success state.
  */
@@ -10607,6 +11683,11 @@ void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tupl
  */
 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 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
  */
@@ -10622,6 +11703,42 @@ struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_B
  */
 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _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);
+
+/**
+ * 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 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 CResult_boolLightningErrorZ in the success state.
  */
@@ -10669,27 +11786,6 @@ void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LD
  */
 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _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);
-
-/**
- * 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);
-
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
@@ -10758,6 +11854,21 @@ void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _r
  */
 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
 
+/**
+ * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
+ */
+struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
+
+/**
+ * Constructs a new COption_AccessZ containing nothing
+ */
+struct LDKCOption_AccessZ COption_AccessZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::chain::Access, if we are in the Some state
+ */
+void COption_AccessZ_free(struct LDKCOption_AccessZ _res);
+
 /**
  * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
  */
@@ -11056,6 +12167,27 @@ void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecod
  */
 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);
+
+/**
+ * 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_CommitmentSignedDecodeErrorZ in the success state.
  */
@@ -11645,157 +12777,432 @@ void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCre
 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the Event
+ * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
  */
-void Event_free(struct LDKEvent this_ptr);
+struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
 
 /**
- * Creates a copy of the Event
+ * Constructs a new COption_FilterZ containing nothing
  */
-struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
+struct LDKCOption_FilterZ COption_FilterZ_none(void);
 
 /**
- * Serialize the Event object into a byte array which can be read by Event_read
+ * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
  */
-struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
+void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
 
 /**
- * Frees any resources used by the MessageSendEvent
+ * Frees any resources used by the PaymentPurpose
  */
-void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
+void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
 
 /**
- * Creates a copy of the MessageSendEvent
+ * Creates a copy of the PaymentPurpose
  */
-struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
+struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
 
 /**
- * Calls the free function if one is set
+ * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
  */
-void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
+struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t user_payment_id);
 
 /**
- * Calls the free function if one is set
+ * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
  */
-void EventsProvider_free(struct LDKEventsProvider this_ptr);
+struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
 
 /**
- * Calls the free function if one is set
+ * Frees any resources used by the ClosureReason
  */
-void EventHandler_free(struct LDKEventHandler this_ptr);
+void ClosureReason_free(struct LDKClosureReason this_ptr);
 
 /**
- * Frees any resources used by the APIError
+ * Creates a copy of the ClosureReason
  */
-void APIError_free(struct LDKAPIError this_ptr);
+struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
 
 /**
- * Creates a copy of the APIError
+ * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
  */
-struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
+struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
 
 /**
- * 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.
+ * Utility method to constructs a new HolderForceClosed-variant ClosureReason
  */
-struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
+struct LDKClosureReason ClosureReason_holder_force_closed(void);
 
 /**
- * Recovers the PublicKey of the signer of the message given the message and the signature.
+ * Utility method to constructs a new CooperativeClosure-variant ClosureReason
  */
-struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
+struct LDKClosureReason ClosureReason_cooperative_closure(void);
 
 /**
- * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
- * and the PublicKey.
+ * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
  */
-bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
+struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
 
 /**
- * Creates a copy of the Level
+ * Utility method to constructs a new ProcessingError-variant ClosureReason
  */
-enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
+struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
 
 /**
- * Checks if two Levels contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
  */
-bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
+struct LDKClosureReason ClosureReason_disconnected_peer(void);
 
 /**
- * Checks if two Levels contain equal inner contents.
+ * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
  */
-uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
+struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
 
 /**
- * Returns the most verbose logging level.
+ * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
  */
-MUST_USE_RES enum LDKLevel Level_max(void);
+struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
 
 /**
- * Calls the free function if one is set
+ * Frees any resources used by the Event
  */
-void Logger_free(struct LDKLogger this_ptr);
+void Event_free(struct LDKEvent this_ptr);
 
 /**
- * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the Event
  */
-void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
+struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
 
 /**
- * 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).
- *
- * Default value: 6.
+ * Utility method to constructs a new FundingGenerationReady-variant Event
  */
-uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id);
 
 /**
- * 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).
- *
- * Default value: 6.
+ * Utility method to constructs a new PaymentReceived-variant Event
  */
-void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
+struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amt, struct LDKPaymentPurpose purpose);
 
 /**
- * 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.
+ * Utility method to constructs a new PaymentSent-variant Event
  */
-uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
+struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_preimage);
 
 /**
- * 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.
+ * Utility method to constructs a new PaymentPathFailed-variant Event
+ */
+struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path);
+
+/**
+ * Utility method to constructs a new PendingHTLCsForwardable-variant Event
+ */
+struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
+
+/**
+ * Utility method to constructs a new SpendableOutputs-variant Event
+ */
+struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
+
+/**
+ * Utility method to constructs a new PaymentForwarded-variant Event
+ */
+struct LDKEvent Event_payment_forwarded(struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx);
+
+/**
+ * Utility method to constructs a new ChannelClosed-variant Event
+ */
+struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKClosureReason reason);
+
+/**
+ * Serialize the Event object into a byte array which can be read by Event_read
+ */
+struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
+
+/**
+ * Frees any resources used by the MessageSendEvent
+ */
+void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
+
+/**
+ * Creates a copy of the MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
+
+/**
+ * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
+
+/**
+ * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
+
+/**
+ * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
+
+/**
+ * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_funding_locked(struct LDKPublicKey node_id, struct LDKFundingLocked msg);
+
+/**
+ * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
+
+/**
+ * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
+
+/**
+ * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
+
+/**
+ * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
+
+/**
+ * Utility method to constructs a new SendShutdown-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
+
+/**
+ * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
+
+/**
+ * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
+
+/**
+ * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
+
+/**
+ * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
+
+/**
+ * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
+
+/**
+ * Utility method to constructs a new HandleError-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
+
+/**
+ * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
+
+/**
+ * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
+
+/**
+ * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
+ */
+struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
+
+/**
+ * Calls the free function if one is set
+ */
+void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
+
+/**
+ * Calls the free function if one is set
+ */
+void EventsProvider_free(struct LDKEventsProvider this_ptr);
+
+/**
+ * Calls the free function if one is set
+ */
+void EventHandler_free(struct LDKEventHandler this_ptr);
+
+/**
+ * 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 RouteError-variant APIError
+ */
+struct LDKAPIError APIError_route_error(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 MonitorUpdateFailed-variant APIError
+ */
+struct LDKAPIError APIError_monitor_update_failed(void);
+
+/**
+ * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
+ */
+struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
+
+/**
+ * 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 LDKCResult_StringErrorZ 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_PublicKeyErrorZ 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);
+
+/**
+ * Creates a copy of the Level
+ */
+enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
+
+/**
+ * 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);
+
+/**
+ * Checks if two Levels contain equal inner contents.
+ */
+uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
+
+/**
+ * Returns the most verbose logging level.
+ */
+MUST_USE_RES enum LDKLevel Level_max(void);
+
+/**
+ * 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).
+ *
+ * Default value: 6.
+ */
+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).
+ *
+ * Default value: 6.
+ */
+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);
 
@@ -12167,10 +13574,100 @@ bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelCon
  */
 void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
 
+/**
+ * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
+ * small to claim on-chain.
+ *
+ * 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 sustantial if there are many dust HTLCs present when the
+ * channel is force-closed.
+ *
+ * This limit is applied for sent, forwarded, and received HTLCs and limits the total
+ * exposure across all three types per-channel. Setting this too low may prevent the
+ * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
+ * important to prevent stealing of dust HTLCs by miners.
+ *
+ * Default value: 5_000_000 msat.
+ */
+uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
+ * small to claim on-chain.
+ *
+ * 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 sustantial if there are many dust HTLCs present when the
+ * channel is force-closed.
+ *
+ * This limit is applied for sent, forwarded, and received HTLCs and limits the total
+ * exposure across all three types per-channel. Setting this too low may prevent the
+ * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
+ * important to prevent stealing of dust HTLCs by miners.
+ *
+ * Default value: 5_000_000 msat.
+ */
+void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t 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 [`Background`] and [`Normal`] 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
+ * [`Normal`] 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
+ * [`Background`] 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 satoshis.
+ *
+ * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
+ * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
+ */
+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 [`Background`] and [`Normal`] 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
+ * [`Normal`] 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
+ * [`Background`] 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 satoshis.
+ *
+ * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
+ * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
+ */
+void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t 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, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
+MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg);
 
 /**
  * Creates a copy of the ChannelConfig
@@ -12318,6 +13815,16 @@ MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR th
  */
 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new UnknownChain-variant AccessError
+ */
+enum LDKAccessError AccessError_unknown_chain(void);
+
+/**
+ * Utility method to constructs a new UnknownTx-variant AccessError
+ */
+enum LDKAccessError AccessError_unknown_tx(void);
+
 /**
  * Calls the free function if one is set
  */
@@ -12350,11 +13857,15 @@ void WatchedOutput_free(struct LDKWatchedOutput this_obj);
 
 /**
  * First block where the transaction output may have been spent.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
 
 /**
  * First block where the transaction output may have been spent.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
@@ -12403,6 +13914,27 @@ void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
  */
 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new Background-variant ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_background(void);
+
+/**
+ * Utility method to constructs a new Normal-variant ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_normal(void);
+
+/**
+ * Utility method to constructs a new HighPriority-variant ConfirmationTarget
+ */
+enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
+
+/**
+ * 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
  */
@@ -12422,7 +13954,20 @@ void ChainMonitor_free(struct LDKChainMonitor this_obj);
  * 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 LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
+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`, allowing you to filter out balances from channels which are still open
+ * (and whose balance should likely be pulled from the [`ChannelDetails`]).
+ *
+ * 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);
 
 /**
  * Constructs a new Listen which calls the relevant methods on this_arg.
@@ -12503,6 +14048,16 @@ struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(str
  */
 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new TemporaryFailure-variant ChannelMonitorUpdateErr
+ */
+enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
+
+/**
+ * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateErr
+ */
+enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
+
 /**
  * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
  */
@@ -12523,6 +14078,16 @@ void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
  */
 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 CommitmentTxConfirmed-variant MonitorEvent
+ */
+struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
+
 /**
  * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
  */
@@ -12543,6 +14108,42 @@ struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj)
  */
 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
 
+/**
+ * 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 claimable_amount_satoshis);
+
+/**
+ * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
+ */
+struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
+
+/**
+ * Utility method to constructs a new ContentiousClaimable-variant Balance
+ */
+struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
+
+/**
+ * Utility method to constructs a new MaybeClaimableHTLCAwaitingTimeout-variant Balance
+ */
+struct LDKBalance Balance_maybe_claimable_htlcawaiting_timeout(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
+
+/**
+ * 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);
+
 /**
  * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
  */
@@ -12678,6 +14279,24 @@ MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct
  */
 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
 
+/**
+ * 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 the balances available when you or your counterparty have broadcasted revoked
+ * state(s) may not be fully captured here.
+ *
+ * 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);
+
 /**
  * Calls the free function if one is set
  */
@@ -12922,6 +14541,21 @@ void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr
  */
 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
+ */
+struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
+
+/**
+ * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
+ */
+struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
+
+/**
+ * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
+ */
+struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
+
 /**
  * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
  */
@@ -13212,6 +14846,55 @@ MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork netwo
  */
 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
 
+/**
+ * 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);
+
 /**
  * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
  */
@@ -13263,6 +14946,27 @@ uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDK
  */
 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);
+
+/**
+ * Constructs a new ChannelCounterparty given each field
+ */
+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);
+
 /**
  * Creates a copy of the ChannelCounterparty
  */
@@ -13305,6 +15009,8 @@ void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_
  *
  * Note that, if this has been set, `channel_id` will be equivalent to
  * `funding_txo.unwrap().to_channel_id()`.
+ *
+ * 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);
 
@@ -13314,6 +15020,8 @@ struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails
  *
  * Note that, if this has been set, `channel_id` will be equivalent to
  * `funding_txo.unwrap().to_channel_id()`.
+ *
+ * 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);
 
@@ -13555,6 +15263,26 @@ void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
  */
 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new ParameterError-variant PaymentSendFailure
+ */
+struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
+
+/**
+ * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
+ */
+struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
+
+/**
+ * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
+ */
+struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
+
+/**
+ * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
+ */
+struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ a);
+
 /**
  * Constructs a new ChannelManager to hold several channels and route between them.
  *
@@ -13594,6 +15322,8 @@ MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configurati
  * 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.
+ *
+ * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_id, struct LDKUserConfig override_config);
 
@@ -13618,10 +15348,45 @@ MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(
  * 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 [`Background`] and
+ *    [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
+ *    estimate.
+ *  * If our counterparty is the channel initiator, we will require a channel closing
+ *    transaction feerate of at least our [`Background`] 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.
+ *
+ * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
+ * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
+ * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
  */
 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]);
 
+/**
+ * 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 [`Normal`] 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).
+ *
+ * May generate a SendShutdown message event on success, which should be relayed.
+ *
+ * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
+ * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
+ * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_target_feerate(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], uint32_t target_feerate_sats_per_1000_weight);
+
 /**
  * Force closes a channel, immediately broadcasting the latest local commitment transaction to
  * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager.
@@ -13674,9 +15439,31 @@ void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NON
  * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
  * bit set (either as required or as available). If multiple paths are present in the Route,
  * we assume the invoice had the basic_mpp feature set.
+ *
+ * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
 
+/**
+ * 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.
+ *
+ * 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.
+ *
+ * Note that `route` must have exactly one path.
+ *
+ * [`send_payment`]: Self::send_payment
+ *
+ * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKCResult_PaymentHashPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
+
 /**
  * Call this upon creation of a funding transaction for the given channel.
  *
@@ -13732,13 +15519,16 @@ void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *
 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
 /**
- * If a peer is disconnected we mark any channels with that peer as 'disabled'.
- * After some time, if channels are still disabled we need to broadcast a ChannelUpdate
- * to inform the network about the uselessness of these channels.
+ * Performs actions which should happen on startup and roughly once per minute thereafter.
  *
- * This method handles all the details, and must be called roughly once per minute.
+ * 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.
  *
- * Note that in some rare cases this may generate a `chain::Watch::update_channel` call.
+ * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
+ * estimate fetches.
  */
 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
@@ -13828,7 +15618,7 @@ MUST_USE_RES struct LDKC2Tuple_PaymentHashPaymentSecretZ ChannelManager_create_i
  * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
  * method may return an Err if another payment with the same payment_hash is still pending.
  *
- * `user_payment_id` will be provided back in [`PaymentReceived::user_payment_id`] events to
+ * `user_payment_id` will be provided back in [`PaymentPurpose::InvoicePayment::user_payment_id`] events to
  * allow tracking of which events correspond with which calls to this and
  * [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
  * copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
@@ -13862,7 +15652,7 @@ MUST_USE_RES struct LDKC2Tuple_PaymentHashPaymentSecretZ ChannelManager_create_i
  *
  * [`create_inbound_payment`]: Self::create_inbound_payment
  * [`PaymentReceived`]: events::Event::PaymentReceived
- * [`PaymentReceived::user_payment_id`]: events::Event::PaymentReceived::user_payment_id
+ * [`PaymentPurpose::InvoicePayment::user_payment_id`]: events::PaymentPurpose::InvoicePayment::user_payment_id
  */
 MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ 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, uint64_t user_payment_id);
 
@@ -14540,12 +16330,12 @@ uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated
 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * The signature of the channel initiator (funder) on the funding transaction
+ * The signature of the channel initiator (funder) on the initial commitment transaction
  */
 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
 
 /**
- * The signature of the channel initiator (funder) on the funding transaction
+ * The signature of the channel initiator (funder) on the initial commitment transaction
  */
 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
 
@@ -14575,12 +16365,12 @@ const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONN
 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
 
 /**
- * The signature of the channel acceptor (fundee) on the funding transaction
+ * The signature of the channel acceptor (fundee) on the initial commitment transaction
  */
 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
 
 /**
- * The signature of the channel acceptor (fundee) on the funding transaction
+ * The signature of the channel acceptor (fundee) on the initial commitment transaction
  */
 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
 
@@ -14666,6 +16456,45 @@ MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id
  */
 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
 
+/**
+ * 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);
+
 /**
  * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
  */
@@ -14701,10 +16530,26 @@ struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *N
  */
 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature 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
  */
-MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg);
+MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
 
 /**
  * Creates a copy of the ClosingSigned
@@ -15148,6 +16993,26 @@ void NetAddress_free(struct LDKNetAddress this_ptr);
  */
 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new IPv4-variant NetAddress
+ */
+struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
+
+/**
+ * Utility method to constructs a new IPv6-variant NetAddress
+ */
+struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
+
+/**
+ * Utility method to constructs a new OnionV2-variant NetAddress
+ */
+struct LDKNetAddress NetAddress_onion_v2(struct LDKTenBytes addr, uint16_t port);
+
+/**
+ * Utility method to constructs a new OnionV3-variant NetAddress
+ */
+struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
+
 /**
  * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
  */
@@ -15778,6 +17643,26 @@ void ErrorAction_free(struct LDKErrorAction this_ptr);
  */
 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 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 SendErrorMessage-variant ErrorAction
+ */
+struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
+
 /**
  * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
  */
@@ -15818,21 +17703,41 @@ struct LDKLightningError LightningError_clone(const struct LDKLightningError *NO
  */
 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
  */
@@ -15840,11 +17745,15 @@ void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate
 
 /**
  * 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);
 
@@ -15868,16 +17777,6 @@ MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(struct LDKCVec_Upda
  */
 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
 
-/**
- * Frees any resources used by the HTLCFailChannelUpdate
- */
-void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr);
-
-/**
- * Creates a copy of the HTLCFailChannelUpdate
- */
-struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
-
 /**
  * Calls the free function if one is set
  */
@@ -15928,6 +17827,16 @@ struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PT
  */
 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
 
+/**
+ * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
+ */
+struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
+
+/**
+ * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
+ */
+struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
+
 /**
  * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
  */
@@ -16159,14 +18068,14 @@ struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(str
 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
 
 /**
- * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
+ * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
  */
-struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
+struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
 
 /**
- * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
+ * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
  */
-struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
+struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
 
 /**
  *\n\t * Calculates the overflow safe ending block height for the query.\n\t * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`\n\t
@@ -16174,14 +18083,14 @@ struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChann
 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
 
 /**
- * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
+ * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
  */
-struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
+struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
 
 /**
- * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
+ * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
  */
-struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
+struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
 
 /**
  * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
@@ -16193,15 +18102,20 @@ struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LD
  */
 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
 
+/**
+ * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
+ */
+struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
+
 /**
  * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
  */
 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
 
 /**
- * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
+ * Calls the free function if one is set
  */
-struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
+void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
 
 /**
  * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
@@ -16225,6 +18139,18 @@ struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsP
  */
 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
 
+/**
+ * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
+ */
+struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
+ */
+struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
+
 /**
  * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
  */
@@ -16338,7 +18264,7 @@ void PeerManager_free(struct LDKPeerManager this_obj);
  * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
  * cryptographically secure random bytes.
  */
-MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger);
+MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKCustomMessageHandler custom_message_handler);
 
 /**
  * Get the list of node ids for peers which have completed the initial handshake.
@@ -16420,6 +18346,9 @@ MUST_USE_RES struct LDKCResult_boolPeerHandleErrorZ PeerManager_read_event(const
  * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
  * issues!
  *
+ * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
+ * or one of the other clients provided in our language bindings.
+ *
  * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
  * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
  * [`send_data`]: SocketDescriptor::send_data
@@ -16445,9 +18374,12 @@ void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR th
 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
 
 /**
- * This function should be called roughly once every 30 seconds.
- * It will send pings to each peer and disconnect those which did not respond to the last
- * round of pings.
+ * Send pings to each peer and disconnect those which did not respond to the last round of
+ * pings.
+ *
+ * This may be called on any timescale you want, however, roughly once every five to ten
+ * seconds is preferred. The call rate determines both how often we send a ping to our peers
+ * and how much time they have to respond before we disconnect them.
  *
  * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
  * issues!
@@ -16461,6 +18393,11 @@ void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR th
  */
 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
 
+/**
+ * Build a closing transaction
+ */
+struct LDKTransaction build_closing_transaction(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint);
+
 /**
  * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
  * from the base secret and the per_commitment_point.
@@ -16849,22 +18786,30 @@ void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelT
 /**
  * The late-bound counterparty channel transaction parameters.
  * These parameters are populated at the point in the protocol where the counterparty provides them.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
 
 /**
  * The late-bound counterparty channel transaction parameters.
  * These parameters are populated at the point in the protocol where the counterparty provides them.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
 
 /**
  * The late-bound funding outpoint
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
 
 /**
  * The late-bound funding outpoint
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
 
@@ -17093,6 +19038,79 @@ MUST_USE_RES struct LDKThirtyTwoBytes BuiltCommitmentTransaction_get_sighash_all
  */
 MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
 
+/**
+ * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
+ */
+void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
+
+/**
+ * Construct an object of the class
+ */
+MUST_USE_RES struct LDKClosingTransaction ClosingTransaction_new(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint);
+
+/**
+ * Trust our pre-built transaction.
+ *
+ * Applies a wrapper which allows access to the transaction.
+ *
+ * This should only be used if you fully trust the builder of this object. It should not
+ * be used by an external signer - instead use the verify function.
+ */
+MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
+
+/**
+ * Verify our pre-built transaction.
+ *
+ * Applies a wrapper which allows access to the transaction.
+ *
+ * An external validating signer must call this method before signing
+ * or using the built transaction.
+ */
+MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
+
+/**
+ * The value to be sent to the holder, or zero if the output will be omitted
+ */
+MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
+
+/**
+ * The value to be sent to the counterparty, or zero if the output will be omitted
+ */
+MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
+
+/**
+ * The destination of the holder's output
+ */
+MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
+
+/**
+ * The destination of the counterparty's output
+ */
+MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
+
+/**
+ * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
+ */
+void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
+
+/**
+ * The pre-built Bitcoin commitment transaction
+ */
+MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
+
+/**
+ * Get the SIGHASH_ALL sighash value of the transaction.
+ *
+ * This can be used to verify a signature.
+ */
+MUST_USE_RES struct LDKThirtyTwoBytes TrustedClosingTransaction_get_sighash_all(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
+
+/**
+ * Sign a transaction, either because we are counter-signing the counterparty's transaction or
+ * because we are about to broadcast a holder transaction.
+ */
+MUST_USE_RES struct LDKSignature TrustedClosingTransaction_sign(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
+
 /**
  * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
  */
@@ -17139,7 +19157,7 @@ MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommi
  * Applies a wrapper which allows access to these fields.
  *
  * This should only be used if you fully trust the builder of this object.  It should not
- *\tbe used by an external signer - instead use the verify function.
+ * be used by an external signer - instead use the verify function.
  */
 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
 
@@ -17269,6 +19287,12 @@ MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
  */
 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
 
+/**
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
+ */
+MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
+
 /**
  * Create a blank Features with no features set
  */
@@ -17279,6 +19303,12 @@ MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
  */
 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
 
+/**
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
+ */
+MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
+
 /**
  * Create a blank Features with no features set
  */
@@ -17289,6 +19319,12 @@ MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
  */
 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
 
+/**
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
+ */
+MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
+
 /**
  * Create a blank Features with no features set
  */
@@ -17299,6 +19335,12 @@ MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
  */
 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
 
+/**
+ * Returns true if this `Features` object contains unknown feature flags which are set as
+ * \"required\".
+ */
+MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
+
 /**
  * Returns whether the `payment_secret` feature is supported.
  */
@@ -17354,6 +19396,101 @@ struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8s
  */
 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
 
+/**
+ * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
+ */
+void ShutdownScript_free(struct LDKShutdownScript this_obj);
+
+/**
+ * Creates a copy of the ShutdownScript
+ */
+struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
+
+/**
+ * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
+ */
+void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
+
+/**
+ * The script that did not meet the requirements from [BOLT #2].
+ *
+ * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
+ */
+struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
+
+/**
+ * The script that did not meet the requirements from [BOLT #2].
+ *
+ * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md
+ */
+void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
+
+/**
+ * Constructs a new InvalidShutdownScript given each field
+ */
+MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
+
+/**
+ * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
+ */
+struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
+
+/**
+ * Read a ShutdownScript from a byte array, created by ShutdownScript_write
+ */
+struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
+
+/**
+ * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
+ */
+MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
+
+/**
+ * Generates a P2WSH script pubkey from the given [`WScriptHash`].
+ */
+MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
+
+/**
+ * Generates a witness script pubkey from the given segwit version and program.
+ *
+ * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
+ * [`ShutdownScript::new_p2wsh`] instead.
+ *
+ * # Errors
+ *
+ * This function may return an error if `program` is invalid for the segwit `version`.
+ */
+MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(uint8_t version, struct LDKu8slice program);
+
+/**
+ * Converts the shutdown script into the underlying [`Script`].
+ */
+MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
+
+/**
+ * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
+
+/**
+ * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
+ *
+ * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
+ */
+MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
+
+/**
+ * Calls the free function if one is set
+ */
+void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
+
+/**
+ * Calls the free function if one is set
+ */
+void Type_free(struct LDKType this_ptr);
+
 /**
  * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
  */
@@ -17439,6 +19576,18 @@ MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, str
  */
 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
 
+/**
+ * Checks if two RouteHops contain equal inner contents.
+ */
+uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
+
+/**
+ * Checks if two RouteHops 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 RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
+
 /**
  * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
  */
@@ -17454,6 +19603,16 @@ struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
  */
 void Route_free(struct LDKRoute this_obj);
 
+/**
+ * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
+ * last RouteHop in each path must be the same.
+ * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
+ * destination. Thus, this must always be at least length one. While the maximum length of any
+ * given path is variable, keeping the length of any path to less than 20 should currently
+ * ensure it is viable.
+ */
+struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
+
 /**
  * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
  * last RouteHop in each path must be the same.
@@ -17474,6 +19633,31 @@ MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg)
  */
 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
 
+/**
+ * Checks if two Routes contain equal inner contents.
+ */
+uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
+
+/**
+ * Checks if two Routes 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 Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
+
+/**
+ * Returns the total amount of fees paid on this [`Route`].
+ *
+ * This doesn't include any extra payment made to the recipient, which can happen in excess of
+ * the amount passed to [`get_route`]'s `final_value_msat`.
+ */
+MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
+
+/**
+ * Returns the total amount paid on this [`Route`], excluding the fees.
+ */
+MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
+
 /**
  * Serialize the Route object into a byte array which can be read by Route_read
  */
@@ -17489,17 +19673,22 @@ struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
  */
 void RouteHint_free(struct LDKRouteHint this_obj);
 
+/**
+ * Creates a copy of the RouteHint
+ */
+struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
+
 /**
  * Checks if two RouteHints 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 RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
+uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
 
 /**
- * Creates a copy of the RouteHint
+ * Checks if two RouteHints 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.
  */
-struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
+bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
 
 /**
  * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
@@ -17571,6 +19760,16 @@ void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this
  */
 MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg);
 
+/**
+ * Creates a copy of the RouteHintHop
+ */
+struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
+
+/**
+ * Checks if two RouteHintHops contain equal inner contents.
+ */
+uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
+
 /**
  * Checks if two RouteHintHops contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -17579,9 +19778,13 @@ MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_nod
 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
 
 /**
- * Creates a copy of the RouteHintHop
+ * Gets a keysend route from us (payer) to the given target node (payee). This is needed because
+ * keysend payments do not have an invoice from which to pull the payee's supported features, which
+ * makes it tricky to otherwise supply the `payee_features` parameter of `get_route`.
+ *
+ * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
+struct LDKCResult_RouteLightningErrorZ get_keysend_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
 
 /**
  * Gets a route from us (payer) to the given target node (payee).
@@ -17603,6 +19806,9 @@ struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_
  * The fees on channels from us to next-hops are ignored (as they are assumed to all be
  * equal), however the enabled/disabled bit on such channels as well as the
  * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
+ *
+ * Note that payee_features (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
 
@@ -17617,49 +19823,76 @@ void NetworkGraph_free(struct LDKNetworkGraph this_obj);
 struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the LockedNetworkGraph, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
+ */
+void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
+
+/**
+ * Frees any resources used by the NetworkUpdate
+ */
+void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
+
+/**
+ * Creates a copy of the NetworkUpdate
+ */
+struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
+ */
+struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
+
+/**
+ * Utility method to constructs a new ChannelClosed-variant NetworkUpdate
+ */
+struct LDKNetworkUpdate NetworkUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent);
+
+/**
+ * Utility method to constructs a new NodeFailure-variant NetworkUpdate
+ */
+struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
+
+/**
+ * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
+ */
+struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
+
+/**
+ * Constructs a new EventHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
  */
-void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
+struct LDKEventHandler NetGraphMsgHandler_as_EventHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
 
 /**
  * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
  */
 void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
 
+/**
+ * Representation of the payment channel network
+ */
+struct LDKNetworkGraph NetGraphMsgHandler_get_network_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_ptr);
+
+/**
+ * Representation of the payment channel network
+ */
+void NetGraphMsgHandler_set_network_graph(struct LDKNetGraphMsgHandler *NONNULL_PTR this_ptr, struct LDKNetworkGraph val);
+
 /**
  * Creates a new tracker of the actual state of the network of channels and nodes,
- * assuming a fresh network graph.
+ * assuming an existing Network Graph.
  * Chain monitor is used to make sure announced channels exist on-chain,
  * channel data is correct, and that the announcement is signed with
  * channel owners' keys.
  */
-MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger);
-
-/**
- * Creates a new tracker of the actual state of the network of channels and nodes,
- * assuming an existing Network Graph.
- */
-MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph);
+MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKNetworkGraph network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
 
 /**
  * Adds a provider used to check new announcements. Does not affect
  * existing announcements unless they are updated.
  * Add, update or remove the provider would replace the current one.
  */
-void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKAccess *chain_access);
-
-/**
- * Take a read lock on the network_graph and return it in the C-bindings
- * newtype helper. This is likely only useful when called via the C
- * bindings as you can call `self.network_graph.read().unwrap()` in Rust
- * yourself.
- */
-MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
-
-/**
- * Get a reference to the NetworkGraph which this read-lock contains.
- */
-MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg);
+void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
 
 /**
  * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
@@ -17745,6 +19978,8 @@ void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_P
  * Mostly redundant with the data we store in fields explicitly.
  * Everything else is useful only for sending out for initial routing sync.
  * Not stored if contains excess data to prevent DoS.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr);
 
@@ -17753,6 +19988,8 @@ struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const str
  * Mostly redundant with the data we store in fields explicitly.
  * Everything else is useful only for sending out for initial routing sync.
  * Not stored if contains excess data to prevent DoS.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
 
@@ -17803,11 +20040,15 @@ void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struc
 
 /**
  * Details about the first direction of a channel
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
 
 /**
  * Details about the first direction of a channel
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
 
@@ -17823,11 +20064,15 @@ void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struc
 
 /**
  * Details about the second direction of a channel
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
 
 /**
  * Details about the second direction of a channel
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val);
 
@@ -17846,6 +20091,8 @@ void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr,
  * Mostly redundant with the data we store in fields explicitly.
  * Everything else is useful only for sending out for initial routing sync.
  * Not stored if contains excess data to prevent DoS.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
 
@@ -17854,6 +20101,8 @@ struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct
  * Mostly redundant with the data we store in fields explicitly.
  * Everything else is useful only for sending out for initial routing sync.
  * Not stored if contains excess data to prevent DoS.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
 
@@ -17921,6 +20170,11 @@ bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDK
  */
 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
 
+/**
+ * Checks if two RoutingFeess contain equal inner contents.
+ */
+uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
+
 /**
  * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
  */
@@ -17992,6 +20246,8 @@ void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_
  * Mostly redundant with the data we store in fields explicitly.
  * Everything else is useful only for sending out for initial routing sync.
  * Not stored if contains excess data to prevent DoS.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
 
@@ -18000,6 +20256,8 @@ struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const s
  * Mostly redundant with the data we store in fields explicitly.
  * Everything else is useful only for sending out for initial routing sync.
  * Not stored if contains excess data to prevent DoS.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
 
@@ -18037,6 +20295,8 @@ void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKC
  * Lowest fees enabling routing via any of the enabled, known channels to a node.
  * The two fields (flat and proportional fee) are independent,
  * meaning they don't have to refer to the same channel.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
 
@@ -18044,6 +20304,8 @@ struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKN
  * Lowest fees enabling routing via any of the enabled, known channels to a node.
  * The two fields (flat and proportional fee) are independent,
  * meaning they don't have to refer to the same channel.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
 
@@ -18051,6 +20313,8 @@ void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR th
  * More information about a node from node_announcement.
  * Optional because we store a Node entry after learning about it from
  * a channel announcement, but before receiving a node announcement.
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
 
@@ -18058,6 +20322,8 @@ struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNo
  * More information about a node from node_announcement.
  * Optional because we store a Node entry after learning about it from
  * a channel announcement, but before receiving a node announcement.
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
 
@@ -18096,6 +20362,11 @@ struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice s
  */
 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash);
 
+/**
+ * Returns a read-only view of the network graph.
+ */
+MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
+
 /**
  * For an already known node (from channel announcements), update its stored properties from a
  * given node announcement.
@@ -18104,7 +20375,7 @@ MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes ge
  * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
  * routing messages from a source using a protocol other than the lightning P2P protocol.
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
 
 /**
  * For an already known node (from channel announcements), update its stored properties from a
@@ -18112,7 +20383,7 @@ MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from
  * given the associated signatures here we cannot relay the node announcement to any of our
  * peers.
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg);
 
 /**
  * Store or update channel info from a channel announcement.
@@ -18124,7 +20395,7 @@ MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from
  * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
  * the corresponding UTXO exists on chain and is correctly-formatted.
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKAccess *chain_access);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_AccessZ chain_access);
 
 /**
  * Store or update channel info from a channel announcement without verifying the associated
@@ -18134,7 +20405,7 @@ MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_f
  * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
  * the corresponding UTXO exists on chain and is correctly-formatted.
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKAccess *chain_access);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_AccessZ chain_access);
 
 /**
  * Close a channel if a corresponding HTLC fail was sent.
@@ -18142,7 +20413,12 @@ MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_f
  * May cause the removal of nodes too, if this was their last channel.
  * If not permanent, makes channels unavailable for routing.
  */
-void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
+void NetworkGraph_close_channel_from_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
+
+/**
+ * Marks a node in the graph as failed.
+ */
+void NetworkGraph_fail_node(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
 
 /**
  * For an already known (from announcement) channel, update info about one of the directions
@@ -18152,14 +20428,14 @@ void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR
  * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
  * routing messages from a source using a protocol other than the lightning P2P protocol.
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
 
 /**
  * For an already known (from announcement) channel, update info about one of the directions
  * of the channel without verifying the associated signatures. Because we aren't given the
  * associated signatures here we cannot relay the channel update to any of our peers.
  */
-MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
+MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
 
 /**
  * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
@@ -18205,29 +20481,66 @@ void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
 void ChannelManagerPersister_free(struct LDKChannelManagerPersister this_ptr);
 
 /**
- * Start a background thread that takes care of responsibilities enumerated in the top-level
- * documentation.
+ * Start a background thread that takes care of responsibilities enumerated in the [top-level
+ * documentation].
  *
- * If `persist_manager` returns an error, then this thread will return said error (and
- * `start()` will need to be called again to restart the `BackgroundProcessor`). Users should
- * wait on [`thread_handle`]'s `join()` method to be able to tell if and when an error is
- * returned, or implement `persist_manager` such that an error is never returned to the
- * `BackgroundProcessor`
+ * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
+ * `persist_manager` returns an error. In case of an error, the error is retrieved by calling
+ * either [`join`] or [`stop`].
+ *
+ * # Data Persistence
  *
  * `persist_manager` is responsible for writing out the [`ChannelManager`] to disk, and/or
  * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
  * [`ChannelManager`]. See [`FilesystemPersister::persist_manager`] for Rust-Lightning's
  * provided implementation.
  *
- * [`thread_handle`]: BackgroundProcessor::thread_handle
+ * Typically, users should either implement [`ChannelManagerPersister`] to never return an
+ * error or call [`join`] and handle any error that may arise. For the latter case,
+ * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
+ *
+ * # Event Handling
+ *
+ * `event_handler` is responsible for handling events that users should be notified of (e.g.,
+ * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
+ * functionality implemented by other handlers.
+ * * [`NetGraphMsgHandler`] if given will update the [`NetworkGraph`] based on payment failures.
+ *
+ * [top-level documentation]: Self
+ * [`join`]: Self::join
+ * [`stop`]: Self::stop
  * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
  * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
  * [`FilesystemPersister::persist_manager`]: lightning_persister::FilesystemPersister::persist_manager
+ * [`NetworkGraph`]: lightning::routing::network_graph::NetworkGraph
+ *
+ * Note that net_graph_msg_handler (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKChannelManagerPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKNetGraphMsgHandler net_graph_msg_handler, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger);
+
+/**
+ * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
+ * [`ChannelManager`].
+ *
+ * # Panics
+ *
+ * This function panics if the background thread has panicked such as while persisting or
+ * handling events.
+ *
+ * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
  */
-MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKChannelManagerPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger);
+MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
 
 /**
- * Stop `BackgroundProcessor`'s thread.
+ * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
+ * [`ChannelManager`].
+ *
+ * # Panics
+ *
+ * This function panics if the background thread has panicked such as while persisting or
+ * handling events.
+ *
+ * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
  */
 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
 
@@ -18358,6 +20671,26 @@ struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTime
  */
 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new Milli-variant SiPrefix
+ */
+enum LDKSiPrefix SiPrefix_milli(void);
+
+/**
+ * Utility method to constructs a new Micro-variant SiPrefix
+ */
+enum LDKSiPrefix SiPrefix_micro(void);
+
+/**
+ * Utility method to constructs a new Nano-variant SiPrefix
+ */
+enum LDKSiPrefix SiPrefix_nano(void);
+
+/**
+ * Utility method to constructs a new Pico-variant SiPrefix
+ */
+enum LDKSiPrefix SiPrefix_pico(void);
+
 /**
  * Checks if two SiPrefixs contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -18375,6 +20708,36 @@ MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR th
  */
 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new Bitcoin-variant Currency
+ */
+enum LDKCurrency Currency_bitcoin(void);
+
+/**
+ * Utility method to constructs a new BitcoinTestnet-variant Currency
+ */
+enum LDKCurrency Currency_bitcoin_testnet(void);
+
+/**
+ * Utility method to constructs a new Regtest-variant Currency
+ */
+enum LDKCurrency Currency_regtest(void);
+
+/**
+ * Utility method to constructs a new Simnet-variant Currency
+ */
+enum LDKCurrency Currency_simnet(void);
+
+/**
+ * Utility method to constructs a new Signet-variant Currency
+ */
+enum LDKCurrency Currency_signet(void);
+
+/**
+ * Checks if two Currencys contain equal inner contents.
+ */
+uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
+
 /**
  * Checks if two Currencys contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -18386,6 +20749,16 @@ bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *
  */
 void Sha256_free(struct LDKSha256 this_obj);
 
+/**
+ * Creates a copy of the Sha256
+ */
+struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
+
+/**
+ * Checks if two Sha256s contain equal inner contents.
+ */
+uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
+
 /**
  * Checks if two Sha256s contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -18394,14 +20767,19 @@ void Sha256_free(struct LDKSha256 this_obj);
 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
 
 /**
- * Creates a copy of the Sha256
+ * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
  */
-struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
+void Description_free(struct LDKDescription this_obj);
 
 /**
- * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the Description
  */
-void Description_free(struct LDKDescription this_obj);
+struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
+
+/**
+ * Checks if two Descriptions contain equal inner contents.
+ */
+uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
 
 /**
  * Checks if two Descriptions contain equal inner contents.
@@ -18411,14 +20789,19 @@ void Description_free(struct LDKDescription this_obj);
 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
 
 /**
- * Creates a copy of the Description
+ * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
  */
-struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
+void PayeePubKey_free(struct LDKPayeePubKey this_obj);
 
 /**
- * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the PayeePubKey
  */
-void PayeePubKey_free(struct LDKPayeePubKey this_obj);
+struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
+
+/**
+ * Checks if two PayeePubKeys contain equal inner contents.
+ */
+uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
 
 /**
  * Checks if two PayeePubKeys contain equal inner contents.
@@ -18428,14 +20811,19 @@ void PayeePubKey_free(struct LDKPayeePubKey this_obj);
 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
 
 /**
- * Creates a copy of the PayeePubKey
+ * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
  */
-struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
+void ExpiryTime_free(struct LDKExpiryTime this_obj);
 
 /**
- * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the ExpiryTime
  */
-void ExpiryTime_free(struct LDKExpiryTime this_obj);
+struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
+
+/**
+ * Checks if two ExpiryTimes contain equal inner contents.
+ */
+uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
 
 /**
  * Checks if two ExpiryTimes contain equal inner contents.
@@ -18445,26 +20833,26 @@ void ExpiryTime_free(struct LDKExpiryTime this_obj);
 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
 
 /**
- * Creates a copy of the ExpiryTime
+ * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
  */
-struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
+void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
 
 /**
- * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the MinFinalCltvExpiry
  */
-void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
+struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
 
 /**
  * Checks if two MinFinalCltvExpirys 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 MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
+uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
 
 /**
- * Creates a copy of the MinFinalCltvExpiry
+ * Checks if two MinFinalCltvExpirys 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.
  */
-struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
+bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
 
 /**
  * Frees any resources used by the Fallback
@@ -18476,6 +20864,26 @@ void Fallback_free(struct LDKFallback this_ptr);
  */
 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new SegWitProgram-variant Fallback
+ */
+struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
+
+/**
+ * Utility method to constructs a new PubKeyHash-variant Fallback
+ */
+struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
+
+/**
+ * Utility method to constructs a new ScriptHash-variant Fallback
+ */
+struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
+
+/**
+ * Checks if two Fallbacks contain equal inner contents.
+ */
+uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
+
 /**
  * Checks if two Fallbacks contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -18487,6 +20895,11 @@ bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallba
  */
 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
 
+/**
+ * Creates a copy of the InvoiceSignature
+ */
+struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
+
 /**
  * Checks if two InvoiceSignatures contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -18495,26 +20908,26 @@ void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
 
 /**
- * Creates a copy of the InvoiceSignature
+ * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
  */
-struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
+void PrivateRoute_free(struct LDKPrivateRoute this_obj);
 
 /**
- * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the PrivateRoute
  */
-void PrivateRoute_free(struct LDKPrivateRoute this_obj);
+struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
 
 /**
  * Checks if two PrivateRoutes 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 PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
+uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
 
 /**
- * Creates a copy of the PrivateRoute
+ * Checks if two PrivateRoutes 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.
  */
-struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
+bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
 
 /**
  * Disassembles the `SignedRawInvoice` into its three parts:
@@ -18555,20 +20968,52 @@ MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvo
  */
 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
+/**
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
+/**
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
+/**
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
+/**
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
+/**
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
+/**
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
+/**
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
+/**
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
@@ -18616,10 +21061,17 @@ MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const
  * ```
  * use lightning_invoice::*;
  *
- * let invoice = \"lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdp\\
- * \tl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq8rkx3yf5tcsyz3d7\\
- * \t3gafnh3cax9rn449d9p5uxz9ezhhypd0elx87sjle52x86fux2ypatgddc6k63n7erqz25le42c4u4ec\\
- * \tky03ylcqca784w\";
+ * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
+ * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
+ * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
+ * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
+ * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
+ * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
+ * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
+ * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
+ * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
+ * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
+ * j5r6drg6k6zcqj0fcwg\";
  *
  * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
  *
@@ -18640,6 +21092,8 @@ MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNU
 
 /**
  * Get the payee's public key if one was included in the invoice
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
 
@@ -18650,6 +21104,8 @@ MUST_USE_RES struct LDKThirtyTwoBytes Invoice_payment_secret(const struct LDKInv
 
 /**
  * Get the invoice features if they were included in the invoice
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
 
@@ -18741,6 +21197,26 @@ MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute
  */
 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new DescriptionTooLong-variant CreationError
+ */
+enum LDKCreationError CreationError_description_too_long(void);
+
+/**
+ * Utility method to constructs a new RouteTooLong-variant CreationError
+ */
+enum LDKCreationError CreationError_route_too_long(void);
+
+/**
+ * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
+ */
+enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
+
+/**
+ * Utility method to constructs a new ExpiryTimeOutOfBounds-variant CreationError
+ */
+enum LDKCreationError CreationError_expiry_time_out_of_bounds(void);
+
 /**
  * Checks if two CreationErrors contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -18757,6 +21233,56 @@ struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
  */
 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new NoPaymentHash-variant SemanticError
+ */
+enum LDKSemanticError SemanticError_no_payment_hash(void);
+
+/**
+ * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
+ */
+enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
+
+/**
+ * Utility method to constructs a new NoDescription-variant SemanticError
+ */
+enum LDKSemanticError SemanticError_no_description(void);
+
+/**
+ * Utility method to constructs a new MultipleDescriptions-variant SemanticError
+ */
+enum LDKSemanticError SemanticError_multiple_descriptions(void);
+
+/**
+ * Utility method to constructs a new NoPaymentSecret-variant SemanticError
+ */
+enum LDKSemanticError SemanticError_no_payment_secret(void);
+
+/**
+ * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
+ */
+enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
+
+/**
+ * Utility method to constructs a new InvalidFeatures-variant SemanticError
+ */
+enum LDKSemanticError SemanticError_invalid_features(void);
+
+/**
+ * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
+ */
+enum LDKSemanticError SemanticError_invalid_recovery_id(void);
+
+/**
+ * Utility method to constructs a new InvalidSignature-variant SemanticError
+ */
+enum LDKSemanticError SemanticError_invalid_signature(void);
+
+/**
+ * Utility method to constructs a new ImpreciseAmount-variant SemanticError
+ */
+enum LDKSemanticError SemanticError_imprecise_amount(void);
+
 /**
  * Checks if two SemanticErrors contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -18778,6 +21304,16 @@ void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
  */
 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new SignError-variant SignOrCreationError
+ */
+struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
+
+/**
+ * Utility method to constructs a new CreationError-variant SignOrCreationError
+ */
+struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
+
 /**
  * Checks if two SignOrCreationErrors contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
@@ -18835,4 +21371,4 @@ struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
 
 #endif /* LDK_C_BINDINGS_H */
 
-#include <ldk_ver.h>
+#include "ldk_ver.h"