Update auto-generated bindings
[ldk-c-bindings] / lightning-c-bindings / include / lightning.h
index 8d27f343936b3071c1a28a4cce38d788ae88a072..9fa8d7b21aa7dd5c1af2b6ee665e41f94e240d94 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`].
@@ -37,9 +37,10 @@ typedef enum LDKChannelMonitorUpdateErr {
     * our state failed, but is expected to succeed at some point in the future).
     *
     * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
-    * submitting new commitment transactions to the counterparty. Once the update(s) which failed
-    * have been successfully applied, ChannelManager::channel_monitor_updated can be used to
-    * restore the channel to an operational state.
+    * submitting new commitment transactions to the counterparty. Once the update(s) that failed
+    * have been successfully applied, a [`MonitorEvent::UpdateCompleted`] event should be returned
+    * via [`Watch::release_pending_monitor_events`] which will then restore the channel to an
+    * operational state.
     *
     * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If
     * you return a TemporaryFailure you must ensure that it is written to disk safely before
@@ -53,13 +54,14 @@ typedef enum LDKChannelMonitorUpdateErr {
     * the channel which would invalidate previous ChannelMonitors are not made when a channel has
     * been \"frozen\".
     *
-    * Note that even if updates made after TemporaryFailure succeed you must still call
-    * channel_monitor_updated to ensure you have the latest monitor and re-enable normal channel
-    * operation.
+    * Note that even if updates made after TemporaryFailure succeed you must still provide a
+    * [`MonitorEvent::UpdateCompleted`] to ensure you have the latest monitor and re-enable
+    * normal channel operation. Note that this is normally generated through a call to
+    * [`ChainMonitor::channel_monitor_updated`].
     *
-    * Note that the update being processed here will not be replayed for you when you call
-    * ChannelManager::channel_monitor_updated, so you must store the update itself along
-    * with the persisted ChannelMonitor on your own local disk prior to returning a
+    * Note that the update being processed here will not be replayed for you when you return a
+    * [`MonitorEvent::UpdateCompleted`] event via [`Watch::release_pending_monitor_events`], so
+    * you must store the update itself on your own local disk prior to returning a
     * TemporaryFailure. You may, of course, employ a journaling approach, storing only the
     * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at
     * reload-time.
@@ -67,6 +69,8 @@ typedef enum LDKChannelMonitorUpdateErr {
     * For deployments where a copy of ChannelMonitors and other local state are backed up in a
     * remote location (with local copies persisted immediately), it is anticipated that all
     * updates will return TemporaryFailure until the remote copies could be updated.
+    *
+    * [`ChainMonitor::channel_monitor_updated`]: chainmonitor::ChainMonitor::channel_monitor_updated
     */
    LDKChannelMonitorUpdateErr_TemporaryFailure,
    /**
@@ -210,29 +214,25 @@ typedef enum LDKIOError {
  */
 typedef enum LDKLevel {
    /**
-    *Designates logger being silent
-    */
-   LDKLevel_Off,
-   /**
-    * Designates very serious errors
+    * Designates very low priority, often extremely verbose, information
     */
-   LDKLevel_Error,
+   LDKLevel_Trace,
    /**
-    * Designates hazardous situations
+    * Designates lower priority information
     */
-   LDKLevel_Warn,
+   LDKLevel_Debug,
    /**
     * Designates useful information
     */
    LDKLevel_Info,
    /**
-    * Designates lower priority information
+    * Designates hazardous situations
     */
-   LDKLevel_Debug,
+   LDKLevel_Warn,
    /**
-    * Designates very low priority, often extremely verbose, information
+    * Designates very serious errors
     */
-   LDKLevel_Trace,
+   LDKLevel_Error,
    /**
     * Must be last for serialization purposes
     */
@@ -332,6 +332,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
     */
@@ -348,6 +353,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
     */
@@ -1044,7 +1053,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.
  *
@@ -1188,6 +1254,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
  */
@@ -1359,6 +1533,100 @@ typedef struct LDKCResult_RouteDecodeErrorZ {
    bool result_ok;
 } LDKCResult_RouteDecodeErrorZ;
 
+
+
+/**
+ * Parameters needed to find a [`Route`] for paying a [`Payee`].
+ *
+ * Passed to [`find_route`] and also provided in [`Event::PaymentPathFailed`] for retrying a failed
+ * payment path.
+ *
+ * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
+ */
+typedef struct MUST_USE_STRUCT LDKRouteParameters {
+   /**
+    * 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.
+    */
+   LDKnativeRouteParameters *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;
+} LDKRouteParameters;
+
+/**
+ * The contents of CResult_RouteParametersDecodeErrorZ
+ */
+typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKRouteParameters *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_RouteParametersDecodeErrorZPtr;
+
+/**
+ * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::router::RouteParameters 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_RouteParametersDecodeErrorZ {
+   /**
+    * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_RouteParametersDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_RouteParametersDecodeErrorZ;
+
+
+
+/**
+ * A list of hops along a payment path terminating with a channel to the recipient.
+ */
+typedef struct MUST_USE_STRUCT LDKRouteHint {
+   /**
+    * 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.
+    */
+   LDKnativeRouteHint *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;
+} LDKRouteHint;
+
+/**
+ * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_RouteHintZ {
+   /**
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    */
+   struct LDKRouteHint *data;
+   /**
+    * The number of elements pointed to by `data`.
+    */
+   uintptr_t datalen;
+} LDKCVec_RouteHintZ;
+
 /**
  * An enum which can either contain a u64 or not
  */
@@ -1389,43 +1657,60 @@ typedef struct LDKCOption_u64Z {
 
 
 /**
- * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
+ * The recipient of a payment.
  */
-typedef struct MUST_USE_STRUCT LDKChannelDetails {
+typedef struct MUST_USE_STRUCT LDKPayee {
    /**
     * 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.
     */
-   LDKnativeChannelDetails *inner;
+   LDKnativePayee *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;
-} LDKChannelDetails;
+} LDKPayee;
 
 /**
- * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
- * This corresponds to std::vector in C++
+ * The contents of CResult_PayeeDecodeErrorZ
  */
-typedef struct LDKCVec_ChannelDetailsZ {
+typedef union LDKCResult_PayeeDecodeErrorZPtr {
    /**
-    * The elements in the array.
-    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKChannelDetails *data;
+   struct LDKPayee *result;
    /**
-    * The number of elements pointed to by `data`.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   uintptr_t datalen;
-} LDKCVec_ChannelDetailsZ;
+   struct LDKDecodeError *err;
+} LDKCResult_PayeeDecodeErrorZPtr;
+
+/**
+ * A CResult_PayeeDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::router::Payee 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_PayeeDecodeErrorZ {
+   /**
+    * The contents of this CResult_PayeeDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_PayeeDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_PayeeDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_PayeeDecodeErrorZ;
 
 
 
 /**
- * A channel descriptor which provides a last-hop route to get_route
+ * A channel descriptor for a hop along a payment path.
  */
 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
    /**
@@ -1458,22 +1743,124 @@ typedef struct LDKCVec_RouteHintHopZ {
    uintptr_t datalen;
 } LDKCVec_RouteHintHopZ;
 
-
-
 /**
- * An Err type for failure to process messages.
+ * The contents of CResult_RouteHintDecodeErrorZ
  */
-typedef struct MUST_USE_STRUCT LDKLightningError {
+typedef union LDKCResult_RouteHintDecodeErrorZPtr {
    /**
-    * 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.
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   LDKnativeLightningError *inner;
+   struct LDKRouteHint *result;
    /**
-    * 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.
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
+    */
+   struct LDKDecodeError *err;
+} LDKCResult_RouteHintDecodeErrorZPtr;
+
+/**
+ * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::router::RouteHint 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_RouteHintDecodeErrorZ {
+   /**
+    * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_RouteHintDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_RouteHintDecodeErrorZ;
+
+/**
+ * The contents of CResult_RouteHintHopDecodeErrorZ
+ */
+typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKRouteHintHop *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_RouteHintHopDecodeErrorZPtr;
+
+/**
+ * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::router::RouteHintHop 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_RouteHintHopDecodeErrorZ {
+   /**
+    * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_RouteHintHopDecodeErrorZ;
+
+
+
+/**
+ * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
+ */
+typedef struct MUST_USE_STRUCT LDKChannelDetails {
+   /**
+    * 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.
+    */
+   LDKnativeChannelDetails *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;
+} LDKChannelDetails;
+
+/**
+ * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_ChannelDetailsZ {
+   /**
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    */
+   struct LDKChannelDetails *data;
+   /**
+    * The number of elements pointed to by `data`.
+    */
+   uintptr_t datalen;
+} LDKCVec_ChannelDetailsZ;
+
+
+
+/**
+ * An Err type for failure to process messages.
+ */
+typedef struct MUST_USE_STRUCT LDKLightningError {
+   /**
+    * 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.
+    */
+   LDKnativeLightningError *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;
 } LDKLightningError;
@@ -1618,7 +2005,7 @@ typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
 
 /**
  * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
- * containing a () on success and a crate::lightning::chain::channelmonitor::ChannelMonitorUpdateErr on failure.
+ * containing a () on success and a crate::lightning::chain::ChannelMonitorUpdateErr on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
@@ -1687,15 +2074,44 @@ 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_CommitmentTxConfirmed,
+   /**
+    * Indicates a [`ChannelMonitor`] update has completed. See
+    * [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used.
+    *
+    * [`ChannelMonitorUpdateErr::TemporaryFailure`]: super::ChannelMonitorUpdateErr::TemporaryFailure
+    */
+   LDKMonitorEvent_UpdateCompleted,
+   /**
+    * Indicates a [`ChannelMonitor`] update has failed. See
+    * [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used.
+    *
+    * [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure
     */
-   LDKMonitorEvent_CommitmentTxBroadcasted,
+   LDKMonitorEvent_UpdateFailed,
    /**
     * Must be last for serialization purposes
     */
    LDKMonitorEvent_Sentinel,
 } LDKMonitorEvent_Tag;
 
+typedef struct LDKMonitorEvent_LDKUpdateCompleted_Body {
+   /**
+    * The funding outpoint of the [`ChannelMonitor`] that was updated
+    */
+   struct LDKOutPoint funding_txo;
+   /**
+    * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
+    * [`ChannelMonitor::get_latest_update_id`].
+    *
+    * Note that this should only be set to a given update's ID if all previous updates for the
+    * same [`ChannelMonitor`] have been applied and persisted.
+    */
+   uint64_t monitor_update_id;
+} LDKMonitorEvent_LDKUpdateCompleted_Body;
+
 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
    LDKMonitorEvent_Tag tag;
    union {
@@ -1703,7 +2119,11 @@ typedef struct MUST_USE_STRUCT LDKMonitorEvent {
          struct LDKHTLCUpdate htlc_event;
       };
       struct {
-         struct LDKOutPoint commitment_tx_broadcasted;
+         struct LDKOutPoint commitment_tx_confirmed;
+      };
+      LDKMonitorEvent_LDKUpdateCompleted_Body update_completed;
+      struct {
+         struct LDKOutPoint update_failed;
       };
    };
 } LDKMonitorEvent;
@@ -1753,6 +2173,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.
@@ -1803,8 +2338,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.
     */
@@ -2139,26 +2674,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
  */
@@ -2209,6 +2724,11 @@ typedef enum LDKErrorAction_Tag {
     * The peer did something harmless that we weren't able to process, just log and ignore
     */
    LDKErrorAction_IgnoreError,
+   /**
+    * The peer did something harmless that we weren't able to meaningfully process.
+    * If the error is logged, log it at the given level.
+    */
+   LDKErrorAction_IgnoreAndLog,
    /**
     * The peer did something incorrect. Tell them.
     */
@@ -2222,6 +2742,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;
@@ -2237,75 +2759,13 @@ typedef struct MUST_USE_STRUCT LDKErrorAction {
    LDKErrorAction_Tag tag;
    union {
       LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
+      struct {
+         enum LDKLevel ignore_and_log;
+      };
       LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
    };
 } 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;
-
 
 
 /**
@@ -2455,14 +2915,15 @@ typedef enum LDKMessageSendEvent_Tag {
     */
    LDKMessageSendEvent_BroadcastChannelUpdate,
    /**
-    * Broadcast an error downstream to be handled
+    * Used to indicate that a channel_update should be sent to a single peer.
+    * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
+    * private channel and we shouldn't be informing all of our peers of channel parameters.
     */
-   LDKMessageSendEvent_HandleError,
+   LDKMessageSendEvent_SendChannelUpdate,
    /**
-    * 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.
+    * Broadcast an error downstream to be handled
     */
-   LDKMessageSendEvent_PaymentFailureNetworkUpdate,
+   LDKMessageSendEvent_HandleError,
    /**
     * Query a peer for channels with funding transaction UTXOs in a block range.
     */
@@ -2629,6 +3090,17 @@ typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
    struct LDKChannelUpdate msg;
 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
 
+typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
+   /**
+    * The node_id of the node which should receive this message
+    */
+   struct LDKPublicKey node_id;
+   /**
+    * The channel_update which should be sent.
+    */
+   struct LDKChannelUpdate msg;
+} LDKMessageSendEvent_LDKSendChannelUpdate_Body;
+
 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
    /**
     * The node_id of the node which should receive this message
@@ -2640,13 +3112,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
@@ -2697,8 +3162,8 @@ typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
       LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
       LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
       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;
@@ -3033,18 +3498,49 @@ 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
     */
-   struct LDKCVec_SignatureZ b;
-} LDKC2Tuple_SignatureCVec_SignatureZZ;
+   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;
 
 /**
  * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
@@ -3112,6 +3608,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
  */
@@ -3172,6 +3692,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
     */
@@ -3192,8 +3721,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
@@ -3271,7 +3810,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.
@@ -3318,21 +3857,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.
@@ -3667,6 +4201,33 @@ typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
    bool result_ok;
 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
 
+/**
+ * An enum which can either contain a u16 or not
+ */
+typedef enum LDKCOption_u16Z_Tag {
+   /**
+    * When we're in this state, this COption_u16Z contains a u16
+    */
+   LDKCOption_u16Z_Some,
+   /**
+    * When we're in this state, this COption_u16Z contains nothing
+    */
+   LDKCOption_u16Z_None,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKCOption_u16Z_Sentinel,
+} LDKCOption_u16Z_Tag;
+
+typedef struct LDKCOption_u16Z {
+   LDKCOption_u16Z_Tag tag;
+   union {
+      struct {
+         uint16_t some;
+      };
+   };
+} LDKCOption_u16Z;
+
 /**
  * Indicates an error on the client's part (usually some variant of attempting to use too-low or
  * too-high values)
@@ -3699,6 +4260,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
     */
@@ -3737,6 +4309,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 {
@@ -3744,6 +4323,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;
 
@@ -3811,6 +4391,39 @@ typedef struct LDKCVec_APIErrorZ {
    uintptr_t datalen;
 } LDKCVec_APIErrorZ;
 
+/**
+ * The contents of CResult__u832APIErrorZ
+ */
+typedef union LDKCResult__u832APIErrorZPtr {
+   /**
+    * 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 LDKAPIError *err;
+} LDKCResult__u832APIErrorZPtr;
+
+/**
+ * A CResult__u832APIErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult__u832APIErrorZ {
+   /**
+    * The contents of this CResult__u832APIErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult__u832APIErrorZPtr contents;
+   /**
+    * Whether this CResult__u832APIErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult__u832APIErrorZ;
+
 /**
  * If a payment fails to send, it can be in one of several states. This enum is returned as the
  * Err() type describing which state the payment is in, see the description of individual enum
@@ -3860,6 +4473,25 @@ typedef enum LDKPaymentSendFailure_Tag {
    LDKPaymentSendFailure_Sentinel,
 } LDKPaymentSendFailure_Tag;
 
+typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
+   /**
+    * The errors themselves, in the same order as the route hops.
+    */
+   struct LDKCVec_CResult_NoneAPIErrorZZ results;
+   /**
+    * If some paths failed without irrevocably committing to the new HTLC(s), this will
+    * contain a [`RouteParameters`] object which can be used to calculate a new route that
+    * will pay all remaining unpaid balance.
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKRouteParameters failed_paths_retry;
+   /**
+    * The payment id for the payment, which is now at least partially pending.
+    */
+   struct LDKThirtyTwoBytes payment_id;
+} LDKPaymentSendFailure_LDKPartialFailure_Body;
+
 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
    LDKPaymentSendFailure_Tag tag;
    union {
@@ -3872,12 +4504,43 @@ typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
       struct {
          struct LDKCVec_APIErrorZ all_failed_retry_safe;
       };
-      struct {
-         struct LDKCVec_CResult_NoneAPIErrorZZ partial_failure;
-      };
+      LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
    };
 } LDKPaymentSendFailure;
 
+/**
+ * The contents of CResult_PaymentIdPaymentSendFailureZ
+ */
+typedef union LDKCResult_PaymentIdPaymentSendFailureZPtr {
+   /**
+    * 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_PaymentIdPaymentSendFailureZPtr;
+
+/**
+ * A CResult_PaymentIdPaymentSendFailureZ 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_PaymentIdPaymentSendFailureZ {
+   /**
+    * The contents of this CResult_PaymentIdPaymentSendFailureZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_PaymentIdPaymentSendFailureZPtr contents;
+   /**
+    * Whether this CResult_PaymentIdPaymentSendFailureZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_PaymentIdPaymentSendFailureZ;
+
 /**
  * The contents of CResult_NonePaymentSendFailureZ
  */
@@ -3910,6 +4573,53 @@ typedef struct LDKCResult_NonePaymentSendFailureZ {
    bool result_ok;
 } LDKCResult_NonePaymentSendFailureZ;
 
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
+   /**
+    * The element at position 0
+    */
+   struct LDKThirtyTwoBytes a;
+   /**
+    * The element at position 1
+    */
+   struct LDKThirtyTwoBytes b;
+} LDKC2Tuple_PaymentHashPaymentIdZ;
+
+/**
+ * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
+ */
+typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKC2Tuple_PaymentHashPaymentIdZ *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_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
+
+/**
+ * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
+ * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ 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_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
+   /**
+    * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
+   /**
+    * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
+
 /**
  * A 4-byte byte array.
  */
@@ -4149,9 +4859,7 @@ typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
  * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
  * multiple instances.
  *
- * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
- * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
- * [`PermanentFailure`]: channelmonitor::ChannelMonitorUpdateErr::PermanentFailure
+ * [`PermanentFailure`]: ChannelMonitorUpdateErr::PermanentFailure
  */
 typedef struct LDKWatch {
    /**
@@ -4166,6 +4874,9 @@ typedef struct LDKWatch {
     * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
     * calling [`block_connected`] and [`block_disconnected`] on the monitor.
     *
+    * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
+    * the given `funding_txo` has previously been registered via `watch_channel`.
+    *
     * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
     * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
     * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
@@ -4178,12 +4889,18 @@ typedef struct LDKWatch {
     * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
     *
     * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
-    * [`ChannelMonitorUpdateErr`]: channelmonitor::ChannelMonitorUpdateErr
     */
    struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
    /**
     * Returns any monitor events since the last call. Subsequent calls must only return new
     * events.
+    *
+    * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
+    * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
+    * to disk.
+    *
+    * For details on asynchronous [`ChannelMonitor`] updating and returning
+    * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
     */
    struct LDKCVec_MonitorEventZ (*release_pending_monitor_events)(const void *this_arg);
    /**
@@ -4251,13 +4968,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!
@@ -4537,110 +5253,270 @@ typedef struct LDKCResult_OutPointDecodeErrorZ {
 } LDKCResult_OutPointDecodeErrorZ;
 
 /**
- * The contents of CResult_SiPrefixNoneZ
+ * Defines a type identifier for sending messages over the wire.
+ *
+ * Messages implementing this trait specify a type and must be [`Writeable`].
  */
-typedef union LDKCResult_SiPrefixNoneZPtr {
+typedef struct LDKType {
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * 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.
     */
-   enum LDKSiPrefix *result;
+   void *this_arg;
    /**
-    * Note that this value is always NULL, as there are no contents in the Err variant
+    * Returns the type identifying the message payload.
     */
-   void *err;
-} LDKCResult_SiPrefixNoneZPtr;
-
-/**
- * A CResult_SiPrefixNoneZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::SiPrefix on success and a () on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
- */
-typedef struct LDKCResult_SiPrefixNoneZ {
+   uint16_t (*type_id)(const void *this_arg);
    /**
-    * The contents of this CResult_SiPrefixNoneZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
+    * Return a human-readable "debug" string describing this object
     */
-   union LDKCResult_SiPrefixNoneZPtr contents;
+   struct LDKStr (*debug_str)(const void *this_arg);
    /**
-    * Whether this CResult_SiPrefixNoneZ represents a success state.
+    * Serialize the object into a byte array
     */
-   bool result_ok;
-} LDKCResult_SiPrefixNoneZ;
-
-
+   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;
 
 /**
- * Represents a syntactically and semantically correct lightning BOLT11 invoice.
- *
- * There are three ways to construct an `Invoice`:
- *  1. using `InvoiceBuilder`
- *  2. using `Invoice::from_signed(SignedRawInvoice)`
- *  3. using `str::parse::<Invoice>(&str)`
+ * An enum which can either contain a crate::lightning::ln::wire::Type or not
  */
-typedef struct MUST_USE_STRUCT LDKInvoice {
+typedef enum LDKCOption_TypeZ_Tag {
    /**
-    * 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.
+    * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
     */
-   LDKnativeInvoice *inner;
+   LDKCOption_TypeZ_Some,
    /**
-    * 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.
+    * When we're in this state, this COption_TypeZ contains nothing
     */
-   bool is_owned;
-} LDKInvoice;
+   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_InvoiceNoneZ
+ * The contents of CResult_COption_TypeZDecodeErrorZ
  */
-typedef union LDKCResult_InvoiceNoneZPtr {
+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 LDKInvoice *result;
+   struct LDKCOption_TypeZ *result;
    /**
-    * Note that this value is always NULL, as there are no contents in the Err variant
+    * A pointer to the contents in the error state.
+    * Reading from this pointer when `result_ok` is set is undefined.
     */
-   void *err;
-} LDKCResult_InvoiceNoneZPtr;
+   struct LDKDecodeError *err;
+} LDKCResult_COption_TypeZDecodeErrorZPtr;
 
 /**
- * A CResult_InvoiceNoneZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::Invoice on success and a () on failure.
+ * 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_InvoiceNoneZ {
+typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
    /**
-    * The contents of this CResult_InvoiceNoneZ, accessible via either
+    * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_InvoiceNoneZPtr contents;
+   union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_InvoiceNoneZ represents a success state.
+    * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_InvoiceNoneZ;
-
-
+} LDKCResult_COption_TypeZDecodeErrorZ;
 
 /**
- * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
- * invalid.
- *
- * # Invariants
- * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
+ * An error that may occur when making a payment.
  */
-typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
+typedef enum LDKPaymentError_Tag {
    /**
-    * 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.
+    * An error resulting from the provided [`Invoice`] or payment hash.
     */
-   LDKnativeSignedRawInvoice *inner;
+   LDKPaymentError_Invoice,
+   /**
+    * An error occurring when finding a route.
+    */
+   LDKPaymentError_Routing,
+   /**
+    * An error occurring when sending a payment.
+    */
+   LDKPaymentError_Sending,
+   /**
+    * Must be last for serialization purposes
+    */
+   LDKPaymentError_Sentinel,
+} LDKPaymentError_Tag;
+
+typedef struct MUST_USE_STRUCT LDKPaymentError {
+   LDKPaymentError_Tag tag;
+   union {
+      struct {
+         struct LDKStr invoice;
+      };
+      struct {
+         struct LDKLightningError routing;
+      };
+      struct {
+         struct LDKPaymentSendFailure sending;
+      };
+   };
+} LDKPaymentError;
+
+/**
+ * The contents of CResult_PaymentIdPaymentErrorZ
+ */
+typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
+   /**
+    * 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 LDKPaymentError *err;
+} LDKCResult_PaymentIdPaymentErrorZPtr;
+
+/**
+ * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
+ * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_PaymentIdPaymentErrorZ {
+   /**
+    * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_PaymentIdPaymentErrorZPtr contents;
+   /**
+    * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_PaymentIdPaymentErrorZ;
+
+/**
+ * The contents of CResult_SiPrefixNoneZ
+ */
+typedef union LDKCResult_SiPrefixNoneZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   enum LDKSiPrefix *result;
+   /**
+    * Note that this value is always NULL, as there are no contents in the Err variant
+    */
+   void *err;
+} LDKCResult_SiPrefixNoneZPtr;
+
+/**
+ * A CResult_SiPrefixNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::SiPrefix on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_SiPrefixNoneZ {
+   /**
+    * The contents of this CResult_SiPrefixNoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_SiPrefixNoneZPtr contents;
+   /**
+    * Whether this CResult_SiPrefixNoneZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_SiPrefixNoneZ;
+
+
+
+/**
+ * Represents a syntactically and semantically correct lightning BOLT11 invoice.
+ *
+ * There are three ways to construct an `Invoice`:
+ *  1. using `InvoiceBuilder`
+ *  2. using `Invoice::from_signed(SignedRawInvoice)`
+ *  3. using `str::parse::<Invoice>(&str)`
+ */
+typedef struct MUST_USE_STRUCT LDKInvoice {
+   /**
+    * 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.
+    */
+   LDKnativeInvoice *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;
+} LDKInvoice;
+
+/**
+ * The contents of CResult_InvoiceNoneZ
+ */
+typedef union LDKCResult_InvoiceNoneZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKInvoice *result;
+   /**
+    * Note that this value is always NULL, as there are no contents in the Err variant
+    */
+   void *err;
+} LDKCResult_InvoiceNoneZPtr;
+
+/**
+ * A CResult_InvoiceNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::Invoice on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_InvoiceNoneZ {
+   /**
+    * The contents of this CResult_InvoiceNoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_InvoiceNoneZPtr contents;
+   /**
+    * Whether this CResult_InvoiceNoneZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_InvoiceNoneZ;
+
+
+
+/**
+ * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
+ * invalid.
+ *
+ * # Invariants
+ * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
+ */
+typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
+   /**
+    * 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.
+    */
+   LDKnativeSignedRawInvoice *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
@@ -4805,36 +5681,36 @@ typedef struct LDKCResult_PayeePubKeyErrorZ {
  * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
  *
  */
-typedef struct MUST_USE_STRUCT LDKRouteHint {
+typedef struct MUST_USE_STRUCT LDKPrivateRoute {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeRouteHint *inner;
+   LDKnativePrivateRoute *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKRouteHint;
+} LDKPrivateRoute;
 
 /**
- * A dynamically-allocated array of crate::lightning_invoice::RouteHints of arbitrary size.
+ * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
  * This corresponds to std::vector in C++
  */
-typedef struct LDKCVec_RouteHintZ {
+typedef struct LDKCVec_PrivateRouteZ {
    /**
     * The elements in the array.
     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   struct LDKRouteHint *data;
+   struct LDKPrivateRoute *data;
    /**
     * The number of elements pointed to by `data`.
     */
    uintptr_t datalen;
-} LDKCVec_RouteHintZ;
+} LDKCVec_PrivateRouteZ;
 
 
 
@@ -5075,37 +5951,37 @@ typedef struct LDKCResult_ExpiryTimeCreationErrorZ {
 } LDKCResult_ExpiryTimeCreationErrorZ;
 
 /**
- * The contents of CResult_RouteHintCreationErrorZ
+ * The contents of CResult_PrivateRouteCreationErrorZ
  */
-typedef union LDKCResult_RouteHintCreationErrorZPtr {
+typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKRouteHint *result;
+   struct LDKPrivateRoute *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    enum LDKCreationError *err;
-} LDKCResult_RouteHintCreationErrorZPtr;
+} LDKCResult_PrivateRouteCreationErrorZPtr;
 
 /**
- * A CResult_RouteHintCreationErrorZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::RouteHint on success and a crate::lightning_invoice::CreationError on failure.
+ * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_RouteHintCreationErrorZ {
+typedef struct LDKCResult_PrivateRouteCreationErrorZ {
    /**
-    * The contents of this CResult_RouteHintCreationErrorZ, accessible via either
+    * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_RouteHintCreationErrorZPtr contents;
+   union LDKCResult_PrivateRouteCreationErrorZPtr contents;
    /**
-    * Whether this CResult_RouteHintCreationErrorZ represents a success state.
+    * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_RouteHintCreationErrorZ;
+} LDKCResult_PrivateRouteCreationErrorZ;
 
 /**
  * The contents of CResult_StringErrorZ
@@ -5336,6 +6212,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.
  *
@@ -5354,27 +6375,31 @@ typedef enum LDKEvent_Tag {
    LDKEvent_FundingGenerationReady,
    /**
     * Indicates we've received money! Just gotta dig out that payment preimage and feed it to
-    * ChannelManager::claim_funds to get it....
-    * Note that if the preimage is not known or the amount paid is incorrect, you should call
-    * ChannelManager::fail_htlc_backwards to free up resources for this HTLC and avoid
+    * [`ChannelManager::claim_funds`] to get it....
+    * Note that if the preimage is not known, you should call
+    * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
     * network congestion.
-    * The amount paid should be considered 'incorrect' when it is less than or more than twice
-    * the amount expected.
-    * If you fail to call either ChannelManager::claim_funds or
-    * ChannelManager::fail_htlc_backwards within the HTLC's timeout, the HTLC will be
+    * If you fail to call either [`ChannelManager::claim_funds`] or
+    * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
     * automatically failed.
+    *
+    * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+    * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
     */
    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.
@@ -5388,6 +6413,20 @@ 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,
+   /**
+    * Used to indicate to the user that they can abandon the funding transaction and recycle the
+    * inputs for another purpose.
+    */
+   LDKEvent_DiscardFunding,
    /**
     * Must be last for serialization purposes
     */
@@ -5409,7 +6448,10 @@ typedef struct LDKEvent_LDKFundingGenerationReady_Body {
     */
    struct LDKCVec_u8Z output_script;
    /**
-    * The value passed in to ChannelManager::create_channel
+    * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
+    * an inbound channel.
+    *
+    * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
     */
    uint64_t user_channel_id;
 } LDKEvent_LDKFundingGenerationReady_Body;
@@ -5420,56 +6462,64 @@ typedef struct LDKEvent_LDKPaymentReceived_Body {
     */
    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
+    * The value, in thousandths of a satoshi, that this payment is for.
     */
-   struct LDKThirtyTwoBytes payment_preimage;
+   uint64_t amt;
    /**
-    * 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
-    * providing proof-of-payment for less than the value you expected!).
-    */
-   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 {
+   /**
+    * The id returned by [`ChannelManager::send_payment`] and used with
+    * [`ChannelManager::retry_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKThirtyTwoBytes payment_id;
    /**
     * The preimage to the hash given to ChannelManager::send_payment.
     * Note that this serves as a payment receipt, if you wish to have such a thing, you must
     * store it somehow!
     */
    struct LDKThirtyTwoBytes payment_preimage;
+   /**
+    * The hash which was given to [`ChannelManager::send_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    */
+   struct LDKThirtyTwoBytes payment_hash;
+   /**
+    * The total fee which was spent at intermediate hops in this payment, across all paths.
+    *
+    * Note that, like [`Route::get_total_fees`] this does *not* include any potential
+    * overpayment to the recipient node.
+    *
+    * If the recipient or an intermediate node misbehaves and gives us free money, this may
+    * overstate the amount paid, though this is unlikely.
+    *
+    * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
+    */
+   struct LDKCOption_u64Z fee_paid_msat;
 } LDKEvent_LDKPaymentSent_Body;
 
-typedef struct LDKEvent_LDKPaymentFailed_Body {
+typedef struct LDKEvent_LDKPaymentPathFailed_Body {
+   /**
+    * The id returned by [`ChannelManager::send_payment`] and used with
+    * [`ChannelManager::retry_payment`].
+    *
+    * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
+    * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKThirtyTwoBytes payment_id;
    /**
     * The hash which was given to ChannelManager::send_payment.
     */
@@ -5480,7 +6530,46 @@ 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;
+   /**
+    * The channel responsible for the failed payment path.
+    *
+    * If this is `Some`, then the corresponding channel should be avoided when the payment is
+    * retried. May be `None` for older [`Event`] serializations.
+    */
+   struct LDKCOption_u64Z short_channel_id;
+   /**
+    * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
+    *
+    * See [`find_route`] for details.
+    *
+    * [`Route`]: crate::routing::router::Route
+    * [`find_route`]: crate::routing::router::find_route
+    *
+    * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKRouteParameters retry;
+} LDKEvent_LDKPaymentPathFailed_Body;
 
 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
    /**
@@ -5499,15 +6588,73 @@ 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 `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
+    * an inbound channel. This will always be zero for objects serialized with LDK versions
+    * prior to 0.0.102.
+    *
+    * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
+    */
+   uint64_t user_channel_id;
+   /**
+    * The reason the channel was closed.
+    */
+   struct LDKClosureReason reason;
+} LDKEvent_LDKChannelClosed_Body;
+
+typedef struct LDKEvent_LDKDiscardFunding_Body {
+   /**
+    * The channel_id of the channel which has been closed.
+    */
+   struct LDKThirtyTwoBytes channel_id;
+   /**
+    * The full transaction received from the user
+    */
+   struct LDKTransaction transaction;
+} LDKEvent_LDKDiscardFunding_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_LDKDiscardFunding_Body discard_funding;
    };
 } LDKEvent;
 
@@ -5603,6 +6750,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
  */
@@ -5636,6 +6896,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
  */
@@ -5719,38 +7041,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++
@@ -5890,82 +7180,187 @@ typedef struct LDKCResult_boolPeerHandleErrorZ {
 
 
 /**
- * Details about one direction of a channel. Received
- * within a channel update.
+ * Represents the compressed public key of a node
  */
-typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
+typedef struct MUST_USE_STRUCT LDKNodeId {
    /**
     * 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.
     */
-   LDKnativeDirectionalChannelInfo *inner;
+   LDKnativeNodeId *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;
-} LDKDirectionalChannelInfo;
+} LDKNodeId;
 
 /**
- * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
+ * The contents of CResult_NodeIdDecodeErrorZ
  */
-typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
+typedef union LDKCResult_NodeIdDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKDirectionalChannelInfo *result;
+   struct LDKNodeId *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_DirectionalChannelInfoDecodeErrorZPtr;
+} LDKCResult_NodeIdDecodeErrorZPtr;
 
 /**
- * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::network_graph::NodeId 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_DirectionalChannelInfoDecodeErrorZ {
+typedef struct LDKCResult_NodeIdDecodeErrorZ {
    /**
-    * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
+    * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
+   union LDKCResult_NodeIdDecodeErrorZPtr contents;
    /**
-    * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
+    * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_DirectionalChannelInfoDecodeErrorZ;
-
-
+} LDKCResult_NodeIdDecodeErrorZ;
 
 /**
- * Details about a channel (both directions).
- * Received within a channel announcement.
+ * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
+ * UTXOs.
  */
-typedef struct MUST_USE_STRUCT LDKChannelInfo {
+typedef struct LDKAccess {
    /**
-    * 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.
+    * 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.
     */
-   LDKnativeChannelInfo *inner;
+   void *this_arg;
    /**
-    * 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.
+    * 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
     */
-   bool is_owned;
-} LDKChannelInfo;
-
-/**
- * The contents of CResult_ChannelInfoDecodeErrorZ
- */
-typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
+   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;
+
+
+
+/**
+ * Details about one direction of a channel. Received
+ * within a channel update.
+ */
+typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
+   /**
+    * 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.
+    */
+   LDKnativeDirectionalChannelInfo *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;
+} LDKDirectionalChannelInfo;
+
+/**
+ * The contents of CResult_DirectionalChannelInfoDecodeErrorZ
+ */
+typedef union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKDirectionalChannelInfo *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_DirectionalChannelInfoDecodeErrorZPtr;
+
+/**
+ * A CResult_DirectionalChannelInfoDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::network_graph::DirectionalChannelInfo 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_DirectionalChannelInfoDecodeErrorZ {
+   /**
+    * The contents of this CResult_DirectionalChannelInfoDecodeErrorZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_DirectionalChannelInfoDecodeErrorZPtr contents;
+   /**
+    * Whether this CResult_DirectionalChannelInfoDecodeErrorZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_DirectionalChannelInfoDecodeErrorZ;
+
+
+
+/**
+ * Details about a channel (both directions).
+ * Received within a channel announcement.
+ */
+typedef struct MUST_USE_STRUCT LDKChannelInfo {
+   /**
+    * 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.
+    */
+   LDKnativeChannelInfo *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;
+} LDKChannelInfo;
+
+/**
+ * The contents of CResult_ChannelInfoDecodeErrorZ
+ */
+typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
@@ -6224,70 +7619,31 @@ typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
 } LDKCResult_NetworkGraphDecodeErrorZ;
 
 /**
- * The contents of CResult_NetAddressu8Z
- */
-typedef union LDKCResult_NetAddressu8ZPtr {
-   /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
-    */
-   struct LDKNetAddress *result;
-   /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
-    */
-   uint8_t *err;
-} LDKCResult_NetAddressu8ZPtr;
-
-/**
- * A CResult_NetAddressu8Z represents the result of a fallible operation,
- * containing a crate::lightning::ln::msgs::NetAddress on success and a u8 on failure.
- * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
  */
-typedef struct LDKCResult_NetAddressu8Z {
-   /**
-    * The contents of this CResult_NetAddressu8Z, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
-    */
-   union LDKCResult_NetAddressu8ZPtr contents;
+typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
    /**
-    * Whether this CResult_NetAddressu8Z represents a success state.
+    * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
     */
-   bool result_ok;
-} LDKCResult_NetAddressu8Z;
-
-/**
- * The contents of CResult_CResult_NetAddressu8ZDecodeErrorZ
- */
-typedef union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr {
+   LDKCOption_CVec_NetAddressZZ_Some,
    /**
-    * A pointer to the contents in the success state.
-    * Reading from this pointer when `result_ok` is not set is undefined.
+    * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
     */
-   struct LDKCResult_NetAddressu8Z *result;
+   LDKCOption_CVec_NetAddressZZ_None,
    /**
-    * A pointer to the contents in the error state.
-    * Reading from this pointer when `result_ok` is set is undefined.
+    * Must be last for serialization purposes
     */
-   struct LDKDecodeError *err;
-} LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr;
+   LDKCOption_CVec_NetAddressZZ_Sentinel,
+} LDKCOption_CVec_NetAddressZZ_Tag;
 
-/**
- * A CResult_CResult_NetAddressu8ZDecodeErrorZ represents the result of a fallible operation,
- * containing a crate::c_types::derived::CResult_NetAddressu8Z 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_CResult_NetAddressu8ZDecodeErrorZ {
-   /**
-    * The contents of this CResult_CResult_NetAddressu8ZDecodeErrorZ, accessible via either
-    * `err` or `result` depending on the state of `result_ok`.
-    */
-   union LDKCResult_CResult_NetAddressu8ZDecodeErrorZPtr contents;
-   /**
-    * Whether this CResult_CResult_NetAddressu8ZDecodeErrorZ represents a success state.
-    */
-   bool result_ok;
-} LDKCResult_CResult_NetAddressu8ZDecodeErrorZ;
+typedef struct LDKCOption_CVec_NetAddressZZ {
+   LDKCOption_CVec_NetAddressZZ_Tag tag;
+   union {
+      struct {
+         struct LDKCVec_NetAddressZ some;
+      };
+   };
+} LDKCOption_CVec_NetAddressZZ;
 
 /**
  * The contents of CResult_NetAddressDecodeErrorZ
@@ -6600,6 +7956,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
  */
@@ -7735,48 +9146,228 @@ 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 {
-   /**
-    * 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;
+typedef struct MUST_USE_STRUCT LDKWatchedOutput {
    /**
-    * Gets the list of pending events which were generated by previous actions, clearing the list
-    * in the process.
+    * 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.
     */
-   struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
+   LDKnativeWatchedOutput *inner;
    /**
-    * 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.
+    * 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.
     */
-   void (*free)(void *this_arg);
-} LDKMessageSendEventsProvider;
+   bool is_owned;
+} LDKWatchedOutput;
 
 /**
- * A trait implemented for objects handling events from [`EventsProvider`].
+ * 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`]: 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 LDKEventHandler {
+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;
    /**
-    * Handles the given [`Event`].
+    * 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.
     *
-    * See [`EventsProvider`] for details that must be considered when implementing this method.
+    * 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).
     */
-   void (*handle_event)(const void *this_arg, struct LDKEvent event);
+   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);
-} LDKEventHandler;
+} 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 read-only reference to a current ChannelMonitor.
+ *
+ * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
+ * released.
+ */
+typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeLockedChannelMonitor *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKLockedChannelMonitor;
+
+/**
+ * The contents of CResult_LockedChannelMonitorNoneZ
+ */
+typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
+   /**
+    * A pointer to the contents in the success state.
+    * Reading from this pointer when `result_ok` is not set is undefined.
+    */
+   struct LDKLockedChannelMonitor *result;
+   /**
+    * Note that this value is always NULL, as there are no contents in the Err variant
+    */
+   void *err;
+} LDKCResult_LockedChannelMonitorNoneZPtr;
+
+/**
+ * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
+ * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_LockedChannelMonitorNoneZ {
+   /**
+    * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
+    * `err` or `result` depending on the state of `result_ok`.
+    */
+   union LDKCResult_LockedChannelMonitorNoneZPtr contents;
+   /**
+    * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
+    */
+   bool result_ok;
+} LDKCResult_LockedChannelMonitorNoneZ;
+
+/**
+ * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
+ * This corresponds to std::vector in C++
+ */
+typedef struct LDKCVec_OutPointZ {
+   /**
+    * The elements in the array.
+    * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
+    */
+   struct LDKOutPoint *data;
+   /**
+    * The number of elements pointed to by `data`.
+    */
+   uintptr_t datalen;
+} LDKCVec_OutPointZ;
+
+/**
+ * A trait indicating an object may generate message send events
+ */
+typedef struct LDKMessageSendEventsProvider {
+   /**
+    * An opaque pointer which is passed to your function implementations as an argument.
+    * This has no meaning in the LDK, and can be NULL or any other value.
+    */
+   void *this_arg;
+   /**
+    * Gets the list of pending events which were generated by previous actions, clearing the list
+    * in the process.
+    */
+   struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
+   /**
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+    */
+   void (*free)(void *this_arg);
+} LDKMessageSendEventsProvider;
+
+/**
+ * A trait implemented for objects handling events from [`EventsProvider`].
+ */
+typedef struct LDKEventHandler {
+   /**
+    * An opaque pointer which is passed to your function implementations as an argument.
+    * This has no meaning in the LDK, and can be NULL or any other value.
+    */
+   void *this_arg;
+   /**
+    * Handles the given [`Event`].
+    *
+    * See [`EventsProvider`] for details that must be considered when implementing this method.
+    */
+   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.
+    */
+   void (*free)(void *this_arg);
+} LDKEventHandler;
 
 /**
  * A trait indicating an object may generate events.
@@ -7900,30 +9491,25 @@ typedef struct MUST_USE_STRUCT LDKUserConfig {
    bool is_owned;
 } LDKUserConfig;
 
+
+
 /**
- * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
- * UTXOs.
+ * The best known block as identified by its hash and height.
  */
-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;
+typedef struct MUST_USE_STRUCT LDKBestBlock {
    /**
-    * 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
+    * 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.
     */
-   struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
+   LDKnativeBestBlock *inner;
    /**
-    * 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.
+    * 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.
     */
-   void (*free)(void *this_arg);
-} LDKAccess;
+   bool is_owned;
+} LDKBestBlock;
 
 /**
  * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
@@ -8055,122 +9641,81 @@ typedef struct 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
+ * An opaque identifier describing a specific [`Persist`] method call.
  */
-typedef struct MUST_USE_STRUCT LDKWatchedOutput {
+typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
    /**
     * 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;
+   LDKnativeMonitorUpdateId *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;
+} LDKMonitorUpdateId;
 
 /**
- * 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.
+ * `Persist` defines behavior for persisting channel monitors: this could mean
+ * writing once to disk, and/or uploading to one or more backup services.
  *
- * 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.
+ * Each method can return three possible values:
+ *  * If persistence (including any relevant `fsync()` calls) happens immediately, the
+ *    implementation should return `Ok(())`, indicating normal channel operation should continue.
+ *  * If persistence happens asynchronously, implementations should first ensure the
+ *    [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
+ *    `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the
+ *    background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be
+ *    called with the corresponding [`MonitorUpdateId`].
  *
- * 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`].
+ *    Note that unlike the direct [`chain::Watch`] interface,
+ *    [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
  *
- * [`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
+ *  * If persistence fails for some reason, implementations should return
+ *    `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be
+ *    closed without broadcasting the latest state. See
+ *    [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
  */
-typedef struct LDKFilter {
+typedef struct LDKPersist {
    /**
     * An opaque pointer which is passed to your function implementations as an argument.
     * This has no meaning in the LDK, and can be NULL or any other value.
     */
    void *this_arg;
    /**
-    * 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.
+    * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
+    * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
     *
-    * 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.
+    * The data can be stored any way you want, but the identifier provided by LDK is the
+    * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
+    * and the stored channel data). Note that you **must** persist every new monitor to disk.
     *
-    * 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.
- *
- * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
- * to disk/backups. And, on every update, you **must** persist either the
- * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
- * of situations such as revoking a transaction, then crashing before this
- * revocation can be persisted, then unintentionally broadcasting a revoked
- * transaction and losing money. This is a risk because previous channel states
- * are toxic, so it's important that whatever channel state is persisted is
- * kept up-to-date.
- */
-typedef struct LDKPersist {
-   /**
-    * An opaque pointer which is passed to your function implementations as an argument.
-    * This has no meaning in the LDK, and can be NULL or any other value.
-    */
-   void *this_arg;
-   /**
-    * Persist a new channel's data. The data can be stored any way you want, but
-    * the identifier provided by Rust-Lightning is the channel's outpoint (and
-    * it is up to you to maintain a correct mapping between the outpoint and the
-    * stored channel data). Note that you **must** persist every new monitor to
-    * disk. See the `Persist` trait documentation for more details.
+    * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
+    * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
     *
-    * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
+    * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
     * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
+    *
+    * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+    * [`Writeable::write`]: crate::util::ser::Writeable::write
     */
-   struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data);
+   struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
    /**
-    * Update one channel's data. The provided `ChannelMonitor` has already
-    * applied the given update.
+    * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
+    * update.
+    *
+    * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
+    * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
+    * details.
     *
-    * Note that on every update, you **must** persist either the
-    * `ChannelMonitorUpdate` or the updated monitor itself to disk/backups. See
-    * the `Persist` trait documentation for more details.
+    * During blockchain synchronization operations, this may be called with no
+    * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
+    * Note that after the full [`ChannelMonitor`] is persisted any previous
+    * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
+    * applied to the persisted [`ChannelMonitor`] as they were already applied.
     *
     * If an implementer chooses to persist the updates only, they need to make
     * sure that all the updates are applied to the `ChannelMonitors` *before*
@@ -8184,11 +9729,18 @@ typedef struct LDKPersist {
     * them in batches. The size of each monitor grows `O(number of state updates)`
     * whereas updates are small and `O(1)`.
     *
-    * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`,
-    * [`ChannelMonitorUpdate::write`] for writing out an update, and
+    * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
+    * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
+    *
+    * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
+    * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
     * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
+    *
+    * [`Writeable::write`]: crate::util::ser::Writeable::write
+    *
+    * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
     */
-   struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data);
+   struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
    /**
     * 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.
@@ -8277,22 +9829,43 @@ typedef struct MUST_USE_STRUCT LDKChainParameters {
 
 
 /**
- * The best known block as identified by its hash and height.
+ * Information needed for constructing an invoice route hint for this channel.
  */
-typedef struct MUST_USE_STRUCT LDKBestBlock {
+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.
     */
-   LDKnativeBestBlock *inner;
+   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;
-} LDKBestBlock;
+} LDKCounterpartyForwardingInfo;
+
+
+
+/**
+ * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
+ * to better separate parameters.
+ */
+typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeChannelCounterparty *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKChannelCounterparty;
 
 /**
  * A 3-byte byte array.
@@ -8417,20 +9990,25 @@ typedef struct LDKChannelMessageHandler {
  *
  * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
  * is:
- * 1) Deserialize all stored ChannelMonitors.
- * 2) Deserialize the ChannelManager by filling in this struct and calling:
- *    <(BlockHash, ChannelManager)>::read(reader, args)
- *    This may result in closing some Channels if the ChannelMonitor is newer than the stored
- *    ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
- * 3) If you are not fetching full blocks, register all relevant ChannelMonitor outpoints the same
- *    way you would handle a `chain::Filter` call using ChannelMonitor::get_outputs_to_watch() and
- *    ChannelMonitor::get_funding_txo().
- * 4) Reconnect blocks on your ChannelMonitors.
- * 5) Disconnect/connect blocks on the ChannelManager.
- * 6) Move the ChannelMonitors into your local chain::Watch.
- *
- * Note that the ordering of #4-6 is not of importance, however all three must occur before you
- * call any other methods on the newly-deserialized ChannelManager.
+ * 1) Deserialize all stored [`ChannelMonitor`]s.
+ * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
+ *    `<(BlockHash, ChannelManager)>::read(reader, args)`
+ *    This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
+ *    [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
+ * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
+ *    same way you would handle a [`chain::Filter`] call using
+ *    [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
+ * 4) Reconnect blocks on your [`ChannelMonitor`]s.
+ * 5) Disconnect/connect blocks on the [`ChannelManager`].
+ * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
+ *    Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
+ *    will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
+ *    the next step.
+ * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
+ *    [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
+ *
+ * Note that the ordering of #4-7 is not of importance, however all four must occur before you
+ * call any other methods on the newly-deserialized [`ChannelManager`].
  *
  * Note that because some channels may be closed during deserialization, it is critical that you
  * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
@@ -8438,6 +10016,8 @@ typedef struct LDKChannelMessageHandler {
  * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
  * not force-close the same channels but consider them live), you may end up revoking a state for
  * which you've already broadcasted the transaction.
+ *
+ * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
  */
 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
    /**
@@ -8507,10 +10087,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
@@ -8522,6 +10098,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);
    /**
@@ -8564,30 +10142,86 @@ typedef struct LDKRoutingMessageHandler {
    void (*free)(void *this_arg);
 } LDKRoutingMessageHandler;
 
-
-
 /**
- * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
- * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
+ * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
+ * decoders.
  */
-typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
+typedef struct LDKCustomMessageReader {
    /**
-    * 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.
+    * 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.
     */
-   LDKnativeIgnoringMessageHandler *inner;
+   void *this_arg;
    /**
-    * 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.
+    * 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.
     */
-   bool is_owned;
-} LDKIgnoringMessageHandler;
-
-
-
-/**
+   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;
+
+
+
+/**
+ * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
+ * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
+ */
+typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeIgnoringMessageHandler *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKIgnoringMessageHandler;
+
+
+
+/**
  * A dummy struct which implements `ChannelMessageHandler` without having any channels.
  * You can provide one of these as the route_handler in a MessageHandler.
  */
@@ -8633,11 +10267,12 @@ typedef struct MUST_USE_STRUCT LDKMessageHandler {
  *
  * For efficiency, Clone should be relatively cheap for this type.
  *
- * You probably want to just extend an int and put a file descriptor in a struct and implement
- * send_data. Note that if you are using a higher-level net library that may call close() itself,
- * be careful to ensure you don't have races whereby you might register a new connection with an
- * fd which is the same as a previous one which has yet to be removed via
- * PeerManager::socket_disconnected().
+ * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
+ * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
+ * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
+ * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
+ * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
+ * to simply use another value which is guaranteed to be globally unique instead.
  */
 typedef struct LDKSocketDescriptor {
    /**
@@ -8649,25 +10284,27 @@ typedef struct LDKSocketDescriptor {
     * Attempts to send some data from the given slice to the peer.
     *
     * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
-    * Note that in the disconnected case, socket_disconnected must still fire and further write
-    * attempts may occur until that time.
+    * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
+    * called and further write attempts may occur until that time.
     *
-    * If the returned size is smaller than data.len(), a write_available event must
-    * trigger the next time more data can be written. Additionally, until the a send_data event
-    * completes fully, no further read_events should trigger on the same peer!
+    * If the returned size is smaller than `data.len()`, a
+    * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
+    * written. Additionally, until a `send_data` event completes fully, no further
+    * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
+    * prevent denial-of-service issues, you should not read or buffer any data from the socket
+    * until then.
     *
-    * If a read_event on this descriptor had previously returned true (indicating that read
-    * events should be paused to prevent DoS in the send buffer), resume_read may be set
-    * indicating that read events on this descriptor should resume. A resume_read of false does
-    * *not* imply that further read events should be paused.
+    * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
+    * (indicating that read events should be paused to prevent DoS in the send buffer),
+    * `resume_read` may be set indicating that read events on this descriptor should resume. A
+    * `resume_read` of false carries no meaning, and should not cause any action.
     */
    uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
    /**
-    * Disconnect the socket pointed to by this SocketDescriptor. Once this function returns, no
-    * more calls to write_buffer_space_avail, read_event or socket_disconnected may be made with
-    * this descriptor. No socket_disconnected call should be generated as a result of this call,
-    * though races may occur whereby disconnect_socket is called after a call to
-    * socket_disconnected but prior to socket_disconnected returning.
+    * Disconnect the socket pointed to by this SocketDescriptor.
+    *
+    * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
+    * call (doing so is a noop).
     */
    void (*disconnect_socket)(void *this_arg);
    /**
@@ -8680,11 +10317,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.
@@ -8695,14 +10332,25 @@ typedef struct LDKSocketDescriptor {
 
 
 /**
- * A PeerManager manages a set of peers, described by their SocketDescriptor and marshalls socket
- * events into messages which it passes on to its MessageHandlers.
+ * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
+ * socket events into messages which it passes on to its [`MessageHandler`].
+ *
+ * Locks are taken internally, so you must never assume that reentrancy from a
+ * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
+ *
+ * Calls to [`read_event`] will decode relevant messages and pass them to the
+ * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
+ * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
+ * [`PeerManager`] functions related to the same connection must occur only in serial, making new
+ * calls only after previous ones have returned.
  *
  * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
  * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
  * essentially you should default to using a SimpleRefPeerManager, and use a
  * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
  * you're using lightning-net-tokio.
+ *
+ * [`read_event`]: PeerManager::read_event
  */
 typedef struct MUST_USE_STRUCT LDKPeerManager {
    /**
@@ -8743,27 +10391,79 @@ typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
    bool is_owned;
 } LDKDirectedChannelTransactionParameters;
 
+/**
+ * An interface used to score payment channels for path finding.
+ *
+ *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
+ */
+typedef struct LDKScore {
+   /**
+    * An opaque pointer which is passed to your function implementations as an argument.
+    * This has no meaning in the LDK, and can be NULL or any other value.
+    */
+   void *this_arg;
+   /**
+    * Returns the fee in msats willing to be paid to avoid routing through the given channel
+    * in the direction from `source` to `target`.
+    */
+   uint64_t (*channel_penalty_msat)(const void *this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target);
+   /**
+    * Handles updating channel penalties after failing to route through a channel.
+    */
+   void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, 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);
+} LDKScore;
+
+
+
+/**
+ * A scorer that is accessed under a lock.
+ *
+ * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
+ * having shared ownership of a scorer but without requiring internal locking in [`Score`]
+ * implementations. Internal locking would be detrimental to route finding performance and could
+ * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
+ *
+ * [`find_route`]: crate::routing::router::find_route
+ */
+typedef struct MUST_USE_STRUCT LDKLockableScore {
+   /**
+    * 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.
+    */
+   LDKnativeLockableScore *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;
+} LDKLockableScore;
+
 
 
 /**
- * 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;
 
 
 
@@ -8773,6 +10473,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 {
    /**
@@ -8791,6 +10494,53 @@ typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
 
 
 
+/**
+ * [`routing::Score`] implementation that provides reasonable default behavior.
+ *
+ * Used to apply a fixed penalty to each channel, thus avoiding long paths when shorter paths with
+ * slightly higher fees are available. May also further penalize failed channels.
+ *
+ * See [module-level documentation] for usage.
+ *
+ * [module-level documentation]: crate::routing::scorer
+ */
+typedef struct MUST_USE_STRUCT LDKScorer {
+   /**
+    * 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.
+    */
+   LDKnativeScorer *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;
+} LDKScorer;
+
+
+
+/**
+ * Parameters for configuring [`Scorer`].
+ */
+typedef struct MUST_USE_STRUCT LDKScoringParameters {
+   /**
+    * 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.
+    */
+   LDKnativeScoringParameters *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;
+} LDKScoringParameters;
+
+
+
 /**
  * FilesystemPersister persists channel data on disk, where each channel's
  * data is stored in a file named after its funding outpoint.
@@ -8823,20 +10573,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 {
    /**
@@ -8986,6 +10745,126 @@ typedef struct MUST_USE_STRUCT LDKFallback {
    };
 } LDKFallback;
 
+/**
+ * A trait defining behavior of an [`Invoice`] payer.
+ */
+typedef struct LDKPayer {
+   /**
+    * 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 payer's node id.
+    */
+   struct LDKPublicKey (*node_id)(const void *this_arg);
+   /**
+    * Returns the payer's channels.
+    */
+   struct LDKCVec_ChannelDetailsZ (*first_hops)(const void *this_arg);
+   /**
+    * Sends a payment over the Lightning Network using the given [`Route`].
+    *
+    * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
+   /**
+    * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
+    */
+   struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_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);
+} LDKPayer;
+
+/**
+ * A trait defining behavior for routing an [`Invoice`] payment.
+ */
+typedef struct LDKRouter {
+   /**
+    * 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;
+   /**
+    * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
+    *
+    * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
+    */
+   struct LDKCResult_RouteLightningErrorZ (*find_route)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR params, struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer);
+   /**
+    * Frees any resources associated with this object given its this_arg pointer.
+    * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+    */
+   void (*free)(void *this_arg);
+} LDKRouter;
+
+
+
+/**
+ * A utility for paying [`Invoice]`s.
+ */
+typedef struct MUST_USE_STRUCT LDKInvoicePayer {
+   /**
+    * 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.
+    */
+   LDKnativeInvoicePayer *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;
+} LDKInvoicePayer;
+
+
+
+/**
+ * Number of attempts to retry payment path failures for an [`Invoice`].
+ *
+ * Note that this is the number of *path* failures, not full payment retries. For multi-path
+ * payments, if this is less than the total number of paths, we will never even retry all of the
+ * payment's paths.
+ */
+typedef struct MUST_USE_STRUCT LDKRetryAttempts {
+   /**
+    * 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.
+    */
+   LDKnativeRetryAttempts *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;
+} LDKRetryAttempts;
+
+
+
+/**
+ * A [`Router`] implemented using [`find_route`].
+ */
+typedef struct MUST_USE_STRUCT LDKDefaultRouter {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeDefaultRouter *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKDefaultRouter;
+
 extern const uintptr_t MAX_BUF_SIZE;
 
 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
@@ -9002,6 +10881,10 @@ extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
 
 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
 
+extern const uint64_t DEFAULT_EXPIRY_TIME;
+
+extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
+
 extern const uint8_t TAG_PAYMENT_HASH;
 
 extern const uint8_t TAG_DESCRIPTION;
@@ -9016,7 +10899,7 @@ extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
 
 extern const uint8_t TAG_FALLBACK;
 
-extern const uint8_t TAG_ROUTE;
+extern const uint8_t TAG_PRIVATE_ROUTE;
 
 extern const uint8_t TAG_PAYMENT_SECRET;
 
@@ -9031,6 +10914,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.
  */
@@ -9276,6 +11164,21 @@ void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_Built
  */
 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
 
+/**
+ * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
+ */
+struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
+
+/**
+ * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
+ */
+struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
+
+/**
+ * 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.
  */
@@ -9333,6 +11236,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.
  */
@@ -9407,17 +11346,43 @@ void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Constructs a new COption_u64Z containing a u64
+ * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
  */
-struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
+struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
 
 /**
- * Constructs a new COption_u64Z containing nothing
+ * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
  */
-struct LDKCOption_u64Z COption_u64Z_none(void);
+struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
- * Frees any resources associated with the u64, if we are in the Some state
+ * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
+ */
+void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
+
+/**
+ * Constructs a new COption_u64Z containing a u64
+ */
+struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
+
+/**
+ * Constructs a new COption_u64Z containing nothing
+ */
+struct LDKCOption_u64Z COption_u64Z_none(void);
+
+/**
+ * Frees any resources associated with the u64, if we are in the Some state
  */
 void COption_u64Z_free(struct LDKCOption_u64Z _res);
 
@@ -9428,15 +11393,78 @@ void COption_u64Z_free(struct LDKCOption_u64Z _res);
 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
 
 /**
- * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ * Creates a new CResult_PayeeDecodeErrorZ in the success state.
  */
-void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
+struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_ok(struct LDKPayee o);
+
+/**
+ * Creates a new CResult_PayeeDecodeErrorZ in the error state.
+ */
+struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Frees any resources used by the CResult_PayeeDecodeErrorZ.
+ */
+void CResult_PayeeDecodeErrorZ_free(struct LDKCResult_PayeeDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_PayeeDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_clone(const struct LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR orig);
 
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
 
+/**
+ * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
+
+/**
+ * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
+ */
+void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
+ */
+struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
+
+/**
+ * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
+ */
+struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
+ */
+void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
+
 /**
  * Creates a new CResult_RouteLightningErrorZ in the success state.
  */
@@ -9552,6 +11580,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.
  */
@@ -9685,6 +11734,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.
@@ -9893,6 +11963,27 @@ struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tu
  */
 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
 
+/**
+ * Constructs a new COption_u16Z containing a u16
+ */
+struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
+
+/**
+ * Constructs a new COption_u16Z containing nothing
+ */
+struct LDKCOption_u16Z COption_u16Z_none(void);
+
+/**
+ * Frees any resources associated with the u16, if we are in the Some state
+ */
+void COption_u16Z_free(struct LDKCOption_u16Z _res);
+
+/**
+ * Creates a new COption_u16Z which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
+
 /**
  * Creates a new CResult_NoneAPIErrorZ in the success state.
  */
@@ -9924,6 +12015,48 @@ void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res
  */
 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
 
+/**
+ * Creates a new CResult__u832APIErrorZ in the success state.
+ */
+struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
+
+/**
+ * Creates a new CResult__u832APIErrorZ in the error state.
+ */
+struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
+
+/**
+ * Frees any resources used by the CResult__u832APIErrorZ.
+ */
+void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
+
+/**
+ * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
+ */
+struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
+
+/**
+ * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state.
+ */
+struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
+
+/**
+ * Frees any resources used by the CResult_PaymentIdPaymentSendFailureZ.
+ */
+void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res);
+
+/**
+ * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig);
+
 /**
  * Creates a new CResult_NonePaymentSendFailureZ in the success state.
  */
@@ -9945,6 +12078,43 @@ void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailu
  */
 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
 
+/**
+ * Creates a new tuple which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
+ */
+struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
+
+/**
+ * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
+ */
+void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
+ */
+struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
+
+/**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
+ */
+struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
+
+/**
+ * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
+ */
+void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
+
+/**
+ * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
+
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
@@ -10059,6 +12229,57 @@ 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_PaymentIdPaymentErrorZ in the success state.
+ */
+struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
+
+/**
+ * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
+ */
+struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
+
+/**
+ * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
+ */
+void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
+
+/**
+ * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
+
 /**
  * Creates a new CResult_SiPrefixNoneZ in the success state.
  */
@@ -10162,7 +12383,7 @@ struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
+void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
 
 /**
  * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
@@ -10270,25 +12491,25 @@ void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationE
 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_RouteHintCreationErrorZ in the success state.
+ * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
  */
-struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_ok(struct LDKRouteHint o);
+struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
 
 /**
- * Creates a new CResult_RouteHintCreationErrorZ in the error state.
+ * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
  */
-struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_err(enum LDKCreationError e);
+struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
 
 /**
- * Frees any resources used by the CResult_RouteHintCreationErrorZ.
+ * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
  */
-void CResult_RouteHintCreationErrorZ_free(struct LDKCResult_RouteHintCreationErrorZ _res);
+void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
 
 /**
- * Creates a new CResult_RouteHintCreationErrorZ which has the same data as `orig`
+ * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_clone(const struct LDKCResult_RouteHintCreationErrorZ *NONNULL_PTR orig);
+struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
 
 /**
  * Creates a new CResult_StringErrorZ in the success state.
@@ -10478,6 +12699,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.
  */
@@ -10493,6 +12719,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.
  */
@@ -10540,27 +12802,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.
  */
@@ -10630,38 +12871,74 @@ void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _r
 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state.
+ * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
  */
-struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
+struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
 
 /**
- * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
+ * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
  */
-struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
 
 /**
- * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
+ * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
  */
-void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
+void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
 
 /**
- * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
+ * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
+ * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
  */
-struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
+struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
 
 /**
- * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
+ * Constructs a new COption_AccessZ containing nothing
  */
-struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCOption_AccessZ COption_AccessZ_none(void);
 
 /**
- * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
+ * 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.
+ */
+struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o);
+
+/**
+ * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state.
+ */
+struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Frees any resources used by the CResult_DirectionalChannelInfoDecodeErrorZ.
+ */
+void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res);
+
+/**
+ * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig);
+
+/**
+ * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
+ */
+struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
+
+/**
+ * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
+ */
+struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
+
+/**
+ * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
  */
 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
 
@@ -10761,46 +13038,25 @@ void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeE
 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_NetAddressu8Z in the success state.
- */
-struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o);
-
-/**
- * Creates a new CResult_NetAddressu8Z in the error state.
- */
-struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e);
-
-/**
- * Frees any resources used by the CResult_NetAddressu8Z.
- */
-void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res);
-
-/**
- * Creates a new CResult_NetAddressu8Z which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
-struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_clone(const struct LDKCResult_NetAddressu8Z *NONNULL_PTR orig);
-
-/**
- * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the success state.
+ * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
  */
-struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o);
+struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
 
 /**
- * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ in the error state.
+ * Constructs a new COption_CVec_NetAddressZZ containing nothing
  */
-struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e);
+struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
 
 /**
- * Frees any resources used by the CResult_CResult_NetAddressu8ZDecodeErrorZ.
+ * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
  */
-void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res);
+void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
 
 /**
- * Creates a new CResult_CResult_NetAddressu8ZDecodeErrorZ which has the same data as `orig`
+ * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(const struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ *NONNULL_PTR orig);
+struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
 
 /**
  * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
@@ -10927,6 +13183,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.
  */
@@ -11515,6 +13792,111 @@ void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCre
  */
 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
 
+/**
+ * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
+ */
+struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
+
+/**
+ * Constructs a new COption_FilterZ containing nothing
+ */
+struct LDKCOption_FilterZ COption_FilterZ_none(void);
+
+/**
+ * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
+ */
+void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
+
+/**
+ * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
+ */
+struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
+
+/**
+ * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
+ */
+struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
+
+/**
+ * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
+ */
+void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
+
+/**
+ * Frees the buffer pointed to by `data` if `datalen` is non-0.
+ */
+void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
+
+/**
+ * Frees any resources used by the PaymentPurpose
+ */
+void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
+
+/**
+ * Creates a copy of the PaymentPurpose
+ */
+struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
+ */
+struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t user_payment_id);
+
+/**
+ * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
+ */
+struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
+
+/**
+ * Frees any resources used by the ClosureReason
+ */
+void ClosureReason_free(struct LDKClosureReason this_ptr);
+
+/**
+ * Creates a copy of the ClosureReason
+ */
+struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
+ */
+struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
+
+/**
+ * Utility method to constructs a new HolderForceClosed-variant ClosureReason
+ */
+struct LDKClosureReason ClosureReason_holder_force_closed(void);
+
+/**
+ * Utility method to constructs a new CooperativeClosure-variant ClosureReason
+ */
+struct LDKClosureReason ClosureReason_cooperative_closure(void);
+
+/**
+ * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
+ */
+struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
+
+/**
+ * Utility method to constructs a new ProcessingError-variant ClosureReason
+ */
+struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
+
+/**
+ * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
+ */
+struct LDKClosureReason ClosureReason_disconnected_peer(void);
+
+/**
+ * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
+ */
+struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
+
+/**
+ * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
+ */
+struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
+
 /**
  * Frees any resources used by the Event
  */
@@ -11525,6 +13907,51 @@ void Event_free(struct LDKEvent this_ptr);
  */
 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
 
+/**
+ * Utility method to constructs a new FundingGenerationReady-variant Event
+ */
+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);
+
+/**
+ * Utility method to constructs a new PaymentReceived-variant Event
+ */
+struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amt, struct LDKPaymentPurpose purpose);
+
+/**
+ * Utility method to constructs a new PaymentSent-variant Event
+ */
+struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
+
+/**
+ * Utility method to constructs a new PaymentPathFailed-variant Event
+ */
+struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry);
+
+/**
+ * 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, uint64_t user_channel_id, struct LDKClosureReason reason);
+
+/**
+ * Utility method to constructs a new DiscardFunding-variant Event
+ */
+struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
+
 /**
  * Serialize the Event object into a byte array which can be read by Event_read
  */
@@ -11540,6 +13967,101 @@ void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
  */
 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
  */
@@ -11565,12 +14087,42 @@ void APIError_free(struct LDKAPIError this_ptr);
  */
 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, struct LDKSecretKey sk);
+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.
@@ -11588,6 +14140,31 @@ bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
  */
 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.
@@ -11815,20 +14392,26 @@ uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHan
 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Set to force the incoming channel to match our announced channel preference in
- * ChannelConfig.
+ * Set to force an incoming channel to match our announced channel preference in
+ * [`ChannelConfig::announced_channel`].
  *
- * Default value: true, to make the default that no announced channels are possible (which is
- * appropriate for any nodes which are not online very reliably).
+ * For a node which is not online reliably, this should be set to true and
+ * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
+ * channels will ever be opened.
+ *
+ * Default value: true.
  */
 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
 
 /**
- * Set to force the incoming channel to match our announced channel preference in
- * ChannelConfig.
+ * Set to force an incoming channel to match our announced channel preference in
+ * [`ChannelConfig::announced_channel`].
  *
- * Default value: true, to make the default that no announced channels are possible (which is
- * appropriate for any nodes which are not online very reliably).
+ * For a node which is not online reliably, this should be set to true and
+ * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
+ * channels will ever be opened.
+ *
+ * Default value: true.
  */
 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
 
@@ -11875,34 +14458,68 @@ MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(voi
 void ChannelConfig_free(struct LDKChannelConfig this_obj);
 
 /**
- * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
+ * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
+ * over the channel.
  * This may be allowed to change at runtime in a later update, however doing so must result in
  * update messages sent to notify all nodes of our updated relay fee.
  *
  * Default value: 0.
  */
-uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
+uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
 
 /**
- * Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
+ * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
+ * over the channel.
  * This may be allowed to change at runtime in a later update, however doing so must result in
  * update messages sent to notify all nodes of our updated relay fee.
  *
  * Default value: 0.
  */
-void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
+void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
- * the channel this config applies to.
+ * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
+ * excess of [`forwarding_fee_proportional_millionths`].
+ * This may be allowed to change at runtime in a later update, however doing so must result in
+ * update messages sent to notify all nodes of our updated relay fee.
  *
- * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
- * HTLC balance when a channel appears on-chain whereas
- * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
- * (non-HTLC-encumbered) balance.
+ * The default value of a single satoshi roughly matches the market rate on many routing nodes
+ * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
+ * this node.
  *
- * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
- * we (or one of our watchtowers) MUST be online to check for broadcast of the current
+ * Default value: 1000.
+ *
+ * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
+ */
+uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
+
+/**
+ * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
+ * excess of [`forwarding_fee_proportional_millionths`].
+ * This may be allowed to change at runtime in a later update, however doing so must result in
+ * update messages sent to notify all nodes of our updated relay fee.
+ *
+ * The default value of a single satoshi roughly matches the market rate on many routing nodes
+ * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
+ * this node.
+ *
+ * Default value: 1000.
+ *
+ * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
+ */
+void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
+ * the channel this config applies to.
+ *
+ * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
+ * HTLC balance when a channel appears on-chain whereas
+ * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
+ * (non-HTLC-encumbered) balance.
+ *
+ * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
+ * we (or one of our watchtowers) MUST be online to check for broadcast of the current
  * commitment transaction at least once per this many blocks (minus some margin to allow us
  * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
  * the spending transaction).
@@ -11945,7 +14562,7 @@ void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR th
  * This should only be set to true for nodes which expect to be online reliably.
  *
  * As the node which funds a channel picks this value this will only apply for new outbound
- * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
+ * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
  *
  * This cannot be changed after the initial channel handshake.
  *
@@ -11960,7 +14577,7 @@ bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_
  * This should only be set to true for nodes which expect to be online reliably.
  *
  * As the node which funds a channel picks this value this will only apply for new outbound
- * channels unless ChannelHandshakeLimits::force_announced_channel_preferences is set.
+ * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
  *
  * This cannot be changed after the initial channel handshake.
  *
@@ -11998,10 +14615,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 fee_proportional_millionths_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
@@ -12058,10 +14765,50 @@ struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfi
  */
 void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
 
+/**
+ * If this is set to false, we will reject any HTLCs which were to be forwarded over private
+ * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
+ * node which is not online reliably.
+ *
+ * For nodes which are not online reliably, you should set all channels to *not* be announced
+ * (using [`ChannelConfig::announced_channel`] and
+ * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
+ * ensure you are not exposed to any forwarding risk.
+ *
+ * Note that because you cannot change a channel's announced state after creation, there is no
+ * way to disable forwarding on public channels retroactively. Thus, in order to change a node
+ * from a publicly-announced forwarding node to a private non-forwarding node you must close
+ * all your channels and open new ones. For privacy, you should also change your node_id
+ * (swapping all private and public key material for new ones) at that time.
+ *
+ * Default value: false.
+ */
+bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
+
+/**
+ * If this is set to false, we will reject any HTLCs which were to be forwarded over private
+ * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
+ * node which is not online reliably.
+ *
+ * For nodes which are not online reliably, you should set all channels to *not* be announced
+ * (using [`ChannelConfig::announced_channel`] and
+ * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
+ * ensure you are not exposed to any forwarding risk.
+ *
+ * Note that because you cannot change a channel's announced state after creation, there is no
+ * way to disable forwarding on public channels retroactively. Thus, in order to change a node
+ * from a publicly-announced forwarding node to a private non-forwarding node you must close
+ * all your channels and open new ones. For privacy, you should also change your node_id
+ * (swapping all private and public key material for new ones) at that time.
+ *
+ * Default value: false.
+ */
+void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
+
 /**
  * Constructs a new UserConfig given each field
  */
-MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg);
+MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg);
 
 /**
  * Creates a copy of the UserConfig
@@ -12073,11 +14820,52 @@ struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR or
  */
 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
 
+/**
+ * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
+ */
+void BestBlock_free(struct LDKBestBlock this_obj);
+
+/**
+ * Creates a copy of the BestBlock
+ */
+struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
+
+/**
+ * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
+ * network.
+ */
+MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
+
+/**
+ * Returns a `BestBlock` as identified by the given block hash and height.
+ */
+MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
+
+/**
+ * Returns the best block hash.
+ */
+MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
+
+/**
+ * Returns the best block height.
+ */
+MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
+
 /**
  * Creates a copy of the AccessError
  */
 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
  */
@@ -12093,6 +14881,21 @@ void Listen_free(struct LDKListen this_ptr);
  */
 void Confirm_free(struct LDKConfirm this_ptr);
 
+/**
+ * Creates a copy of the ChannelMonitorUpdateErr
+ */
+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);
+
 /**
  * Calls the free function if one is set
  */
@@ -12110,11 +14913,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);
 
@@ -12163,11 +14970,64 @@ 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
  */
 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
 
+/**
+ * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
+ */
+void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
+
+/**
+ * Creates a copy of the MonitorUpdateId
+ */
+struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
+
+/**
+ * Checks if two MonitorUpdateIds contain equal inner contents.
+ */
+uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
+
+/**
+ * Checks if two MonitorUpdateIds 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 MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
+
+/**
+ * Calls the free function if one is set
+ */
+void Persist_free(struct LDKPersist this_ptr);
+
+/**
+ * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
+ */
+void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
+
 /**
  * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
  */
@@ -12182,7 +15042,54 @@ 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);
+
+/**
+ * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
+ * such [`ChannelMonitor`] is currently being monitored for.
+ *
+ * Note that the result holds a mutex over our monitor set, and should not be held
+ * indefinitely.
+ */
+MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
+
+/**
+ * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
+ *
+ * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
+ * monitoring for on-chain state resolutions.
+ */
+MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
+
+/**
+ * Indicates the persistence of a [`ChannelMonitor`] has completed after
+ * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation.
+ *
+ * Thus, the anticipated use is, at a high level:
+ *  1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
+ *     update to disk and begins updating any remote (e.g. watchtower/backup) copies,
+ *     returning [`ChannelMonitorUpdateErr::TemporaryFailure`],
+ *  2) once all remote copies are updated, you call this function with the
+ *     `completed_update_id` that completed, and once all pending updates have completed the
+ *     channel will be re-enabled.
+ *
+ * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
+ * registered [`ChannelMonitor`]s.
+ */
+MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id);
 
 /**
  * Constructs a new Listen which calls the relevant methods on this_arg.
@@ -12259,14 +15166,18 @@ struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpda
 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
 
 /**
- * Creates a copy of the ChannelMonitorUpdateErr
+ * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
  */
-enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
+void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
+
+struct LDKStr MonitorUpdateError_get_a(const struct LDKMonitorUpdateError *NONNULL_PTR this_ptr);
+
+void MonitorUpdateError_set_a(struct LDKMonitorUpdateError *NONNULL_PTR this_ptr, struct LDKStr val);
 
 /**
- * Frees any resources used by the MonitorUpdateError, if is_owned is set and inner is non-NULL.
+ * Constructs a new MonitorUpdateError given each field
  */
-void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
+MUST_USE_RES struct LDKMonitorUpdateError MonitorUpdateError_new(struct LDKStr a_arg);
 
 /**
  * Creates a copy of the MonitorUpdateError
@@ -12283,6 +15194,31 @@ 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);
+
+/**
+ * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
+ */
+struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
+
+/**
+ * Utility method to constructs a new UpdateFailed-variant MonitorEvent
+ */
+struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
+
+/**
+ * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
+ */
+struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
+
 /**
  * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
  */
@@ -12303,6 +15239,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.
  */
@@ -12433,9 +15405,28 @@ MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_best_block_update
 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
 
 /**
- * Calls the free function if one is set
+ * Gets the latest best block which was connected either via the [`chain::Listen`] or
+ * [`chain::Confirm`] interfaces.
  */
-void Persist_free(struct LDKPersist this_ptr);
+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);
 
 /**
  * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
@@ -12676,6 +15667,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
  */
@@ -12967,109 +15973,195 @@ 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 BestBlock, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
  */
-void BestBlock_free(struct LDKBestBlock this_obj);
+void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
 
 /**
- * Creates a copy of the BestBlock
+ * Base routing fee in millisatoshis.
  */
-struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
+uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
 
 /**
- * Returns the best block from the genesis of the given network.
+ * Base routing fee in millisatoshis.
  */
-MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
+void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Returns the best block as identified by the given block hash and height.
+ * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
  */
-MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
+uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
 
 /**
- * Returns the best block hash.
+ * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
  */
-MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
+void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Returns the best block height.
+ * 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.
  */
-MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
+uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
+ * 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 ChannelDetails_free(struct LDKChannelDetails this_obj);
+void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
 
 /**
- * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
- * thereafter this is the txid of the funding transaction xor the funding transaction output).
- * Note that this means this value is *not* persistent - it can change once during the
- * lifetime of the channel.
+ * Constructs a new CounterpartyForwardingInfo given each field
  */
-const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
+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);
 
 /**
- * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
- * thereafter this is the txid of the funding transaction xor the funding transaction output).
- * Note that this means this value is *not* persistent - it can change once during the
- * lifetime of the channel.
+ * Creates a copy of the CounterpartyForwardingInfo
  */
-void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
 
 /**
- * The Channel's funding transaction output, if we've negotiated the funding transaction with
- * our counterparty already.
- *
- * Note that, if this has been set, `channel_id` will be equivalent to
- * `funding_txo.unwrap().to_channel_id()`.
+ * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
  */
-struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
 
 /**
- * The Channel's funding transaction output, if we've negotiated the funding transaction with
- * our counterparty already.
+ * The node_id of our counterparty
+ */
+struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * The node_id of our counterparty
+ */
+void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The Features the channel counterparty provided upon last connection.
+ * Useful for routing as it is the most up-to-date copy of the counterparty's features and
+ * many routing-relevant features are present in the init context.
+ */
+struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
+
+/**
+ * The Features the channel counterparty provided upon last connection.
+ * Useful for routing as it is the most up-to-date copy of the counterparty's features and
+ * many routing-relevant features are present in the init context.
+ */
+void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
+
+/**
+ * The value, in satoshis, that must always be held in the channel for our counterparty. This
+ * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
+ * claiming at least this value on chain.
  *
- * Note that, if this has been set, `channel_id` will be equivalent to
- * `funding_txo.unwrap().to_channel_id()`.
+ * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
+ *
+ * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
  */
-void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
+uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
 
 /**
- * The position of the funding transaction in the chain. None if the funding transaction has
- * not yet been confirmed and the channel fully opened.
+ * The value, in satoshis, that must always be held in the channel for our counterparty. This
+ * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
+ * claiming at least this value on chain.
+ *
+ * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
+ *
+ * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
  */
-struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The position of the funding transaction in the chain. None if the funding transaction has
- * not yet been confirmed and the channel fully opened.
+ * 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
  */
-void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
 
 /**
- * The node_id of our counterparty
+ * 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
  */
-struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
 
 /**
- * The node_id of our counterparty
+ * Constructs a new ChannelCounterparty given each field
  */
-void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+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);
 
 /**
- * The Features the channel counterparty provided upon last connection.
- * Useful for routing as it is the most up-to-date copy of the counterparty's features and
- * many routing-relevant features are present in the init context.
+ * Creates a copy of the ChannelCounterparty
  */
-struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
 
 /**
- * The Features the channel counterparty provided upon last connection.
- * Useful for routing as it is the most up-to-date copy of the counterparty's features and
- * many routing-relevant features are present in the init context.
+ * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
+ */
+void ChannelDetails_free(struct LDKChannelDetails this_obj);
+
+/**
+ * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
+ * thereafter this is the txid of the funding transaction xor the funding transaction output).
+ * Note that this means this value is *not* persistent - it can change once during the
+ * lifetime of the channel.
+ */
+const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
+
+/**
+ * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
+ * thereafter this is the txid of the funding transaction xor the funding transaction output).
+ * Note that this means this value is *not* persistent - it can change once during the
+ * lifetime of the channel.
+ */
+void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
+
+/**
+ * Parameters which apply to our counterparty. See individual fields for more information.
  */
-void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
+struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * Parameters which apply to our counterparty. See individual fields for more information.
+ */
+void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
+
+/**
+ * The Channel's funding transaction output, if we've negotiated the funding transaction with
+ * our counterparty already.
+ *
+ * Note that, 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);
+
+/**
+ * The Channel's funding transaction output, if we've negotiated the funding transaction with
+ * our counterparty already.
+ *
+ * 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);
+
+/**
+ * The position of the funding transaction in the chain. None if the funding transaction has
+ * not yet been confirmed and the channel fully opened.
+ */
+struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The position of the funding transaction in the chain. None if the funding transaction has
+ * not yet been confirmed and the channel fully opened.
+ */
+void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
 
 /**
  * The value, in satoshis, of this channel as appears in the funding output
@@ -13082,20 +16174,50 @@ uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetail
 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * The user_id passed in to create_channel, or 0 if the channel was inbound.
+ * The value, in satoshis, that must always be held in the channel for us. This value ensures
+ * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
+ * this value on chain.
+ *
+ * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ *
+ * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
+ */
+struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The value, in satoshis, that must always be held in the channel for us. This value ensures
+ * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
+ * this value on chain.
+ *
+ * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ *
+ * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
+ */
+void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
  */
-uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
 
 /**
- * The user_id passed in to create_channel, or 0 if the channel was inbound.
+ * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
  */
-void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
+void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
  * The available outbound capacity for sending HTLCs to the remote peer. This does not include
  * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
  * available for inclusion in new outbound HTLCs). This further does not include any pending
  * outgoing HTLCs which are awaiting some other resolution to be sent.
+ *
+ * This value is not exact. Due to various in-flight changes, feerate changes, and our
+ * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
+ * should be able to spend nearly this amount.
  */
 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
 
@@ -13104,6 +16226,10 @@ uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetail
  * any pending HTLCs which are not yet fully resolved (and, thus, who's balance is not
  * available for inclusion in new outbound HTLCs). This further does not include any pending
  * outgoing HTLCs which are awaiting some other resolution to be sent.
+ *
+ * This value is not exact. Due to various in-flight changes, feerate changes, and our
+ * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
+ * should be able to spend nearly this amount.
  */
 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
 
@@ -13113,6 +16239,10 @@ void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL
  * available for inclusion in new inbound HTLCs).
  * Note that there are some corner cases not fully handled here, so the actual available
  * inbound capacity may be slightly higher than this.
+ *
+ * This value is not exact. Due to various in-flight changes, feerate changes, and our
+ * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
+ * However, our counterparty should be able to spend nearly this amount.
  */
 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
 
@@ -13122,9 +16252,65 @@ uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails
  * available for inclusion in new inbound HTLCs).
  * Note that there are some corner cases not fully handled here, so the actual available
  * inbound capacity may be slightly higher than this.
+ *
+ * This value is not exact. Due to various in-flight changes, feerate changes, and our
+ * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
+ * However, our counterparty should be able to spend nearly this amount.
  */
 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
 
+/**
+ * The number of required confirmations on the funding transaction before the funding will be
+ * considered \"locked\". This number is selected by the channel fundee (i.e. us if
+ * [`is_outbound`] is *not* set), and can be selected for inbound channels with
+ * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
+ * [`ChannelHandshakeLimits::max_minimum_depth`].
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ *
+ * [`is_outbound`]: ChannelDetails::is_outbound
+ * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
+ * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
+ */
+struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The number of required confirmations on the funding transaction before the funding will be
+ * considered \"locked\". This number is selected by the channel fundee (i.e. us if
+ * [`is_outbound`] is *not* set), and can be selected for inbound channels with
+ * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
+ * [`ChannelHandshakeLimits::max_minimum_depth`].
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ *
+ * [`is_outbound`]: ChannelDetails::is_outbound
+ * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
+ * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
+ */
+void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
+
+/**
+ * The number of blocks (after our commitment transaction confirms) that we will need to wait
+ * until we can claim our funds after we force-close the channel. During this time our
+ * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
+ * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
+ * time to claim our non-HTLC-encumbered funds.
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ */
+struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
+
+/**
+ * The number of blocks (after our commitment transaction confirms) that we will need to wait
+ * until we can claim our funds after we force-close the channel. During this time our
+ * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
+ * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
+ * time to claim our non-HTLC-encumbered funds.
+ *
+ * This value will be `None` for outbound channels until the counterparty accepts the channel.
+ */
+void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
+
 /**
  * True if the channel was initiated (and thus funded) by us.
  */
@@ -13139,7 +16325,10 @@ void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_p
  * True if the channel is confirmed, funding_locked messages have been exchanged, and the
  * channel is not currently being shut down. `funding_locked` message exchange implies the
  * required confirmation count has been reached (and we were connected to the peer at some
- * point after the funding transaction received enough confirmations).
+ * point after the funding transaction received enough confirmations). The required
+ * confirmation count is provided in [`confirmations_required`].
+ *
+ * [`confirmations_required`]: ChannelDetails::confirmations_required
  */
 bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
 
@@ -13147,14 +16336,16 @@ bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNUL
  * True if the channel is confirmed, funding_locked messages have been exchanged, and the
  * channel is not currently being shut down. `funding_locked` message exchange implies the
  * required confirmation count has been reached (and we were connected to the peer at some
- * point after the funding transaction received enough confirmations).
+ * point after the funding transaction received enough confirmations). The required
+ * confirmation count is provided in [`confirmations_required`].
+ *
+ * [`confirmations_required`]: ChannelDetails::confirmations_required
  */
 void ChannelDetails_set_is_funding_locked(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
 
 /**
  * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
- * the peer is connected, (c) no monitor update failure is pending resolution, and (d) the
- * channel is not currently negotiating a shutdown.
+ * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
  *
  * This is a strict superset of `is_funding_locked`.
  */
@@ -13162,8 +16353,7 @@ bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR th
 
 /**
  * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b)
- * the peer is connected, (c) no monitor update failure is pending resolution, and (d) the
- * channel is not currently negotiating a shutdown.
+ * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
  *
  * This is a strict superset of `is_funding_locked`.
  */
@@ -13179,6 +16369,11 @@ bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR th
  */
 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
 
+/**
+ * Constructs a new ChannelDetails given each field
+ */
+MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg);
+
 /**
  * Creates a copy of the ChannelDetails
  */
@@ -13194,6 +16389,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 results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
+
 /**
  * Constructs a new ChannelManager to hold several channels and route between them.
  *
@@ -13218,19 +16433,34 @@ MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configurati
 /**
  * Creates a new outbound channel to the given remote node and with the given value.
  *
- * user_id will be provided back as user_channel_id in FundingGenerationReady events to allow
- * tracking of which events correspond with which create_channel call. Note that the
- * user_channel_id defaults to 0 for inbound channels, so you may wish to avoid using 0 for
- * user_id here. user_id has no meaning inside of LDK, it is simply copied to events and
- * otherwise ignored.
+ * `user_channel_id` will be provided back as in
+ * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
+ * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
+ * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
+ * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
+ * ignored.
+ *
+ * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
+ * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
+ *
+ * Note that we do not check if you are currently connected to the given peer. If no
+ * connection is available, the outbound `open_channel` message may fail to send, resulting in
+ * the channel eventually being silently forgotten (dropped on reload).
  *
- * If successful, will generate a SendOpenChannel message event, so you should probably poll
- * PeerManager::process_events afterwards.
+ * Returns the new Channel's temporary `channel_id`. This ID will appear as
+ * [`Event::FundingGenerationReady::temporary_channel_id`] and in
+ * [`ChannelDetails::channel_id`] until after
+ * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
+ * one derived from the funding transaction's TXID. If the counterparty rejects the channel
+ * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
  *
- * Raises APIError::APIMisuseError when channel_value_satoshis > 2**24 or push_msat is
- * greater than channel_value_satoshis * 1k or channel_value_satoshis is < 1000.
+ * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
+ * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
+ * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
+ *
+ * Note that 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);
+MUST_USE_RES struct LDKCResult__u832APIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_channel_id, struct LDKUserConfig override_config);
 
 /**
  * Gets the list of open channels, in random order. See ChannelDetail field documentation for
@@ -13253,10 +16483,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.
@@ -13309,8 +16574,42 @@ 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_PaymentIdPaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
+
+/**
+ * Retries a payment along the given [`Route`].
+ *
+ * Errors returned are a superset of those returned from [`send_payment`], so see
+ * [`send_payment`] documentation for more details on errors. This method will also error if the
+ * retry amount puts the payment more than 10% over the payment's total amount, or if the payment
+ * for the given `payment_id` cannot be found (likely due to timeout or success).
+ *
+ * [`send_payment`]: [`ChannelManager::send_payment`]
+ */
+MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_retry_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
+
+/**
+ * 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_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);
+MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
 
 /**
  * Call this upon creation of a funding transaction for the given channel.
@@ -13367,13 +16666,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);
 
@@ -13408,30 +16710,6 @@ MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NON
  */
 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
-/**
- * Restores a single, given channel to normal operation after a
- * ChannelMonitorUpdateErr::TemporaryFailure was returned from a channel monitor update
- * operation.
- *
- * All ChannelMonitor updates up to and including highest_applied_update_id must have been
- * fully committed in every copy of the given channels' ChannelMonitors.
- *
- * Note that there is no effect to calling with a highest_applied_update_id other than the
- * current latest ChannelMonitorUpdate and one call to this function after multiple
- * ChannelMonitorUpdateErr::TemporaryFailures is fine. The highest_applied_update_id field
- * exists largely only to prevent races between this and concurrent update_monitor calls.
- *
- * Thus, the anticipated use is, at a high level:
- *  1) You register a chain::Watch with this ChannelManager,
- *  2) it stores each update to disk, and begins updating any remote (eg watchtower) copies of
- *     said ChannelMonitors as it can, returning ChannelMonitorUpdateErr::TemporaryFailures
- *     any time it cannot do so instantly,
- *  3) update(s) are applied to each remote copy of a ChannelMonitor,
- *  4) once all remote copies are updated, you call this function with the update_id that
- *     completed, and once it is the latest the Channel will be re-enabled.
- */
-void ChannelManager_channel_monitor_updated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR funding_txo, uint64_t highest_applied_update_id);
-
 /**
  * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
  * to pay us.
@@ -13463,7 +16741,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
@@ -13497,7 +16775,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);
 
@@ -13541,6 +16819,12 @@ MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct L
  */
 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
 
+/**
+ * Gets the latest best block which was connected either via the [`chain::Listen`] or
+ * [`chain::Confirm`] interfaces.
+ */
+MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
 /**
  * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
  * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
@@ -14169,12 +17453,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);
 
@@ -14204,12 +17488,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);
 
@@ -14295,6 +17579,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.
  */
@@ -14330,10 +17653,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
@@ -14778,14 +18117,29 @@ void NetAddress_free(struct LDKNetAddress this_ptr);
 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
 
 /**
- * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
+ * Utility method to constructs a new IPv4-variant NetAddress
  */
-struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
+struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
 
 /**
- * Read a Result from a byte array, created by Result_write
+ * Utility method to constructs a new IPv6-variant NetAddress
  */
-struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
+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
+ */
+struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
 
 /**
  * Read a NetAddress from a byte array, created by NetAddress_write
@@ -15407,6 +18761,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.
  */
@@ -15447,11 +18821,21 @@ 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
  */
@@ -15460,7 +18844,17 @@ void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNU
 /**
  * update_fail_htlc messages which should be sent
  */
-void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
+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
@@ -15469,11 +18863,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);
 
@@ -15497,16 +18895,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
  */
@@ -15557,6 +18945,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
  */
@@ -15788,14 +19186,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
@@ -15803,14 +19201,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
@@ -15822,15 +19220,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.
@@ -15854,6 +19257,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.
  */
@@ -15883,25 +19298,35 @@ void MessageHandler_free(struct LDKMessageHandler this_obj);
 
 /**
  * A message handler which handles messages specific to channels. Usually this is just a
- * ChannelManager object or a ErroringMessageHandler.
+ * [`ChannelManager`] object or an [`ErroringMessageHandler`].
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
  */
 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
 
 /**
  * A message handler which handles messages specific to channels. Usually this is just a
- * ChannelManager object or a ErroringMessageHandler.
+ * [`ChannelManager`] object or an [`ErroringMessageHandler`].
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
  */
 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
 
 /**
  * A message handler which handles messages updating our knowledge of the network channel
- * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
+ * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
+ * [`IgnoringMessageHandler`].
+ *
+ * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
  */
 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
 
 /**
  * A message handler which handles messages updating our knowledge of the network channel
- * graph. Usually this is just a NetGraphMsgHandlerMonitor object or an IgnoringMessageHandler.
+ * graph. Usually this is just a [`NetGraphMsgHandler`] object or an
+ * [`IgnoringMessageHandler`].
+ *
+ * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler
  */
 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
 
@@ -15957,7 +19382,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.
@@ -15975,8 +19400,10 @@ MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struc
  *
  * Returns a small number of bytes to send to the remote node (currently always 50).
  *
- * Panics if descriptor is duplicative with some other descriptor which has not yet had a
- * socket_disconnected().
+ * Panics if descriptor is duplicative with some other descriptor which has not yet been
+ * [`socket_disconnected()`].
+ *
+ * [`socket_disconnected()`]: PeerManager::socket_disconnected
  */
 MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor);
 
@@ -15988,8 +19415,10 @@ MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound
  * call socket_disconnected for the new descriptor but must disconnect the connection
  * immediately.
  *
- * Panics if descriptor is duplicative with some other descriptor which has not yet had
- * socket_disconnected called.
+ * Panics if descriptor is duplicative with some other descriptor which has not yet been
+ * [`socket_disconnected()`].
+ *
+ * [`socket_disconnected()`]: PeerManager::socket_disconnected
  */
 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor);
 
@@ -15998,12 +19427,14 @@ MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_conn
  *
  * May return an Err to indicate that the connection should be closed.
  *
- * Will most likely call send_data on the descriptor passed in (or the descriptor handed into
- * new_*\\_connection) before returning. Thus, be very careful with reentrancy issues! The
- * invariants around calling write_buffer_space_avail in case a write did not fully complete
- * must still hold - be ready to call write_buffer_space_avail again if a write call generated
- * here isn't sufficient! Panics if the descriptor was not previously registered in a
- * new_\\*_connection event.
+ * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
+ * returning. Thus, be very careful with reentrancy issues! The invariants around calling
+ * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
+ * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
+ * sufficient!
+ *
+ * [`send_data`]: SocketDescriptor::send_data
+ * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
  */
 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
 
@@ -16012,51 +19443,73 @@ MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_spa
  *
  * May return an Err to indicate that the connection should be closed.
  *
- * Will *not* call back into send_data on any descriptors to avoid reentrancy complexity.
- * Thus, however, you almost certainly want to call process_events() after any read_event to
- * generate send_data calls to handle responses.
+ * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
+ * Thus, however, you should call [`process_events`] after any `read_event` to generate
+ * [`send_data`] calls to handle responses.
  *
- * If Ok(true) is returned, further read_events should not be triggered until a send_data call
- * on this file descriptor has resume_read set (preventing DoS issues in the send buffer).
+ * If `Ok(true)` is returned, further read_events should not be triggered until a
+ * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
+ * send buffer).
  *
- * Panics if the descriptor was not previously registered in a new_*_connection event.
+ * [`send_data`]: SocketDescriptor::send_data
+ * [`process_events`]: PeerManager::process_events
  */
 MUST_USE_RES struct LDKCResult_boolPeerHandleErrorZ PeerManager_read_event(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR peer_descriptor, struct LDKu8slice data);
 
 /**
  * Checks for any events generated by our handlers and processes them. Includes sending most
  * response messages as well as messages generated by calls to handler functions directly (eg
- * functions like ChannelManager::process_pending_htlc_forward or send_payment).
+ * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
+ *
+ * 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
  */
 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
 
 /**
  * Indicates that the given socket descriptor's connection is now closed.
- *
- * This must only be called if the socket has been disconnected by the peer or your own
- * decision to disconnect it and must NOT be called in any case where other parts of this
- * library (eg PeerHandleError, explicit disconnect_socket calls) instruct you to disconnect
- * the peer.
- *
- * Panics if the descriptor was not previously registered in a successful new_*_connection event.
  */
 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
 
 /**
  * Disconnect a peer given its node id.
  *
- * Set no_connection_possible to true to prevent any further connection with this peer,
+ * Set `no_connection_possible` to true to prevent any further connection with this peer,
  * force-closing any channels we have with it.
  *
- * If a peer is connected, this will call `disconnect_socket` on the descriptor for the peer,
- * so be careful about reentrancy issues.
+ * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
+ * peer. Thus, be very careful about reentrancy issues.
+ *
+ * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
  */
 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.
- * Will most likely call send_data on all of the registered descriptors, thus, be very careful with reentrancy issues!
+ * Disconnects all currently-connected peers. This is useful on platforms where there may be
+ * an indication that TCP sockets have stalled even if we weren't around to time them out
+ * using regular ping/pongs.
+ */
+void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
+
+/**
+ * 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!
+ *
+ * [`send_data`]: SocketDescriptor::send_data
  */
 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
 
@@ -16065,6 +19518,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.
@@ -16453,22 +19911,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);
 
@@ -16697,6 +20163,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.
  */
@@ -16743,7 +20282,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);
 
@@ -16873,6 +20412,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
  */
@@ -16883,6 +20428,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
  */
@@ -16893,6 +20444,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
  */
@@ -16903,6 +20460,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.
  */
@@ -16959,294 +20522,221 @@ struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8s
 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
 
 /**
- * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
  */
-void RouteHop_free(struct LDKRouteHop this_obj);
+void ShutdownScript_free(struct LDKShutdownScript this_obj);
 
 /**
- * The node_id of the node at this hop.
+ * Creates a copy of the ShutdownScript
  */
-struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
 
 /**
- * The node_id of the node at this hop.
+ * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
  */
-void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
 
 /**
- * The node_announcement features of the node at this hop. For the last hop, these may be
- * amended to match the features present in the invoice this node generated.
+ * 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 LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
 
 /**
- * The node_announcement features of the node at this hop. For the last hop, these may be
- * amended to match the features present in the invoice this node generated.
+ * 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 RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
+void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
 
 /**
- * The channel that should be used from the previous hop to reach this node.
+ * Constructs a new InvalidShutdownScript given each field
  */
-uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
 
 /**
- * The channel that should be used from the previous hop to reach this node.
+ * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
  */
-void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
 
 /**
- * The channel_announcement features of the channel that should be used from the previous hop
- * to reach this node.
+ * Read a ShutdownScript from a byte array, created by ShutdownScript_write
  */
-struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
 
 /**
- * The channel_announcement features of the channel that should be used from the previous hop
- * to reach this node.
+ * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
  */
-void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
+MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
 
 /**
- * The fee taken on this hop (for paying for the use of the *next* channel in the path).
- * For the last hop, this should be the full value of the payment (might be more than
- * requested if we had to match htlc_minimum_msat).
+ * Generates a P2WSH script pubkey from the given [`WScriptHash`].
  */
-uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
 
 /**
- * The fee taken on this hop (for paying for the use of the *next* channel in the path).
- * For the last hop, this should be the full value of the payment (might be more than
- * requested if we had to match htlc_minimum_msat).
+ * 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`.
  */
-void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
+MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(uint8_t version, struct LDKu8slice program);
 
 /**
- * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
- * expected at the destination, in excess of the current block height.
+ * Converts the shutdown script into the underlying [`Script`].
  */
-uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
+MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
 
 /**
- * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
- * expected at the destination, in excess of the current block height.
+ * 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
  */
-void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
+MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new RouteHop given each field
+ * 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 struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg);
+MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
 
 /**
- * Creates a copy of the RouteHop
+ * Calls the free function if one is set
  */
-struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
+void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
 
 /**
- * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
+ * Calls the free function if one is set
  */
-struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
+void Type_free(struct LDKType this_ptr);
 
 /**
- * Read a RouteHop from a byte array, created by RouteHop_write
+ * Calls the free function if one is set
  */
-struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
+void Score_free(struct LDKScore this_ptr);
 
 /**
- * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the LockableScore, if is_owned is set and inner is non-NULL.
  */
-void Route_free(struct LDKRoute this_obj);
+void LockableScore_free(struct LDKLockableScore 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.
+ * Constructs a new LockableScore from a Score
  */
-void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
+MUST_USE_RES struct LDKLockableScore LockableScore_new(struct LDKScore score);
 
 /**
- * Constructs a new Route given each field
+ * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg);
+void NodeId_free(struct LDKNodeId this_obj);
 
 /**
- * Creates a copy of the Route
+ * Creates a copy of the NodeId
  */
-struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
+struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
 
 /**
- * Serialize the Route object into a byte array which can be read by Route_read
+ * Create a new NodeId from a public key
  */
-struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
+MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
 
 /**
- * Read a Route from a byte array, created by Route_write
+ * Get the public key slice from this NodeId
  */
-struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
+MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
 
 /**
- * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
+ * Checks if two NodeIds contain equal inner contents.
  */
-void RouteHintHop_free(struct LDKRouteHintHop this_obj);
+uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
 
 /**
- * The node_id of the non-target end of the route
+ * Serialize the NodeId object into a byte array which can be read by NodeId_read
  */
-struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
 
 /**
- * The node_id of the non-target end of the route
+ * Read a NodeId from a byte array, created by NodeId_write
  */
-void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
 
 /**
- * The short_channel_id of this channel
+ * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
  */
-uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+void NetworkGraph_free(struct LDKNetworkGraph this_obj);
 
 /**
- * The short_channel_id of this channel
+ * Creates a copy of the NetworkGraph
  */
-void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
+struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig);
 
 /**
- * The fees which must be paid to use this channel
+ * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
  */
-struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
 
 /**
- * The fees which must be paid to use this channel
+ * Frees any resources used by the NetworkUpdate
  */
-void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
+void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
 
 /**
- * The difference in CLTV values between this node and the next node.
+ * Creates a copy of the NetworkUpdate
  */
-uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
 
 /**
- * The difference in CLTV values between this node and the next node.
+ * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
  */
-void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
+struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
 
 /**
- * The minimum value, in msat, which must be relayed to the next hop.
+ * Utility method to constructs a new ChannelClosed-variant NetworkUpdate
  */
-struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+struct LDKNetworkUpdate NetworkUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent);
 
 /**
- * The minimum value, in msat, which must be relayed to the next hop.
+ * Utility method to constructs a new NodeFailure-variant NetworkUpdate
  */
-void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
 
 /**
- * The maximum value in msat available for routing with a single HTLC.
+ * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
  */
-struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
 
 /**
- * The maximum value in msat available for routing with a single HTLC.
+ * 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 RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+struct LDKEventHandler NetGraphMsgHandler_as_EventHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg);
 
 /**
- * Constructs a new RouteHintHop given each field
+ * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
  */
-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);
+void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
 
 /**
- * Checks if two RouteHintHops 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.
+ * Creates a new tracker of the actual state of the network of channels and nodes,
+ * 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.
  */
-bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
-
-/**
- * Creates a copy of the RouteHintHop
- */
-struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
-
-/**
- * Gets a route from us (payer) to the given target node (payee).
- *
- * If the payee provided features in their invoice, they should be provided via payee_features.
- * Without this, MPP will only be used if the payee's features are available in the network graph.
- *
- * Extra routing hops between known nodes and the target will be used if they are included in
- * last_hops.
- *
- * If some channels aren't announced, it may be useful to fill in a first_hops with the
- * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
- * view of our local channels (from net_graph_msg_handler) will be ignored, and only those
- * in first_hops will be used.
- *
- * Panics if first_hops contains channels without short_channel_ids
- * (ChannelManager::list_usable_channels will never include such channels).
- *
- * 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.
- */
-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_RouteHintHopZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
-
-/**
- * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
- */
-void NetworkGraph_free(struct LDKNetworkGraph this_obj);
-
-/**
- * Creates a copy of the NetworkGraph
- */
-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.
- */
-void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_obj);
-
-/**
- * Frees any resources used by the NetGraphMsgHandler, if is_owned is set and inner is non-NULL.
- */
-void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj);
-
-/**
- * Creates a new tracker of the actual state of the network of channels and nodes,
- * assuming a fresh 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(const struct LDKNetworkGraph *NONNULL_PTR 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.
@@ -17332,6 +20822,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);
 
@@ -17340,6 +20832,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);
 
@@ -17381,40 +20875,48 @@ void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struc
 /**
  * Source node of the first direction of a channel
  */
-struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
+struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
 
 /**
  * Source node of the first direction of a channel
  */
-void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
 
 /**
  * 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);
 
 /**
  * Source node of the second direction of a channel
  */
-struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
+struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
 
 /**
  * Source node of the second direction of a channel
  */
-void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
 
 /**
  * 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);
 
@@ -17433,6 +20935,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);
 
@@ -17441,13 +20945,15 @@ 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);
 
 /**
  * Constructs a new ChannelInfo given each field
  */
-MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKPublicKey node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKPublicKey node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg);
+MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKNodeId node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKNodeId node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg);
 
 /**
  * Creates a copy of the ChannelInfo
@@ -17508,6 +21014,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
  */
@@ -17579,6 +21090,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);
 
@@ -17587,6 +21100,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);
 
@@ -17624,6 +21139,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);
 
@@ -17631,6 +21148,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);
 
@@ -17638,6 +21157,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);
 
@@ -17645,6 +21166,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);
 
@@ -17683,6 +21206,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.
@@ -17691,7 +21219,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
@@ -17699,7 +21227,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.
@@ -17711,7 +21239,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
@@ -17721,7 +21249,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.
@@ -17729,7 +21257,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
@@ -17739,263 +21272,956 @@ 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.
+ * Get network addresses by node id.
+ * Returns None if the requested node is completely unknown,
+ * or if node announcement for the node was never received.
  */
-void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
+MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
 
 /**
- * Initialize a new FilesystemPersister and set the path to the individual channels'
- * files.
+ * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
  */
-MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
+void RouteHop_free(struct LDKRouteHop this_obj);
 
 /**
- * Get the directory which was provided when this persister was initialized.
+ * The node_id of the node at this hop.
  */
-MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
+struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
- * initialization, within a file called \"manager\".
+ * The node_id of the node at this hop.
  */
-MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
+void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
 
 /**
- * Read `ChannelMonitor`s from disk.
+ * The node_announcement features of the node at this hop. For the last hop, these may be
+ * amended to match the features present in the invoice this node generated.
  */
-MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
+struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * Constructs a new Persist which calls the relevant methods on this_arg.
- * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
+ * The node_announcement features of the node at this hop. For the last hop, these may be
+ * amended to match the features present in the invoice this node generated.
  */
-struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
+void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
 
 /**
- * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
+ * The channel that should be used from the previous hop to reach this node.
  */
-void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
+uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * Calls the free function if one is set
+ * The channel that should be used from the previous hop to reach this node.
  */
-void ChannelManagerPersister_free(struct LDKChannelManagerPersister this_ptr);
+void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * 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`
- *
- * `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
- * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
- * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
- * [`FilesystemPersister::persist_manager`]: lightning_persister::FilesystemPersister::persist_manager
+ * The channel_announcement features of the channel that should be used from the previous hop
+ * to reach this node.
  */
-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);
+struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * Stop `BackgroundProcessor`'s thread.
+ * The channel_announcement features of the channel that should be used from the previous hop
+ * to reach this node.
  */
-MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
+void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
 
 /**
- * **Call this function on startup to ensure that all assumptions about the platform are valid.**
- *
- * Unfortunately we have to make assumptions about the upper bounds of the `SystemTime` type on
- * your platform which we can't fully verify at compile time and which isn't part of it's contract.
- * To our best knowledge our assumptions hold for all platforms officially supported by rust, but
- * since this check is fast we recommend to do it anyway.
- *
- * If this function fails this is considered a bug. Please open an issue describing your
- * platform and stating your current system time.
- *
- * # Panics
- * If the check fails this function panics. By calling this function on startup you ensure that
- * this wont happen at an arbitrary later point in time.
+ * The fee taken on this hop (for paying for the use of the *next* channel in the path).
+ * For the last hop, this should be the full value of the payment (might be more than
+ * requested if we had to match htlc_minimum_msat).
  */
-void check_platform(void);
+uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
+ * The fee taken on this hop (for paying for the use of the *next* channel in the path).
+ * For the last hop, this should be the full value of the payment (might be more than
+ * requested if we had to match htlc_minimum_msat).
  */
-void Invoice_free(struct LDKInvoice this_obj);
+void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Checks if two Invoices 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.
+ * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
+ * expected at the destination, in excess of the current block height.
  */
-bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
+uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the Invoice
+ * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
+ * expected at the destination, in excess of the current block height.
  */
-struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
+void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
 
 /**
- * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
+ * Constructs a new RouteHop given each field
  */
-void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
+MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg);
 
 /**
- * Checks if two SignedRawInvoices 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.
+ * Creates a copy of the RouteHop
  */
-bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
+struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
 
 /**
- * Creates a copy of the SignedRawInvoice
+ * Checks if two RouteHops contain equal inner contents.
  */
-struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
+uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
 
 /**
- * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
+ * 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.
  */
-void RawInvoice_free(struct LDKRawInvoice this_obj);
+bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
 
 /**
- * data part
+ * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
  */
-struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
+struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
 
 /**
- * data part
+ * Read a RouteHop from a byte array, created by RouteHop_write
  */
-void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
+struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
 
 /**
- * Checks if two RawInvoices 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.
+ * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
  */
-bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
+void Route_free(struct LDKRoute this_obj);
 
 /**
- * Creates a copy of the RawInvoice
+ * 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 LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
+struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
+ * 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.
  */
-void RawDataPart_free(struct LDKRawDataPart this_obj);
+void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
 
 /**
- * generation time of the invoice
+ * The `payee` parameter passed to [`find_route`].
+ * This is used by `ChannelManager` to track information which may be required for retries,
+ * provided back to you via [`Event::PaymentPathFailed`].
+ *
+ * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
+struct LDKPayee Route_get_payee(const struct LDKRoute *NONNULL_PTR this_ptr);
 
 /**
- * generation time of the invoice
+ * The `payee` parameter passed to [`find_route`].
+ * This is used by `ChannelManager` to track information which may be required for retries,
+ * provided back to you via [`Event::PaymentPathFailed`].
+ *
+ * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
  */
-void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
+void Route_set_payee(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPayee val);
 
 /**
- * Checks if two RawDataParts 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.
+ * Constructs a new Route given each field
  */
-bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
+MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPayee payee_arg);
 
 /**
- * Creates a copy of the RawDataPart
+ * Creates a copy of the Route
  */
-struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
+struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
+ * Checks if two Routes contain equal inner contents.
  */
-void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
+uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
 
 /**
- * Checks if two PositiveTimestamps contain equal inner contents.
+ * 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 PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
+bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
 
 /**
- * Creates a copy of the PositiveTimestamp
+ * 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 [`find_route`]'s `params.final_value_msat`.
  */
-struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
+MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
 
 /**
- * Creates a copy of the SiPrefix
+ * Returns the total amount paid on this [`Route`], excluding the fees.
  */
-enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
+MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
 
 /**
- * Checks if two SiPrefixs contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Serialize the Route object into a byte array which can be read by Route_read
  */
-bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
+struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
 
 /**
- * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
- * This is effectively 10^12 * the prefix multiplier
+ * Read a Route from a byte array, created by Route_write
  */
-MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
+struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
 
 /**
- * Creates a copy of the Currency
+ * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
  */
-enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
+void RouteParameters_free(struct LDKRouteParameters this_obj);
 
 /**
- * Checks if two Currencys contain equal inner contents.
- * This ignores pointers and is_owned flags and looks at the values in fields.
+ * The recipient of the failed payment path.
  */
-bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
+struct LDKPayee RouteParameters_get_payee(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
 
 /**
- * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
+ * The recipient of the failed payment path.
  */
-void Sha256_free(struct LDKSha256 this_obj);
+void RouteParameters_set_payee(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
 
 /**
- * Checks if two Sha256s 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.
+ * The amount in msats sent on the failed payment path.
  */
-bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
+uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
 
 /**
- * Creates a copy of the Sha256
+ * The amount in msats sent on the failed payment path.
  */
-struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
+void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
 
 /**
- * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
+ * The CLTV on the final hop of the failed payment path.
+ */
+uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The CLTV on the final hop of the failed payment path.
+ */
+void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
+
+/**
+ * Constructs a new RouteParameters given each field
+ */
+MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPayee payee_arg, uint64_t final_value_msat_arg, uint32_t final_cltv_expiry_delta_arg);
+
+/**
+ * Creates a copy of the RouteParameters
+ */
+struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
+
+/**
+ * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
+ */
+struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
+
+/**
+ * Read a RouteParameters from a byte array, created by RouteParameters_write
+ */
+struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the Payee, if is_owned is set and inner is non-NULL.
+ */
+void Payee_free(struct LDKPayee this_obj);
+
+/**
+ * The node id of the payee.
+ */
+struct LDKPublicKey Payee_get_pubkey(const struct LDKPayee *NONNULL_PTR this_ptr);
+
+/**
+ * The node id of the payee.
+ */
+void Payee_set_pubkey(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Features supported by the payee.
+ *
+ * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
+ * does not contain any features.
+ *
+ * [`for_keysend`]: Self::for_keysend
+ *
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKInvoiceFeatures Payee_get_features(const struct LDKPayee *NONNULL_PTR this_ptr);
+
+/**
+ * Features supported by the payee.
+ *
+ * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
+ * does not contain any features.
+ *
+ * [`for_keysend`]: Self::for_keysend
+ *
+ * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+void Payee_set_features(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
+
+/**
+ * Hints for routing to the payee, containing channels connecting the payee to public nodes.
+ */
+struct LDKCVec_RouteHintZ Payee_get_route_hints(const struct LDKPayee *NONNULL_PTR this_ptr);
+
+/**
+ * Hints for routing to the payee, containing channels connecting the payee to public nodes.
+ */
+void Payee_set_route_hints(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
+
+/**
+ * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
+ */
+struct LDKCOption_u64Z Payee_get_expiry_time(const struct LDKPayee *NONNULL_PTR this_ptr);
+
+/**
+ * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
+ */
+void Payee_set_expiry_time(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * Constructs a new Payee given each field
+ */
+MUST_USE_RES struct LDKPayee Payee_new(struct LDKPublicKey pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKCVec_RouteHintZ route_hints_arg, struct LDKCOption_u64Z expiry_time_arg);
+
+/**
+ * Creates a copy of the Payee
+ */
+struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
+
+/**
+ * Checks if two Payees contain equal inner contents.
+ */
+uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
+
+/**
+ * Checks if two Payees 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 Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
+
+/**
+ * Serialize the Payee object into a byte array which can be read by Payee_read
+ */
+struct LDKCVec_u8Z Payee_write(const struct LDKPayee *NONNULL_PTR obj);
+
+/**
+ * Read a Payee from a byte array, created by Payee_write
+ */
+struct LDKCResult_PayeeDecodeErrorZ Payee_read(struct LDKu8slice ser);
+
+/**
+ * Creates a payee with the node id of the given `pubkey`.
+ */
+MUST_USE_RES struct LDKPayee Payee_from_node_id(struct LDKPublicKey pubkey);
+
+/**
+ * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
+ */
+MUST_USE_RES struct LDKPayee Payee_for_keysend(struct LDKPublicKey pubkey);
+
+/**
+ * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
+ */
+void RouteHint_free(struct LDKRouteHint this_obj);
+
+struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
+
+void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
+
+/**
+ * Constructs a new RouteHint given each field
+ */
+MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
+
+/**
+ * Creates a copy of the RouteHint
+ */
+struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
+
+/**
+ * Checks if two RouteHints contain equal inner contents.
+ */
+uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
+
+/**
+ * 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);
+
+/**
+ * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
+ */
+struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
+
+/**
+ * Read a RouteHint from a byte array, created by RouteHint_write
+ */
+struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
+
+/**
+ * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
+ */
+void RouteHintHop_free(struct LDKRouteHintHop this_obj);
+
+/**
+ * The node_id of the non-target end of the route
+ */
+struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+
+/**
+ * The node_id of the non-target end of the route
+ */
+void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * The short_channel_id of this channel
+ */
+uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+
+/**
+ * The short_channel_id of this channel
+ */
+void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The fees which must be paid to use this channel
+ */
+struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+
+/**
+ * The fees which must be paid to use this channel
+ */
+void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
+
+/**
+ * The difference in CLTV values between this node and the next node.
+ */
+uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+
+/**
+ * The difference in CLTV values between this node and the next node.
+ */
+void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
+
+/**
+ * The minimum value, in msat, which must be relayed to the next hop.
+ */
+struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+
+/**
+ * The minimum value, in msat, which must be relayed to the next hop.
+ */
+void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * The maximum value in msat available for routing with a single HTLC.
+ */
+struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
+
+/**
+ * The maximum value in msat available for routing with a single HTLC.
+ */
+void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
+
+/**
+ * Constructs a new RouteHintHop given each field
+ */
+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.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
+
+/**
+ * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
+ */
+struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
+
+/**
+ * Read a RouteHintHop from a byte array, created by RouteHintHop_write
+ */
+struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
+
+/**
+ * Finds a route from us (payer) to the given target node (payee).
+ *
+ * If the payee provided features in their invoice, they should be provided via `params.payee`.
+ * Without this, MPP will only be used if the payee's features are available in the network graph.
+ *
+ * Private routing paths between a public node and the target may be included in `params.payee`.
+ *
+ * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
+ * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of our local
+ * channels from [`NetworkGraph`] will be ignored, and only those in `first_hops` will be used.
+ *
+ * The fees on channels from us to the next hop 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
+ *
+ * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
+ * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
+ * function.
+ *
+ * # Panics
+ *
+ * Panics if first_hops contains channels without short_channel_ids;
+ * [`ChannelManager::list_usable_channels`] will never include such channels.
+ *
+ * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
+ * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
+ *
+ * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR params, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer);
+
+/**
+ * Frees any resources used by the Scorer, if is_owned is set and inner is non-NULL.
+ */
+void Scorer_free(struct LDKScorer this_obj);
+
+/**
+ * Frees any resources used by the ScoringParameters, if is_owned is set and inner is non-NULL.
+ */
+void ScoringParameters_free(struct LDKScoringParameters this_obj);
+
+/**
+ * A fixed penalty in msats to apply to each channel.
+ */
+uint64_t ScoringParameters_get_base_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+
+/**
+ * A fixed penalty in msats to apply to each channel.
+ */
+void ScoringParameters_set_base_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * A penalty in msats to apply to a channel upon failure.
+ *
+ * This may be reduced over time based on [`failure_penalty_half_life`].
+ *
+ * [`failure_penalty_half_life`]: Self::failure_penalty_half_life
+ */
+uint64_t ScoringParameters_get_failure_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+
+/**
+ * A penalty in msats to apply to a channel upon failure.
+ *
+ * This may be reduced over time based on [`failure_penalty_half_life`].
+ *
+ * [`failure_penalty_half_life`]: Self::failure_penalty_half_life
+ */
+void ScoringParameters_set_failure_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * The time needed before any accumulated channel failure penalties are cut in half.
+ */
+uint64_t ScoringParameters_get_failure_penalty_half_life(const struct LDKScoringParameters *NONNULL_PTR this_ptr);
+
+/**
+ * The time needed before any accumulated channel failure penalties are cut in half.
+ */
+void ScoringParameters_set_failure_penalty_half_life(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Constructs a new ScoringParameters given each field
+ */
+MUST_USE_RES struct LDKScoringParameters ScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t failure_penalty_msat_arg, uint64_t failure_penalty_half_life_arg);
+
+/**
+ * Creates a new scorer using the given scoring parameters.
+ */
+MUST_USE_RES struct LDKScorer Scorer_new(struct LDKScoringParameters params);
+
+/**
+ * Creates a "default" Scorer. See struct and individual field documentaiton for details on which values are used.
+ */
+MUST_USE_RES struct LDKScorer Scorer_default(void);
+
+/**
+ * Creates a "default" ScoringParameters. See struct and individual field documentaiton for details on which values are used.
+ */
+MUST_USE_RES struct LDKScoringParameters ScoringParameters_default(void);
+
+/**
+ * Constructs a new Score which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
+ */
+struct LDKScore Scorer_as_Score(const struct LDKScorer *NONNULL_PTR this_arg);
+
+/**
+ * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
+ */
+void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
+
+/**
+ * Initialize a new FilesystemPersister and set the path to the individual channels'
+ * files.
+ */
+MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
+
+/**
+ * Get the directory which was provided when this persister was initialized.
+ */
+MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
+
+/**
+ * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
+ * initialization, within a file called \"manager\".
+ */
+MUST_USE_RES struct LDKCResult_NoneErrorZ FilesystemPersister_persist_manager(struct LDKStr data_dir, const struct LDKChannelManager *NONNULL_PTR manager);
+
+/**
+ * Read `ChannelMonitor`s from disk.
+ */
+MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
+
+/**
+ * Constructs a new Persist which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
+ */
+struct LDKPersist FilesystemPersister_as_Persist(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
+
+/**
+ * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
+ */
+void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
+
+/**
+ * Calls the free function if one is set
+ */
+void ChannelManagerPersister_free(struct LDKChannelManagerPersister this_ptr);
+
+/**
+ * Start a background thread that takes care of responsibilities enumerated in the [top-level
+ * documentation].
+ *
+ * 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.
+ *
+ * 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 LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
+
+/**
+ * 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);
+
+/**
+ * **Call this function on startup to ensure that all assumptions about the platform are valid.**
+ *
+ * Unfortunately we have to make assumptions about the upper bounds of the `SystemTime` type on
+ * your platform which we can't fully verify at compile time and which isn't part of it's contract.
+ * To our best knowledge our assumptions hold for all platforms officially supported by rust, but
+ * since this check is fast we recommend to do it anyway.
+ *
+ * If this function fails this is considered a bug. Please open an issue describing your
+ * platform and stating your current system time.
+ *
+ * # Panics
+ * If the check fails this function panics. By calling this function on startup you ensure that
+ * this wont happen at an arbitrary later point in time.
+ */
+void check_platform(void);
+
+/**
+ * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
+ */
+void Invoice_free(struct LDKInvoice this_obj);
+
+/**
+ * Checks if two Invoices 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 Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the Invoice
+ */
+struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
+
+/**
+ * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
+ */
+void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
+
+/**
+ * Checks if two SignedRawInvoices 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 SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the SignedRawInvoice
+ */
+struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
+
+/**
+ * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
+ */
+void RawInvoice_free(struct LDKRawInvoice this_obj);
+
+/**
+ * data part
+ */
+struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
+
+/**
+ * data part
+ */
+void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
+
+/**
+ * Checks if two RawInvoices 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 RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the RawInvoice
+ */
+struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
+
+/**
+ * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
+ */
+void RawDataPart_free(struct LDKRawDataPart this_obj);
+
+/**
+ * generation time of the invoice
+ */
+struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
+
+/**
+ * generation time of the invoice
+ */
+void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
+
+/**
+ * Checks if two RawDataParts 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 RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the RawDataPart
+ */
+struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
+
+/**
+ * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
+ */
+void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
+
+/**
+ * Checks if two PositiveTimestamps 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 PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the PositiveTimestamp
+ */
+struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
+
+/**
+ * Creates a copy of the SiPrefix
+ */
+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.
+ */
+bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
+
+/**
+ * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
+ * This is effectively 10^12 * the prefix multiplier
+ */
+MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
+
+/**
+ * Creates a copy of the Currency
+ */
+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.
+ */
+bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
+ */
+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.
  */
-void Description_free(struct LDKDescription this_obj);
+uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
 
 /**
- * Checks if two Descriptions contain equal inner contents.
+ * Checks if two Sha256s 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 Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
+bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
+ */
+void Description_free(struct LDKDescription this_obj);
 
 /**
  * Creates a copy of the Description
@@ -18003,16 +22229,30 @@ bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDK
 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
+ * Checks if two Descriptions contain equal inner contents.
  */
-void PayeePubKey_free(struct LDKPayeePubKey this_obj);
+uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
 
 /**
- * Checks if two PayeePubKeys contain equal inner contents.
+ * Checks if two Descriptions 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 PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
+bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
+ */
+void PayeePubKey_free(struct LDKPayeePubKey this_obj);
+
+struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
+
+void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
+
+/**
+ * Constructs a new PayeePubKey given each field
+ */
+MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
 
 /**
  * Creates a copy of the PayeePubKey
@@ -18020,16 +22260,21 @@ bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDK
 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
+ * Checks if two PayeePubKeys contain equal inner contents.
  */
-void ExpiryTime_free(struct LDKExpiryTime this_obj);
+uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
 
 /**
- * Checks if two ExpiryTimes contain equal inner contents.
+ * Checks if two PayeePubKeys 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 ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
+bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
+ */
+void ExpiryTime_free(struct LDKExpiryTime this_obj);
 
 /**
  * Creates a copy of the ExpiryTime
@@ -18037,22 +22282,48 @@ bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKEx
 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
+ * Checks if two ExpiryTimes contain equal inner contents.
  */
-void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
+uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
 
 /**
- * Checks if two MinFinalCltvExpirys contain equal inner contents.
+ * Checks if two ExpiryTimes 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);
+bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
+
+/**
+ * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
+ */
+void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
+
+uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
+
+void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
+
+/**
+ * Constructs a new MinFinalCltvExpiry given each field
+ */
+MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
 
 /**
  * Creates a copy of the MinFinalCltvExpiry
  */
 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
 
+/**
+ * Checks if two MinFinalCltvExpirys contain equal inner contents.
+ */
+uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
+
+/**
+ * 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);
+
 /**
  * Frees any resources used by the Fallback
  */
@@ -18063,6 +22334,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.
@@ -18074,6 +22365,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.
@@ -18082,26 +22378,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 RouteHint, if is_owned is set and inner is non-NULL.
+ * Creates a copy of the PrivateRoute
  */
-void RouteHint_free(struct LDKRouteHint this_obj);
+struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *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.
+ * Checks if two PrivateRoutes contain equal inner contents.
  */
-bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
+uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
 
 /**
- * Creates a copy of the RouteHint
+ * 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 LDKRouteHint RouteHint_clone(const struct LDKRouteHint *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:
@@ -18142,23 +22438,55 @@ 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_RouteHintZ RawInvoice_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
@@ -18199,14 +22527,21 @@ MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoic
 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
 
 /**
- * Constructs an `Invoice` from a `SignedInvoice` by checking all its invariants.
+ * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
  * ```
  * 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();
  *
@@ -18227,16 +22562,20 @@ 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);
 
 /**
  * Get the payment secret if one was included in the invoice
  */
-MUST_USE_RES struct LDKThirtyTwoBytes Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg);
+MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
 
 /**
  * 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);
 
@@ -18250,6 +22589,11 @@ MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKI
  */
 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
 
+/**
+ * Returns whether the invoice has expired.
+ */
+MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
+
 /**
  * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
  * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
@@ -18259,7 +22603,12 @@ MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NON
 /**
  * Returns a list of all routes included in the invoice
  */
-MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
+
+/**
+ * Returns a list of all routes included in the invoice as the underlying hints
+ */
+MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
 
 /**
  * Returns the currency for which the invoice was issued
@@ -18267,9 +22616,9 @@ MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_routes(const struct LDKInvoice *N
 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
 
 /**
- * Returns the amount if specified in the invoice as pico <currency>.
+ * Returns the amount if specified in the invoice as millisatoshis.
  */
-MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_pico_btc(const struct LDKInvoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
 
 /**
  * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
@@ -18309,20 +22658,40 @@ MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_
 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
 
 /**
- * Create a new (partial) route from a list of hops
+ * Creates a new (partial) route from a list of hops
  */
-MUST_USE_RES struct LDKCResult_RouteHintCreationErrorZ RouteHint_new(struct LDKCVec_RouteHintHopZ hops);
+MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
 
 /**
- * Returrn the underlying vector of hops
+ * Returns the underlying list of hops
  */
-MUST_USE_RES struct LDKCVec_RouteHintHopZ RouteHint_into_inner(struct LDKRouteHint this_arg);
+MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
 
 /**
  * Creates a copy of the CreationError
  */
 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.
@@ -18339,6 +22708,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.
@@ -18360,6 +22779,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.
@@ -18371,6 +22800,118 @@ bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a,
  */
 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
 
+/**
+ * Frees any resources used by the InvoicePayer, if is_owned is set and inner is non-NULL.
+ */
+void InvoicePayer_free(struct LDKInvoicePayer this_obj);
+
+/**
+ * Calls the free function if one is set
+ */
+void Payer_free(struct LDKPayer this_ptr);
+
+/**
+ * Calls the free function if one is set
+ */
+void Router_free(struct LDKRouter this_ptr);
+
+/**
+ * Frees any resources used by the RetryAttempts, if is_owned is set and inner is non-NULL.
+ */
+void RetryAttempts_free(struct LDKRetryAttempts this_obj);
+
+uintptr_t RetryAttempts_get_a(const struct LDKRetryAttempts *NONNULL_PTR this_ptr);
+
+void RetryAttempts_set_a(struct LDKRetryAttempts *NONNULL_PTR this_ptr, uintptr_t val);
+
+/**
+ * Constructs a new RetryAttempts given each field
+ */
+MUST_USE_RES struct LDKRetryAttempts RetryAttempts_new(uintptr_t a_arg);
+
+/**
+ * Creates a copy of the RetryAttempts
+ */
+struct LDKRetryAttempts RetryAttempts_clone(const struct LDKRetryAttempts *NONNULL_PTR orig);
+
+/**
+ * Checks if two RetryAttemptss 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 RetryAttempts_eq(const struct LDKRetryAttempts *NONNULL_PTR a, const struct LDKRetryAttempts *NONNULL_PTR b);
+
+/**
+ * Checks if two RetryAttemptss contain equal inner contents.
+ */
+uint64_t RetryAttempts_hash(const struct LDKRetryAttempts *NONNULL_PTR o);
+
+/**
+ * Frees any resources used by the PaymentError
+ */
+void PaymentError_free(struct LDKPaymentError this_ptr);
+
+/**
+ * Creates a copy of the PaymentError
+ */
+struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
+
+/**
+ * Utility method to constructs a new Invoice-variant PaymentError
+ */
+struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
+
+/**
+ * Utility method to constructs a new Routing-variant PaymentError
+ */
+struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
+
+/**
+ * Utility method to constructs a new Sending-variant PaymentError
+ */
+struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
+
+/**
+ * Creates an invoice payer that retries failed payment paths.
+ *
+ * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
+ * `retry_attempts` has been exceeded for a given [`Invoice`].
+ */
+MUST_USE_RES struct LDKInvoicePayer InvoicePayer_new(struct LDKPayer payer, struct LDKRouter router, const struct LDKLockableScore *NONNULL_PTR scorer, struct LDKLogger logger, struct LDKEventHandler event_handler, struct LDKRetryAttempts retry_attempts);
+
+/**
+ * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
+ *
+ * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
+ * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
+ * for you.
+ */
+MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
+
+/**
+ * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
+ * case a retry is needed.
+ *
+ * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
+ * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
+ * for you.
+ */
+MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_zero_value_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats);
+
+/**
+ * Removes the payment cached by the given payment hash.
+ *
+ * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
+ * [`EventHandler`]. Otherwise, calling this method is unnecessary.
+ */
+void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
+
+/**
+ * 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
+ */
+struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
+
 /**
  * Utility to construct an invoice. Generally, unless you want to do something like a custom
  * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
@@ -18380,6 +22921,28 @@ struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NO
  */
 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description);
 
+/**
+ * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
+ */
+void DefaultRouter_free(struct LDKDefaultRouter this_obj);
+
+/**
+ * Creates a new router using the given [`NetworkGraph`] and  [`Logger`].
+ */
+MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
+
+/**
+ * Constructs a new Router which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
+ */
+struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
+
+/**
+ * Constructs a new Payer which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
+ */
+struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
+
 /**
  * Read a SiPrefix object from a string
  */
@@ -18417,4 +22980,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"